Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-4150

Add support for revising an order

    XMLWordPrintable

Details

    Description

      User Story

      As a user, i would like to revise an existing order

      Dev Notes

      • Add a convenience method to Order class e.g. copyForRevision() that technically clones the original order, sets the status and previousOrder fields on the clone.
      • Add saveRevisedOrder() method to OrderService, takes in a new order with an action of REVISE or sets it if null and reject the order if it is set to anything else, should require it to have a previous order. Should NOT set encounter. Can't revise a discontinuation order(one that has action of DISCONTINUE)
      • EA-1 needs to worked as part of this effort

      As a dev i should be able to do this:

      DrugOrder original = // something
      // We wouldn't want to use copy because we don't want to copy fields from BaseOpenmrsData e.g creator. dateCreated etc, also
      // fields that are too specific to a single order can't also be copied over e.g. previousOrder, dateStopped etc. 
      DrugOrder revised = original.cloneForRevision();
      revised.setDosage(100, milligrams);
      orderService.saveOrder(revised);
      

      ...which is a shortcut for...

      DrugOrder original = // something
      DrugOrder revised = new DrugOrder();
      revised.setAction(OrderAction.REVISE);
      revised.setPreviousOrder(original);
      revised.setDosage(100, milligrams);
      // copy other properties from original to revised
      orderService.saveOrder(revised);
      

      Gliffy Diagrams

        Attachments

          Issue Links

            Activity

              People

                shruthidipali Shruthi Dipali
                wyclif Wyclif Luyima
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Time Tracking

                    Estimated:
                    Original Estimate - 5 hours Original Estimate - 5 hours
                    5h
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 1 day
                    1d