this.substitution = new MedicationDispenseSubstitutionComponent(); return this.substitution;
@Override public Base addChild(String name) throws FHIRException { if (name.equals("wasSubstituted")) { throw new FHIRException("Cannot call addChild on a primitive type MedicationDispense.wasSubstituted"); } else if (name.equals("type")) { this.type = new CodeableConcept(); return this.type; } else if (name.equals("reason")) { return addReason(); } else if (name.equals("responsibleParty")) { return addResponsibleParty(); } else return super.addChild(name); }
@Override public Base setProperty(String name, Base value) throws FHIRException { if (name.equals("wasSubstituted")) { this.wasSubstituted = castToBoolean(value); // BooleanType } else if (name.equals("type")) { this.type = castToCodeableConcept(value); // CodeableConcept } else if (name.equals("reason")) { this.getReason().add(castToCodeableConcept(value)); } else if (name.equals("responsibleParty")) { this.getResponsibleParty().add(castToReference(value)); } else return super.setProperty(name, value); return value; }
@Override public Base setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case -592113567: // wasSubstituted this.wasSubstituted = castToBoolean(value); // BooleanType return value; case 3575610: // type this.type = castToCodeableConcept(value); // CodeableConcept return value; case -934964668: // reason this.getReason().add(castToCodeableConcept(value)); // CodeableConcept return value; case 1511509392: // responsibleParty this.getResponsibleParty().add(castToReference(value)); // Reference return value; default: return super.setProperty(hash, name, value); } }
public MedicationDispenseSubstitutionComponent copy() { MedicationDispenseSubstitutionComponent dst = new MedicationDispenseSubstitutionComponent(); copyValues(dst); dst.wasSubstituted = wasSubstituted == null ? null : wasSubstituted.copy(); dst.type = type == null ? null : type.copy(); if (reason != null) { dst.reason = new ArrayList<CodeableConcept>(); for (CodeableConcept i : reason) dst.reason.add(i.copy()); }; if (responsibleParty != null) { dst.responsibleParty = new ArrayList<Reference>(); for (Reference i : responsibleParty) dst.responsibleParty.add(i.copy()); }; return dst; }
public boolean hasSubstitution() { return this.substitution != null && !this.substitution.isEmpty(); }
/** * @return {@link #substitution} (Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but does not happen, in other cases substitution is not expected but does happen. This block explains what substitution did or did not happen and why. If nothing is specified, substitution was not done.) */ public MedicationDispenseSubstitutionComponent getSubstitution() { if (this.substitution == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create MedicationDispense.substitution"); else if (Configuration.doAutoCreate()) this.substitution = new MedicationDispenseSubstitutionComponent(); // cc return this.substitution; }
public org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseSubstitutionComponent convertMedicationDispenseSubstitutionComponent(org.hl7.fhir.instance.model.MedicationDispense.MedicationDispenseSubstitutionComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseSubstitutionComponent tgt = new org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseSubstitutionComponent(); copyElement(src, tgt); tgt.setType(convertCodeableConcept(src.getType())); for (org.hl7.fhir.instance.model.CodeableConcept t : src.getReason()) tgt.addReason(convertCodeableConcept(t)); for (org.hl7.fhir.instance.model.Reference t : src.getResponsibleParty()) tgt.addResponsibleParty(convertReference(t)); return tgt; }
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -592113567: return getWasSubstitutedElement(); case 3575610: return getType(); case -934964668: return addReason(); case 1511509392: return addResponsibleParty(); default: return super.makeProperty(hash, name); } }
public org.hl7.fhir.instance.model.MedicationDispense.MedicationDispenseSubstitutionComponent convertMedicationDispenseSubstitutionComponent(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseSubstitutionComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.MedicationDispense.MedicationDispenseSubstitutionComponent tgt = new org.hl7.fhir.instance.model.MedicationDispense.MedicationDispenseSubstitutionComponent(); copyElement(src, tgt); tgt.setType(convertCodeableConcept(src.getType())); for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReason(convertCodeableConcept(t)); for (org.hl7.fhir.dstu3.model.Reference t : src.getResponsibleParty()) tgt.addResponsibleParty(convertReference(t)); return tgt; }
/** * @return The first repetition of repeating field {@link #responsibleParty}, creating it if it does not already exist */ public Reference getResponsiblePartyFirstRep() { if (getResponsibleParty().isEmpty()) { addResponsibleParty(); } return getResponsibleParty().get(0); }
public org.hl7.fhir.instance.model.MedicationDispense.MedicationDispenseSubstitutionComponent convertMedicationDispenseSubstitutionComponent(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseSubstitutionComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.MedicationDispense.MedicationDispenseSubstitutionComponent tgt = new org.hl7.fhir.instance.model.MedicationDispense.MedicationDispenseSubstitutionComponent(); copyElement(src, tgt); tgt.setType(convertCodeableConcept(src.getType())); for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason()) tgt.addReason(convertCodeableConcept(t)); for (org.hl7.fhir.dstu3.model.Reference t : src.getResponsibleParty()) tgt.addResponsibleParty(convertReference(t)); return tgt; }
public org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseSubstitutionComponent convertMedicationDispenseSubstitutionComponent(org.hl7.fhir.instance.model.MedicationDispense.MedicationDispenseSubstitutionComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseSubstitutionComponent tgt = new org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseSubstitutionComponent(); copyElement(src, tgt); tgt.setType(convertCodeableConcept(src.getType())); for (org.hl7.fhir.instance.model.CodeableConcept t : src.getReason()) tgt.addReason(convertCodeableConcept(t)); for (org.hl7.fhir.instance.model.Reference t : src.getResponsibleParty()) tgt.addResponsibleParty(convertReference(t)); return tgt; }