diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9413987..19c0292 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,22 +15,23 @@ jobs: java-version: '21' distribution: 'zulu' cache: 'maven' -# - name: Login to Docker Hub -# uses: docker/login-action@v3 -# with: -# username: ${{secrets.DOCKERHUB_SIMPLEDOTORG_USERNAME}} -# password: ${{secrets.DOCKERHUB_SIMPLEDOTORG_ACCESS_TOCKEN}} - uses: stCarolas/setup-maven@v4.5 with: maven-version: 3.9.6 + - name: Clean branch name + run: | + BRANCH_NAME=${{ env.CLEAN_BRANCH_NAME }} + CLEAN_BRANCH_NAME=$(echo $BRANCH_NAME | sed 's/[\/_]/-/g') + echo "Cleaned branch name: $CLEAN_BRANCH_NAME" + echo CLEAN_BRANCH_NAME=$CLEAN_BRANCH_NAME >> $GITHUB_ENV - name: Sets up version working-directory: packager - run: mvn versions:set -DnewVersion=${{github.ref_name}}.${{github.run_number}} + run: mvn versions:set -DnewVersion=${{env.CLEAN_BRANCH_NAME}}.${{github.run_number}} - name: Builds Artifacts and Images working-directory: packager run: mvn clean install - name: Archive Hypertension Package uses: actions/upload-artifact@v4 with: - name: Dhis2HypertensionPackage-${{github.ref_name}}.${{github.run_number}}-package.zip - path: packager/target/Dhis2HypertensionPackage-${{github.ref_name}}.${{github.run_number}}-package.zip + name: Dhis2HypertensionPackage-${{env.CLEAN_BRANCH_NAME}}.${{github.run_number}}-package.zip + path: packager/target/Dhis2HypertensionPackage-${{env.CLEAN_BRANCH_NAME}}.${{github.run_number}}-package.zip diff --git a/scenarios/hypertension/hypertension_contactable_overdue_patients.feature b/scenarios/hypertension/hypertension_contactable_overdue_patients.feature new file mode 100644 index 0000000..a63400c --- /dev/null +++ b/scenarios/hypertension/hypertension_contactable_overdue_patients.feature @@ -0,0 +1,262 @@ +Feature: Contactable Overdue Patients + ___ + As a tester + Given I have some "overdue" tracked entity instances with contact information in the system + When I export analytics + Then I should see the "HTN - Contactable overdue patients" program indicator data as expected + ___ + + Scenario: All patients must have a patient phone number + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + Given I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Callable | + | GEN - Family name | Patient | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | Patient Phone Number | 345672781624 | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Unreachable | + | GEN - Family name | Patient | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Contactable overdue patients" with period type "Months" should be + | thisMonth | 1 | + | 1_MonthAgo | 1 | + | 2_MonthsAgo | 1 | + | 3_MonthsAgo | 1 | + | 4_MonthsAgo | 1 | + | 5_MonthsAgo | 1 | + | 6_MonthsAgo | 0 | + | 7_MonthsAgo | 0 | + | 8_MonthsAgo | 0 | + | 9_MonthsAgo | 0 | + | 10_MonthsAgo | 0 | + | 11_MonthsAgo | 0 | + | 12_MonthsAgo | 0 | + + Scenario: All overdue patients has to be hypertensive + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + Given I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Priyanka | + | GEN - Family name | Chopra | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | Patient Phone Number | 345672781624 | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Alia | + | GEN - Family name | Bhatt | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | NO | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | Patient Phone Number | 345672781624 | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 139 | + | Diastole | 89 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Contactable overdue patients" with period type "Months" should be + | thisMonth | 1 | + | 1_MonthAgo | 1 | + | 2_MonthsAgo | 1 | + | 3_MonthsAgo | 1 | + | 4_MonthsAgo | 1 | + | 5_MonthsAgo | 1 | + | 6_MonthsAgo | 0 | + | 7_MonthsAgo | 0 | + | 8_MonthsAgo | 0 | + | 9_MonthsAgo | 0 | + | 10_MonthsAgo | 0 | + | 11_MonthsAgo | 0 | + | 12_MonthsAgo | 0 | + + Scenario: Dead patients should not be included + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Test | + | GEN - Family name | TEST | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | Patient Phone Number | 345672781624 | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Test | + | GEN - Family name | TEST | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | Patient Phone Number | 345672781624 | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + And That TEI was updated on "2_MonthsAgo" with the following attributes + | HTN - NCD Patient Status | DIED | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Contactable overdue patients" with period type "Months" should be + | thisMonth | 1 | + | 1_MonthAgo | 1 | + | 2_MonthsAgo | 1 | + | 3_MonthsAgo | 1 | + | 4_MonthsAgo | 1 | + | 5_MonthsAgo | 1 | + | 6_MonthsAgo | 0 | + | 7_MonthsAgo | 0 | + | 8_MonthsAgo | 0 | + | 9_MonthsAgo | 0 | + | 10_MonthsAgo | 0 | + | 11_MonthsAgo | 0 | + | 12_MonthsAgo | 0 | + + Scenario: TEI are not marked as overdue anymore if they have visited after the due date. + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Rose | + | GEN - Family name | Mary | + | GEN - Sex | FEMALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | Patient Phone Number | 345672781624 | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo_Minus_1_Day" + + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Angel | + | GEN - Family name | John | + | GEN - Sex | FEMALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | Patient Phone Number | 345672781624 | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Calling report" event on "5_MonthsAgo_Plus_1_Day" with following data + | Result of call | REMOVE_FROM_OVERDUE | + | HTN - Remove from overdue list because: | OTHER | + And That TEI has a "Hypertension & Diabetes visit" event on "3_MonthsAgo" which was scheduled on "5_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Angel | + | GEN - Family name | John | + | GEN - Sex | FEMALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Calling report" event on "5_MonthsAgo_Plus_1_Day" with following data + | Result of call | REMOVE_FROM_OVERDUE | + | HTN - Remove from overdue list because: | OTHER | + And That TEI has a "Hypertension & Diabetes visit" event on "3_MonthsAgo" which was scheduled on "5_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Contactable overdue patients" with period type "Months" should be + | thisMonth | 1 | + | 1_MonthAgo | 1 | + | 2_MonthsAgo | 1 | + | 3_MonthsAgo | 2 | + | 4_MonthsAgo | 2 | + | 5_MonthsAgo | 1 | + | 6_MonthsAgo | 1 | + | 7_MonthsAgo | 0 | + | 8_MonthsAgo | 0 | + | 9_MonthsAgo | 0 | + | 10_MonthsAgo | 0 | + | 11_MonthsAgo | 0 | + | 12_MonthsAgo | 0 | diff --git a/scenarios/hypertension/hypertension_contactable_overdue_patients_called.feature b/scenarios/hypertension/hypertension_contactable_overdue_patients_called.feature new file mode 100644 index 0000000..c9d0929 --- /dev/null +++ b/scenarios/hypertension/hypertension_contactable_overdue_patients_called.feature @@ -0,0 +1,124 @@ +Feature: Contactable overdue patients called + ___ + As a tester + Given I call some contactable patients + When I export the analytics + Then I should should see correct "HTN - Contactable overdue patients called" data + ___ + + Scenario: Contactable called overdue patients should be counted + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Rose | + | GEN - Family name | Mary | + | GEN - Sex | FEMALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | Patient Phone Number | 345672781624 | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo_Minus_1_Day" + And That TEI has a "Calling report" event on "6_MonthsAgo_Plus_1_Day" with following data + | Result of call | REMIND_TO_CALL_LATER | + And That TEI has a "Calling report" event on "3_MonthsAgo_Plus_1_Day" with following data + | Result of call | AGREE_TO_VISIT | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Contactable overdue patients called" with period type "Months" should be + | 3_MonthsAgo | 1 | + | 4_MonthsAgo | 0 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 1 | + | 7_MonthsAgo | 0 | + + Scenario: Assume calls only happen to overdue patients, and count all patients called + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Frances | + | GEN - Family name | Bourgois | + | GEN - Sex | FEMALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | Patient Phone Number | 345672781624 | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Calling report" event on "6_MonthsAgo_Plus_1_Day" with following data + | Result of call | AGREE_TO_VISIT | + And That TEI has a "Calling report" event on "3_MonthsAgo_Plus_1_Day" with following data + | Result of call | AGREE_TO_VISIT | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Contactable overdue patients called" with period type "Months" should be + | 3_MonthsAgo | 1 | + | 4_MonthsAgo | 0 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 1 | + | 7_MonthsAgo | 0 | + + Scenario: Only managed patients should be counted (Hypertensive, alive, and in-facility) + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + # Create the patients + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Nonne | + | GEN - Family name | Hypertensive | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | NO | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | By the beach | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 119 | + | Diastole | 69 | + And That TEI has a "Calling report" event on "6_MonthsAgo_Plus_1_Day" with following data + | Result of call | AGREE_TO_VISIT | + And I create a new TEI on "5_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Swimming with| + | GEN - Family name | The Fishes | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | NO | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | By the beach | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Calling report" event on "4_MonthsAgo" with following data + | Result of call | AGREE_TO_VISIT | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Contactable overdue patients called" with period type "Months" should be + | 3_MonthsAgo | 0 | + | 4_MonthsAgo | 0 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 0 | + | 7_MonthsAgo | 0 | diff --git a/scenarios/hypertension/hypertension_contactable_overdue_patients_called_and_returned_to_care.feature b/scenarios/hypertension/hypertension_contactable_overdue_patients_called_and_returned_to_care.feature new file mode 100644 index 0000000..2cb6add --- /dev/null +++ b/scenarios/hypertension/hypertension_contactable_overdue_patients_called_and_returned_to_care.feature @@ -0,0 +1,315 @@ +Feature: Contactable patients called and returned to care + ___ + As a tester + Given Some contactable overdue HTN TEIs return to care after being called + When I export the analytics + Then I should see data in the "HTN - Contactable overdue patients called and returned to care" program indicator as expected + ___ + + Scenario: Overdue contactable patients called returned to care + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + Given I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Priyanka | + | GEN - Family name | Chopra | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | Patient Phone Number | 345672781624 | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + And That TEI has a "Calling report" event on "5_MonthsAgo_Plus_1_Day" with following data + | Result of call | AGREE_TO_VISIT | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo_Plus_10_Day" with following data + | Systole | 142 | + | Diastole | 95 | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Contactable overdue patients called and returned to care" with period type "Months" should be + | 4_MonthsAgo | 0 | + | 5_MonthsAgo | 1 | + | 6_MonthsAgo | 0 | + + Scenario: Overdue non-contactable patients called returned to care + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + Given I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Priyanka | + | GEN - Family name | Chopra | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + And That TEI has a "Calling report" event on "5_MonthsAgo_Plus_1_Day" with following data + | Result of call | AGREE_TO_VISIT | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo_Plus_10_Day" with following data + | Systole | 142 | + | Diastole | 95 | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Contactable overdue patients called and returned to care" with period type "Months" should be + | 4_MonthsAgo | 0 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 0 | + + Scenario: Overdue contactable patients called did not return to care + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + Given I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Priyanka | + | GEN - Family name | Chopra | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | Patient Phone Number | 345672781624 | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + And That TEI has a "Calling report" event on "5_MonthsAgo_Plus_1_Day" with following data + | Result of call | AGREE_TO_VISIT | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Contactable overdue patients called and returned to care" with period type "Months" should be + | 4_MonthsAgo | 0 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 0 | + + Scenario: Overdue contactable patients returned to care without being called + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + Given I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Priyanka | + | GEN - Family name | Chopra | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | Patient Phone Number | 345672781624 | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo_Plus_10_Day" with following data + | Systole | 142 | + | Diastole | 95 | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Contactable overdue patients called and returned to care" with period type "Months" should be + | 3_MonthsAgo | 0 | + | 4_MonthsAgo | 0 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 0 | + | 7_MonthsAgo | 0 | + + Scenario: Overdue contactable patients returned to care after 15 days + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + Given I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Priyanka | + | GEN - Family name | Chopra | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | Patient Phone Number | 345672781624 | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + And That TEI has a "Calling report" event on "6_MonthsAgo_Plus_5_Day" with following data + | Result of call | AGREE_TO_VISIT | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo_Plus_1_Day" with following data + | Systole | 142 | + | Diastole | 95 | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Contactable overdue patients called and returned to care" with period type "Months" should be + | 4_MonthsAgo | 0 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 0 | + + Scenario: Exclude contactable patients called and realized to be dead + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + Given I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Priyanka | + | GEN - Family name | Chopra | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | Patient Phone Number | 345672781624 | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + And That TEI has a "Calling report" event on "5_MonthsAgo_Plus_1_Day" with following data + | Result of call | REMOVE_FROM_OVERDUE | + | HTN - Remove from overdue list because: | DIED | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Contactable overdue patients called and returned to care" with period type "Months" should be + | 4_MonthsAgo | 0 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 0 | + + + Scenario: Exclude contactable patients called and realized as transfered to other facilities + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + Given I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Priyanka | + | GEN - Family name | Chopra | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | Patient Phone Number | 345672781624 | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + And That TEI has a "Calling report" event on "5_MonthsAgo_Plus_1_Day" with following data + | Result of call | REMOVE_FROM_OVERDUE | + | HTN - Remove from overdue list because: | TRANSFERRED_TO_ANOTHER_FACILITY | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Contactable overdue patients called and returned to care" with period type "Months" should be + | 4_MonthsAgo | 0 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 0 | + + Scenario: Exclude contactable patients who had their last visit more than a year ago + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + Given I create a new TEI on "13_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Priyanka | + | GEN - Family name | Chopra | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | Patient Phone Number | 345672781624 | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "13_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "12_MonthsAgo" + And That TEI has a "Calling report" event on "12_MonthsAgo_Plus_1_Day" with following data + | Result of call | AGREE_TO_VISIT | + And That TEI has a "Hypertension & Diabetes visit" event on "12_MonthsAgo_Plus_5_Day" with following data + | Systole | 142 | + | Diastole | 95 | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Contactable overdue patients called and returned to care" with period type "Months" should be + | thisMonth | 0 | + | 11_MonthsAgo | 0 | + | 12_MonthsAgo | 1 | + + Scenario: Overdue contactable patients called anytime after they have become overdue, but returned on time, should count + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + Given I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Priyanka | + | GEN - Family name | Chopra | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | Patient Phone Number | 345672781624 | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + And That TEI has a "Calling report" event on "4_MonthsAgo_Plus_1_Day" with following data + | Result of call | AGREE_TO_VISIT | + And That TEI has a "Hypertension & Diabetes visit" event on "4_MonthsAgo_Plus_10_Day" with following data + | Systole | 142 | + | Diastole | 95 | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Contactable overdue patients called and returned to care" with period type "Months" should be + | 4_MonthsAgo | 1 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 0 | diff --git a/scenarios/hypertension/hypertension_cumulative_registration.feature b/scenarios/hypertension/hypertension_cumulative_registration.feature new file mode 100644 index 0000000..b303b3a --- /dev/null +++ b/scenarios/hypertension/hypertension_cumulative_registration.feature @@ -0,0 +1,359 @@ +@programIndicator +Feature: Audit HTN - Cumulative registrations + + Scenario: All the tracked entity instances except the dead ones are included + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + # + # Patient 1 - Dead patient + # + And I create a new TEI on "7_MonthsAgo" at this organisation unit with the following attributes + | GEN - Given name | Test | + | GEN - Family name | TEST | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event on "6_MonthsAgo" with following data + | Systole | 140 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_MonthsAgo" with following data + | Systole | 136 | + | Diastole | 84 | + And That TEI was updated on "2_MonthsAgo" with the following attributes + | HTN - NCD Patient Status | DIED | + + # + # Patient 2 - Not a hypertension patient + # + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | Given name | Fabian | + | Family name | Moore | + | Sex | MALE | + | HTN diagnosis | No | + | DM diagnosis | YES | + | Date of birth | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | HTN - Type of diabetes measure? | FBS | + | HTN - Blood sugar reading | 130 | + | HTN - Blood sugar unit | MG_OR_DL | + + # + # Patient 3 + # + And I create a new TEI on "9_MonthsAgo" for this Facility with the following attributes + | Given name | Sue | + | Family name | Perkins | + | Sex | MALE | + | HTN diagnosis | YES | + | v4DnYfXn9Mu | YES | + | NI0QRzJvQ0k | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "9_MonthsAgo" with following data + | Systole | 147 | + | Diastole | 89 | + And That TEI has a "Hypertension & Diabetes visit" event on "8_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | Systole | 140 | + | Diastole | 83 | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | Systole | 135 | + | Diastole | 84 | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | Systole | 134 | + | Diastole | 83 | + + # + # Patient 4 + # + And I create a new TEI on "9_MonthsAgo" for this Facility with the following attributes + | Given name | Kiran | + | Family name | Kishor | + | Sex | MALE | + | HTN diagnosis | YES | + | v4DnYfXn9Mu | YES | + | NI0QRzJvQ0k | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "9_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event on "8_MonthsAgo" with following data + | Systole | 139 | + | Diastole | 90 | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 132 | + | Diastole | 82 | + And That TEI has a "Hypertension & Diabetes visit" event on "6_MonthsAgo" with following data + | Systole | 128 | + | Diastole | 78 | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | Systole | 140 | + | Diastole | 88 | + + When I wait for 1 second + And Export the analytics + + Then The value of "PI":"HTN - Cumulative registrations" with period type "Months" should be + | thisMonth | 2 | + | 1_MonthAgo | 2 | + | 2_MonthsAgo | 2 | + | 3_MonthsAgo | 2 | + | 4_MonthsAgo | 2 | + | 5_MonthsAgo | 2 | + | 6_MonthsAgo | 2 | + | 7_MonthsAgo | 2 | + | 8_MonthsAgo | 2 | + | 9_MonthsAgo | 2 | + | 10_MonthsAgo | 0 | + | 11_MonthsAgo | 0 | + | 12_MonthsAgo | 0 | + + Then The value of "PI":"HTN - Cumulative dead patients" with period type "Months" should be + | thisMonth | 1 | + | 1_MonthAgo | 1 | + | 2_MonthsAgo | 1 | + | 3_MonthsAgo | 1 | + | 4_MonthsAgo | 1 | + | 5_MonthsAgo | 1 | + | 6_MonthsAgo | 1 | + | 7_MonthsAgo | 1 | + | 8_MonthsAgo | 0 | + | 9_MonthsAgo | 0 | + | 10_MonthsAgo | 0 | + | 11_MonthsAgo | 0 | + | 12_MonthsAgo | 0 | + + Scenario: Only hypertensive tracked entity instances are included + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + # + # Patient 1 - Not a hypertension patient + # + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | Given name | Fabian | + | Family name | Moore | + | Sex | MALE | + | HTN diagnosis | No | + | DM diagnosis | YES | + | Date of birth | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | HTN - Type of diabetes measure? | FBS | + | HTN - Blood sugar reading | 130 | + | HTN - Blood sugar unit | MG_OR_DL | + + # + # Patient 2 + # + And I create a new TEI on "10_MonthsAgo" for this Facility with the following attributes + | Given name | Sue | + | Family name | Perkins | + | Sex | MALE | + | HTN diagnosis | YES | + | v4DnYfXn9Mu | YES | + | NI0QRzJvQ0k | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "10_MonthsAgo" with following data + | Systole | 147 | + | Diastole | 89 | + And That TEI has a "Hypertension & Diabetes visit" event on "9_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 140 | + | Diastole | 83 | + And That TEI has a "Hypertension & Diabetes visit" event on "6_MonthsAgo" with following data + | Systole | 135 | + | Diastole | 84 | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | Systole | 134 | + | Diastole | 83 | + + # + # Patient 3 + # + And I create a new TEI on "10_MonthsAgo" for this Facility with the following attributes + | Given name | Kiran | + | Family name | Kishor | + | Sex | MALE | + | HTN diagnosis | YES | + | v4DnYfXn9Mu | YES | + | NI0QRzJvQ0k | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "10_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event on "8_MonthsAgo" with following data + | Systole | 139 | + | Diastole | 90 | + And That TEI has a "Hypertension & Diabetes visit" event on "6_MonthsAgo" with following data + | Systole | 132 | + | Diastole | 82 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_MonthsAgo" with following data + | Systole | 128 | + | Diastole | 78 | + And That TEI has a "Hypertension & Diabetes visit" event on "1_MonthAgo" with following data + | Systole | 140 | + | Diastole | 88 | + + When I wait for 1 second + And Export the analytics + And Run the Hypertension data aggregation + + Then The value of "PI":"HTN - Cumulative registrations" with period type "Months" should be + | thisMonth | 2 | + | 1_MonthAgo | 2 | + | 2_MonthsAgo | 2 | + | 3_MonthsAgo | 2 | + | 4_MonthsAgo | 2 | + | 5_MonthsAgo | 2 | + | 6_MonthsAgo | 2 | + | 7_MonthsAgo | 2 | + | 8_MonthsAgo | 2 | + | 9_MonthsAgo | 2 | + | 10_MonthsAgo | 2 | + | 11_MonthsAgo | 0 | + | 12_MonthsAgo | 0 | + + Scenario: Patients inactive for more than 12 months should be included + And I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + # + # Patient 1 - Lost To Followup + # + And I create a new TEI on "18_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Test | + | GEN - Family name | TEST | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + + And That TEI has a "Hypertension & Diabetes visit" event on "18_MonthsAgo" with following data + | Systole | 145 | + | Diastole | 92 | + And That TEI has a "Hypertension & Diabetes visit" event on "17_MonthsAgo" with following data + | Systole | 140 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "14_MonthsAgo" with following data + | Systole | 136 | + | Diastole | 84 | + + # + # Patient 2 - Lost To Followup and Dead + # + And I create a new TEI on "8_MonthsAgo" for this Facility with the following attributes + | Given name | Sue | + | Family name | Perkins | + | Sex | MALE | + | HTN diagnosis | YES | + | v4DnYfXn9Mu | YES | + | NI0QRzJvQ0k | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "8_MonthsAgo" with following data + | Systole | 147 | + | Diastole | 89 | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 140 | + | Diastole | 83 | + And That TEI has a "Hypertension & Diabetes visit" event on "6_MonthsAgo" with following data + | Systole | 135 | + | Diastole | 84 | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | Systole | 134 | + | Diastole | 83 | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 147 | + | Diastole | 87 | + And That TEI was updated on "6_MonthsAgo" with the following attributes + | HTN - NCD Patient Status | DIED | + + # + # Patient 3 - Under care + # + And I create a new TEI on "10_MonthsAgo" for this Facility with the following attributes + | Given name | Sue | + | Family name | Perkins | + | Sex | MALE | + | HTN diagnosis | YES | + | v4DnYfXn9Mu | YES | + | NI0QRzJvQ0k | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "10_MonthsAgo" with following data + | Systole | 147 | + | Diastole | 89 | + And That TEI has a "Hypertension & Diabetes visit" event on "8_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "6_MonthsAgo" with following data + | Systole | 140 | + | Diastole | 83 | + And That TEI has a "Hypertension & Diabetes visit" event on "4_MonthsAgo" with following data + | Systole | 135 | + | Diastole | 84 | + And That TEI has a "Hypertension & Diabetes visit" event on "2_MonthsAgo" with following data + | Systole | 134 | + | Diastole | 83 | + + When I wait for 1 second + And Export the analytics + + + + Then The value of "Program Indicator":"HTN - Cumulative registrations" with period type "Months" should be + | thisMonth | 2 | + | 1_MonthAgo | 2 | + | 2_MonthsAgo | 2 | + | 3_MonthsAgo | 2 | + | 4_MonthsAgo | 2 | + | 5_MonthsAgo | 2 | + | 6_MonthsAgo | 2 | + | 7_MonthsAgo | 2 | + | 8_MonthsAgo | 2 | + | 9_MonthsAgo | 2 | + | 10_MonthsAgo | 2 | + | 11_MonthsAgo | 1 | + | 12_MonthsAgo | 1 | diff --git a/scenarios/hypertension/hypertension_data_audit.feature b/scenarios/hypertension/hypertension_data_audit.feature new file mode 100644 index 0000000..c493428 --- /dev/null +++ b/scenarios/hypertension/hypertension_data_audit.feature @@ -0,0 +1,768 @@ +Feature: Hypertension Data Audit + ____ + As a tester + Given I have a few tracked entity instances with event history in the system + When I export the analytics and run the hypertension data aggregation + Then I should see all the hypertension program indicator data for each month as expected + ____ + + Scenario: Verify all the hypertension monthly program indicator + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + # + # Patient 1 - Dead + # + + And I create a new TEI on "7_MonthsAgo_BeginningOfMonth" for this Facility with the following attributes + | Given name | Joe | + | Family name | Bloggs | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 145 | + | Diastole | 92 | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | Systole | 140 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_MonthsAgo" with following data + | Systole | 136 | + | Diastole | 84 | + And That TEI was updated on "2_MonthsAgo" with the following attributes + | NCD Patient Status | DIED | + # + # Patient 2 - Not a hypertension TEI + # + And I create a new TEI on "5_MonthsAgo" for this Facility with the following attributes + | Given name | Fabian | + | Family name | Moore | + | Sex | MALE | + | HTN diagnosis | NO | + | DM diagnosis | YES | + | Date of birth | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | HTN - Type of diabetes measure? | HBA1C | + | HTN - Blood sugar reading | 9 | + # + # Patient 3 - Patient under care, TEI under care registered before the past 3 months and controlled + # + And I create a new TEI on "10_MonthsAgo" for this Facility with the following attributes + | Given name | Sue | + | Family name | Perkins | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "10_MonthsAgo" with following data + | Systole | 147 | + | Diastole | 89 | + And That TEI has a "Hypertension & Diabetes visit" event on "9_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 140 | + | Diastole | 83 | + And That TEI has a "Hypertension & Diabetes visit" event on "6_MonthsAgo" with following data + | Systole | 135 | + | Diastole | 84 | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | Systole | 134 | + | Diastole | 83 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_MonthsAgo" with following data + | Systole | 137 | + | Diastole | 86 | + # + # Patient 4 - Patient under care, TEI under care registered before the past 3 months and controlled + # + And I create a new TEI on "19_MonthsAgo" for this Facility with the following attributes + | Given name | Kiran | + | Family name | Kishor | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "19_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event on "18_MonthsAgo" with following data + | Systole | 139 | + | Diastole | 90 | + And That TEI has a "Hypertension & Diabetes visit" event on "17_MonthsAgo" with following data + | Systole | 132 | + | Diastole | 82 | + And That TEI has a "Hypertension & Diabetes visit" event on "16_MonthsAgo" with following data + | Systole | 128 | + | Diastole | 72 | + And That TEI has a "Hypertension & Diabetes visit" event on "15_MonthsAgo" with following data + | Systole | 140 | + | Diastole | 88 | + # + # Patient 5 - Patient under care, TEI under care registered before the past 3 months and uncontrolled + # + And I create a new TEI on "8_MonthsAgo" for this Facility with the following attributes + | Given name | Lilly | + | Family name | Martin | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 42 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "8_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 132 | + | Diastole | 82 | + And That TEI has a "Hypertension & Diabetes visit" event on "6_MonthsAgo" with following data + | Systole | 146 | + | Diastole | 93 | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | Systole | 143 | + | Diastole | 89 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_MonthsAgo" with following data + | Systole | 138 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "2_MonthsAgo" with following data + | Systole | 140 | + | Diastole | 91 | + # + # Patient 6 - Patient under care, TEI under care registered before the past 3 months and no visit in last 3 months + # + And I create a new TEI on "12_MonthsAgo" for this Facility with the following attributes + | Given name | Ajesh | + | Family name | Choudhary | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 42 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "12_MonthsAgo" with following data + | Systole | 146 | + | Diastole | 93 | + And That TEI has a "Hypertension & Diabetes visit" event on "11_MonthsAgo" with following data + | Systole | 143 | + | Diastole | 93 | + And That TEI has a "Hypertension & Diabetes visit" event on "10_MonthsAgo" with following data + | Systole | 138 | + | Diastole | 83 | + And That TEI has a "Hypertension & Diabetes visit" event on "9_MonthsAgo" with following data + | Systole | 143 | + | Diastole | 91 | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 148 | + | Diastole | 93 | + And That TEI has a "Hypertension & Diabetes visit" event on "6_MonthsAgo" with following data + | Systole | 136 | + | Diastole | 82 | + # + # Patient 7 - Patient under care, TEI under care registered before the past 3 months and controlled + # + And I create a new TEI on "4_MonthsAgo" for this Facility with the following attributes + | Given name | Bianca | + | Family name | Santos | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 42 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "4_MonthsAgo" with following data + | Systole | 141 | + | Diastole | 94 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_MonthsAgo" with following data + | Systole | 143 | + | Diastole | 93 | + And That TEI has a "Hypertension & Diabetes visit" event on "2_MonthsAgo" with following data + | Systole | 138 | + | Diastole | 83 | + # + # Patient 8 - Patient has not visited for more than 12 months + # + And I create a new TEI on "16_MonthsAgo" for this Facility with the following attributes + | Given name | Joanne | + | Family name | Holme | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 42 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "16_MonthsAgo" with following data + | Systole | 152 | + | Diastole | 98 | + # + # Patient 9 - Patient under care, TEI under care registered before the past 3 months and controlled + # + And I create a new TEI on "6_MonthsAgo" for this Facility with the following attributes + | Given name | Karlo | + | Family name | Petersen | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 42 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "6_MonthsAgo" with following data + | Systole | 152 | + | Diastole | 98 | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | Systole | 145 | + | Diastole | 98 | + And That TEI has a "Hypertension & Diabetes visit" event on "4_MonthsAgo" with following data + | Systole | 138 | + | Diastole | 91 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_MonthsAgo" with following data + | Systole | 128 | + | Diastole | 76 | + And That TEI has a "Hypertension & Diabetes visit" event on "2_MonthsAgo" with following data + | Systole | 125 | + | Diastole | 77 | + # + # Patient 10 - Patient under care, TEI under care registered before the past 3 months and controlled + # + And I create a new TEI on "8_MonthsAgo" for this Facility with the following attributes + | Given name | Adrien | + | Family name | Palomo | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 42 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "8_MonthsAgo" with following data + | Systole | 152 | + | Diastole | 98 | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 143 | + | Diastole | 93 | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | Systole | 138 | + | Diastole | 83 | + # + # Patient 11 - Patient under care, TEI under care registered before the past 3 months and no visit + # + And I create a new TEI on "9_MonthsAgo" for this Facility with the following attributes + | Given name | Iverna | + | Family name | Terrazas | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 42 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "9_MonthsAgo" with following data + | Systole | 146 | + | Diastole | 93 | + And That TEI has a "Hypertension & Diabetes visit" event on "8_MonthsAgo" with following data + | Systole | 143 | + | Diastole | 93 | + And That TEI has a "Hypertension & Diabetes visit" event on "6_MonthsAgo" with following data + | Systole | 138 | + | Diastole | 83 | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | Systole | 137 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_MonthsAgo" with following data + | Systole | 135 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "2_MonthsAgo" with following data + | Systole | 130 | + | Diastole | 81 | + | HTN - Type of diabetes measure? | FBS | + | HTN - Blood sugar reading | 200 | + | HTN - Blood sugar unit | MG_OR_DL | + And That TEI has a "Hypertension & Diabetes visit" event on "2_MonthsAgo_Plus_4_Days" with following data + | HTN - Type of diabetes measure? | FBS | + | HTN - Blood sugar reading | 130 | + | HTN - Blood sugar unit | MG_OR_DL | + And That TEI has a "Hypertension & Diabetes visit" event on "1_MonthAgo" with following data + | HTN - Type of diabetes measure? | FBS | + | HTN - Blood sugar reading | 100 | + | HTN - Blood sugar unit | MG_OR_DL | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Cumulative dead patients" with period type "Months" should be + | 12_MonthsAgo | 0 | + | 11_MonthsAgo | 0 | + | 10_MonthsAgo | 0 | + | 9_MonthsAgo | 0 | + | 8_MonthsAgo | 0 | + | 7_MonthsAgo | 1 | + | 6_MonthsAgo | 1 | + | 5_MonthsAgo | 1 | + | 4_MonthsAgo | 1 | + | 3_MonthsAgo | 1 | + | 2_MonthsAgo | 1 | + | 1_MonthAgo | 1 | + | thisMonth | 1 | + Then The value of "PI":"HTN - Cumulative registrations" with period type "Months" should be + | 12_MonthsAgo | 3 | + | 11_MonthsAgo | 3 | + | 10_MonthsAgo | 4 | + | 9_MonthsAgo | 5 | + | 8_MonthsAgo | 7 | + | 7_MonthsAgo | 7 | + | 6_MonthsAgo | 8 | + | 5_MonthsAgo | 8 | + | 4_MonthsAgo | 9 | + | 3_MonthsAgo | 9 | + | 2_MonthsAgo | 9 | + | 1_MonthAgo | 9 | + | thisMonth | 9 | + Then The value of "PI":"HTN - Monthly registrations" with period type "Months" should be + | 12_MonthsAgo | 1 | + | 11_MonthsAgo | 0 | + | 10_MonthsAgo | 1 | + | 9_MonthsAgo | 1 | + | 8_MonthsAgo | 2 | + | 7_MonthsAgo | 1 | + | 6_MonthsAgo | 1 | + | 5_MonthsAgo | 0 | + | 4_MonthsAgo | 1 | + | 3_MonthsAgo | 0 | + | 2_MonthsAgo | 0 | + | 1_MonthAgo | 0 | + | thisMonth | 0 | + Then The value of "PI":"HTN - Patients under care with controlled BP at latest visit in past 3 months and registered before the past 3 months" with period type "Months" should be + | 12_MonthsAgo | 0 | + | 11_MonthsAgo | 0 | + | 10_MonthsAgo | 0 | + | 9_MonthsAgo | 0 | + | 8_MonthsAgo | 0 | + | 7_MonthsAgo | 0 | + | 6_MonthsAgo | 3 | + | 5_MonthsAgo | 4 | + | 4_MonthsAgo | 4 | + | 3_MonthsAgo | 5 | + | 2_MonthsAgo | 3 | + | 1_MonthAgo | 4 | + | thisMonth | 3 | + + Then The value of "PI":"HTN - Patients under care with no visit in past 3 months registered before the past 3 months" with period type "Months" should be + | 12_MonthsAgo | 2 | + | 11_MonthsAgo | 2 | + | 10_MonthsAgo | 2 | + | 9_MonthsAgo | 2 | + | 8_MonthsAgo | 2 | + | 7_MonthsAgo | 2 | + | 6_MonthsAgo | 2 | + | 5_MonthsAgo | 2 | + | 4_MonthsAgo | 1 | + | 3_MonthsAgo | 1 | + | 2_MonthsAgo | 2 | + | 1_MonthAgo | 2 | + | thisMonth | 3 | + Then The value of "PI":"HTN - Patients under care with uncontrolled BP at latest visit in past 3 months registered before the past 3 months" with period type "Months" should be + | 12_MonthsAgo | 0 | + | 11_MonthsAgo | 0 | + | 10_MonthsAgo | 0 | + | 9_MonthsAgo | 1 | + | 8_MonthsAgo | 1 | + | 7_MonthsAgo | 2 | + | 6_MonthsAgo | 0 | + | 5_MonthsAgo | 1 | + | 4_MonthsAgo | 1 | + | 3_MonthsAgo | 0 | + | 2_MonthsAgo | 1 | + | 1_MonthAgo | 1 | + | thisMonth | 1 | + Then The value of "PI":"HTN - Patients with no visit in last 12 months" with period type "Months" should be + | 12_MonthsAgo | 0 | + | 11_MonthsAgo | 0 | + | 10_MonthsAgo | 0 | + | 9_MonthsAgo | 0 | + | 8_MonthsAgo | 0 | + | 7_MonthsAgo | 0 | + | 6_MonthsAgo | 0 | + | 5_MonthsAgo | 0 | + | 4_MonthsAgo | 1 | + | 3_MonthsAgo | 2 | + | 2_MonthsAgo | 2 | + | 1_MonthAgo | 2 | + | thisMonth | 2 | + + Then The value of "PI":"HTN - Patients under care registered before the past 3 months." with period type "Months" should be + | 12_MonthsAgo | 2 | + | 11_MonthsAgo | 2 | + | 10_MonthsAgo | 2 | + | 9_MonthsAgo | 3 | + | 8_MonthsAgo | 3 | + | 7_MonthsAgo | 4 | + | 6_MonthsAgo | 5 | + | 5_MonthsAgo | 7 | + | 4_MonthsAgo | 6 | + | 3_MonthsAgo | 6 | + | 2_MonthsAgo | 6 | + | 1_MonthAgo | 7 | + | thisMonth | 7 | + Scenario: Verify all the hypertension quarterly program indicator + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + # + # Patient 1 - Dead + # + + And I create a new TEI on "3_QuartersAgo" for this Facility with the following attributes + | Given name | Joe | + | Family name | Bloggs | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "3_QuartersAgo" with following data + | Systole | 145 | + | Diastole | 92 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_QuarterAgo_Plus_2_Months" with following data + | Systole | 140 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "2_QuartersAgo_Plus_1_Month" with following data + | Systole | 136 | + | Diastole | 84 | + And That TEI was updated on "thisQuarter" with the following attributes + | NCD Patient Status | DIED | + # + # Patient 2 - Not a hypertension TEI + # + And I create a new TEI on "3_QuarterAgo" for this Facility with the following attributes + | Given name | Fabian | + | Family name | Moore | + | Sex | MALE | + | HTN diagnosis | NO | + | DM diagnosis | YES | + | Date of birth | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "3_QuarterAgo" with following data + | HTN - Type of diabetes measure? | HBA1C | + | HTN - Blood sugar reading | 9 | + # + # Patient 3 - Patient under care, TEI under care registered before the past 3 months and controlled visit in following quarter + # + And I create a new TEI on "4_QuartersAgo" for this Facility with the following attributes + | Given name | Sue | + | Family name | Perkins | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "4_QuartersAgo" with following data + | Systole | 147 | + | Diastole | 89 | + And That TEI has a "Hypertension & Diabetes visit" event on "4_QuartersAgo_Plus_1_Month" with following data + | Systole | 142 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_QuartersAgo" with following data + | Systole | 140 | + | Diastole | 83 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_QuartersAgo_Plus_1_Month" with following data + | Systole | 135 | + | Diastole | 84 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_QuartersAgo_Plus_2_Month" with following data + | Systole | 134 | + | Diastole | 83 | + And That TEI has a "Hypertension & Diabetes visit" event on "2_QuartersAgo_Plus_1_Month" with following data + | Systole | 137 | + | Diastole | 86 | + # + # Patient 4 - Patient under care, TEI under care registered before the past 3 months and uncontrolled visit in following quarter + # + And I create a new TEI on "3_QuartersAgo" for this Facility with the following attributes + | Given name | Kiran | + | Family name | Kishor | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "3_QuartersAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_QuartersAgo_Plus_1_Month" with following data + | Systole | 139 | + | Diastole | 90 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_QuartersAgo_Plus_2_Month" with following data + | Systole | 132 | + | Diastole | 82 | + And That TEI has a "Hypertension & Diabetes visit" event on "2_QuartersAgo" with following data + | Systole | 128 | + | Diastole | 72 | + And That TEI has a "Hypertension & Diabetes visit" event on "2_QuartersAgo_Plus_1_Month" with following data + | Systole | 140 | + | Diastole | 88 | + # + # Patient 5 - Patient under care, TEI under care registered before the past 3 months and uncontrolled visit in following quarter + # + And I create a new TEI on "4_QuartersAgo_Plus_2_Months" for this Facility with the following attributes + | Given name | Lilly | + | Family name | Martin | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 42 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "4_QuartersAgo_Plus_2_Months" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_QuartersAgo" with following data + | Systole | 132 | + | Diastole | 82 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_QuartersAgo_Plus_1_Months" with following data + | Systole | 146 | + | Diastole | 93 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_QuartersAgo_Plus_2_Months" with following data + | Systole | 143 | + | Diastole | 89 | + And That TEI has a "Hypertension & Diabetes visit" event on "2_QuartersAgo_Plus_1_Month" with following data + | Systole | 138 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "2_QuartersAgo_Plus_2_Months" with following data + | Systole | 140 | + | Diastole | 91 | + # + # Patient 6 - Patient under care, TEI under care registered before the past 3 months and uncontrolled visit in following quarter + # + And I create a new TEI on "5_QuartersAgo" for this Facility with the following attributes + | Given name | Ajesh | + | Family name | Choudhary | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 42 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "5_QuartersAgo" with following data + | Systole | 146 | + | Diastole | 93 | + And That TEI has a "Hypertension & Diabetes visit" event on "5_QuartersAgo_Plus_1_Month" with following data + | Systole | 143 | + | Diastole | 93 | + And That TEI has a "Hypertension & Diabetes visit" event on "4_QuartersAgo" with following data + | Systole | 138 | + | Diastole | 83 | + And That TEI has a "Hypertension & Diabetes visit" event on "4_QuartersAgo_Plus_1_Month" with following data + | Systole | 143 | + | Diastole | 91 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_QuartersAgo" with following data + | Systole | 148 | + | Diastole | 93 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_QuartersAgo_Plus_1_Month" with following data + | Systole | 136 | + | Diastole | 82 | + # + # Patient 7 - Patient under care, TEI under care registered before the past 3 months and no visit in following quarter + # + And I create a new TEI on "3_QuartersAgo" for this Facility with the following attributes + | Given name | Bianca | + | Family name | Santos | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 42 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "3_QuartersAgo" with following data + | Systole | 141 | + | Diastole | 94 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_QuarterAgo_Plus_1_Month" with following data + | Systole | 143 | + | Diastole | 93 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_QuarterAgo_Plus_2_Month" with following data + | Systole | 138 | + | Diastole | 83 | + # + # Patient 8 - Patient who has no visit in following quarter + # + And I create a new TEI on "2_QuartersAgo" for this Facility with the following attributes + | Given name | Joanne | + | Family name | Holme | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 42 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "2_QuartersAgo" with following data + | Systole | 152 | + | Diastole | 98 | + # + # Patient 9 - Patient under care, TEI under care registered before the past 3 months and controlled visit in following quarter + # + And I create a new TEI on "2_QuartersAgo" for this Facility with the following attributes + | Given name | Karlo | + | Family name | Petersen | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 42 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "2_QuartersAgo" with following data + | Systole | 152 | + | Diastole | 98 | + And That TEI has a "Hypertension & Diabetes visit" event on "1_QuarterAgo" with following data + | Systole | 145 | + | Diastole | 98 | + And That TEI has a "Hypertension & Diabetes visit" event on "1_QuartersAgo_Plus_1_Month" with following data + | Systole | 138 | + | Diastole | 91 | + And That TEI has a "Hypertension & Diabetes visit" event on "1_QuarterAgo_Plus_2_Month" with following data + | Systole | 128 | + | Diastole | 76 | + And That TEI has a "Hypertension & Diabetes visit" event on "thisQuarter" with following data + | Systole | 125 | + | Diastole | 77 | + # + # Patient 10 - Patient under care, TEI under care registered before the past 3 months and controlled visit in following quarter + # + And I create a new TEI on "3_QuartersAgo" for this Facility with the following attributes + | Given name | Adrien | + | Family name | Palomo | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 42 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "3_QuartersAgo" with following data + | Systole | 152 | + | Diastole | 98 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_QuartersAgo_Plus_1_Month" with following data + | Systole | 143 | + | Diastole | 93 | + And That TEI has a "Hypertension & Diabetes visit" event on "2_QuarterAgo" with following data + | Systole | 138 | + | Diastole | 83 | + # + # Patient 11 - Patient under care, TEI under care registered before the past 3 months and controlled visit in following quarter + # + And I create a new TEI on "3_QuartersAgo" for this Facility with the following attributes + | Given name | Iverna | + | Family name | Terrazas | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 42 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "3_QuartersAgo" with following data + | Systole | 146 | + | Diastole | 93 | + And That TEI has a "Hypertension & Diabetes visit" event on "2_QuartersAgo" with following data + | Systole | 143 | + | Diastole | 93 | + And That TEI has a "Hypertension & Diabetes visit" event on "2_QuartersAgo_Plus_1_Month" with following data + | Systole | 138 | + | Diastole | 83 | + And That TEI has a "Hypertension & Diabetes visit" event on "1_QuarterAgo" with following data + | Systole | 137 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "1_QuarterAgo_Plus_1_Month" with following data + | Systole | 135 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "thisQuarter" with following data + | Systole | 130 | + | Diastole | 81 | + | HTN - Type of diabetes measure? | FBS | + | HTN - Blood sugar reading | 200 | + | HTN - Blood sugar unit | MG_OR_DL | + And That TEI has a "Hypertension & Diabetes visit" event on "thisQuarter_Plus_1_Month" with following data + | HTN - Type of diabetes measure? | FBS | + | HTN - Blood sugar reading | 130 | + | HTN - Blood sugar unit | MG_OR_DL | + And That TEI has a "Hypertension & Diabetes visit" event on "thisQuarter_Plus_1_Month_15_Days" with following data + | HTN - Type of diabetes measure? | FBS | + | HTN - Blood sugar reading | 100 | + | HTN - Blood sugar unit | MG_OR_DL | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Total patient registrations in previous quarter" with period type "Quarters" should be + | 4_QuartersAgo | 1 | + | 3_QuartersAgo | 2 | + | 2_QuartersAgo | 4 | + | 1_QuarterAgo | 2 | + | thisQuarter | 0 | + Then The value of "PI":"HTN - Patients with controlled BP at latest visit in this quarter" with period type "Quarters" should be + | 4_QuartersAgo | 0 | + | 3_QuartersAgo | 1 | + | 2_QuartersAgo | 2 | + | 1_QuarterAgo | 1 | + | thisQuarter | 0 | + Then The value of "PI":"HTN - Patients with uncontrolled BP from latest visit in this quarter" with period type "Quarters" should be + | 4_QuartersAgo | 1 | + | 3_QuartersAgo | 1 | + | 2_QuartersAgo | 1 | + | 1_QuarterAgo | 0 | + | thisQuarter | 0 | + Then The value of "PI":"HTN - Patients with no visit in this quarter" with period type "Quarters" should be + | 4_QuartersAgo | 0 | + | 3_QuartersAgo | 0 | + | 2_QuartersAgo | 1 | + | 1_QuarterAgo | 1 | + | thisQuarter | 0 | diff --git a/scenarios/hypertension/hypertension_overdue_patients.feature b/scenarios/hypertension/hypertension_overdue_patients.feature new file mode 100644 index 0000000..432d549 --- /dev/null +++ b/scenarios/hypertension/hypertension_overdue_patients.feature @@ -0,0 +1,179 @@ +Feature: Number of overdue patients + ____ + As a tester + Given I have a few tracked entity instances with event history in the system + When I export the analytics and run the hypertension data aggregation + Then I should see the "HTN - Overdue patients" program indicator data for each month as expected + ____ + + Scenario: All patients has to be hypertensive + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + Given I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Priyanka | + | GEN - Family name | Chopra | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Alia | + | GEN - Family name | Bhatt | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | NO | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Overdue patients" with period type "Months" should be + | thisMonth | 1 | + | 1_MonthAgo | 1 | + | 2_MonthsAgo | 1 | + | 3_MonthsAgo | 1 | + | 4_MonthsAgo | 1 | + | 5_MonthsAgo | 1 | + | 6_MonthsAgo | 0 | + | 7_MonthsAgo | 0 | + | 8_MonthsAgo | 0 | + | 9_MonthsAgo | 0 | + | 10_MonthsAgo | 0 | + | 11_MonthsAgo | 0 | + | 12_MonthsAgo | 0 | + + Scenario: Dead patients should not be included + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Test | + | GEN - Family name | TEST | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Test | + | GEN - Family name | TEST | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + And That TEI was updated on "2_MonthsAgo" with the following attributes + | HTN - NCD Patient Status | DIED | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Overdue patients" with period type "Months" should be + | thisMonth | 1 | + | 1_MonthAgo | 1 | + | 2_MonthsAgo | 1 | + | 3_MonthsAgo | 1 | + | 4_MonthsAgo | 1 | + | 5_MonthsAgo | 1 | + | 6_MonthsAgo | 0 | + | 7_MonthsAgo | 0 | + | 8_MonthsAgo | 0 | + | 9_MonthsAgo | 0 | + | 10_MonthsAgo | 0 | + | 11_MonthsAgo | 0 | + | 12_MonthsAgo | 0 | + + Scenario: TEI are not marked as overdue anymore if they have visited after the due date. + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Rose | + | GEN - Family name | Mary | + | GEN - Sex | FEMALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo_Minus_1_Day" + + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Angel | + | GEN - Family name | John | + | GEN - Sex | FEMALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Calling report" event on "5_MonthsAgo_Plus_1_Day" with following data + | Result of call | REMOVE_FROM_OVERDUE | + | HTN - Remove from overdue list because: | OTHER | + And That TEI has a "Hypertension & Diabetes visit" event on "3_MonthsAgo" which was scheduled on "5_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Overdue patients" with period type "Months" should be + | thisMonth | 1 | + | 1_MonthAgo | 1 | + | 2_MonthsAgo | 1 | + | 3_MonthsAgo | 2 | + | 4_MonthsAgo | 2 | + | 5_MonthsAgo | 1 | + | 6_MonthsAgo | 1 | + | 7_MonthsAgo | 0 | + | 8_MonthsAgo | 0 | + | 9_MonthsAgo | 0 | + | 10_MonthsAgo | 0 | + | 11_MonthsAgo | 0 | + | 12_MonthsAgo | 0 | diff --git a/scenarios/hypertension/hypertension_overdue_patients_called.feature b/scenarios/hypertension/hypertension_overdue_patients_called.feature new file mode 100644 index 0000000..d3a9b7a --- /dev/null +++ b/scenarios/hypertension/hypertension_overdue_patients_called.feature @@ -0,0 +1,136 @@ +Feature: Number of overdue patients called + ___ + As a tester + Given I have some tracked entity instances with call history in the system + When I export the analytics + Then I should should see the "HTN - Overdue patients called" program indicator data for each month as expected + ___ + + Scenario: Called overdue patients should be counted + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Rose | + | GEN - Family name | Mary | + | GEN - Sex | FEMALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo_Minus_1_Day" + And That TEI has a "Calling report" event on "6_MonthsAgo_Plus_1_Day" with following data + | Result of call | REMIND_TO_CALL_LATER | + And That TEI has a "Calling report" event on "3_MonthsAgo_Plus_1_Day" with following data + | Result of call | REMOVE_FROM_OVERDUE | + | HTN - Remove from overdue list because: | OTHER | + + When I export the analytics + + Then The value of "PI":"HTN - Overdue patients called" with period type "Months" should be + | 3_MonthsAgo | 1 | + | 4_MonthsAgo | 0 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 1 | + | 7_MonthsAgo | 0 | + + Scenario: Assume calls only happen to overdue patients, and count all patients called + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Frances | + | GEN - Family name | Bourgois | + | GEN - Sex | FEMALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Calling report" event on "6_MonthsAgo_Plus_1_Day" with following data + | Result of call | AGREE_TO_VISIT | + And That TEI has a "Calling report" event on "3_MonthsAgo_Plus_1_Day" with following data + | Result of call | REMOVE_FROM_OVERDUE | + | HTN - Remove from overdue list because: | OTHER | + + When I export the analytics + + Then The value of "PI":"HTN - Overdue patients called" with period type "Months" should be + | 3_MonthsAgo | 1 | + | 4_MonthsAgo | 0 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 1 | + | 7_MonthsAgo | 0 | + + Scenario: Only managed patients should be counted (Hypertensive, alive, and in-facility) + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + # Create the patients + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Nonne | + | GEN - Family name | Hypertensive | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | NO | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | By the beach | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 119 | + | Diastole | 69 | + And That TEI has a "Calling report" event on "6_MonthsAgo_Plus_1_Day" with following data + | Result of call | AGREE_TO_VISIT | + And I create a new TEI on "5_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Swimming with | + | GEN - Family name | The Fishes | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | NO | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | By the beach | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Calling report" event on "4_MonthsAgo" with following data + | Result of call | REMOVE_FROM_OVERDUE | + | HTN - Remove from overdue list because: | DIED | + And I create a new TEI on "5_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Moved To | + | GEN - Family name | Another City | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | NO | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | New Home | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Calling report" event on "4_MonthsAgo" with following data + | Result of call | REMOVE_FROM_OVERDUE | + | HTN - Remove from overdue list because: | DIED | + + When I export the analytics + + Then The value of "PI":"HTN - Overdue patients called" with period type "Months" should be + | 3_MonthsAgo | 0 | + | 4_MonthsAgo | 0 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 0 | + | 7_MonthsAgo | 0 | diff --git a/scenarios/hypertension/hypertension_overdue_patients_called_returned_to_care.feature b/scenarios/hypertension/hypertension_overdue_patients_called_returned_to_care.feature new file mode 100644 index 0000000..522d600 --- /dev/null +++ b/scenarios/hypertension/hypertension_overdue_patients_called_returned_to_care.feature @@ -0,0 +1,274 @@ +Feature: Number of overdue patients + ___ + As a tester + Given Some managed overdue HTN TEIs return to care after being called + When I export the analytics + Then I should see data in the "HTN - Overdue patients called and returned to care" program indicator as expected + ___ + + Scenario: Overdue patients called returned to care + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + Given I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Priyanka | + | GEN - Family name | Chopra | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + And That TEI has a "Calling report" event on "5_MonthsAgo_Plus_1_Day" with following data + | Result of call | AGREE_TO_VISIT | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo_Plus_10_Day" with following data + | Systole | 142 | + | Diastole | 95 | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Overdue patients called and returned to care" with period type "Months" should be + | 4_MonthsAgo | 0 | + | 5_MonthsAgo | 1 | + | 6_MonthsAgo | 0 | + + Scenario: Overdue patients called did not return to care + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + Given I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Priyanka | + | GEN - Family name | Chopra | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + And That TEI has a "Calling report" event on "5_MonthsAgo_Plus_1_Day" with following data + | Result of call | AGREE_TO_VISIT | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Overdue patients called and returned to care" with period type "Months" should be + | 4_MonthsAgo | 0 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 0 | + + Scenario: Overdue patients returned to care without being called + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + Given I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Priyanka | + | GEN - Family name | Chopra | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo_Plus_10_Day" with following data + | Systole | 142 | + | Diastole | 95 | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Overdue patients called and returned to care" with period type "Months" should be + | 3_MonthsAgo | 0 | + | 4_MonthsAgo | 0 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 0 | + | 7_MonthsAgo | 0 | + + Scenario: Overdue patients returned to care after 15 days + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + Given I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Priyanka | + | GEN - Family name | Chopra | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + And That TEI has a "Calling report" event on "6_MonthsAgo_Plus_5_Day" with following data + | Result of call | AGREE_TO_VISIT | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo_Plus_1_Day" with following data + | Systole | 142 | + | Diastole | 95 | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Overdue patients called and returned to care" with period type "Months" should be + | 4_MonthsAgo | 0 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 0 | + + Scenario: Exclude patients called and realized to be dead + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + Given I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Priyanka | + | GEN - Family name | Chopra | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + And That TEI has a "Calling report" event on "5_MonthsAgo_Plus_1_Day" with following data + | Result of call | REMOVE_FROM_OVERDUE | + | HTN - Remove from overdue list because: | DIED | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Overdue patients called and returned to care" with period type "Months" should be + | 4_MonthsAgo | 0 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 0 | + + + Scenario: Exclude patients called and realized as transfered to other facilities + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + Given I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Priyanka | + | GEN - Family name | Chopra | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + And That TEI has a "Calling report" event on "5_MonthsAgo_Plus_1_Day" with following data + | Result of call | REMOVE_FROM_OVERDUE | + | HTN - Remove from overdue list because: | TRANSFERRED_TO_ANOTHER_FACILITY | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Overdue patients called and returned to care" with period type "Months" should be + | 4_MonthsAgo | 0 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 0 | + + Scenario: Exclude patients who had their last visit more than a year ago + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + Given I create a new TEI on "13_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Priyanka | + | GEN - Family name | Chopra | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "13_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "12_MonthsAgo" + And That TEI has a "Calling report" event on "12_MonthsAgo_Plus_1_Day" with following data + | Result of call | AGREE_TO_VISIT | + And That TEI has a "Hypertension & Diabetes visit" event on "12_MonthsAgo_Plus_5_Day" with following data + | Systole | 142 | + | Diastole | 95 | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Overdue patients called and returned to care" with period type "Months" should be + | thisMonth | 0 | + | 11_MonthsAgo | 0 | + | 12_MonthsAgo | 1 | + + Scenario: Overdue patients called after a month overdue, but returned on time, should count + Given I am signed in as a user with role "Superuser" + And I have access to an organisation unit at level 5 + And I register that organisation unit for program "Hypertension & Diabetes" + + Given I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Priyanka | + | GEN - Family name | Chopra | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo" + And That TEI has a "Calling report" event on "4_MonthsAgo_Plus_1_Day" with following data + | Result of call | AGREE_TO_VISIT | + And That TEI has a "Hypertension & Diabetes visit" event on "4_MonthsAgo_Plus_10_Day" with following data + | Systole | 142 | + | Diastole | 95 | + + When I wait for 1 second + And I export the analytics + + Then The value of "PI":"HTN - Overdue patients called and returned to care" with period type "Months" should be + | 4_MonthsAgo | 1 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 0 | + diff --git a/scenarios/hypertension/hypertension_patient_under_care_controlled.feature b/scenarios/hypertension/hypertension_patient_under_care_controlled.feature new file mode 100644 index 0000000..4fff20e --- /dev/null +++ b/scenarios/hypertension/hypertension_patient_under_care_controlled.feature @@ -0,0 +1,31 @@ + Feature: Audit the PI - HTN PUC registered before 3 months and is controlled in the last 3 months + ____ + As a tester + Given I have a few tracked entity instances with event history in the system + When I export the analytics and run the hypertension data aggregation + Then I should see the "HTN PUC registered before 3 months and is controlled in the last 3 months" program indicator data for each month as expected + ____ + + Scenario: All patients should be hypertensive + Given I create a new OrgUnit + And I assign the current user to the current orgUnit + And I register that Facility for program "Hypertension & Diabetes" + And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes + | GEN - Given name | Priyanka | + | GEN - Family name | Chopra | + | GEN - Sex | MALE | + | HTN - Does patient have hypertension? | YES | + | HTN - Does patient have diabetes? | YES | + | GEN - Date of birth | 32 | + | Address (current) | Rose Gardens | + | District | KOLARA | + | HTN - Consent to record data | true | + | HTN - NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_monthsAgo" with following data + | HTN - Type of diabetes measure? | FBS | + | HTN - Blood sugar reading | 130 | + | HTN - Blood sugar unit | MG_OR_DL | + + Scenario: All patients should have a visit in the last 12 months + Scenario: The last visit has to be controlled + diff --git a/scenarios/hypertension/hypertension_patient_under_registered_before_past_3_months.feature b/scenarios/hypertension/hypertension_patient_under_registered_before_past_3_months.feature new file mode 100644 index 0000000..721e731 --- /dev/null +++ b/scenarios/hypertension/hypertension_patient_under_registered_before_past_3_months.feature @@ -0,0 +1,363 @@ +Feature: Audit the program indicator: HTN - Patients under care registered before the past 3 months + + Scenario: All TEIs must be hypertensive + Given I create a new OrgUnit + And I assign the current user to the current orgUnit + And I register that Facility for program "Hypertension & Diabetes" + + # + # Patient 1 - Not a hypertension TEI + # + And I create a new TEI on "7_MonthsAgo" at this organisation unit with the following attributes + | Given name | Fabian | + | Family name | Moore | + | Sex | MALE | + | HTN diagnosis | NO | + | DM diagnosis | YES | + | Date of birth | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | HTN - Type of diabetes measure? | FBS | + | HTN - Blood sugar reading | 206 | + | HTN - Blood sugar unit | MG_OR_DL | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | HTN - Type of diabetes measure? | FBS | + | HTN - Blood sugar reading | 134 | + | HTN - Blood sugar unit | MG_OR_DL | + And That TEI has a "Hypertension & Diabetes visit" event on "3_MonthsAgo" with following data + | HTN - Type of diabetes measure? | FBS | + | HTN - Blood sugar reading | 130 | + | HTN - Blood sugar unit | MG_OR_DL | + And That TEI has a "Hypertension & Diabetes visit" event on "1_MonthAgo" with following data + | HTN - Type of diabetes measure? | FBS | + | HTN - Blood sugar reading | 133 | + | HTN - Blood sugar unit | MG_OR_DL | + + # + # Patient 2 + # + And I create a new TEI on "7_MonthsAgo" at this organisation unit with the following attributes + | Given name | Sue | + | Family name | Perkins | + | Sex | MALE | + | HTN diagnosis | YES | + | v4DnYfXn9Mu | YES | + | NI0QRzJvQ0k | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 147 | + | Diastole | 89 | + And That TEI has a "Hypertension & Diabetes visit" event on "6_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | Systole | 140 | + | Diastole | 83 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_MonthsAgo" with following data + | Systole | 135 | + | Diastole | 84 | + And That TEI has a "Hypertension & Diabetes visit" event on "1_MonthAgo" with following data + | Systole | 134 | + | Diastole | 83 | + + When I wait for 1 second + And I export the analytics + + # NOTE the PI name has a '.' at the end. + Then The value of "PI":"HTN - Patients under care registered before the past 3 months." with period type "Months" should be + | 1_MonthAgo | 1 | + | 2_MonthsAgo | 1 | + | 3_MonthsAgo | 1 | + | 4_MonthsAgo | 1 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 0 | + | 7_MonthsAgo | 0 | + | 8_MonthsAgo | 0 | + | 9_MonthsAgo | 0 | + | 10_MonthsAgo | 0 | + | 11_MonthsAgo | 0 | + | 12_MonthsAgo | 0 | + + Scenario: All dead TEIs are excluded + And I create a new OrgUnit + And I assign the current user to the current orgUnit + And I register that Facility for program "Hypertension & Diabetes" + # + # Patient 1 -Dead + # + And I create a new TEI on "6_MonthsAgo" for this Facility with the following attributes + | Given name | Fabian | + | Family name | Moore | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | YES | + | Date of birth | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "6_MonthsAgo" with following data + | HTN - Type of diabetes measure? | FBS | + | HTN - Blood sugar reading | 200 | + | HTN - Blood sugar unit | MG_OR_DL | + + + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | HTN - Type of diabetes measure? | FBS | + | HTN - Blood sugar reading | 130 | + | HTN - Blood sugar unit | MG_OR_DL | + + And That TEI has a "Hypertension & Diabetes visit" event on "3_MonthsAgo" with following data + | HTN - Type of diabetes measure? | FBS | + | HTN - Blood sugar reading | 130 | + | HTN - Blood sugar unit | MG_OR_DL | + + And That TEI has a "Hypertension & Diabetes visit" event on "1_MonthAgo" with following data + | HTN - Type of diabetes measure? | FBS | + | HTN - Blood sugar reading | 130 | + | HTN - Blood sugar unit | MG_OR_DL | + + And That TEI was updated on "1_MonthAgo" with the following attributes + | HTN - NCD Patient Status | DIED | + + # + # Patient 2 + # + And I create a new TEI on "7_MonthsAgo" at this organisation unit with the following attributes + | Given name | Sue | + | Family name | Perkins | + | Sex | MALE | + | HTN diagnosis | YES | + | v4DnYfXn9Mu | YES | + | NI0QRzJvQ0k | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 147 | + | Diastole | 89 | + And That TEI has a "Hypertension & Diabetes visit" event on "6_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | Systole | 140 | + | Diastole | 83 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_MonthsAgo" with following data + | Systole | 135 | + | Diastole | 84 | + And That TEI has a "Hypertension & Diabetes visit" event on "1_MonthAgo" with following data + | Systole | 134 | + | Diastole | 83 | + + When I wait for 1 second + And I export the analytics + + # NOTE the PI name has a '.' at the end. + Then The value of "PI":"HTN - Patients under care registered before the past 3 months." with period type "Months" should be + | 1_MonthAgo | 1 | + | 2_MonthsAgo | 1 | + | 3_MonthsAgo | 1 | + | 4_MonthsAgo | 1 | + | 5_MonthsAgo | 0 | + | 6_MonthsAgo | 0 | + | 7_MonthsAgo | 0 | + | 8_MonthsAgo | 0 | + | 9_MonthsAgo | 0 | + | 10_MonthsAgo | 0 | + | 11_MonthsAgo | 0 | + | 12_MonthsAgo | 0 | + + Scenario: All TEIs must be registered before 3 months + Given I create a new OrgUnit + And I assign the current user to the current orgUnit + And I register that Facility for program "Hypertension & Diabetes" + # + # Patient 1 + # + And I create a new TEI on "10_MonthsAgo" for this Facility with the following attributes + | Given name | Fabian | + | Family name | Moore | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | NO | + | Date of birth | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "10_MonthsAgo" with following data + | Systole | 147 | + | Diastole | 95 | + And That TEI has a "Hypertension & Diabetes visit" event on "8_MonthsAgo" with following data + | Systole | 147 | + | Diastole | 89 | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | Systole | 140 | + | Diastole | 83 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_MonthsAgo" with following data + | Systole | 135 | + | Diastole | 84 | + And That TEI has a "Hypertension & Diabetes visit" event on "1_MonthAgo" with following data + | Systole | 134 | + | Diastole | 83 | + + # + # Patient 2 + # + And I create a new TEI on "7_MonthsAgo" at this organisation unit with the following attributes + | Given name | Sue | + | Family name | Perkins | + | Sex | MALE | + | HTN diagnosis | YES | + | v4DnYfXn9Mu | YES | + | NI0QRzJvQ0k | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 147 | + | Diastole | 89 | + And That TEI has a "Hypertension & Diabetes visit" event on "6_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | Systole | 140 | + | Diastole | 83 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_MonthsAgo" with following data + | Systole | 135 | + | Diastole | 84 | + And That TEI has a "Hypertension & Diabetes visit" event on "1_MonthAgo" with following data + | Systole | 134 | + | Diastole | 83 | + + When I wait for 1 second + And I export the analytics + + # NOTE the PI name has a '.' at the end. + Then The value of "PI":"HTN - Patients under care registered before the past 3 months." with period type "Months" should be + | 1_MonthAgo | 2 | + | 2_MonthsAgo | 2 | + | 3_MonthsAgo | 2 | + | 4_MonthsAgo | 2 | + | 5_MonthsAgo | 1 | + | 6_MonthsAgo | 1 | + | 7_MonthsAgo | 1 | + | 8_MonthsAgo | 0 | + | 9_MonthsAgo | 0 | + | 10_MonthsAgo | 0 | + | 11_MonthsAgo | 0 | + | 12_MonthsAgo | 0 | + + Scenario: All TEIs who have their last visit before 12 months must be excluded + Given I create a new OrgUnit + And I assign the current user to the current orgUnit + And I register that Facility for program "Hypertension & Diabetes" + # + # Patient 1 + # + And I create a new TEI on "7_MonthsAgo" at this organisation unit with the following attributes + | Given name | Fabian | + | Family name | Moore | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | NO | + | Date of birth | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | Systole | 140 | + | Diastole | 83 | + And That TEI has a "Hypertension & Diabetes visit" event on "3_MonthsAgo" with following data + | Systole | 135 | + | Diastole | 84 | + And That TEI has a "Hypertension & Diabetes visit" event on "1_MonthAgo" with following data + | Systole | 134 | + | Diastole | 83 | + + # + # Patient 2 + # + And I create a new TEI on "10_MonthsAgo" at this organisation unit with the following attributes + | Given name | Joey | + | Family name | Joseph | + | Sex | MALE | + | HTN diagnosis | YES | + | v4DnYfXn9Mu | NO | + | NI0QRzJvQ0k | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + + And That TEI has a "Hypertension & Diabetes visit" event on "10_MonthsAgo" with following data + | Systole | 147 | + | Diastole | 89 | + And That TEI has a "Hypertension & Diabetes visit" event on "8_MonthsAgo" with following data + | Systole | 142 | + | Diastole | 87 | + And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data + | Systole | 140 | + | Diastole | 83 | + And That TEI has a "Hypertension & Diabetes visit" event on "5_MonthsAgo" with following data + | Systole | 135 | + | Diastole | 84 | + And That TEI has a "Hypertension & Diabetes visit" event on "1_MonthAgo" with following data + | Systole | 134 | + | Diastole | 83 | + + # + # Patient 3 + # + And I create a new TEI on "18_MonthsAgo" for this Facility with the following attributes + | Given name | Fabian | + | Family name | Moore | + | Sex | MALE | + | HTN diagnosis | YES | + | DM diagnosis | NO | + | Date of birth | 32 | + | Address | Rose Gardens | + | District | KOLARA | + | Data consent | true | + | NCD Patient Status | ACTIVE | + And That TEI has a "Hypertension & Diabetes visit" event on "18_MonthsAgo" with following data + | Systole | 147 | + | Diastole | 89 | + + When I wait for 1 second + And I export the analytics + + # NOTE the PI name has a '.' at the end. + Then The value of "PI":"HTN - Patients under care registered before the past 3 months." with period type "Months" should be + | thisMonth | 2 | + | 1_MonthAgo | 2 | + | 2_MonthsAgo | 2 | + | 3_MonthsAgo | 2 | + | 4_MonthsAgo | 2 | + | 5_MonthsAgo | 1 | + | 6_MonthsAgo | 1 | + | 7_MonthsAgo | 2 | + | 8_MonthsAgo | 1 | + | 9_MonthsAgo | 1 | + | 10_MonthsAgo | 1 | + | 11_MonthsAgo | 1 | + | 12_MonthsAgo | 1 |