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;
}
Aggregations