diff --git a/omod/src/main/java/org/bahmni/module/hip/web/model/FhirPrescription.java b/omod/src/main/java/org/bahmni/module/hip/web/model/FhirPrescription.java index 9b136b40..b1c3b30c 100644 --- a/omod/src/main/java/org/bahmni/module/hip/web/model/FhirPrescription.java +++ b/omod/src/main/java/org/bahmni/module/hip/web/model/FhirPrescription.java @@ -46,7 +46,7 @@ private FhirPrescription(Date visitTimeStamp, Integer encounterID, Encounter enc } public static FhirPrescription from(OpenMrsPrescription openMrsPrescription, FHIRResourceMapper fhirResourceMapper, OmrsObsDocumentTransformer documentTransformer) { - Date encounterDatetime = openMrsPrescription.getEncounter().getVisit().getStartDatetime(); + Date encounterDatetime = openMrsPrescription.getEncounter().getEncounterDatetime(); Integer encounterId = openMrsPrescription.getEncounter().getId(); Patient patient = fhirResourceMapper.mapToPatient(openMrsPrescription.getPatient()); Reference patientReference = FHIRUtils.getReferenceToResource(patient); diff --git a/omod/src/main/java/org/bahmni/module/hip/web/service/FHIRResourceMapper.java b/omod/src/main/java/org/bahmni/module/hip/web/service/FHIRResourceMapper.java index ba92ccfa..7ee16366 100644 --- a/omod/src/main/java/org/bahmni/module/hip/web/service/FHIRResourceMapper.java +++ b/omod/src/main/java/org/bahmni/module/hip/web/service/FHIRResourceMapper.java @@ -359,7 +359,9 @@ public Medication mapToMedication(DrugOrder order) { if (order.getDrug() == null) { return null; } - return medicationTranslator.toFhirResource(order.getDrug()); + Medication medication = medicationTranslator.toFhirResource(order.getDrug()); + medication.getCode().setText(order.getDrug().getName()); + return medication; } public static T initializeEntityAndUnproxy(T entity) {