Medication Dispense Java API
A new MedicationDispenseService will be added (via the MedicationDispense module) that handles:
Basic CRUD operations on the Medication Dispense domain object
A RESTful version of the API
Business-layer operating needed for the implementation of the Medication Dispense UI
Java API
CRUD Operations
getMedicationDispenseByUuid
getMedicationDispenseByPatient
getMedicationDispenseByDrugOrder
saveMedicationDispense
voidMedicationDispense
unvoidMedicationDispense
purgeMedicationDispense
(We should also add new privileges for these various operations, based on the patterns we use for other domain objects)
Should medication dispense objects be updateable (my gut answer is yes)
RESTful API
Support for all the Java API methods via OpenMRS REST or FHIR format
If we support a "FHIR" format, will we have to map the an OpenMRS Drug Order to a FHIR Medication Request? Looks like there's already support in the FHIR module to do this, should research further. Could we use an extension to associate one or more Medication Dispense resources with a Medication Request?
Potential Business Layer Operations
These are all pending confirmation of the UI and use cases, very much a work-in-progress, Phase 2
Method | Parameters | Returns | Notes |
|---|---|---|---|
getDrugOrdersWithAssociatedDispensingInformation Hold for now, pending further requirements | Date earliestDateActivated, Date latestDateActivated, Patient patient, List<FullfillerStatus> fulfillerStatuses | Map<DrugOrder, List<MedicationDispense>>
(Is there a better way to translate this, than a map)? | Used to populate the Pharmacist List page (with Patient= null, and likely FulfillerStatus != COMPLETED) and the Back to Clinician Page (with Patient = null, and with FulfillerStatus == Exception or In_Progress or Received?) and Patient-specific medication page Should likely build a custom DAO method that joins DrugOrder to MedicationDispense on drug_order.order_id = medication_dispense.drug_order_id My thought is that this search based on Date and FulfillerStatus (likely all but FulfillerStatus = COMPLETED), but the other filters (Drug, Prescriber) can happen on the client side? Interesting reference: https://stackoverflow.com/questions/56177921/why-medicationdispense-doesnt-contain-attribute-of-prescription-number Perhaps this could all be handled via FHIR: https://www.hl7.org/fhir/search.html#include ... would this work:
|
|
|
|
|
We do have a mapping from Drug Order → MedicationRequest but it's primarily a best guess since at the time I couldn't find an implementation actually using Drug Orders actively. Some of the components that make that mapping possible may be reusable for the MedicationDispense, since they share some data structures.
FHIR likes to model things so these many-to-one things are all reported from the many side, mostly because it simplifies things for implementations that don't use a relational data store. That said, I think the preferred way to do this in FHIR would not be to return this as an extension but to allow the MedicationDispense resources to be loaded using the
_revincludesearch parameter. E.g.,/MedicationRequest/?_id=12345&_revinclude=MedicationDispsense:prescriptionWill get you the specified order and any dispense events associated with it.