Skip to content

Commit

Permalink
EA-180 | Unable to save dosing instruction route in user locale (#220)
Browse files Browse the repository at this point in the history
* BAH-3500 | Add a method getRouteConceptByName to get correct concept irrespective of the locale.

* BAH-3500 | Reverting the version change.
  • Loading branch information
poojadeshpande01 authored Jan 30, 2024
1 parent aa45884 commit 60377f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public DrugOrder map(EncounterTransaction.DosingInstructions dosingInstructions,
drugOrder.setDose(dosingInstructions.getDose());
drugOrder.setDoseUnits(orderMetadataService.getDoseUnitsConceptByName(dosingInstructions.getDoseUnits()));
drugOrder.setDosingInstructions(dosingInstructions.getAdministrationInstructions());
drugOrder.setRoute(conceptByName(dosingInstructions.getRoute()));
drugOrder.setRoute(orderMetadataService.getRouteConceptByName(dosingInstructions.getRoute()));
drugOrder.setAsNeeded(dosingInstructions.getAsNeeded());
drugOrder.setFrequency(orderMetadataService.getOrderFrequencyByName(dosingInstructions.getFrequency(), false));
drugOrder.setQuantity(Double.valueOf(dosingInstructions.getQuantity()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,15 @@ public Concept getDispenseUnitsConceptByName(String conceptName) {
}
return null;
}

public Concept getRouteConceptByName(String conceptName) {
List<Concept> drugRoutes = orderService.getDrugRoutes();
for (Concept route : drugRoutes) {
if(route.getName().getName().equals(conceptName)){
return route;
}
}
return null;
}

}

0 comments on commit 60377f0

Please sign in to comment.