avniproject / apfodishanutrition

GNU Affero General Public License v3.0
0 stars 0 forks source link

APF Phase 2| Offline Dashboard for QRT : Medical Facilitation #276

Closed AnjaliBhagabati closed 2 months ago

AnjaliBhagabati commented 4 months ago
  1. QRT Intervention Required? Logic: In the Medical Facilitation Form for Poshan Sathi, if in the question "Is QRT Intervention Required?" is answered as "Yes" for any child, that count should be shown in this "QRT Intervention Required?" offline dashboard card till a corresponding QRT form (Medical Facilitation - for QRT) is not filled

  2. Link

Tech notes

vedfordev commented 3 months ago

backup:

// Documentation - https://docs.mongodb.com/realm-legacy/docs/javascript/latest/index.html#queries
'use strict';
({params, imports}) => {
    let indList = params.db.objects('ProgramEnrolment')
    .filtered(`voided = false AND programExitDateTime = null AND program.name = 'Child'`);
    indList =  indList.filter(enrolment=>{
        let temp = false;
        let x = enrolment.findLatestObservationInEntireEnrolment("Is QRT Intervention Required?");

        temp = (x)?x.getReadableValue() == 'Yes':false;
        return temp;
    }).map(enrolment=>enrolment.individual);

    return indList;     
};
AnjaliBhagabati commented 3 months ago

@vedfordev as confirmed by the client, can you add in the decision rule that if "Is QRT Intervention Required?" is answered as Yes in the Medical Facilitation by Poshan Sathi form, consider "To be monitored by QRT "as Yes irrespective of the QRT scheduling in the Growth Monitoring

cc @nupoorkhandelwal @Dinesh2019