Class LocationUtil
- java.lang.Object
 - 
- com.ibm.fhir.search.location.util.LocationUtil
 
 
- 
public class LocationUtil extends Object
Common Location related functions. 
- 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DoublecheckAndLimitMaximumLatitude(Double value)force the latitude to a minimumstatic DoublecheckAndLimitMaximumLongitude(Double value)force the longitude to a minimumstatic booleancheckLatValid(Double lat)common constraint for valid latitude and longitude.static booleancheckLonValid(Double lon)common constraint for valid latitude and longitude.static booleancheckNull(Double val)if null, return true.static voidcheckOverUnderNinety(Double up, Double down)check if the location/area spans over the pole (either one).static intfindNearParameterIndex(List<QueryParameter> searchParameters)Finds the index of the 'near' parameter in the passed list of search parameters.static booleanisLocation(Class<?> resourceType, QueryParameter queryParm)Check if it's a location and 'near' 
 - 
 
- 
- 
Method Detail
- 
checkAndLimitMaximumLatitude
public static Double checkAndLimitMaximumLatitude(Double value)
force the latitude to a minimum- Parameters:
 value-- Returns:
 
 
- 
checkAndLimitMaximumLongitude
public static Double checkAndLimitMaximumLongitude(Double value)
force the longitude to a minimum- Parameters:
 value-- Returns:
 
 
- 
findNearParameterIndex
public static int findNearParameterIndex(List<QueryParameter> searchParameters)
Finds the index of the 'near' parameter in the passed list of search parameters. If not found, -1 is returned.- Parameters:
 searchParameters-- Returns:
 - int - The index of the 'near' parameter in the passed List.
 
 
- 
isLocation
public static boolean isLocation(Class<?> resourceType, QueryParameter queryParm)
Check if it's a location and 'near'- Parameters:
 resourceType-queryParm-- Returns:
 
 
- 
checkNull
public static boolean checkNull(Double val)
if null, return true.- Parameters:
 val-- Returns:
 
 
- 
checkLatValid
public static boolean checkLatValid(Double lat)
common constraint for valid latitude and longitude.- Parameters:
 lat-- Returns:
 
 
- 
checkLonValid
public static boolean checkLonValid(Double lon)
common constraint for valid latitude and longitude.- Parameters:
 lon-- Returns:
 
 
- 
checkOverUnderNinety
public static void checkOverUnderNinety(Double up, Double down) throws FHIRSearchException
check if the location/area spans over the pole (either one). If it does, just frankly, it's hard to do the math properly.- Parameters:
 up-down-- Throws:
 FHIRSearchException
 
 - 
 
 -