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

Create new getOrders(OrderSearchCriteria) service method

    Details

    • Type: Story
    • Status: Closed
    • Priority: TBD
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Platform 2.2.0
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Undetermined

      Description

       

      We should add a new service method to the Order Service that allows for searching for orders across multiple critieria, similar to the EncounterSearchCriteria.  

      For starters, the criteria should include (all can be empty/nullabe):

      • Patient
      • CareSetting
      • Collection<Concept>
      • Collection<OrderType>
      • Date activatedOnOrBefore
      • Date activatedOnOrAfter
      • Boolean includeVoided
      • Boolean includeInactive (TBD pending design call)

      The idea is that we will continue to expand these criteria as needed.  

      All the critiera map directly to columns for Order in the DB, with the except of "includeInactive".  If includeInactive=true, no restriction will be placed on the status of the order, but if includeInactive is false, the query will only return the Orders that are active on the current date, with "active" behind defined as:

      ((dateActivated !=null && dateActivated < current date) &&

      (dateStopped == null || dateStopped > current date) &&

      (autoExpireDate == null || autoExpireDate > current date))

       

      Relevant code for the EncounterSearchCriteria:

      https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/api/EncounterService.java#L181

      https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/parameter/EncounterSearchCriteria.java

      https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/parameter/EncounterSearchCriteria.java

      https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/api/impl/EncounterServiceImpl.java#L384

       

        Gliffy Diagrams

          Attachments

            Issue Links

              Attachments-Category-Modification

                Activity

                  People

                  • Assignee:
                    dsurrao Dominic Surrao
                    Reporter:
                    mogoodrich Mark Goodrich
                  • Votes:
                    0 Vote for this issue
                    Watchers:
                    4 Start watching this issue

                    Dates

                    • Created:
                      Updated:
                      Resolved: