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

You should not be allowed to create a discontinue order by concept that ambiguously indicates stopping more than one active order

    XMLWordPrintable

    Details

    • Complexity:
      Low

      Description

      Per discussion on Design Forum 2015-04-29 ...

      Generally, we want to push people to discontinue a specific order, not to generically "discontinue Warfarin" and count on the API to figure out which active Warfarin order to discontinue.

      The current code does allow discontinuing by concept (rather than by order), and we want to continue supporting this in most cases.

      However we should change the current implementation so that if there are multiple active orders for the given concept, and thus "discontinue <Concept>" is ambiguous, we throw an AmbiguousOrderException exception, instead of just discontinuing the first one.

      Example

      A patient has two active drug orders:

      • Paracetamol 250mg tablet: take one tablet twice a day, for 7 days
      • Amoxicillin, 500mg tablets: take one tablet daily with meals, for 5 days

      At this point, if the doctor places the order action:discontinue, concept:Paracetamol, we can safely know that they are referring to a specific order (the only active order for Paracetamol) and we can discontinue this order.

      Now consider the scenario where we add one additional order to the two previous ones:

      • Paracetamol 250mg tablet: take one tablet twice a day, for 7 days
      • Amoxicillin, 500mg tablets: take one tablet daily with meals, for 5 days
      • (this is new) Paracetamol 500mg tablets, take one tablet as needed for pain, not to exceed (blah blah blah)

      At this point, if the clinician places the same order action:discontinue, concept:Paracetamol, this order is ambiguous, because we don't know if this means to stop both of the paracetamols, just the first, or just the second. This ambiguous order should not be allowed.

      Dev Notes

      This should happen near here in the code.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sintjuri Yuri Sintyaev
              Reporter:
              darius Darius Jazayeri
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 5 hours
                  5h
                  Remaining:
                  Time Spent - 4 hours Remaining Estimate - 1 hour
                  1h
                  Logged:
                  Time Spent - 4 hours Remaining Estimate - 1 hour
                  4h