Source:
public DrugOrder map(EncounterTransaction.DrugOrder drugOrder, Encounter encounter) { DrugOrder openMRSDrugOrder = createDrugOrder(drugOrder); openMRSDrugOrder.setCareSetting(getCareSettingFrom(drugOrder, openMRSDrugOrder)); Drug drug = getDrugFrom(drugOrder, openMRSDrugOrder); if(drug == null) { throw new APIException("No such drug : " + drugOrder.getDrug().getName()); } openMRSDrugOrder.setDrug(drug); openMRSDrugOrder.setEncounter(encounter); openMRSDrugOrder.setDateActivated(drugOrder.getDateActivated()); openMRSDrugOrder.setScheduledDate(drugOrder.getScheduledDate()); openMRSDrugOrder.setUrgency(drugOrder.getScheduledDate() != null ? Order.Urgency.ON_SCHEDULED_DATE : DEFAULT_URGENCY); openMRSDrugOrder.setDuration(drugOrder.getDuration()); openMRSDrugOrder.setDurationUnits(orderMetadataService.getDurationUnitsConceptByName(drugOrder.getDurationUnits())); try { if (drugOrder.getDosingInstructionType() != null) { openMRSDrugOrder.setDosingType((Class<? extends DosingInstructions>) Context.loadClass(drugOrder.getDosingInstructionType())); } } catch (ClassNotFoundException e) { throw new APIException("Class not found for : DosingInstructionType " + drugOrder.getDosingInstructionType(), e); } if (Order.Action.REVISE == openMRSDrugOrder.getAction() && openMRSDrugOrder.getDuration() != null) { openMRSDrugOrder.setAutoExpireDate(null); } dosingInstructionsMapper.map(drugOrder.getDosingInstructions(), openMRSDrugOrder); openMRSDrugOrder.setInstructions(drugOrder.getInstructions()); Provider provider = encounter.getEncounterProviders().iterator().next().getProvider(); openMRSDrugOrder.setOrderer(provider); return openMRSDrugOrder; }

Target:
public DrugOrder map(EncounterTransaction.DrugOrder drugOrder, Encounter encounter) { DrugOrder openMRSDrugOrder = createDrugOrder(drugOrder); openMRSDrugOrder.setCareSetting(getCareSettingFrom(drugOrder, openMRSDrugOrder)); Drug drug = getDrugFrom(drugOrder, openMRSDrugOrder); if (drug == null) { throw new APIException("No such drug : " + drugOrder.getDrug().getName()); } openMRSDrugOrder.setDrug(drug); openMRSDrugOrder.setEncounter(encounter); openMRSDrugOrder.setDateActivated(drugOrder.getDateActivated()); openMRSDrugOrder.setScheduledDate(drugOrder.getScheduledDate()); openMRSDrugOrder.setUrgency(drugOrder.getScheduledDate() != null ? Order.Urgency.ON_SCHEDULED_DATE : DEFAULT_URGENCY); openMRSDrugOrder.setDuration(drugOrder.getDuration()); openMRSDrugOrder.setDurationUnits(orderMetadataService.getDurationUnitsConceptByName(drugOrder.getDurationUnits())); openMRSDrugOrder.setAutoExpireDate(drugOrder.getAutoExpireDate()); try { if (drugOrder.getDosingInstructionType() != null) { openMRSDrugOrder.setDosingType((Class<? extends DosingInstructions>) Context.loadClass(drugOrder.getDosingInstructionType())); } } catch (ClassNotFoundException e) { throw new APIException("Class not found for : DosingInstructionType " + drugOrder.getDosingInstructionType(), e); } dosingInstructionsMapper.map(drugOrder.getDosingInstructions(), openMRSDrugOrder); openMRSDrugOrder.setInstructions(drugOrder.getInstructions()); Provider provider = encounter.getEncounterProviders().iterator().next().getProvider(); openMRSDrugOrder.setOrderer(provider); return openMRSDrugOrder; }