Details
-
Bug
-
Status: Closed
-
Should
-
Resolution: Fixed
-
Platform 1.10.0
-
Low
-
Release 1.10 RC
Description
This issue was identified while working https://issues.openmrs.org/browse/TRUNK-4436
- The drug_inventory_id in liquibase migration sets up default value as 0 in database. This would not allow drug_order with non coded drug name in future.
- The DrugOrder Class overrides setConcept() to do nothing and getConcept() return null when no drug is set.
We had written tests for for DrugOrder#hasSameOrderableAs(Order) to consider drug orders without drug. These below tests can not be run till above issues are fixed.
DrugOrderTest.java
@Test public void hasSameOrderableAs_shouldBeFalseWhenThisOrderHasDrugAndOtherOrderDoesNotHaveDrug() { DrugOrder order = new DrugOrder(); order.setDrug(new Drug()); DrugOrder otherOrder = new DrugOrder(); otherOrder.setDrug(null); otherOrder.setConcept(new Concept()); assertFalse(order.hasSameOrderableAs(otherOrder)); } @Test public void hasSameOrderableAs_shouldBeFalseWhenThisOrderDoesNotHaveDrugAndOtherOrderHasDrug() { DrugOrder order = new DrugOrder(); order.setDrug(null); order.setConcept(new Concept()); DrugOrder otherOrder = new DrugOrder(); otherOrder.setDrug(new Drug()); assertFalse(order.hasSameOrderableAs(otherOrder)); } @Test public void hasSameOrderableAs_shouldBeTrueWhenBothOrdersDoNotHaveDrugAndConceptsMatch() { DrugOrder order = new DrugOrder(); Concept concept = new Concept(); order.setDrug(null); order.setConcept(concept); DrugOrder otherOrder = new DrugOrder(); otherOrder.setDrug(null); otherOrder.setConcept(concept); assertTrue(order.hasSameOrderableAs(otherOrder)); } @Test public void hasSameOrderableAs_shouldBeFalseWhenBothOrdersDoNotHaveDrugAndConceptsDoNotMatch() { DrugOrder order = new DrugOrder(); order.setDrug(null); order.setConcept(new Concept(123)); DrugOrder otherOrder = new DrugOrder(); otherOrder.setDrug(null); otherOrder.setConcept(new Concept(456)); assertFalse(order.hasSameOrderableAs(otherOrder)); }
Gliffy Diagrams
Attachments
Issue Links
- is depended on by
-
TRUNK-4436 Drug orders for different formulations of the same concept should be allowed
-
- Closed
-
- mentioned in
-
Page Loading...