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

POC-522 #1328

Merged
merged 5 commits into from
Oct 5, 2023
Merged

POC-522 #1328

Changes from all 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
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
Loading