OrderService does not enforce orderable concepts via ConceptClass

Tags: #<Tag:0x00007f0f1c3ad0b8>

Hello!

I want to prevent users from selecting concepts like “false”, “false labor”, “friend” when entering new radiology orders. Users should only be able to select a concept from a list of configurable concepts like X-Ray Chest, X-Ray Leg, …

I found the term orderable concepts via concept classes here https://wiki.openmrs.org/pages/viewpage.action?pageId=34147019

and would like to know if I am on the right track?

So I assigned some concepts (X-Ray Chest, X-Ray Leg) to a new concept class “Radiology Orders” which I map to my OrderType “Radiology Order” via table order_type_class_map. But the OrderService.saveOrder() does not throw an exception when I save a RadiologyOrder with a concept like “false” which is not mapped to my OrderType.

Is this behavior intended? Are ConceptClass’es only used to determine the OrderType during OrderService.saveOrder(Order) when OrderType is null?

Hi Teleivo,

order_type_class_map entries are used to determine order type in case it is null and not for adding some sort of constraint. I think what you can do is to call ConceptService.getOrderableConcepts(…) to get back the concepts of the mapped concept classes and let the user select from those in your concept autocomplete.