Wiki Spaces

Documentation
Projects
Resources

Get Help from Others

Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack

Projects

Page tree
Skip to end of metadata
Go to start of metadata

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 (warning)

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)

(question) 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

(question) 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

(warning) These are all pending confirmation of the UI and use cases, very much a work-in-progress, Phase 2

MethodParametersReturnsNotes

getDrugOrdersWithAssociatedDispensingInformation

(warning) Hold for now, pending further requirements

Date earliestDateActivated, Date latestDateActivated, Patient patient, List<FullfillerStatus> fulfillerStatuses

Map<DrugOrder, List<MedicationDispense>> (question)


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

 GET [base]/MedicationRequest?_revinclude=MedicationDispense:target

New Notes (2022-03-01): Do we really need to use fulfiller status?
Note: do we really need at all, probably better to have separate requests?





  • No labels

1 Comment

  1. If we support a "FHIR" format, will we have to map the an OpenMRS Drug Order to a FHIR Medication Request?

    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.

    Could we use an extension to associate one or more Medication Dispense resources with a Medication Request?

    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 _revinclude search parameter. E.g.,

    /MedicationRequest/?_id=12345&_revinclude=MedicationDispsense:prescription

    Will get you the specified order and any dispense events associated with it.