Class TimingEventR5
java.lang.Object
io.github.jy95.fds.r5.translators.TimingEventR5
- All Implemented Interfaces:
TimingEvent<FDSConfigR5,
,org.hl7.fhir.r5.model.Dosage> Translator<FDSConfigR5,
,org.hl7.fhir.r5.model.Dosage> TranslatorTiming<FDSConfigR5,
org.hl7.fhir.r5.model.Dosage>
public class TimingEventR5
extends Object
implements TimingEvent<FDSConfigR5,org.hl7.fhir.r5.model.Dosage>
R5 class for translating "timing.event"
- Author:
- jy95
-
Field Summary
Modifier and TypeFieldDescriptionprotected final com.ibm.icu.text.MessageFormat
MessageFormat instance used for "event" translation. -
Constructor Summary
ConstructorDescriptionTimingEventR5
(FDSConfigR5 config, ResourceBundle bundle) Constructor forTimingEventR5
. -
Method Summary
Modifier and TypeMethodDescriptionconvert
(org.hl7.fhir.r5.model.Dosage dosage) Converts a dosage field into a human-readable string representation asynchronously.getEvents
(org.hl7.fhir.r5.model.Dosage dosage) Extracts a list of timing events from the data object.boolean
hasRequiredElements
(org.hl7.fhir.r5.model.Dosage dosage) Checks if the "Timing" element of the given dosage object contains the required conditions for this translator.boolean
hasTiming
(org.hl7.fhir.r5.model.Dosage dosage) Checks if the given dosage object contains a "Timing" element.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.github.jy95.fds.common.translators.TimingEvent
getTimingEventMsg
Methods inherited from interface io.github.jy95.fds.common.types.TranslatorTiming
isPresent
-
Field Details
-
timingEventMsg
protected final com.ibm.icu.text.MessageFormat timingEventMsgMessageFormat instance used for "event" translation.
-
-
Constructor Details
-
TimingEventR5
Constructor forTimingEventR5
.- Parameters:
config
- The configuration object used for translation.bundle
- aResourceBundle
object
-
-
Method Details
-
hasRequiredElements
public boolean hasRequiredElements(org.hl7.fhir.r5.model.Dosage dosage) Checks if the "Timing" element of the given dosage object contains the required conditions for this translator.- Specified by:
hasRequiredElements
in interfaceTranslatorTiming<FDSConfigR5,
org.hl7.fhir.r5.model.Dosage> - Parameters:
dosage
- the dosage object to check- Returns:
true
if the "Timing" element has the required conditions,false
otherwise
-
getEvents
Extracts a list of timing events from the data object.- Specified by:
getEvents
in interfaceTimingEvent<FDSConfigR5,
org.hl7.fhir.r5.model.Dosage> - Parameters:
dosage
- The data object containing timing events.- Returns:
- A list of timing events represented as strings.
-
hasTiming
public boolean hasTiming(org.hl7.fhir.r5.model.Dosage dosage) Checks if the given dosage object contains a "Timing" element.- Specified by:
hasTiming
in interfaceTranslatorTiming<FDSConfigR5,
org.hl7.fhir.r5.model.Dosage> - Parameters:
dosage
- the dosage object to check- Returns:
true
if the dosage object has a "Timing" element,false
otherwise
-
convert
Converts a dosage field into a human-readable string representation asynchronously.- Specified by:
convert
in interfaceTranslator<FDSConfigR5,
org.hl7.fhir.r5.model.Dosage> - Parameters:
dosage
- the dosage field to be converted- Returns:
- a
CompletableFuture
that will complete with the human-readable string
-