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; }
public org.hl7.fhir.instance.model.MedicationDispense convertMedicationDispense(org.hl7.fhir.dstu3.model.MedicationDispense src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.MedicationDispense tgt = new org.hl7.fhir.instance.model.MedicationDispense(); copyDomainResource(src, tgt); tgt.setIdentifier(convertIdentifier(src.getIdentifierFirstRep())); tgt.setStatus(convertMedicationDispenseStatus(src.getStatus())); tgt.setMedication(convertType(src.getMedication())); tgt.setPatient(convertReference(src.getSubject())); // tgt.setDispenser(convertReference(src.getDispenser())); for (org.hl7.fhir.dstu3.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.dstu3.model.Reference t : src.getReceiver()) tgt.addReceiver(convertReference(t)); for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.setNote(t.getText()); for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(convertMedicationDispenseDosageInstructionComponent(t)); tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); return tgt; }
/** * @return The first repetition of repeating field {@link #dosageInstruction}, creating it if it does not already exist */ public Dosage getDosageInstructionFirstRep() { if (getDosageInstruction().isEmpty()) { addDosageInstruction(); } return getDosageInstruction().get(0); }
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1618432855: return addIdentifier(); case -995410646: return addPartOf(); case -892481550: return getStatusElement(); case 50511102: return getCategory(); case 1458402129: return getMedication(); case 1998965455: return getMedication(); case -1867885268: return getSubject(); case 951530927: return getContext(); case -1248768647: return addSupportingInformation(); case 481140686: return addPerformer(); case -1237557856: return addAuthorizingPrescription(); case 3575610: return getType(); case -1285004149: return getQuantity(); case 197175334: return getDaysSupply(); case -562837097: return getWhenPreparedElement(); case -940241380: return getWhenHandedOverElement(); case -1429847026: return getDestination(); case -808719889: return addReceiver(); case 3387378: return addNote(); case -1201373865: return addDosageInstruction(); case 826147581: return getSubstitution(); case 51602295: return addDetectedIssue(); case 2128257269: return getNotDoneElement(); case -1762771385: return getNotDoneReason(); case -1973169255: return getNotDoneReason(); case 1835190426: return addEventHistory(); default: return super.makeProperty(hash, name);
switch (hash) { case -1618432855: // identifier this.getIdentifier().add(castToIdentifier(value)); // Identifier return value; case -995410646: // partOf this.getPartOf().add(castToReference(value)); // Reference return value; case -892481550: // status value = new MedicationDispenseStatusEnumFactory().fromType(castToCode(value)); this.status = (Enumeration) value; // Enumeration<MedicationDispenseStatus> return value; case 50511102: // category this.category = castToCodeableConcept(value); // CodeableConcept return value; case 1998965455: // medication this.medication = castToType(value); // Type return value; case -1867885268: // subject this.subject = castToReference(value); // Reference return value; case 951530927: // context this.context = castToReference(value); // Reference return value; case -1248768647: // supportingInformation this.getSupportingInformation().add(castToReference(value)); // Reference return value; case 481140686: // performer this.getPerformer().add((MedicationDispensePerformerComponent) value); // MedicationDispensePerformerComponent return value;
@Override public Base addChild(String name) throws FHIRException { if (name.equals("identifier")) { return addIdentifier(); return addPartOf(); return addSupportingInformation(); return addPerformer(); return addAuthorizingPrescription(); return addReceiver(); return addNote(); return addDosageInstruction(); return addDetectedIssue(); return addEventHistory();
/** * @return The first repetition of repeating field {@link #authorizingPrescription}, creating it if it does not already exist */ public Reference getAuthorizingPrescriptionFirstRep() { if (getAuthorizingPrescription().isEmpty()) { addAuthorizingPrescription(); } return getAuthorizingPrescription().get(0); }
/** * @return The first repetition of repeating field {@link #receiver}, creating it if it does not already exist */ public Reference getReceiverFirstRep() { if (getReceiver().isEmpty()) { addReceiver(); } return getReceiver().get(0); }
/** * @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 MedicationDispense copy() { MedicationDispense dst = new MedicationDispense(); copyValues(dst); if (identifier != null) { dst.identifier = new ArrayList<Identifier>();
return new ProcessRequest(); if ("MedicationDispense".equals(name)) return new MedicationDispense(); if ("DiagnosticReport".equals(name)) return new DiagnosticReport();
@Override public Base setProperty(String name, Base value) throws FHIRException { if (name.equals("identifier")) { this.getIdentifier().add(castToIdentifier(value)); } else if (name.equals("partOf")) { this.getPartOf().add(castToReference(value)); } else if (name.equals("status")) { value = new MedicationDispenseStatusEnumFactory().fromType(castToCode(value)); this.status = (Enumeration) value; // Enumeration<MedicationDispenseStatus> } else if (name.equals("category")) { this.category = castToCodeableConcept(value); // CodeableConcept } else if (name.equals("medication[x]")) { this.medication = castToType(value); // Type } else if (name.equals("subject")) { this.subject = castToReference(value); // Reference } else if (name.equals("context")) { this.context = castToReference(value); // Reference } else if (name.equals("supportingInformation")) { this.getSupportingInformation().add(castToReference(value)); } else if (name.equals("performer")) { this.getPerformer().add((MedicationDispensePerformerComponent) value); } else if (name.equals("authorizingPrescription")) { this.getAuthorizingPrescription().add(castToReference(value)); } else if (name.equals("type")) { this.type = castToCodeableConcept(value); // CodeableConcept } else if (name.equals("quantity")) { this.quantity = castToSimpleQuantity(value); // SimpleQuantity } else if (name.equals("daysSupply")) { this.daysSupply = castToSimpleQuantity(value); // SimpleQuantity } else if (name.equals("whenPrepared")) {
case -302536977: return new Medication(); case -342579923: return new MedicationAdministration(); case -408244884: return new MedicationDispense(); case 1627523232: return new MedicationRequest(); case -2097348800: return new MedicationStatement();
public org.hl7.fhir.instance.model.MedicationDispense convertMedicationDispense(org.hl7.fhir.dstu3.model.MedicationDispense src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.MedicationDispense tgt = new org.hl7.fhir.instance.model.MedicationDispense(); copyDomainResource(src, tgt); tgt.setIdentifier(convertIdentifier(src.getIdentifierFirstRep())); tgt.setStatus(convertMedicationDispenseStatus(src.getStatus())); tgt.setMedication(convertType(src.getMedication())); tgt.setPatient(convertReference(src.getSubject())); // tgt.setDispenser(convertReference(src.getDispenser())); for (org.hl7.fhir.dstu3.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.dstu3.model.Reference t : src.getReceiver()) tgt.addReceiver(convertReference(t)); for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.setNote(t.getText()); for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosageInstruction()) tgt.addDosageInstruction(convertMedicationDispenseDosageInstructionComponent(t)); tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); return tgt; }
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; }