Package org.ehrbase.openehr.sdk.util
Class OpenEHRDateTimeSerializationUtils
java.lang.Object
org.ehrbase.openehr.sdk.util.OpenEHRDateTimeSerializationUtils
This helper class is used to work around some Archie issues with date/time parsing accepting invalid years or not following the specified format fully (i.e. 2023-13, ignoring leap years)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DateTimeFormatterstatic final DateTimeFormatterstatic final DateTimeFormatter -
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatDate(TemporalAccessor date) static StringformatDateTime(TemporalAccessor dateTime) static StringformatTime(TemporalAccessor time) static LongtoMagnitude(com.nedap.archie.rm.datavalues.quantity.datetime.DvDate date) Archie does not support partial dates for getMagnitude.static LongtoMagnitude(com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime dateTime) Archie does not support partial date-times for getMagnitude.static DoubletoMagnitude(com.nedap.archie.rm.datavalues.quantity.datetime.DvTime time) Archie does not support partial times for getMagnitude.
-
Field Details
-
ISO_8601_DATE_FORMATTER
-
ISO_8601_TIME_FORMATTER
-
ISO_8601_DATE_TIME_FORMATTER
-
-
Method Details
-
formatDate
-
formatTime
-
formatDateTime
-
toMagnitude
Archie does not support partial dates for getMagnitude. This method will assume first day/month if missing. As the openEHR spec defines year as the minimum, a non-null input will throw an Exception ifChronoField.YEAR is not supported.- Parameters:
date-- Returns:
-
toMagnitude
public static Long toMagnitude(com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime dateTime) Archie does not support partial date-times for getMagnitude. This method will assume first day/month and 0 for time components if missing. As the openEHR spec defines year as the minimum, a non-null input will throw an Exception ifChronoField.YEAR is not supported.- Parameters:
dateTime-- Returns:
-
toMagnitude
Archie does not support partial times for getMagnitude. This method will assume 0 for fields not within the precision. As the openEHR spec defines hour as the minimum, a non-null input will throw an Exception ifChronoField.MINUTE_OF_HOUR is not supported.- Parameters:
time-- Returns:
-