Uploaded image for project: 'Radiology Module'
  1. Radiology Module
  2. RAD-317 RadiologyOrderSearchCriteria
  3. RAD-319

Provide means to exclude/include discontinued orders

    XMLWordPrintable

    Details

    • Type: Technical task
    • Status: Closed
    • Priority: Could
    • Resolution: Won't Fix
    • Component/s: Ordering
    • Labels:
      None
    • Complexity:
      Undetermined
    • Sprint:
      Sprint 2, Sprint 3

      Description

      Provide member includeDiscontinued to the RadiologyOrderSearchCritiera, which should default to false (see RadiologyReportSearchCriteria and its includeVoided)

      This issue will not be worked on at the moment.

      Background:
      the idea for this issue was born because of the statements in the https://wiki.openmrs.org/display/docs/REST+Web+Services+API+For+Clients

      "Including Retired and Deleted data"
      A normal REST query will not include Retired metadata or Deleted/Voided data. You may send an includeAll=true query parameter to include retired/deleted data.

      discussion on talk https://talk.openmrs.org/t/difference-voided-and-discontinued-order/6906/33
      was about whether discontinued orders would also fall under the "Deleted/Voided data".

      Looking at the openmrs core API especially OrderService.getOrders(Patient patient, CareSetting careSetting, OrderType orderType, boolean includeVoided)
      discontinued orders are returned (discontinuation orders are not, and voided orders are included only if requested).

      This behaviour is proved by the following unit tests:

          @Test
          public void getOrders_includeVoidedTrue() throws Exception
          {
              Patient patient = patientService.getPatient(PATIENT_ID_WITH_DISCONTINUED_RADIOLOGY_ORDER_AND_DISCONTINUATION_ORDER);
              CareSetting careSetting = radiologyProperties.getRadiologyCareSetting();
              OrderType orderType = radiologyProperties.getRadiologyTestOrderType();
              
              Order discontinuedRadiologyOrder=orderService.getOrder(ORDER_ID_OF_DISCONTINUED_RADIOLOGY_ORDER);
              Order discontinuationOrder= orderService.getOrder(ORDER_ID_OF_DISCONTINUATION_ORDER);
              Order voidedRadiologyOrder=orderService.getOrder(ORDER_ID_OF_VOIDED_ORDER);
              Order nonVoidedRadiologyOrder=orderService.getOrder(ORDER_ID_OF_NON_VOIDED_ORDER);
              
              List<Order> returnedOrders = orderService.getOrders(patient, careSetting, orderType, true);
      
              assertThat(returnedOrders.size(), is(3));
              assertThat(returnedOrders.contains(discontinuedRadiologyOrder), is(true));
              assertThat(returnedOrders.contains(discontinuationOrder), is(false)); //as discontinuation orders are exlcuded by default in getOrders
              assertThat(returnedOrders.contains(voidedRadiologyOrder), is(true)); 
              assertThat(returnedOrders.contains(nonVoidedRadiologyOrder), is(true));
          }
          
          @Test
          public void getOrders_includeVoidedFalse() throws Exception
          {
              Patient patient = patientService.getPatient(PATIENT_ID_WITH_DISCONTINUED_RADIOLOGY_ORDER_AND_DISCONTINUATION_ORDER);
              CareSetting careSetting = radiologyProperties.getRadiologyCareSetting();
              OrderType orderType = radiologyProperties.getRadiologyTestOrderType();
              
              Order discontinuedRadiologyOrder=orderService.getOrder(ORDER_ID_OF_DISCONTINUED_RADIOLOGY_ORDER);
              Order discontinuationOrder= orderService.getOrder(ORDER_ID_OF_DISCONTINUATION_ORDER);
              Order voidedRadiologyOrder=orderService.getOrder(ORDER_ID_OF_VOIDED_ORDER);
              Order nonVoidedRadiologyOrder=orderService.getOrder(ORDER_ID_OF_NON_VOIDED_ORDER);
              
              List<Order> returnedOrders = orderService.getOrders(patient, careSetting, orderType, false);
      
              assertThat(returnedOrders.size(), is(2));
              assertThat(returnedOrders.contains(discontinuedRadiologyOrder), is(true));
              assertThat(returnedOrders.contains(discontinuationOrder), is(false)); //as discontinuation orders are exlcuded by default in getOrders
              assertThat(returnedOrders.contains(voidedRadiologyOrder), is(false)); // because include voided is set to false
              assertThat(returnedOrders.contains(nonVoidedRadiologyOrder), is(true));
          }
      

      we will therefore not work on this feature for now. The user will thus see discontinued radiology orders in lists (stopped date will indicate that these orders are stopped.)

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              bgevam Georg Bernold
              Reporter:
              teleivo Ivo Ulrich
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: