Skip to content

Commit

Permalink
Merge pull request #475 from njorocs/clinical-visit-etl
Browse files Browse the repository at this point in the history
Reverted mat_results column
  • Loading branch information
patryllus authored Aug 14, 2024
2 parents ee641c3 + eed603d commit e90103e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion omod/src/main/resources/sql/DDL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions omod/src/main/resources/sql/DML.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion omod/src/main/resources/sql/DataTools.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2371,7 +2371,7 @@ select
mental_health_referred,
mental_health_text,
mat_screened,
-- mat_results,
mat_results,
mat_treated,
mat_referred,
mat_text,
Expand Down
8 changes: 4 additions & 4 deletions omod/src/main/resources/sql/Scheduled_Updates.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion omod/src/main/resources/sql/dwapi/DDL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions omod/src/main/resources/sql/dwapi/DML.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit e90103e

Please sign in to comment.