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

[APF] Changes for QRT users #37

Closed
18 of 20 tasks
nupoorkhandelwal opened this issue Feb 2, 2023 · 9 comments
Closed
18 of 20 tasks

[APF] Changes for QRT users #37

nupoorkhandelwal opened this issue Feb 2, 2023 · 9 comments
Assignees

Comments

@nupoorkhandelwal
Copy link
Contributor

nupoorkhandelwal commented Feb 2, 2023

Initial rules configured for Adding decision "High Risk"

  • Adding decision "High Risk" as yes/no via decision rule in following forms on respective conditions-
  1. Registration form - Add registration decision as High risk - "No"
  2. Pregnancy enrolment - If no other High risk condition is true then add High risk as "No" else "Yes"
    Child enrolment - default high risk as "No"
  3. ANC followup - If no other High risk condition is true then add High risk as "No" else "Yes"
  4. Child followup - Weight for Height Status is SAM / Weight for age Status is Severely Underweight
  • Write a script to -
  1. Add High risk - "No" in registration decision for all individual subject type( Exclude other subject types)
  2. Add registration decision "High Risk" - "Yes/No" via script for all the individual subjects based on the conditions mentioned in the first point
  • Remove access to sync/view other subject types ie. HH, AWC and Village for QRT users group and remove individual registration permission

  • Script to update individual subject_type table to have High Risk concept as the sync concept 1.

  • Script to update sync settings for all the users except in user group - Poshan to have sync settings - High risk -Yes and No both

  • Script to update sync settings for all the users in user group - QRT to have sync settings - High risk -Yes

Details of data change to be done to handle new requirement

Presupposition for making the data change:

  1. for pregnancy High Risk Conditions (coded concept) is already available (This was not known to us earlier)
  2. for child Weight for age Status and Weight for Height Status is already available

Logical steps to make the required data change

  1. Program encounters - If there is a non-empty array on encounter type 'ANC' for concept "High Risk Conditions", then add an observation "High Risk" = "yes". If not, add "High Risk" = no.
    for child Weight for Height Status == "SAM" or Weight for age Status == "Severely Underweight"

  2. Program enrolment - Populate the latest (by encounter date time) value of "High Risk" in program encounters of type ANC to the program enrolment
    for child take child Followup

  3. Program enrolment - If High risk not available then set as High risk no

  4. Individual - Populate the latest (by enrolment date time) value of High Risk from program enrolment into observations of registration

  5. Individual - If High risk not available then set as High risk no

  6. Sync attributes - Populate sync attributes of all individual, program_enrolment and program_encounter tables with the "High Risk" observation on individual. Here, do not limit to specific programs or encounter types or voided

For user and sync setting

  1. update subject_type table and sync_registration_concept_1 as high risk (uuid) and sync_registration_concept_1_usable as true for Individual.
  2. update user sync setting add high risk as yes for qrt and for poshan sathi as yes and no

Changes to rules

  1. Add "High Risk" to encounter and enrolment decisions as well
    for pregnancy
    add "High Risk" in decisions rule in pregnancy_enrollment and ANC encounter
    for child
    add "High Risk" in decisions rule in chilld_enrollment and Child Followup encounter

Implementation tasks:

  • 1. take dump of prerelease sql dumps //Skipped, use prereleasedb instead
  • 2. apply dump to local db //Skipped, use prereleasedb instead
  • 3. write psudo code link
  • 4. get psudo code review
  • 5. test case for validation
  • 6. get test case review
  • 7. write code/query as per pusdo code link
  • 8. write test code/query as per test case
  • 9. Execute sync query. link
  • 10. execute code query. (prerelease : link )
  • 11. ensure test succeed
  • 12. send it for qa on prerelease
  • 13. deployed to prod
  • 14. test on prod
@arjunk
Copy link
Contributor

arjunk commented Mar 6, 2023

This card is currently blocked due to this platform dependency https://app.zenhub.com/workspaces/avni-product-635b73bded85e50018871ae6/issues/gh/avniproject/avni-server/509

@utkarshavni
Copy link

@nupoorkhandelwal Moving this to Ready now as the release has happened.

@mahalakshme
Copy link

mahalakshme commented May 3, 2023

Regarding this task: "Script to update individual subject_type table to have High Risk concept as the sync concept 1 " - need to modify the script to make it applicable for encounter, program_enrolment, program_encounter, entity_approval_status tables as well - only then it will sync correctly for the existing catchment(meaning to work as expected with the already existing data).

Script link: https://github.com/avniproject/apfodishanutrition/blob/main/migrations/Scripts%20to%20add%20High%20Risk%20for%20QRT

@vedfordev vedfordev self-assigned this May 8, 2023
@vedfordev
Copy link
Contributor

added program_enrolment, program_encounter.
in old code not mentioned about child program enrolment high risk

@vedfordev
Copy link
Contributor

need more clarification how to set sync_concept_1_value like based on latest_encounter or any other condition

@mahalakshme
Copy link

latest value of high_risk condition of the individual need to be taken(need to consider all cases of wherever it is configured to get updated - registeration, enrolment, encounter) and need to update that value in sync_concept_1 column in the above mentioned tables.

@vedfordev
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
@arjunk @mahalakshme @nupoorkhandelwal @BEULAHEVANJALIN @utkarshavni @vedfordev and others