Loosen validation requirement for quantity, units, and refills on outpatient drug orders

Description

There have been many examples of users who have run into issues with the validation rules in Order Entry that require all Drug Orders with careSetting = 'OUTPATIENT' to have non-null quantity, quantityUnits, and numRefills specified.

The typical suggested workaround is for these users to build custom application handling that hides these fields and sets them all to "0".  This indicates clearly that there are use cases in which this validation should be loosened, and users / implementations should be able to opt out of it if desired.  The suggestion is also difficult due to the additional validation that non-null quantity (eg. 0) requires a non-null quantityUnits (which must refer to a valid concept, and this concept must exist within a defined concept set, and this must be configured in a global property).  So it's a lot to ask and not a great situation.

This ticket is to change the validation as follows:

  1. Add a new global property:  "drugOrder.requireOutpatientQuantity" which defaults to true (for backwards-compatibility)

  2. Modify the DrugOrderValidator.validateFieldsForOutpatientCareSettingType method to skip validation if the value of the above global property = false.

 FYI

See slack conversation:

https://openmrs.slack.com/archives/CHP5QAE5R/p1602776894132300?thread_ts=1602776135.130400&cid=CHP5QAE5R

See talk thread:

https://talk.openmrs.org/t/can-drug-orders-continue-indefinitely-until-explicitly-stopped/3492/7?u=mseaton

FYI - I will have a need to backport this into the 2.3.x line, in addition to master

Activity

Show:

Mike Seaton February 4, 2021 at 5:27 PM

Thank you !!

Daniel Kayiwa February 4, 2021 at 5:21 PM

Daniel Kayiwa February 4, 2021 at 5:16 PM

Mike Seaton February 4, 2021 at 5:07 PM

No it is not .  It is related somewhat in the fact that the previous validation ended up requiring quantityUnits by transitive association.  i.e. quantityUnits is required if quantity is non-null, so since quantity was required to be non-null before, this meant that quantityUnits was required to be non-null as well.  My test just confirms that all of these fields can be set to null without issue.

Daniel Kayiwa February 4, 2021 at 5:00 PM

like i said on github, quantityUnits does not seem to be part of the validation.

Fixed

Details

Assignee

Reporter

Complexity

Low

Priority

Created February 3, 2021 at 10:27 PM
Updated February 4, 2021 at 5:27 PM
Resolved February 4, 2021 at 5:23 PM