/** * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist */ public Identifier getIdentifierFirstRep() { if (getIdentifier().isEmpty()) { addIdentifier(); } return getIdentifier().get(0); }
public org.hl7.fhir.dstu3.model.MedicationDispense convertMedicationDispense(org.hl7.fhir.instance.model.MedicationDispense src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.MedicationDispense tgt = new org.hl7.fhir.dstu3.model.MedicationDispense(); copyDomainResource(src, tgt); tgt.addIdentifier(convertIdentifier(src.getIdentifier())); tgt.setStatus(convertMedicationDispenseStatus(src.getStatus())); tgt.setMedication(convertType(src.getMedication())); tgt.setSubject(convertReference(src.getPatient())); // tgt.setDispenser(convertReference(src.getDispenser())); for (org.hl7.fhir.instance.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(convertReference(t)); tgt.setType(convertCodeableConcept(src.getType())); tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); tgt.setDaysSupply(convertSimpleQuantity(src.getDaysSupply())); tgt.setWhenPrepared(src.getWhenPrepared()); tgt.setWhenHandedOver(src.getWhenHandedOver()); tgt.setDestination(convertReference(src.getDestination())); for (org.hl7.fhir.instance.model.Reference t : src.getReceiver()) tgt.addReceiver(convertReference(t)); if (src.hasNote()) tgt.addNote().setText(src.getNote()); for (org.hl7.fhir.instance.model.MedicationDispense.MedicationDispenseDosageInstructionComponent t : src.getDosageInstruction()) tgt.addDosageInstruction(convertMedicationDispenseDosageInstructionComponent(t)); tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); return tgt; }
@Override public Base addChild(String name) throws FHIRException { if (name.equals("identifier")) { return addIdentifier();
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1618432855: return addIdentifier(); case -995410646: return addPartOf(); case -892481550: return getStatusElement();
public org.hl7.fhir.dstu3.model.MedicationDispense convertMedicationDispense(org.hl7.fhir.instance.model.MedicationDispense src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.MedicationDispense tgt = new org.hl7.fhir.dstu3.model.MedicationDispense(); copyDomainResource(src, tgt); tgt.addIdentifier(convertIdentifier(src.getIdentifier())); tgt.setStatus(convertMedicationDispenseStatus(src.getStatus())); tgt.setMedication(convertType(src.getMedication())); tgt.setSubject(convertReference(src.getPatient())); // tgt.setDispenser(convertReference(src.getDispenser())); for (org.hl7.fhir.instance.model.Reference t : src.getAuthorizingPrescription()) tgt.addAuthorizingPrescription(convertReference(t)); tgt.setType(convertCodeableConcept(src.getType())); tgt.setQuantity(convertSimpleQuantity(src.getQuantity())); tgt.setDaysSupply(convertSimpleQuantity(src.getDaysSupply())); tgt.setWhenPrepared(src.getWhenPrepared()); tgt.setWhenHandedOver(src.getWhenHandedOver()); tgt.setDestination(convertReference(src.getDestination())); for (org.hl7.fhir.instance.model.Reference t : src.getReceiver()) tgt.addReceiver(convertReference(t)); if (src.hasNote()) tgt.addNote().setText(src.getNote()); for (org.hl7.fhir.instance.model.MedicationDispense.MedicationDispenseDosageInstructionComponent t : src.getDosageInstruction()) tgt.addDosageInstruction(convertMedicationDispenseDosageInstructionComponent(t)); tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); return tgt; }