Skip to content

Commit

Permalink
BAH-3449 | Refactored. Medication to send drug name and encounter dat…
Browse files Browse the repository at this point in the history
…e time (#127)

* BAH-3449 | Add. code text as drug name

* BAH-3449 | Pass encounter date time instead of visit time
  • Loading branch information
SanoferSameera authored Jan 5, 2024
1 parent 8062c51 commit 57df5e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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> T initializeEntityAndUnproxy(T entity) {
Expand Down

0 comments on commit 57df5e1

Please sign in to comment.