Package com.ibm.fhir.search.location
Class NearLocationHandler
- java.lang.Object
-
- com.ibm.fhir.search.location.NearLocationHandler
-
public class NearLocationHandler extends Object
FHIR Search: Special Location - Positional Searching
Custom processing of the NEAR Location into Bounding Boxes or Bounding Radius.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
boundingRadius
static double
DEFAULT_DISTANCE
static String
DEFAULT_UNIT
static String
LATITUDE
static String
LONGITUDE
static String
NEAR
-
Constructor Summary
Constructors Constructor Description NearLocationHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BoundingBox
createBoundingBox(double latitude, double longitude, double distance, String unit)
build a bounding box given a latitude, longitude and distance.Bounding
createBoundingRadius(double latitude, double longitude, double distance, String unit)
create bounding radius.double
degree2radians(double deg)
degrees to radiansList<Bounding>
generateLocationPositionsFromParameters(List<QueryParameter> queryParameters)
generates location positions for processing from parameters.double
radians2degrees(double rad)
radians to degreesvoid
setBounding(boolean boundingRadius)
overrides the bounding functionality.
-
-
-
Field Detail
-
LATITUDE
public static final String LATITUDE
- See Also:
- Constant Field Values
-
LONGITUDE
public static final String LONGITUDE
- See Also:
- Constant Field Values
-
NEAR
public static final String NEAR
- See Also:
- Constant Field Values
-
DEFAULT_DISTANCE
public static final double DEFAULT_DISTANCE
- See Also:
- Constant Field Values
-
DEFAULT_UNIT
public static final String DEFAULT_UNIT
- See Also:
- Constant Field Values
-
boundingRadius
boolean boundingRadius
-
-
Method Detail
-
degree2radians
public double degree2radians(double deg)
degrees to radians- Parameters:
deg
-- Returns:
-
radians2degrees
public double radians2degrees(double rad)
radians to degrees- Parameters:
rad
-- Returns:
-
createBoundingBox
public BoundingBox createBoundingBox(double latitude, double longitude, double distance, String unit) throws FHIRSearchException
build a bounding box given a latitude, longitude and distance.
WGS84 format [latitude]|[longitude]|[distance]|[units]- Parameters:
latitude
-longitude
-distance
-unit
-- Returns:
- Throws:
FHIRSearchException
-
generateLocationPositionsFromParameters
public List<Bounding> generateLocationPositionsFromParameters(List<QueryParameter> queryParameters) throws FHIRSearchException
generates location positions for processing from parameters.- Parameters:
queryParameters
-- Returns:
- Throws:
FHIRSearchException
-
createBoundingRadius
public Bounding createBoundingRadius(double latitude, double longitude, double distance, String unit) throws FHIRSearchException
create bounding radius.- Parameters:
latitude
-longitude
-distance
-unit
-- Returns:
- Throws:
FHIRSearchException
-
setBounding
public void setBounding(boolean boundingRadius)
overrides the bounding functionality.- Parameters:
boundingRadius
-
-
-