@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; }
/** * @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); }
@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 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.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; }