Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(all): Add HTN scenarios #11

Merged
merged 3 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
Original file line number Diff line number Diff line change
@@ -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 |
aagrawalrtsl marked this conversation as resolved.
Show resolved Hide resolved
| 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 | 142 |
| Diastole | 95 |
aagrawalrtsl marked this conversation as resolved.
Show resolved Hide resolved
igbanam marked this conversation as resolved.
Show resolved Hide resolved
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 |
aagrawalrtsl marked this conversation as resolved.
Show resolved Hide resolved
| 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 |
aagrawalrtsl marked this conversation as resolved.
Show resolved Hide resolved
| 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 |
Loading
Loading