- All the information in the table can be retrieved from the Order, I believe, with the exception of Last Dispensed. Assuming we add the MedicationDispense object, to determine the provider we can fetch all MedicationDispesned objects associated with an order, sorted by dateHandedOver, take the most recent and then take the provider from it. (Tech question: is this the preferred method, to get MedicationDispense via a separate request, or should we provide some composite object?)
- Still need to figure out the "orderless" use case.
- What is the query logic for the table? All non-voided orders with date_activated before or equal to current date, ordered by date activated descending? (In this case would obviously needed to be paginated)
What are all the possible statuses and what do they mean? I could see the following:
- See - O3-1214Getting issue details... STATUS for current thoughts
- Active prescription: order is active (current date is after or equal dateActivated, and current date before dateExpired or dateStopped, and type not DISCONTINUED... see complete logic here: https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/Order.java#L447
- Completed: Curious what the business logic would be here. Does this mean that a single, complete dispensing event has occurred? Or that all the refills have been satisfied? Does this take precedence over all other status (ie, if an order is both "expired" and "completed" we display "completed") (We do have a field on Order, fulfiller_status, with values: RECEIVED, IN_PROGRESS, EXCEPTION and COMPLETED, so we could use "completed" for this)
- Returned: I assume this means that it is being returned to the prescriber? We do have a fulfiller_status of "EXCEPTION" (see above), which we can use to reflected
- Expired: Not pictured in the above, but I think needed, and would be any order that fulfills the isExpired logic: https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/Order.java#L530
- Discontinued: Not pictured in the above, but I think needed, and would be any order the fulfills the isDiscontinued logic: https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/Order.java#L510
- Any other states I missed?
Will need to define how to display the Drug column based on name of underling drug and/or name of underlying concept, and/or drugNonCoded field.
- Do we need to support "Change Date View" in phase 1, or just stick to the current date. In general, seems like setting a historical date would likely just be confusing for the user? Is this actually meant to limit to certain date?