/** * Gets the first repetition for <b>dosageInstruction</b> (How medication should be taken), * creating it if it does not already exist. * * <p> * <b>Definition:</b> * Indicates how the medication is to be used by the patient * </p> */ public DosageInstruction getDosageInstructionFirstRep() { if (getDosageInstruction().isEmpty()) { return addDosageInstruction(); } return getDosageInstruction().get(0); }
/** * Gets the first repetition for <b>identifier</b> (External identifier), * creating it if it does not already exist. * * <p> * <b>Definition:</b> * External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system. * </p> */ public IdentifierDt getIdentifierFirstRep() { if (getIdentifier().isEmpty()) { return addIdentifier(); } return getIdentifier().get(0); } /**
@Override public IdentifierDt getIdentifier() { if(myMedicationPrescription != null){ return myMedicationPrescription.getIdentifierFirstRep(); } return null; }
@Override public String getName() { if(myMedicationPrescription != null){ if(myMedicationPrescription.getMedication() != null){ Medication m = (Medication) myMedicationPrescription.getMedication().getResource(); if(m != null){ return "Medication Prescription: " + m.getName().getValue(); } } return "Medication Prescription: " + myMedicationPrescription.getId().getValueAsString(); //if we don't have a medication name, use the id as the name } return ""; //no medication prescription, nothing to do here }
/** * Sets the value(s) for <b>status</b> (active | on hold | completed | entered in error | stopped | superceded) * * <p> * <b>Definition:</b> * A code specifying the state of the order. Generally this will be active or completed state * </p> */ public MedicationPrescription setStatus(MedicationPrescriptionStatusEnum theValue) { getStatus().setValueAsEnum(theValue); return this; }
/** * Adds and returns a new value for <b>dosageInstruction</b> (How medication should be taken) * * <p> * <b>Definition:</b> * Indicates how the medication is to be used by the patient * </p> */ public DosageInstruction addDosageInstruction() { DosageInstruction newType = new DosageInstruction(); getDosageInstruction().add(newType); return newType; }
/** * Adds and returns a new value for <b>identifier</b> (External identifier) * * <p> * <b>Definition:</b> * External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system. * </p> */ public IdentifierDt addIdentifier() { IdentifierDt newType = new IdentifierDt(); getIdentifier().add(newType); return newType; }