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

Encounters should appropriately save retrospective orders

    XMLWordPrintable

Details

    • Story
    • Status: Closed
    • TBD
    • Resolution: Fixed
    • None
    • Core 2.4.1, Core 2.3.4
    • 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.

      Gliffy Diagrams

        Attachments

          Activity

            People

              mseaton Mike Seaton
              mseaton Mike Seaton
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: