Order Entry config via REST web service

I am working on an order entry UI and I see that there’s no way to call things like this via REST:

List<Concept> org.openmrs.api.OrderService#getDrugRoutes()

I’m planning to add an “orderentryconfig” REST resource at the top level, but other suggestions are welcome. (What definitely isn’t okay is first querying for a “order.drugRoutesConceptUuid” global property and then querying for a concept with that UUID and getting its set members.)

PS- everything we build in the underlying OpenMRS platform should be REST-accessible, and we need to get in the mode where everyone is thinking about this up front, and it doesn’t fall to the first person who actually tries to use them to go and write the web service after the fact.


Why an OrderEntryConfig resource instead of a DrugRoute resource?

My idea had been to have a single resource that includes all of

  • getDrugRoutes()
  • getDrugDosingUnits()
  • getDrugDispensingUnits()
  • getDurationUnits()
  • getTestSpecimenSources()

I don’t have an informed opinion about whether to have these in a single resource, or as 5.

My vote is for a single resource.

Why not a Drug resource? Even if a drug is a Concept.

The idea is that all 5 of these things are List. So I could also make them accessible like:

GET .../concept?orderentryconfig=drugRoutes
GET .../concept?orderentryconfig=drugDosingUnits
// etc

But that seems less intuitive to me than having a top-level named resource like orderentryconfig, which has 5 properties that are List (and eventually could have other things if it turns out we need them).

Darius, from your approach it seems like the OrderEntryConfig resource would have Concept as the supported resource or is this not the case? I would assume we should keep in mind that there could be other domain objects we might want to support in the future that this resource can support

This is what I actually wrote:

1 Like

The code snippet clears what i asked, thanks!

Hi Darius,

Please if i want to consume this web service like the encounter i use this : /ws/rest/v1/encounter i want to use the same things to have list of prescription according to a patient it’s possible?