From 9d5fa3c5ab3d2fe2cdb3bccb2f4be32af66b2184 Mon Sep 17 00:00:00 2001 From: Angie-540 Date: Fri, 12 Jan 2024 16:28:44 +0300 Subject: [PATCH] added sms outcome column --- .../ml-predictions/ml-weekly-predictions-base.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/reporting-framework/json-reports/ml-predictions/ml-weekly-predictions-base.json b/app/reporting-framework/json-reports/ml-predictions/ml-weekly-predictions-base.json index 39d5293e8..89b9728a2 100644 --- a/app/reporting-framework/json-reports/ml-predictions/ml-weekly-predictions-base.json +++ b/app/reporting-framework/json-reports/ml-predictions/ml-weekly-predictions-base.json @@ -64,6 +64,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": [ @@ -157,6 +165,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",