Skip to content

Commit

Permalink
POC-584a (#1343)
Browse files Browse the repository at this point in the history
* display patient intervention status based on latest pre-follow-up form

* pre.encounter

---------

Co-authored-by: Drizzentic <[email protected]>
  • Loading branch information
Angie-540 and drizzentic authored Nov 15, 2023
1 parent 90ed1b3 commit 135ff2f
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,16 @@
"alias": "pre",
"join": {
"type": "LEFT",
"joinCondition": "pre.person_id = ml.person_id"
"joinCondition": "pre.person_id = ml.person_id and(DATEDIFF(ml.start_date, pre.encounter_datetime) <= 7)"
}
},

{
"table": "( select max(is_successful_phone_follow_up) as latest_phone_follow_up, person_id, follow_up_type from etl.pre_appointment_summary group by person_id )",
"alias": "s",
"join": {
"type": "LEFT",
"joinCondition": "pre.person_id = s.person_id"
}
}
],
Expand Down Expand Up @@ -180,12 +189,12 @@
},
{
"filterType": "tableColumns",
"conditionExpression": "(if((pre.is_successful_phone_follow_up = 'YES' OR (pre.attempted_home_visit = 'YES' AND pre.was_client_found = 'YES')), 1, 0)) = ?",
"conditionExpression": "(if((latest_phone_follow_up = 'YES' OR (pre.attempted_home_visit = 'YES' AND pre.was_client_found = 'YES')), 1, 0)) = ?",
"parameterName": "successfulOutcome"
},
{
"filterType": "tableColumns",
"conditionExpression": "(if((pre.is_successful_phone_follow_up = 'NO' OR (pre.attempted_home_visit = 'YES' AND pre.was_client_found = 'NO')), 1, 0)) = ?",
"conditionExpression": "(if((latest_phone_follow_up = 'NO' OR (pre.attempted_home_visit = 'YES' AND pre.was_client_found = 'NO')), 1, 0)) = ?",
"parameterName": "failedOutcome"
},
{
Expand Down

0 comments on commit 135ff2f

Please sign in to comment.