Search in sources :

Example 71 with Timing

use of org.hl7.fhir.dstu2.model.Timing in project eCRNow by drajer-health.

the class PlanDefinitionProcessor method getTimingSchedule.

private TimingSchedule getTimingSchedule(Timing t, TriggerType type) {
    if (t != null && t.hasRepeat()) {
        TimingRepeatComponent rc = t.getRepeat();
        // Create Timing Data
        TimingSchedule ts = new TimingSchedule();
        ts.setTriggerType(type);
        ts.setNumOfRepeat(rc.getCount());
        ts.setMaxRepeat(rc.getCountMax());
        ts.setFrequency(rc.getFrequency());
        ts.setFrequencyMax(rc.getFrequencyMax());
        ts.setFrequencyPeriod(rc.getPeriod());
        ts.setFrequencyPeriodUnit(rc.getPeriodUnitElement().getValue());
        ts.setDuration(rc.getDuration());
        ts.setDurationUnit(rc.getDurationUnit());
        logger.info("Found Timing Element with Frequency Period {} {} AND Duration {} {}", rc.getPeriod(), rc.getPeriodUnitElement().getValueAsString(), rc.getDuration(), rc.getDurationUnit());
        return ts;
    }
    return null;
}
Also used : TimingRepeatComponent(org.hl7.fhir.r4.model.Timing.TimingRepeatComponent) TimingSchedule(com.drajer.eca.model.TimingSchedule)

Aggregations

NotImplementedException (org.apache.commons.lang3.NotImplementedException)14 Timing (org.hl7.fhir.r4.model.Timing)11 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)10 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)9 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)8 Base64 (org.apache.commons.codec.binary.Base64)6 CommaSeparatedStringBuilder (org.hl7.fhir.utilities.CommaSeparatedStringBuilder)6 ArrayList (java.util.ArrayList)5 Date (java.util.Date)5 Timing (org.hl7.fhir.dstu3.model.Timing)5 DateTimeType (org.hl7.fhir.r4.model.DateTimeType)5 Reference (org.hl7.fhir.dstu3.model.Reference)4 EventTiming (org.hl7.fhir.dstu3.model.Timing.EventTiming)4 TimingRepeatComponent (org.hl7.fhir.dstu3.model.Timing.TimingRepeatComponent)4 BigDecimal (java.math.BigDecimal)3 Dosage (org.hl7.fhir.r4.model.Dosage)3 Period (org.hl7.fhir.r4.model.Period)3 Quantity (org.hl7.fhir.r4.model.Quantity)3 TimingRepeatComponent (org.hl7.fhir.r4.model.Timing.TimingRepeatComponent)3 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)3