New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding new validation rules for orders and drugOrders. #774
Conversation
@@ -2488,14 +2488,14 @@ public void getAllConcepts_shouldExcludeRetiredConceptsWhenSetIncludeRetiredToFa | |||
public void getAllConcepts_shouldOrderByAConceptField() throws Exception { | |||
List<Concept> allConcepts = conceptService.getAllConcepts("dateCreated", true, true); | |||
|
|||
assertEquals(29, allConcepts.size()); | |||
assertEquals(30, allConcepts.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason we make it possible to inject more data in a test method is to avoid adding more to the standard dataset which results in editing several existing tests like in this case, personally i only add extra data to standard test data if i know there is about 1-5 affected existing tests methods or if it's a new column or table.
* @should fail validation if order concept is null | ||
* @should fail validation if drug concept is different from order concept | ||
* @should fail validation if dose, dose units, route, frequency are null for drugOrders with SIMPLE dosingType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you using https://wiki.openmrs.org/display/docs/Generate+Test+Case+Plugin
I see that this annotation has no matching test method and there are test methods with no matching @shoulds here
- Null check for careSetting, encounter, urgency, startDate, action field. - Null check for dose, dose units, route, frequency for drugOrders with SIMPLE dosingType - Null check for instructions for drugOrders with FREE_TEXT dosingType - Null check for dosing_instructions for drugOrders for any other dosingType. - Null check for quantity, quantity units, and number of refills for drugOrders with outpatient careSettings. Fixed tests failing due to these new validations. Fixed standardTestData.xml to create orders which honour these validations. Removing voiding of Orders & Obs from patient void handler. These are automatically voided in RequiredDataAdvice. Had to remove to fix some failing tests.
* @should fail validation if quantityUnits is null for outpatient careSetting | ||
* @should fail validation if quantity is null for outpatient careSetting | ||
* @should fail validation if doseUnits is null when dose is present | ||
* @should fail validation if quantityUnits is null when quantity is present |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you missed durationUnits when duration is done
Null check for careSetting, encounter, urgency, startDate, action field.
Fixed tests failing due to these new validations. Fixed standardTestData.xml to create orders which honour these validations.
Removing voiding of Orders & Obs from patient void handler.
These are automatically voided in RequiredDataAdvice. Had to remove to fix some failing tests.