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

    Fields
    Modifier and Type
    Field
    Description
    protected final com.ibm.icu.text.MessageFormat
    MessageFormat instance used for "event" translation.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for TimingEventR5.
  • Method Summary

    Modifier and Type
    Method
    Description
    convert(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 timingEventMsg
      MessageFormat instance used for "event" translation.
  • Constructor Details

    • TimingEventR5

      public TimingEventR5(FDSConfigR5 config, ResourceBundle bundle)
      Constructor for TimingEventR5.
      Parameters:
      config - The configuration object used for translation.
      bundle - a ResourceBundle 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 interface TranslatorTiming<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

      public List<String> getEvents(org.hl7.fhir.r5.model.Dosage dosage)
      Extracts a list of timing events from the data object.
      Specified by:
      getEvents in interface TimingEvent<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 interface TranslatorTiming<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

      public CompletableFuture<String> convert(org.hl7.fhir.r5.model.Dosage dosage)
      Converts a dosage field into a human-readable string representation asynchronously.
      Specified by:
      convert in interface Translator<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