Uploaded image for project: 'Reporting Module'
  1. Reporting Module
  2. REPORT-804

Support queries on drug orders against openmrs-core 1.10+ API

    XMLWordPrintable

Details

    • New Feature
    • Status: Design
    • Could
    • Resolution: Unresolved
    • None
    • Future
    • None
    • Low
    • Reporting Module Sprint #1

    Description

      Background

      The reportingcompatibility module includes two queries that are used by the cohort builder to search for patients based on their drug orders:

      Note that these existing queries were written against the old order entry API which was completely rewritten in openmrs-core 1.10, so those queries won't directly work anymore.

      We want to implement new versions of these queries that are (a) slightly improved in their functionality, and (b) run against openmrs-core 1.10+.

      Details

      1. Introduce a query very similar to DrugOrderFilter, which supports parameters:

      • which = all/any/none
      • List<Concept> drugConcepts (concepts representing generic drugs, or drug ingredients)
      • List<Concept> drugSets (concepts representing drug sets)
      • Date activeOnOrBefore, activeOnOrAfter
      • Integer activeWithinLastMonths, activeWithinLastDays
      • boolean onlyCurrentlyActive
      • CareSetting careSetting

      2. Introduce a one or more queries to support searching for patients with drug orders based on one of:

      • started (patient wasn't taking the drug in any dose, and now is taking it)
      • stopped (no longer taking the drug at any dose)
      • changed (started OR stopped/ended OR dosing changed)

      These queries should also support

      • List<Concept> drugConcepts (concepts representing generic drugs, or drug ingredients)
      • List<Concept> drugSets (concepts representing drug sets)
      • Date onOrBefore, onOrAfter
      • Integer withinLastMonths, withinLastDays
      • CareSetting careSetting

      Dev Notes

      A "started" drug order means a drug order with action=NEW and previousOrder=null.

      A "stopped" drug order means

      • any order where nvl(stop_date, auto_expire_date) matches the date range
      • OR an order with action=DISCONTINUE with date_activated that matches
        ... AND not exists any order with previous_order_id pointing to the order

      A "changed" drug order means any order for which date_activated or nvl(stop_date, auto_expire_date) matches the date range

      Open questions

      Clarify above whether we should be using date_activated, scheduled_date or some combination.

      Gliffy Diagrams

        Attachments

          Issue Links

            Activity

              People

                niyolynate Proscovia Niyonsaba
                darius Darius Jazayeri
                Mike Seaton Mike Seaton
                Votes:
                0 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                  Created:
                  Updated:

                  Time Tracking

                    Estimated:
                    Original Estimate - 2 days Original Estimate - 2 days
                    2d
                    Remaining:
                    Time Spent - 2 weeks Remaining Estimate - 1 week, 3 days
                    1w 3d
                    Logged:
                    Time Spent - 2 weeks Remaining Estimate - 1 week, 3 days
                    2w