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):
- 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: