From eed603de0cde63c5f3e5262f660c9db641fdcc28 Mon Sep 17 00:00:00 2001 From: njorocs Date: Wed, 14 Aug 2024 18:21:02 +0300 Subject: [PATCH] Reverted mat_results column --- omod/src/main/resources/sql/DDL.sql | 2 +- omod/src/main/resources/sql/DML.sql | 6 +++--- omod/src/main/resources/sql/DataTools.sql | 2 +- omod/src/main/resources/sql/Scheduled_Updates.sql | 8 ++++---- omod/src/main/resources/sql/dwapi/DDL.sql | 2 +- omod/src/main/resources/sql/dwapi/DML.sql | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/omod/src/main/resources/sql/DDL.sql b/omod/src/main/resources/sql/DDL.sql index 19313cbf..aa1a6ac9 100644 --- a/omod/src/main/resources/sql/DDL.sql +++ b/omod/src/main/resources/sql/DDL.sql @@ -2522,7 +2522,7 @@ CREATE TABLE kenyaemr_etl.etl_patient_program ( mental_health_referred VARCHAR(10), mental_health_text VARCHAR(255), mat_screened VARCHAR(10), --- mat_results VARCHAR(255), + mat_results VARCHAR(255), mat_treated VARCHAR(100), mat_referred VARCHAR(10), mat_text VARCHAR(255), diff --git a/omod/src/main/resources/sql/DML.sql b/omod/src/main/resources/sql/DML.sql index f4b2668e..b7c74404 100644 --- a/omod/src/main/resources/sql/DML.sql +++ b/omod/src/main/resources/sql/DML.sql @@ -5348,7 +5348,7 @@ CREATE PROCEDURE sp_populate_etl_client_trace() mental_health_referred, mental_health_text, mat_screened, --- mat_results, + mat_results, mat_treated, mat_referred, mat_text, @@ -5494,10 +5494,10 @@ CREATE PROCEDURE sp_populate_etl_client_trace() max(if(o.concept_id=165281,(case o.value_coded when 1065 THEN "Yes" when 1066 then "No" else "" end),null)) as mental_health_referred, max(if(o.concept_id=165282,o.value_text,null)) as mental_health_text, max(if(o.concept_id=166663,(case o.value_coded when 1065 then "Yes" when 1066 THEN "No" else "" end),null)) as mat_screened, --- max(if(o.concept_id=166664,(case o.value_coded when 703 then "Positive" when 664 THEN "Negative" else "" end),null)) as mat_results, + max(if(o.concept_id=166664,(case o.value_coded when 703 then "Positive" when 664 THEN "Negative" else "" end),null)) as mat_results, max(if(o.concept_id=165052,(case o.value_coded when 1065 then "Yes" when 1066 THEN "No" else "" end),null)) as mat_treated, max(if(o.concept_id=165093,(case o.value_coded when 1065 THEN "Yes" when 1066 then "No" else "" end),null)) as mat_referred, - max(if(o.concept_id=166637,o.value_text,null)) as mental_health_text, + max(if(o.concept_id=166637,o.value_text,null)) as mat_text, max(if(o.concept_id=165214,(case o.value_coded when 664 then "Negative" when 703 THEN "Positive" when 1067 then "Unknown" else "" end),null)) as hiv_self_rep_status, max(if(o.concept_id=165215,(case o.value_coded when 165216 then "Universal HTS" when 165217 THEN "Self-testing" when 1402 then "Never tested" else "" end),null)) as last_hiv_test_setting, max(if(o.concept_id=159382,(case o.value_coded when 1065 THEN "Yes" when 1066 then "No" else "" end),null)) as counselled_for_hiv, diff --git a/omod/src/main/resources/sql/DataTools.sql b/omod/src/main/resources/sql/DataTools.sql index fb39e18e..9eabf610 100644 --- a/omod/src/main/resources/sql/DataTools.sql +++ b/omod/src/main/resources/sql/DataTools.sql @@ -2371,7 +2371,7 @@ select mental_health_referred, mental_health_text, mat_screened, --- mat_results, + mat_results, mat_treated, mat_referred, mat_text, diff --git a/omod/src/main/resources/sql/Scheduled_Updates.sql b/omod/src/main/resources/sql/Scheduled_Updates.sql index b95ad2ae..218e5e0e 100644 --- a/omod/src/main/resources/sql/Scheduled_Updates.sql +++ b/omod/src/main/resources/sql/Scheduled_Updates.sql @@ -5472,7 +5472,7 @@ CREATE PROCEDURE sp_update_etl_kp_clinical_visit(IN last_update_time DATETIME) mental_health_referred, mental_health_text, mat_screened, --- mat_results, + mat_results, mat_treated, mat_referred, mat_text, @@ -5618,10 +5618,10 @@ CREATE PROCEDURE sp_update_etl_kp_clinical_visit(IN last_update_time DATETIME) max(if(o.concept_id=165281,(case o.value_coded when 1065 THEN "Yes" when 1066 then "No" else "" end),null)) as mental_health_referred, max(if(o.concept_id=165282,o.value_text,null)) as mental_health_text, max(if(o.concept_id=166663,(case o.value_coded when 1065 then "Yes" when 1066 THEN "No" else "" end),null)) as mat_screened, --- max(if(o.concept_id=166664,(case o.value_coded when 703 then "Positive" when 664 THEN "Negative" else "" end),null)) as mat_results, + max(if(o.concept_id=166664,(case o.value_coded when 703 then "Positive" when 664 THEN "Negative" else "" end),null)) as mat_results, max(if(o.concept_id=165052,(case o.value_coded when 1065 then "Yes" when 1066 THEN "No" else "" end),null)) as mat_treated, max(if(o.concept_id=165093,(case o.value_coded when 1065 THEN "Yes" when 1066 then "No" else "" end),null)) as mat_referred, - max(if(o.concept_id=166637,o.value_text,null)) as mental_health_text, + max(if(o.concept_id=166637,o.value_text,null)) as mat_text, max(if(o.concept_id=165214,(case o.value_coded when 664 then "Negative" when 703 THEN "Positive" when 1067 then "Unknown" else "" end),null)) as hiv_self_rep_status, max(if(o.concept_id=165215,(case o.value_coded when 165216 then "Universal HTS" when 165217 THEN "Self-testing" when 1402 then "Never tested" else "" end),null)) as last_hiv_test_setting, max(if(o.concept_id=159382,(case o.value_coded when 1065 THEN "Yes" when 1066 then "No" else "" end),null)) as counselled_for_hiv, @@ -5772,7 +5772,7 @@ CREATE PROCEDURE sp_update_etl_kp_clinical_visit(IN last_update_time DATETIME) mental_health_referred=VALUES(mental_health_referred), mental_health_text=VALUES(mental_health_text), mat_screened=VALUES(mat_screened), --- mat_results=VALUES(mat_results), + mat_results=VALUES(mat_results), mat_treated=VALUES(mat_treated), mat_referred=VALUES(mat_referred), mat_text=VALUES(mat_text), diff --git a/omod/src/main/resources/sql/dwapi/DDL.sql b/omod/src/main/resources/sql/dwapi/DDL.sql index 86fb0a60..b227050b 100644 --- a/omod/src/main/resources/sql/dwapi/DDL.sql +++ b/omod/src/main/resources/sql/dwapi/DDL.sql @@ -2491,7 +2491,7 @@ CREATE TABLE dwapi_etl.etl_patient_program ( mental_health_referred VARCHAR(10), mental_health_text VARCHAR(255), mat_screened VARCHAR(10), --- mat_results VARCHAR(255), + mat_results VARCHAR(255), mat_treated VARCHAR(100), mat_referred VARCHAR(10), mat_text VARCHAR(255), diff --git a/omod/src/main/resources/sql/dwapi/DML.sql b/omod/src/main/resources/sql/dwapi/DML.sql index ebd99da5..872df336 100644 --- a/omod/src/main/resources/sql/dwapi/DML.sql +++ b/omod/src/main/resources/sql/dwapi/DML.sql @@ -5108,7 +5108,7 @@ CREATE PROCEDURE sp_populate_dwapi_client_trace() mental_health_referred, mental_health_text, mat_screened, --- mat_results, + mat_results, mat_treated, mat_referred, mat_text, @@ -5255,10 +5255,10 @@ CREATE PROCEDURE sp_populate_dwapi_client_trace() max(if(o.concept_id=165281,(case o.value_coded when 1065 THEN "Yes" when 1066 then "No" else "" end),null)) as mental_health_referred, max(if(o.concept_id=165282,o.value_text,null)) as mental_health_text, max(if(o.concept_id=166663,(case o.value_coded when 1065 then "Yes" when 1066 THEN "No" else "" end),null)) as mat_screened, --- max(if(o.concept_id=166664,(case o.value_coded when 703 then "Positive" when 664 THEN "Negative" else "" end),null)) as mat_results, + max(if(o.concept_id=166664,(case o.value_coded when 703 then "Positive" when 664 THEN "Negative" else "" end),null)) as mat_results, max(if(o.concept_id=165052,(case o.value_coded when 1065 then "Yes" when 1066 THEN "No" else "" end),null)) as mat_treated, max(if(o.concept_id=165093,(case o.value_coded when 1065 THEN "Yes" when 1066 then "No" else "" end),null)) as mat_referred, - max(if(o.concept_id=166637,o.value_text,null)) as mental_health_text, + max(if(o.concept_id=166637,o.value_text,null)) as mat_text, max(if(o.concept_id=165214,(case o.value_coded when 664 then "Negative" when 703 THEN "Positive" when 1067 then "Unknown" else "" end),null)) as hiv_self_rep_status, max(if(o.concept_id=165215,(case o.value_coded when 165216 then "Universal HTS" when 165217 THEN "Self-testing" when 1402 then "Never tested" else "" end),null)) as last_hiv_test_setting, max(if(o.concept_id=159382,(case o.value_coded when 1065 THEN "Yes" when 1066 then "No" else "" end),null)) as counselled_for_hiv,