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

Discontinue an order

    XMLWordPrintable

Details

    Description

      Story

      As a client of the API
      I want to be able to discontinue an active drug of a patient
      So that i can change his medications based on his current condition

      Scenario

      1) Stop a medicine to a reaction/not needed any more
      2) Discontinue drug that is past the auto_expire date?

      Potential impacted components

      openmrs core, webservices rest, emr api

      Potential impacted objects

      orders

      TODOs:
      Add the method below to Order

      //Creates a DC order, sets the previousOrder and action fields
      public Order cloneForDiscontinuing(Order orderToDiscontinue)
      

      Add the method below to OrderService and implement it:

      //Should fail if orderToDiscontinue is a DC order
      public Order discontinueOrder(Order orderToDiscontinue, Concept reasonCoded, Date discontinueDate);
      public Order discontinueOrder(Order orderToDiscontinue, String reasonNonCoded, Date discontinueDate);
      

      Also, the following should work:

      Order o = new Order();
      o.setAction(Order.Action.DISCONTINUE);
      o.setDrug(ampicillin100mg);
      orderService.saveOrder(o);
      
      // if there is an active Ampicillin 100mg order, then the API will set o.previousOrder to be that
      // and it will stop o.previousOrder. (Note that there should only ever a single active order for
      // a given orderable.)
      

      Also EA-1 needs to worked as part of this effort

      Gliffy Diagrams

        Attachments

          Issue Links

            There are no Sub-Tasks for this issue.

            Activity

              People

                vinay Vinay Venu
                sriramk Sriram Krishnaswamy
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Time Tracking

                    Estimated:
                    Original Estimate - 4 days, 1 hour
                    4d 1h
                    Remaining:
                    Time Spent - 3 days, 2 hours Remaining Estimate - 7 hours
                    7h
                    Logged:
                    Time Spent - 3 days, 2 hours Remaining Estimate - 7 hours
                    3d 2h