Class LocationUtil


  • public class LocationUtil
    extends Object
    Common Location related functions.
    • 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