# Revising and Renewing Orders

**URL:** <https://talk.openmrs.org/t/revising-and-renewing-orders/30476>\
**Category:** Development\
**Tags:** order-entry\
**Created:** [October 8, 2020, 2:33pm UTC](https://talk.openmrs.org/t/revising-and-renewing-orders/30476 "2020-10-08T14:33:31Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![mseaton](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mseaton/32/8088_2.png) [@mseaton](https://talk.openmrs.org/u/mseaton)\
**Post date:** [October 27, 2020, 3:47pm UTC](https://talk.openmrs.org/t/revising-and-renewing-orders/30476/7 "2020-10-27T15:47:28Z")

</div>

> [@burke](#):
>
> For example, when an order is revised, we void the prior version of the order and issue the new one. The revision (the order) would be sent to other systems (e.g., via HL7 messages), but not the internal void operation

Whoa - hang on @burke🙂 Are you saying that a REVISE operation should _void_ the previous order? That is not what the API currently does - the API _stops_ the previous order. If the revising order has a dateActivated of T, the API sets the “dateStopped” of the previous order to “T - 1s”. So the result is that you have 2 non-voided orders in your history, with the first stopping 1s prior to the second.

I assumed this was the way the API was supposed to work, but I’d be very interested to hear if it isn’t, as that would make it much easier to support these retrospective use cases. eg:

Editing = issuing a ‘REVISE’, which voids the old order and creates a new order with action = ‘REVISE’, and sets it’s previousOrder to the voided order

Changing = issuing a ‘DISCONTINUE’ of the existing order, followed by a ‘NEW’ of the new Order

Or is that not what you meant @burke?

(Incidentally, where the current API causes problems with setting dateStopped on the previous order is where the dateActivated of the revised Order is the same as the dateActivated of the previous Order, because this leads the previousOrder to have dateStopped \< dateActivated by 1 second).

Mike

---

_[View the full topic](https://talk.openmrs.org/t/revising-and-renewing-orders/30476)._
