Skip to content

Commit

Permalink
POC-522 (#1328)
Browse files Browse the repository at this point in the history
* Add query to generate line list with no intervention done on the defaulters list report

* Update line list query

* POC-522: Add column outreach follow-up to defaulter list

* Remove unwanted columns

---------

Co-authored-by: kantush <sainingo>
Co-authored-by: Drizzentic <[email protected]>
  • Loading branch information
sainingo and drizzentic authored Oct 5, 2023
1 parent 918352a commit 0cd7be6
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion app/reporting-framework/json-reports/defaulter-list-base.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@
"alias": "de",
"join": {
"type": "LEFT",
"joinCondition": "de.encounter_id = fd.encounter_id"
"joinCondition": "de.encounter_id = fd.encounter_id "
}
},
{
"table": "(SELECT MAX(am.encounter_datetime) AS max_encounter_datetime, am.encounter_datetime, am.encounter_type, am.patient_id, fd.person_id , fd.rtc_date FROM etl.flat_defaulters fd INNER JOIN amrs.encounter am on (am.patient_id = fd.person_id) WHERE am.encounter_type = 21 group by am.patient_id)",
"alias": "am",
"join": {
"type": "INNER",
"joinCondition": "am.patient_id = fd.person_id"
}
},
{
Expand Down Expand Up @@ -82,6 +90,14 @@
"type": "simple_column",
"alias": "rtc_date",
"column": "DATE_FORMAT(fd.rtc_date,'%Y-%m-%d')"
},
{
"type": "derived_column",
"alias": "outreach_follow_up",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "case when max_encounter_datetime >= fd.rtc_date then 'Yes' else 'No' end"
}
}
],
"filters": {
Expand Down

0 comments on commit 0cd7be6

Please sign in to comment.