Skip to content

Commit

Permalink
Fix validation on (PHQ-9) for Depression Screening (#175)
Browse files Browse the repository at this point in the history
Co-authored-by: Makombe <makombe>
  • Loading branch information
makombe authored Sep 6, 2023
1 parent 4b3697b commit 4f2d5eb
Showing 1 changed file with 268 additions and 89 deletions.
357 changes: 268 additions & 89 deletions configuration/ampathforms/Depression_Screening_PHQ-9.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,91 +47,267 @@
]
},
{
"label": "Patient Health Questionnaire-9 (PHQ-9) for Depression Screening",
"label": "Over the last 2 weeks, how often have you been bothered by any of the following problems?",
"isExpanded": "true",
"questions": [
{
"label": "Over the last 2 weeks, how often have you been bothered by any of the following problems?",
"type": "obsGroup",
"label": "1. Little interest or pleasure in doing things",
"type": "control",
"id": "noInterest",
"questionOptions": {
"rendering": "repeating",
"concept": "1284AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
},
"questions": [
{
"label": "Please select a problem",
"type": "obs",
"questionOptions": {
"rendering": "select",
"concept": "1284AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"answers": [
{
"label": "Little interest or pleasure in doing things",
"concept": ""
},
{
"label": "Feeling down, depressed, or hopeless",
"concept": ""
},
{
"label": "Trouble falling or staying asleep, or sleeping too much",
"concept": ""
},
{
"label": "Feeling tired or having little energy",
"concept": ""
},
{
"label": "Poor appetite or overeating",
"concept": ""
},
{
"label": "Feeling bad about yourself, or that you are a failure,or that you have let yourself or your family down",
"concept": ""
},
{
"label": "Trouble concentrating on things (linked with patient's usual activities,such as reading the newspaper or listening to a radio programme)",
"concept": ""
},
{
"label": "Moving or speaking so slowly that other people could have noticed.Or the opposite, being so fidgety or restless that you have been moving around a lot more than usual",
"concept": ""
},
{
"label": "Thoughts that you would be better off dead or of hurting yourself in some way",
"concept": ""
}
]
"concept": "",
"rendering": "radio",
"answers": [
{
"concept": "163733AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Not at all"
},
{
"concept": "163734AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Several days "
},
{
"concept": "163735AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "More than half the days"
},
{
"concept": "163736AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Nearly every day"
}
},
{
"label": "Screening Outcomes",
"type": "obs",
"id": "DhPQOutcomes",
"questionOptions": {
"concept": "",
"rendering": "select",
"answers": [
{
"label": "Not at all",
"concept": ""
},
{
"label": "Several Days",
"concept": ""
},
{
"label": "More than half the day",
"concept": ""
},
{
"label": "Nearly every day",
"concept": ""
}
]
]
}
},
{
"label": "2. Feeling down, depressed, or hopeless",
"type": "control",
"id": "depressed",
"questionOptions": {
"concept": "",
"rendering": "radio",
"answers": [
{
"concept": "163733AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Not at all"
},
{
"concept": "163734AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Several days "
},
{
"concept": "163735AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "More than half the days"
},
{
"concept": "163736AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Nearly every day"
}
]
}
},
{
"label": "3. Trouble falling or staying asleep, or sleeping too much ",
"type": "control",
"id": "sleep",
"questionOptions": {
"concept": "",
"rendering": "radio",
"answers": [
{
"concept": "163733AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Not at all"
},
{
"concept": "163734AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Several days "
},
{
"concept": "163735AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "More than half the days"
},
{
"concept": "163736AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Nearly every day"
}
]
}
},
{
"label": "4. Feeling tired or having little energy",
"type": "control",
"id": "feelingTired",
"questionOptions": {
"concept": "",
"rendering": "radio",
"answers": [
{
"concept": "163733AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Not at all"
},
{
"concept": "163734AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Several days "
},
{
"concept": "163735AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "More than half the days"
},
{
"concept": "163736AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Nearly every day"
}
]
}
},
{
"label": "5. Poor appetite or overeating",
"type": "control",
"id": "poorAppetite",
"questionOptions": {
"concept": "",
"rendering": "radio",
"answers": [
{
"concept": "163733AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Not at all"
},
{
"concept": "163734AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Several days "
},
{
"concept": "163735AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "More than half the days"
},
{
"concept": "163736AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Nearly every day"
}
]
}
},
{
"label": "6. Feeling bad about yourself, or that you are a failure,or that you have let yourself or your family down",
"type": "control",
"id": "feelingBad",
"questionOptions": {
"concept": "",
"rendering": "radio",
"answers": [
{
"concept": "163733AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Not at all"
},
{
"concept": "163734AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Several days "
},
{
"concept": "163735AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "More than half the days"
},
{
"concept": "163736AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Nearly every day"
}
]
}
},
{
"label": "7. Trouble concentrating on things (linked with patient usual activities,such as reading the newspaper or listening to a radio programme)",
"type": "control",
"id": "troubled",
"questionOptions": {
"concept": "",
"rendering": "radio",
"answers": [
{
"concept": "163733AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Not at all"
},
{
"concept": "163734AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Several days "
},
{
"concept": "163735AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "More than half the days"
},
{
"concept": "163736AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Nearly every day"
}
]
}
},
{
"label": "8. Moving or speaking so slowly that other people could have noticed.Or the opposite, being so fidgety or restless that you have been moving around a lot more than usual",
"type": "control",
"id": "speakingSlowly",
"questionOptions": {
"concept": "",
"rendering": "radio",
"answers": [
{
"concept": "163733AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Not at all"
},
{
"concept": "163734AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Several days "
},
{
"concept": "163735AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "More than half the days"
},
{
"concept": "163736AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Nearly every day"
}
]
}
},
{
"label": "9. Thoughts that you would be better off dead or of hurting yourself in some way",
"type": "control",
"id": "betterDead",
"questionOptions": {
"concept": "",
"rendering": "radio",
"answers": [
{
"concept": "163733AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Not at all"
},
{
"concept": "163734AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Several days "
},
{
"concept": "163735AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "More than half the days"
},
{
"concept": "163736AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Nearly every day"
}
]
}
},
{
"label": "Anxiety score rating:",
"id": "anxietyScore",
"questionOptions": {
"concept": "",
"rendering": "text",
"calculate": {
"calculateExpression": "(String(noInterest) === '163734AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 1 : String(noInterest) === '163735AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 2 : String(noInterest) === '163736AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 3 : 0) + (String(depressed) === '163734AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 1 : String(depressed) === '163735AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 2 : String(depressed)==='163736AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 3 : 0) + (String(sleep) === '163734AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 1 : String(sleep) === '163735AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 2 : String(sleep) === '163736AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 3 : 0) + (String(feelingTired) === '163734AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 1 : String(feelingTired) === '163735AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 2 : String(feelingTired) === '163736AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 3 : 0) +(String(poorAppetite) === '163734AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 1 : String(poorAppetite) === '163735AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 2 : String(poorAppetite) === '163736AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 3 : 0) + (String(troubled) === '163734AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 1 : String(troubled) === '163735AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 2 : String(troubled) === '163736AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 3 : 0) + (String(feelingBad) === '163734AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 1 : String(feelingBad) === '163735AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 2 : String(feelingBad) === '163736AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 3 : 0) + (String(speakingSlowly) === '163734AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 1 : String(speakingSlowly) === '163735AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 2 : String(speakingSlowly) === '163736AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 3 : 0) + (String(betterDead) === '163734AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 1 : String(betterDead) === '163735AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 2 : String(betterDead) === '163736AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' ? 3 : 0)"
}
]
},
"type": "control",
"validators": [],
"hide": {
"hideWhenExpression": "isEmpty(myValue) || !isEmpty(myValue)"
}
}
]
},
Expand All @@ -147,27 +323,30 @@
"concept": "33bb96f8-e009-482a-ba68-212281780fb8",
"rendering": "select",
"answers": [
{
"concept": "126627AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Severe depression"
},
{
"concept": "134017AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Moderate severe depression"
},
{
"concept": "1115AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Depression unlikely"
},
{
"concept": "157790AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Mild depression"
},
{
"concept": "134011AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Moderate depression"
},
{
"concept": "157790AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Mild depression"
"concept": "134017AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Moderate severe depression"
},
{
"concept": "126627AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"label": "Severe depression"
}
]
],
"calculate": {
"calculateExpression": "(!isEmpty(noInterest) || !isEmpty(depressed) || !isEmpty(speakingSlowly) || !isEmpty(betterDead) || !isEmpty(sleep) || !isEmpty(feelingTired) || !isEmpty(poorAppetite)|| !isEmpty(troubled)|| !isEmpty(feelingBad) ) && parseInt(anxietyScore) < 5 ? '1115AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' : ( parseInt(anxietyScore) > 4 && parseInt(anxietyScore) < 10 ) ? '157790AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' : ( parseInt(anxietyScore) > 9 && parseInt(anxietyScore) < 15 ) ? '134011AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA': ( parseInt(anxietyScore) > 14 && parseInt(anxietyScore) < 20 ) ? '134017AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA': parseInt(anxietyScore) >= 19 ? '126627AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' : ''"
}
}
}
]
Expand Down

0 comments on commit 4f2d5eb

Please sign in to comment.