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-563a #1362

Merged
merged 2 commits into from
Jan 19, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@
"joinCondition": "pre.person_id = ml.person_id and(DATEDIFF(ml.start_date, pre.encounter_datetime) <= 7)"
}
},
{
"table": "etl.sms_delivery_report",
"alias": "sm",
"join": {
"type": "LEFT",
"joinCondition": "sm.person_id = pre.person_id"
}
},
{
"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",
Expand All @@ -64,6 +72,14 @@
"type": "LEFT",
"joinCondition": "ml.person_id = etc.person_id"
}
},
{
"table": "(SELECT ps.* FROM etl.pre_appointment_summary ps JOIN ( SELECT MAX(encounter_datetime) AS max_encounter_datetime, person_id FROM etl.pre_appointment_summary GROUP BY person_id ) latest_dates ON ps.encounter_datetime = latest_dates.max_encounter_datetime AND ps.person_id = latest_dates.person_id)",
"alias": "utd",
"join": {
"type": "LEFT",
"joinCondition": "ml.person_id = utd.person_id"
}
}
],
"columns": [
Expand Down Expand Up @@ -112,6 +128,11 @@
"alias": "prediction_generated_date",
"column": "DATE_FORMAT(ml.prediction_generated_date,'%Y-%m-%d')"
},
{
"type": "simple_column",
"alias": "sms_delivery_status",
"column": "sm.delivery_status"
},
{
"type": "simple_column",
"alias": "rtc_date",
Expand Down Expand Up @@ -157,6 +178,11 @@
"alias": "was_client_found",
"column": "pre.was_client_found"
},
{
"type": "simple_column",
"alias": "comments",
"column": "utd.comments"
},
{
"type": "simple_column",
"alias": "reason_client_not_found",
Expand All @@ -179,11 +205,6 @@
"type": "simple_column",
"alias": "number_of_failed_phone_attempts",
"column": "etc.counter"
},
{
"type": "simple_column",
"alias": "comments",
"column": "pre.comments"
}
],
"filters": {
Expand Down
Loading