Currently attempting to edit a discontinuation(DC) order fails, this is an order where action is DISCONTINUED, we need to support it. Update ImmutableOrderInterceptor to check for edited DC orders so that it discards the changes on the original order, clones it, voids it and saves the clone as the new DC order. We also need to keep dcOrder.dateStarted == dcOrder.previousOrder.dateStopped, so changing a start date for a D/C order should up the dateStopped on the previous order if one exists.
- Add a method to OrderService that contains the logic of cloning and voiding a DC order
- Update ImmutableOrderInterceptor to call the new method above to handler saved/flushed edited DC orders, i.e it should check if the startDate or orderReason or orderReasonNonCoded has changed to call the method above
Include unit tests.