public org.hl7.fhir.dstu3.model.Timing convertTiming(org.hl7.fhir.instance.model.Timing src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Timing tgt = new org.hl7.fhir.dstu3.model.Timing(); copyElement(src, tgt); for (org.hl7.fhir.instance.model.DateTimeType t : src.getEvent()) tgt.addEvent(t.getValue()); tgt.setRepeat(convertTimingRepeatComponent(src.getRepeat())); tgt.setCode(convertCodeableConcept(src.getCode())); return tgt; }
/** * @return {@link #schedule} (The time period and frequency at which the diet should be given.) */ // syntactic sugar public Timing addSchedule() { //3 Timing t = new Timing(); if (this.schedule == null) this.schedule = new ArrayList<Timing>(); this.schedule.add(t); return t; }
public org.hl7.fhir.instance.model.Timing convertTiming(org.hl7.fhir.r4.model.Timing src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.Timing tgt = new org.hl7.fhir.instance.model.Timing(); copyElement(src, tgt); for (org.hl7.fhir.r4.model.DateTimeType t : src.getEvent()) tgt.addEvent(t.getValue()); tgt.setRepeat(convertTimingRepeatComponent(src.getRepeat())); tgt.setCode(convertCodeableConcept(src.getCode())); return tgt; }
@Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("event")) this.getEvent().add(castToDateTime(value)); else if (name.equals("repeat")) this.repeat = (TimingRepeatComponent) value; // TimingRepeatComponent else if (name.equals("code")) this.code = castToCodeableConcept(value); // CodeableConcept else super.setProperty(name, value); }
private void checkTiming(List<ValidationMessage> errors, String path, WrapperElement focus, Timing fixed) { checkFixedValue(errors, path + ".repeat", focus.getNamedChild("repeat"), fixed.getRepeat(), "value"); List<WrapperElement> events = new ArrayList<WrapperElement>(); focus.getNamedChildren("event", events); if (rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, events.size() == fixed.getEvent().size(), "Expected " + Integer.toString(fixed.getEvent().size()) + " but found " + Integer.toString(events.size()) + " event elements")) { for (int i = 0; i < events.size(); i++) checkFixedValue(errors, path + ".event", events.get(i), fixed.getEvent().get(i), "event"); } }
public Timing copy() { Timing dst = new Timing(); copyValues(dst); if (event != null) { dst.event = new ArrayList<DateTimeType>(); for (DateTimeType i : event) dst.event.add(i.copy()); }; dst.repeat = repeat == null ? null : repeat.copy(); dst.code = code == null ? null : code.copy(); return dst; }
public boolean hasSchedule() { if (this.schedule == null) return false; for (Timing item : this.schedule) if (!item.isEmpty()) return true; return false; }
@Override public boolean equalsDeep(Base other) { if (!super.equalsDeep(other)) return false; if (!(other instanceof Timing)) return false; Timing o = (Timing) other; return compareDeep(event, o.event, true) && compareDeep(repeat, o.repeat, true) && compareDeep(code, o.code, true) ; }
@Override public boolean equalsShallow(Base other) { if (!super.equalsShallow(other)) return false; if (!(other instanceof Timing)) return false; Timing o = (Timing) other; return compareValues(event, o.event, true); }
public boolean hasSchedule() { if (this.schedule == null) return false; for (Timing item : this.schedule) if (!item.isEmpty()) return true; return false; }
@Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("event")) this.getEvent().add(castToDateTime(value)); else if (name.equals("repeat")) this.repeat = (TimingRepeatComponent) value; // TimingRepeatComponent else if (name.equals("code")) this.code = castToCodeableConcept(value); // CodeableConcept else super.setProperty(name, value); }
private void checkTiming(List<ValidationMessage> errors, String path, WrapperElement focus, Timing fixed) { checkFixedValue(errors, path + ".repeat", focus.getNamedChild("repeat"), fixed.getRepeat(), "value"); List<WrapperElement> events = new ArrayList<WrapperElement>(); focus.getNamedChildren("event", events); if (rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, events.size() == fixed.getEvent().size(), "Expected " + Integer.toString(fixed.getEvent().size()) + " but found " + Integer.toString(events.size()) + " event elements")) { for (int i = 0; i < events.size(); i++) checkFixedValue(errors, path + ".event", events.get(i), fixed.getEvent().get(i), "event"); } }
public Timing copy() { Timing dst = new Timing(); copyValues(dst); if (event != null) { dst.event = new ArrayList<DateTimeType>(); for (DateTimeType i : event) dst.event.add(i.copy()); }; dst.repeat = repeat == null ? null : repeat.copy(); dst.code = code == null ? null : code.copy(); return dst; }
@Override public boolean equalsDeep(Base other) { if (!super.equalsDeep(other)) return false; if (!(other instanceof Timing)) return false; Timing o = (Timing) other; return compareDeep(event, o.event, true) && compareDeep(repeat, o.repeat, true) && compareDeep(code, o.code, true) ; }
@Override public boolean equalsShallow(Base other) { if (!super.equalsShallow(other)) return false; if (!(other instanceof Timing)) return false; Timing o = (Timing) other; return compareValues(event, o.event, true); }
public org.hl7.fhir.r4.model.Timing convertTiming(org.hl7.fhir.instance.model.Timing src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.Timing tgt = new org.hl7.fhir.r4.model.Timing(); copyElement(src, tgt); for (org.hl7.fhir.instance.model.DateTimeType t : src.getEvent()) tgt.addEvent(t.getValue()); tgt.setRepeat(convertTimingRepeatComponent(src.getRepeat())); tgt.setCode(convertCodeableConcept(src.getCode())); return tgt; }
/** * @return {@link #schedule} (The time period and frequency at which the supplement(s) should be given.) */ // syntactic sugar public Timing addSchedule() { //3 Timing t = new Timing(); if (this.schedule == null) this.schedule = new ArrayList<Timing>(); this.schedule.add(t); return t; }
public boolean hasTiming() { return this.timing != null && !this.timing.isEmpty(); }
public org.hl7.fhir.instance.model.Timing convertTiming(org.hl7.fhir.dstu3.model.Timing src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.Timing tgt = new org.hl7.fhir.instance.model.Timing(); copyElement(src, tgt); for (org.hl7.fhir.dstu3.model.DateTimeType t : src.getEvent()) tgt.addEvent(t.getValue()); tgt.setRepeat(convertTimingRepeatComponent(src.getRepeat())); tgt.setCode(convertCodeableConcept(src.getCode())); return tgt; }
public org.hl7.fhir.r4.model.Timing convertTiming(org.hl7.fhir.instance.model.Timing src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.Timing tgt = new org.hl7.fhir.r4.model.Timing(); copyElement(src, tgt); for (org.hl7.fhir.instance.model.DateTimeType t : src.getEvent()) tgt.addEvent(t.getValue()); tgt.setRepeat(convertTimingRepeatComponent(src.getRepeat())); tgt.setCode(convertCodeableConcept(src.getCode())); return tgt; }