Details
-
Story
-
Status: Closed
-
TBD
-
Resolution: Fixed
-
None
-
None
-
None
-
Undetermined
Description
See Talk thread at:
https://talk.openmrs.org/t/retrospective-encounters-and-orders/33266
There is a feature that exists in the Order Entry API that allows one to distinguish between a real-time Order and a retrospectively-entered Order:
OrderServiceImpl:
{{}}
Order saveOrder(Order order, OrderContext orderContext); Order saveRetrospectiveOrder(Order order, OrderContext orderContext);
{{}}
The "saveRetrospectiveOrder" method saves with a specific flag that changes validation rules. In particular, it allows for stopping/discontinuing an Order for a date prior to it’s auto-expire date, even if that auto-expire date is currently in the past.
However, currently in the Encounter Service, all nested Orders are saved by invoking the non-retrospective method:
From EncounterServiceImpl:
{{ }}
//save the new orders which do not have order groups for (Order o : encounter.getOrdersWithoutOrderGroups()) { if (o.getOrderId() == null) { Context.getOrderService().saveOrder(o, null); } }
{{}}
This needs to be modified in order to ensure that if an Encounter and Orders are entered retrospectively, that the appropriate retrospective order processing is invoked.