Optionally Restrict Order Finalisation to Clinicians - Practice pref
Description
Environment
Attachments
- 13 Nov 2016, 03:16 AM
Activity
Tim Anderson November 22, 2016 at 11:23 PMEdited
Thanks for the contribution. The patch has been applied with the following changes:
removed act.supplierOrder restricted node. This is now determined by looking at the products on each of the order items to see if they have a restricted drug schedule
changed OrderEditor prevent save if ordering is restricted and the status is changed to POSTED, the user isn't a clinician, and the order has restricted products
added default lookups to openvpms-release/src/import/data/base.xml
<data archetype="lookup.productDrugSchedule" code="S1" name="S1"/> <data archetype="lookup.productDrugSchedule" code="S2" name="S2"/> <data archetype="lookup.productDrugSchedule" code="S3" name="S3"/> <data archetype="lookup.productDrugSchedule" code="S4" name="S4" restricted="true"/> <data archetype="lookup.productDrugSchedule" code="S5" name="S5"/> <data archetype="lookup.productDrugSchedule" code="S6" name="S6"/> <data archetype="lookup.productDrugSchedule" code="S7" name="S7"/> <data archetype="lookup.productDrugSchedule" code="S8" name="S8"/>
test cases added:
OrderRulesTestCase.testHasRestrictedProducts()
ProductRulesTestCase.testIsRestricted()
migration script added in openvpms-db/org/openvpms/db/migration/1.9/V1.9.0.1__OVPMS-1821.sql
Changes applied on the 2.0-dev branch, revision 7305
Ben Charlton November 13, 2016 at 3:17 AMEdited
Patch updated to fix mispell - Order gen test is failing as I cant work out why the lookupservice is failing to return the saved lookup.
java.lang.NullPointerException: null
at org.openvpms.component.business.service.archetype.helper.DescriptorHelper.getArchetypeDescriptor(DescriptorHelper.java:124)
at org.openvpms.component.business.service.archetype.helper.AbstractNodePropertySet.getArchetype(AbstractNodePropertySet.java:109)
at org.openvpms.component.business.service.archetype.helper.AbstractNodePropertySet.getNode(AbstractNodePropertySet.java:125)
at org.openvpms.component.business.service.archetype.helper.AbstractNodePropertySet.get(AbstractNodePropertySet.java:84)
at org.openvpms.component.system.common.util.AbstractPropertySet.get(AbstractPropertySet.java:251)
at org.openvpms.component.system.common.util.AbstractPropertySet.getBoolean(AbstractPropertySet.java:74)
at org.openvpms.component.business.service.archetype.helper.IMObjectBean.getBoolean(IMObjectBean.java:212)
at org.openvpms.archetype.rules.product.ProductRules.isRestricted(ProductRules.java:413)
at org.openvpms.archetype.rules.supplier.OrderGenerator.createOrder(OrderGenerator.java:154)
at org.openvpms.archetype.rules.supplier.OrderGeneratorTestCase.testCreateOrder(OrderGeneratorTestCase.java:300)
QLD restricts the placement of restricted drug ordering to veterinary surgeons for an electronic system to comply it must restrict other staff from ordering using a password system.
To attempt to comply as best possible OpenVPMS should have a optional system that stops anyone not a clinician from finalising and sending a supplier order. It would be disabled by default.