Class DateTimeHandler

    • Constructor Detail

      • DateTimeHandler

        public DateTimeHandler()
    • Method Detail

      • generateTimestamp

        public static Timestamp generateTimestamp​(Instant inst)
      • generateLowerBoundApproximation

        public static Instant generateLowerBoundApproximation​(Instant now,
                                                              Instant cur)
        Calculates a lower bound absolutely. No matter if the time is AFTER the current time.
        Parameters:
        now - the instant representing "now"...the now to compare against for computing the "approximation" range
        cur - the search parameter value instant
        Returns:
      • generateValue

        public static Instant generateValue​(TemporalAccessor value)
        Common code to generate an instant value. If needed, this method will pad the TemporalAccessor and then interpret this value according to the default timezone of the system.
        Parameters:
        value -
        Returns:
      • generateUpperBound

        public static Instant generateUpperBound​(DateTime value)
        convenience method to generate upper bound for a DateTime value.
        Parameters:
        value -
        Returns:
      • generateUpperBound

        public static Instant generateUpperBound​(Date value)
        convenience method to generate upper bound for a Date value.
        Parameters:
        value -
        Returns:
      • generateUpperBoundApproximation

        public static Instant generateUpperBoundApproximation​(Instant now,
                                                              Instant cur)
        Calculates a lower bound absolutely. No matter if the time is AFTER the current time.
        Parameters:
        now -
        cur -
        Returns:
      • serialize

        public static String serialize​(TemporalAccessor value)
        Serializer encapsulates the logic to serialize to string.
      • parse

        public static TemporalAccessor parse​(String value)
                                      throws FHIRSearchException
        Parses the value into a set of bounds/value and adds to parameter value. The value will be truncated to a microsecond precision after being parsed.
        Parameters:
        value - The date/time value to be parsed
        Returns:
        A TemporalAccessor object representing the parsed and truncated date/time value
        Throws:
        FHIRSearchException
      • parseQuiet

        public static TemporalAccessor parseQuiet​(String value)
        Parses quiet the value into a set of bounds/value and adds to parameter value. The value will be truncated to a microsecond precision after being parsed.
        Parameters:
        value - The date/time value to be parsed
        Returns:
        A TemporalAccessor object representing the parsed and truncated date/time value, or null if the value could not be parsed successfully