Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

vinkesh
Copy link
Contributor

@vinkesh vinkesh commented Mar 12, 2014

  • 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.

@@ -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());
Copy link
Member

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.

@vinkesh vinkesh closed this Mar 17, 2014
@vinkesh vinkesh deleted the TRUNK-4217 branch March 17, 2014 13:39
@vinkesh vinkesh restored the TRUNK-4217 branch March 17, 2014 13:39
@vinkesh vinkesh reopened this Mar 17, 2014
* @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
Copy link
Member

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
Copy link
Member

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

@vinkesh vinkesh closed this Mar 26, 2014
@vinkesh vinkesh deleted the TRUNK-4217 branch March 26, 2014 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants