Skip to content

Commit

Permalink
Correctly filter to only send orders if SCC is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
ibacher committed Jul 25, 2024
1 parent 0192f7d commit e3da001
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void doOrder(Encounter encounter) throws NewOrderException {
StringUtils.join(orderDestinations, ','));

for (OrderDestination destination : orderDestinations) {
if (!destination.equals(OrderDestination.SCC)) {
if (destination.equals(OrderDestination.SCC)) {
orderSenderManager.sendOrders(encounter, destination);
} else {
LOGGER.info("Skipping order not bound for SCC");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ public static List<OrderDestination> getOrderDestinations(Encounter encounter) {

for (Obs obs : encounter.getAllObs()) {
if (ObjectUtils.equals(obs.getConcept().getUuid(), ORDER_DESTINATION_CONCEPT_UUID)) {
destinations.add(OrderDestination.fromString(obs.getValueText()));
OrderDestination destination = OrderDestination.fromString(obs.getValueText());
if (destination != null) {
destinations.add(destination);
}
}
}

Expand Down

0 comments on commit e3da001

Please sign in to comment.