From 9b622ab4ae3a2b1730769435697810847a811f99 Mon Sep 17 00:00:00 2001 From: henrykorir Date: Mon, 5 Feb 2024 11:02:08 +0300 Subject: [PATCH] POC-544-v2: Added Prettier Complience --- app/reporting-framework/base-mysql.report.js | 8 +- .../cardiovascular-disease/cvd-aggregate.json | 3 +- .../cardiovascular-disease/cvd-base.json | 3 +- .../anxiety-aggregate.json | 183 +++--- .../mental-health-disorder/anxiety-base.json | 293 +++++---- .../bipolar-and-related-mh-aggregate.json | 183 +++--- .../bipolar-and-related-mh-base.json | 317 +++++----- .../depressive-aggregate.json | 183 +++--- .../feeding-and-eating-mh-aggregate.json | 183 +++--- .../feeding-and-eating-mh-base.json | 317 +++++----- .../general-mental-disorder-aggregate.json | 183 +++--- .../general-mental-disorder-base.json | 317 +++++----- .../mental-health-disorder/mh-aggregate.json | 577 +++++++++--------- .../mental-health-disorder/mh-base.json | 2 +- .../mental-health-disorder/ocd-aggregate.json | 183 +++--- .../mental-health-disorder/ocd-base.json | 317 +++++----- .../personality-mh-aggregate.json | 183 +++--- .../personality-mh-base.json | 317 +++++----- .../status-sub-total-aggregate.json | 143 +++-- .../status-sub-total-base.json | 253 ++++---- .../total-mh-aggregate.json | 133 ++-- .../mental-health-disorder/total-mh-base.json | 237 ++++--- .../neurological-disease/neuro-aggregate.json | 337 +++++----- .../neurological-disease/neuro-base.json | 557 +++++++++-------- .../rheumatologic-disease/rheu-aggregate.json | 465 +++++++------- .../rheumatologic-disease/rheu-base.json | 559 +++++++++-------- app/routes/plhiv-ncd-v2-report.route.js | 2 +- .../plhiv-ncd-v2-summary.service.js | 1 - 28 files changed, 3205 insertions(+), 3234 deletions(-) diff --git a/app/reporting-framework/base-mysql.report.js b/app/reporting-framework/base-mysql.report.js index 20de90568..f48052933 100755 --- a/app/reporting-framework/base-mysql.report.js +++ b/app/reporting-framework/base-mysql.report.js @@ -1912,9 +1912,7 @@ export class BaseMysqlReport { case 'genMDPlhivAggregate': resolve({ main: this.cloneJsonSchema(genMD_plhiv_aggregate), - genMDPlhivBase: this.cloneJsonSchema( - genMD_plhiv_base - ) + genMDPlhivBase: this.cloneJsonSchema(genMD_plhiv_base) }); break; case 'stMDPlhivAggregate': @@ -1926,9 +1924,7 @@ export class BaseMysqlReport { case 'totMDPlhivAggregate': resolve({ main: this.cloneJsonSchema(totMD_plhiv_aggregate), - totMDPlhivBase: this.cloneJsonSchema( - totMD_plhiv_base - ) + totMDPlhivBase: this.cloneJsonSchema(totMD_plhiv_base) }); break; case 'cvdPlhivAggregate': diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/cardiovascular-disease/cvd-aggregate.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/cardiovascular-disease/cvd-aggregate.json index 1f36a3f86..799765588 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/cardiovascular-disease/cvd-aggregate.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/cardiovascular-disease/cvd-aggregate.json @@ -159,9 +159,8 @@ "expressionOptions": { "expression": "sum(b.sub_tot_nw_cvd)" } - } + }, - , { "type": "derived_column", "alias": "sub_tot_ct_cvd_m", diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/cardiovascular-disease/cvd-base.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/cardiovascular-disease/cvd-base.json index 56a2a0af5..28d86a6e7 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/cardiovascular-disease/cvd-base.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/cardiovascular-disease/cvd-base.json @@ -194,9 +194,8 @@ "expressionOptions": { "expression": "IF(((nmrd.gender = 'F' OR nmrd.gender = 'M') AND nmrd.has_cvd = 1 AND hmrd.started_art_this_month = 1), 1, 0)" } - } + }, - , { "type": "derived_column", "alias": "sub_tot_ct_cvd_m", diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/anxiety-aggregate.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/anxiety-aggregate.json index 0c8078dc0..28064dc3b 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/anxiety-aggregate.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/anxiety-aggregate.json @@ -1,100 +1,99 @@ { - "name": "anxPlhivAggregate", - "version": "1.0", - "tag": "", - "description": "", - "uses": [ - { - "name": "anxPlhivBase", - "version": "1.0", - "type": "dataset_def" - } - ], - "sources": [ - { - "dataSet": "anxPlhivBase", - "alias": "b" - } - ], - "columns": [ - { - "type": "derived_column", - "alias": "join_location", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "1" - } - }, - { - "type": "simple_column", - "alias": "location_id", - "column": "b.location_id" - }, - { - "type": "simple_column", - "alias": "location_uuid", - "column": "b.location_uuid" - }, - { - "type": "simple_column", - "alias": "location", - "column": "b.location" - }, - { - "type": "simple_column", - "alias": "nw_anx_mh_f", - "column": "sum(b.nw_anx_mh_f)" - }, - { - "type": "simple_column", - "alias": "nw_anx_mh_m", - "column": "sum(b.nw_anx_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_nw_anx_mh", - "column": "sum(b.tot_nw_anx_mh)" - }, - { - "type": "simple_column", - "alias": "ct_anx_mh_f", - "column": "sum(b.ct_anx_mh_f)" - }, - { - "type": "simple_column", - "alias": "ct_anx_mh_m", - "column": "sum(b.ct_anx_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_ct_anx_mh", - "column": "sum(b.tot_ct_anx_mh)" + "name": "anxPlhivAggregate", + "version": "1.0", + "tag": "", + "description": "", + "uses": [ + { + "name": "anxPlhivBase", + "version": "1.0", + "type": "dataset_def" + } + ], + "sources": [ + { + "dataSet": "anxPlhivBase", + "alias": "b" + } + ], + "columns": [ + { + "type": "derived_column", + "alias": "join_location", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "1" } - ], - "groupBy": { - "groupParam": "groupByParam", - "columns": ["b.location_id"], - "excludeParam": "excludeParam" }, - "transFormDirectives": { - "joinColumn": "location_id", - "joinColumnParam": "", - "skipColumns": [""], - "disaggregationColumns": [] + { + "type": "simple_column", + "alias": "location_id", + "column": "b.location_id" + }, + { + "type": "simple_column", + "alias": "location_uuid", + "column": "b.location_uuid" + }, + { + "type": "simple_column", + "alias": "location", + "column": "b.location" }, - "dynamicJsonQueryGenerationDirectives": { - "patientListGenerator": { - "useTemplate": "patient-list-with-contacts-template", - "useTemplateVersion": "1.0", - "generatingDirectives": { - "joinDirectives": { - "joinType": "INNER", - "joinCondition": "<> = <>", - "baseColumn": "person_id", - "templateColumn": "person_id" - } + { + "type": "simple_column", + "alias": "nw_anx_mh_f", + "column": "sum(b.nw_anx_mh_f)" + }, + { + "type": "simple_column", + "alias": "nw_anx_mh_m", + "column": "sum(b.nw_anx_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_nw_anx_mh", + "column": "sum(b.tot_nw_anx_mh)" + }, + { + "type": "simple_column", + "alias": "ct_anx_mh_f", + "column": "sum(b.ct_anx_mh_f)" + }, + { + "type": "simple_column", + "alias": "ct_anx_mh_m", + "column": "sum(b.ct_anx_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_ct_anx_mh", + "column": "sum(b.tot_ct_anx_mh)" + } + ], + "groupBy": { + "groupParam": "groupByParam", + "columns": ["b.location_id"], + "excludeParam": "excludeParam" + }, + "transFormDirectives": { + "joinColumn": "location_id", + "joinColumnParam": "", + "skipColumns": [""], + "disaggregationColumns": [] + }, + "dynamicJsonQueryGenerationDirectives": { + "patientListGenerator": { + "useTemplate": "patient-list-with-contacts-template", + "useTemplateVersion": "1.0", + "generatingDirectives": { + "joinDirectives": { + "joinType": "INNER", + "joinCondition": "<> = <>", + "baseColumn": "person_id", + "templateColumn": "person_id" } } } } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/anxiety-base.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/anxiety-base.json index ea637dbb4..ae0775dfa 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/anxiety-base.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/anxiety-base.json @@ -1,141 +1,141 @@ { - "name": "anxPlhivBase", - "version": "1.0", - "tag": "", - "description": "", - "uses": [], - "sources": [ - { - "table": "etl.ncd_monthly_report_dataset", - "alias": "nmrd" - }, - { - "table": "etl.hiv_monthly_report_dataset_v1_2", - "alias": "hmrd", - "join": { - "type": "INNER", - "joinCondition": "nmrd.person_id = hmrd.person_id AND hmrd.status = 'active'" - } - }, - { - "table": "etl.flat_patient_identifiers_v1", - "alias": "fi", - "join": { - "type": "LEFT", - "joinCondition": "nmrd.person_id = fi.patient_id" - } - }, - { - "table": "amrs.location", - "alias": "l", - "join": { - "type": "INNER", - "joinCondition": "nmrd.location_id = l.location_id" - } - }, - { - "table": "amrs.person", - "alias": "per", - "join": { - "type": "INNER", - "joinCondition": "nmrd.person_id = per.person_id" - } + "name": "anxPlhivBase", + "version": "1.0", + "tag": "", + "description": "", + "uses": [], + "sources": [ + { + "table": "etl.ncd_monthly_report_dataset", + "alias": "nmrd" + }, + { + "table": "etl.hiv_monthly_report_dataset_v1_2", + "alias": "hmrd", + "join": { + "type": "INNER", + "joinCondition": "nmrd.person_id = hmrd.person_id AND hmrd.status = 'active'" } - ], - "columns": [ - { - "type": "simple_column", - "alias": "location_uuid", - "column": "nmrd.location_uuid" - }, - { - "type": "simple_column", - "alias": "person_id", - "column": "nmrd.person_id" - }, - { - "type": "simple_column", - "alias": "ccc_number", - "column": "fi.ccc" - }, - { - "type": "simple_column", - "alias": "ovcid_id", - "column": "fi.ovcid" - }, - { - "type": "simple_column", - "alias": "upi_number", - "column": "fi.nupi" - }, - { - "type": "simple_column", - "alias": "age", - "column": "nmrd.age" - }, - { - "type": "simple_column", - "alias": "location_id", - "column": "nmrd.location_id" - }, - { - "type": "simple_column", - "alias": "location", - "column": "nmrd.clinic" - }, - { - "type": "derived_column", - "alias": "nw_anx_mh_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.is_anxiety_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "nw_anx_mh_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.is_anxiety_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "tot_nw_anx_mh", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.is_anxiety_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "ct_anx_mh_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.is_anxiety_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "ct_anx_mh_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.is_anxiety_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "tot_ct_anx_mh", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.is_anxiety_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + }, + { + "table": "etl.flat_patient_identifiers_v1", + "alias": "fi", + "join": { + "type": "LEFT", + "joinCondition": "nmrd.person_id = fi.patient_id" } - ], - "filters": { - "conditionJoinOperator": "and", - "conditions": [ - { + }, + { + "table": "amrs.location", + "alias": "l", + "join": { + "type": "INNER", + "joinCondition": "nmrd.location_id = l.location_id" + } + }, + { + "table": "amrs.person", + "alias": "per", + "join": { + "type": "INNER", + "joinCondition": "nmrd.person_id = per.person_id" + } + } + ], + "columns": [ + { + "type": "simple_column", + "alias": "location_uuid", + "column": "nmrd.location_uuid" + }, + { + "type": "simple_column", + "alias": "person_id", + "column": "nmrd.person_id" + }, + { + "type": "simple_column", + "alias": "ccc_number", + "column": "fi.ccc" + }, + { + "type": "simple_column", + "alias": "ovcid_id", + "column": "fi.ovcid" + }, + { + "type": "simple_column", + "alias": "upi_number", + "column": "fi.nupi" + }, + { + "type": "simple_column", + "alias": "age", + "column": "nmrd.age" + }, + { + "type": "simple_column", + "alias": "location_id", + "column": "nmrd.location_id" + }, + { + "type": "simple_column", + "alias": "location", + "column": "nmrd.clinic" + }, + { + "type": "derived_column", + "alias": "nw_anx_mh_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.is_anxiety_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "nw_anx_mh_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.is_anxiety_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_nw_anx_mh", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.is_anxiety_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "ct_anx_mh_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.is_anxiety_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "ct_anx_mh_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.is_anxiety_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_ct_anx_mh", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.is_anxiety_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + } + ], + "filters": { + "conditionJoinOperator": "and", + "conditions": [ + { "filterType": "tableColumns", "conditionExpression": "nmrd.location_id in ?", "parameterName": "locations" @@ -155,16 +155,15 @@ "conditionExpression": "nmrd.visit_this_month in ?", "parameterName": "visitState" } - ] - }, - "groupBy": { - "groupParam": "groupByParam", - "columns": ["nmrd.person_id"], - "excludeParam": "excludeParam" - }, - "paging": { - "offSetParam": "offSetParam", - "limitParam": "limitParam" - } + ] + }, + "groupBy": { + "groupParam": "groupByParam", + "columns": ["nmrd.person_id"], + "excludeParam": "excludeParam" + }, + "paging": { + "offSetParam": "offSetParam", + "limitParam": "limitParam" } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/bipolar-and-related-mh-aggregate.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/bipolar-and-related-mh-aggregate.json index 80d937b9a..fae4706ae 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/bipolar-and-related-mh-aggregate.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/bipolar-and-related-mh-aggregate.json @@ -1,100 +1,99 @@ { - "name": "bipPlhivAggregate", - "version": "1.0", - "tag": "", - "description": "", - "uses": [ - { - "name": "bipPlhivBase", - "version": "1.0", - "type": "dataset_def" - } - ], - "sources": [ - { - "dataSet": "bipPlhivBase", - "alias": "b" - } - ], - "columns": [ - { - "type": "derived_column", - "alias": "join_location", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "1" - } - }, - { - "type": "simple_column", - "alias": "location_id", - "column": "b.location_id" - }, - { - "type": "simple_column", - "alias": "location_uuid", - "column": "b.location_uuid" - }, - { - "type": "simple_column", - "alias": "location", - "column": "b.location" - }, - { - "type": "simple_column", - "alias": "nw_bip_mh_f", - "column": "sum(b.nw_bip_mh_f)" - }, - { - "type": "simple_column", - "alias": "nw_bip_mh_m", - "column": "sum(b.nw_bip_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_nw_bip_mh", - "column": "sum(b.tot_nw_bip_mh)" - }, - { - "type": "simple_column", - "alias": "ct_bip_mh_f", - "column": "sum(b.ct_bip_mh_f)" - }, - { - "type": "simple_column", - "alias": "ct_bip_mh_m", - "column": "sum(b.ct_bip_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_ct_bip_mh", - "column": "sum(b.tot_ct_bip_mh)" + "name": "bipPlhivAggregate", + "version": "1.0", + "tag": "", + "description": "", + "uses": [ + { + "name": "bipPlhivBase", + "version": "1.0", + "type": "dataset_def" + } + ], + "sources": [ + { + "dataSet": "bipPlhivBase", + "alias": "b" + } + ], + "columns": [ + { + "type": "derived_column", + "alias": "join_location", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "1" } - ], - "groupBy": { - "groupParam": "groupByParam", - "columns": ["b.location_id"], - "excludeParam": "excludeParam" }, - "transFormDirectives": { - "joinColumn": "location_id", - "joinColumnParam": "", - "skipColumns": [""], - "disaggregationColumns": [] + { + "type": "simple_column", + "alias": "location_id", + "column": "b.location_id" + }, + { + "type": "simple_column", + "alias": "location_uuid", + "column": "b.location_uuid" + }, + { + "type": "simple_column", + "alias": "location", + "column": "b.location" }, - "dynamicJsonQueryGenerationDirectives": { - "patientListGenerator": { - "useTemplate": "patient-list-with-contacts-template", - "useTemplateVersion": "1.0", - "generatingDirectives": { - "joinDirectives": { - "joinType": "INNER", - "joinCondition": "<> = <>", - "baseColumn": "person_id", - "templateColumn": "person_id" - } + { + "type": "simple_column", + "alias": "nw_bip_mh_f", + "column": "sum(b.nw_bip_mh_f)" + }, + { + "type": "simple_column", + "alias": "nw_bip_mh_m", + "column": "sum(b.nw_bip_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_nw_bip_mh", + "column": "sum(b.tot_nw_bip_mh)" + }, + { + "type": "simple_column", + "alias": "ct_bip_mh_f", + "column": "sum(b.ct_bip_mh_f)" + }, + { + "type": "simple_column", + "alias": "ct_bip_mh_m", + "column": "sum(b.ct_bip_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_ct_bip_mh", + "column": "sum(b.tot_ct_bip_mh)" + } + ], + "groupBy": { + "groupParam": "groupByParam", + "columns": ["b.location_id"], + "excludeParam": "excludeParam" + }, + "transFormDirectives": { + "joinColumn": "location_id", + "joinColumnParam": "", + "skipColumns": [""], + "disaggregationColumns": [] + }, + "dynamicJsonQueryGenerationDirectives": { + "patientListGenerator": { + "useTemplate": "patient-list-with-contacts-template", + "useTemplateVersion": "1.0", + "generatingDirectives": { + "joinDirectives": { + "joinType": "INNER", + "joinCondition": "<> = <>", + "baseColumn": "person_id", + "templateColumn": "person_id" } } } } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/bipolar-and-related-mh-base.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/bipolar-and-related-mh-base.json index 6f08b9bef..08b976a95 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/bipolar-and-related-mh-base.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/bipolar-and-related-mh-base.json @@ -1,170 +1,169 @@ { - "name": "bipPlhivBase", - "version": "1.0", - "tag": "", - "description": "", - "uses": [], - "sources": [ - { - "table": "etl.ncd_monthly_report_dataset", - "alias": "nmrd" - }, - { - "table": "etl.hiv_monthly_report_dataset_v1_2", - "alias": "hmrd", - "join": { - "type": "INNER", - "joinCondition": "nmrd.person_id = hmrd.person_id AND hmrd.status = 'active'" - } - }, - { - "table": "etl.flat_patient_identifiers_v1", - "alias": "fi", - "join": { - "type": "LEFT", - "joinCondition": "nmrd.person_id = fi.patient_id" - } - }, - { - "table": "amrs.location", - "alias": "l", - "join": { - "type": "INNER", - "joinCondition": "nmrd.location_id = l.location_id" - } - }, - { - "table": "amrs.person", - "alias": "per", - "join": { - "type": "INNER", - "joinCondition": "nmrd.person_id = per.person_id" - } + "name": "bipPlhivBase", + "version": "1.0", + "tag": "", + "description": "", + "uses": [], + "sources": [ + { + "table": "etl.ncd_monthly_report_dataset", + "alias": "nmrd" + }, + { + "table": "etl.hiv_monthly_report_dataset_v1_2", + "alias": "hmrd", + "join": { + "type": "INNER", + "joinCondition": "nmrd.person_id = hmrd.person_id AND hmrd.status = 'active'" } - ], - "columns": [ - { - "type": "simple_column", - "alias": "location_uuid", - "column": "nmrd.location_uuid" - }, - { - "type": "simple_column", - "alias": "person_id", - "column": "nmrd.person_id" - }, - { - "type": "simple_column", - "alias": "ccc_number", - "column": "fi.ccc" - }, - { - "type": "simple_column", - "alias": "ovcid_id", - "column": "fi.ovcid" - }, - { - "type": "simple_column", - "alias": "upi_number", - "column": "fi.nupi" - }, - { - "type": "simple_column", - "alias": "age", - "column": "nmrd.age" - }, - { - "type": "simple_column", - "alias": "location_id", - "column": "nmrd.location_id" - }, - { - "type": "simple_column", - "alias": "location", - "column": "nmrd.clinic" - }, - { - "type": "derived_column", - "alias": "nw_bip_mh_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.is_bipolar_and_related_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "nw_bip_mh_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.is_bipolar_and_related_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } - }, + }, + { + "table": "etl.flat_patient_identifiers_v1", + "alias": "fi", + "join": { + "type": "LEFT", + "joinCondition": "nmrd.person_id = fi.patient_id" + } + }, + { + "table": "amrs.location", + "alias": "l", + "join": { + "type": "INNER", + "joinCondition": "nmrd.location_id = l.location_id" + } + }, + { + "table": "amrs.person", + "alias": "per", + "join": { + "type": "INNER", + "joinCondition": "nmrd.person_id = per.person_id" + } + } + ], + "columns": [ + { + "type": "simple_column", + "alias": "location_uuid", + "column": "nmrd.location_uuid" + }, + { + "type": "simple_column", + "alias": "person_id", + "column": "nmrd.person_id" + }, + { + "type": "simple_column", + "alias": "ccc_number", + "column": "fi.ccc" + }, + { + "type": "simple_column", + "alias": "ovcid_id", + "column": "fi.ovcid" + }, + { + "type": "simple_column", + "alias": "upi_number", + "column": "fi.nupi" + }, + { + "type": "simple_column", + "alias": "age", + "column": "nmrd.age" + }, + { + "type": "simple_column", + "alias": "location_id", + "column": "nmrd.location_id" + }, + { + "type": "simple_column", + "alias": "location", + "column": "nmrd.clinic" + }, + { + "type": "derived_column", + "alias": "nw_bip_mh_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.is_bipolar_and_related_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "nw_bip_mh_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.is_bipolar_and_related_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_nw_bip_mh", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.is_bipolar_and_related_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "ct_bip_mh_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.is_bipolar_and_related_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "ct_bip_mh_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.is_bipolar_and_related_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_ct_bip_mh", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.is_bipolar_and_related_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + } + ], + "filters": { + "conditionJoinOperator": "and", + "conditions": [ { - "type": "derived_column", - "alias": "tot_nw_bip_mh", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.is_bipolar_and_related_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.location_id in ?", + "parameterName": "locations" }, { - "type": "derived_column", - "alias": "ct_bip_mh_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.is_bipolar_and_related_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.endDate >= ?", + "parameterName": "startDate" }, { - "type": "derived_column", - "alias": "ct_bip_mh_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.is_bipolar_and_related_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.endDate <= ?", + "parameterName": "endDate" }, { - "type": "derived_column", - "alias": "tot_ct_bip_mh", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.is_bipolar_and_related_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.visit_this_month in ?", + "parameterName": "visitState" } - ], - "filters": { - "conditionJoinOperator": "and", - "conditions": [ - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.location_id in ?", - "parameterName": "locations" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.endDate >= ?", - "parameterName": "startDate" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.endDate <= ?", - "parameterName": "endDate" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.visit_this_month in ?", - "parameterName": "visitState" - } - ] - }, - "groupBy": { - "groupParam": "groupByParam", - "columns": ["nmrd.person_id"], - "excludeParam": "excludeParam" - }, - "paging": { - "offSetParam": "offSetParam", - "limitParam": "limitParam" - } + ] + }, + "groupBy": { + "groupParam": "groupByParam", + "columns": ["nmrd.person_id"], + "excludeParam": "excludeParam" + }, + "paging": { + "offSetParam": "offSetParam", + "limitParam": "limitParam" } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/depressive-aggregate.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/depressive-aggregate.json index 9590c2ec0..c6774d71c 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/depressive-aggregate.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/depressive-aggregate.json @@ -1,100 +1,99 @@ { - "name": "depPlhivAggregate", - "version": "1.0", - "tag": "", - "description": "", - "uses": [ - { - "name": "depPlhivBase", - "version": "1.0", - "type": "dataset_def" - } - ], - "sources": [ - { - "dataSet": "depPlhivBase", - "alias": "b" - } - ], - "columns": [ - { - "type": "derived_column", - "alias": "join_location", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "1" - } - }, - { - "type": "simple_column", - "alias": "location_id", - "column": "b.location_id" - }, - { - "type": "simple_column", - "alias": "location_uuid", - "column": "b.location_uuid" - }, - { - "type": "simple_column", - "alias": "location", - "column": "b.location" - }, - { - "type": "simple_column", - "alias": "nw_dp_mh_f", - "column": "sum(b.nw_dp_mh_f)" - }, - { - "type": "simple_column", - "alias": "nw_dp_mh_m", - "column": "sum(b.nw_dp_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_nw_dp_mh", - "column": "sum(b.tot_nw_dp_mh)" - }, - { - "type": "simple_column", - "alias": "ct_dp_mh_f", - "column": "sum(b.ct_dp_mh_f)" - }, - { - "type": "simple_column", - "alias": "ct_dp_mh_m", - "column": "sum(b.ct_dp_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_ct_dp_mh", - "column": "sum(b.tot_ct_dp_mh)" + "name": "depPlhivAggregate", + "version": "1.0", + "tag": "", + "description": "", + "uses": [ + { + "name": "depPlhivBase", + "version": "1.0", + "type": "dataset_def" + } + ], + "sources": [ + { + "dataSet": "depPlhivBase", + "alias": "b" + } + ], + "columns": [ + { + "type": "derived_column", + "alias": "join_location", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "1" } - ], - "groupBy": { - "groupParam": "groupByParam", - "columns": ["b.location_id"], - "excludeParam": "excludeParam" }, - "transFormDirectives": { - "joinColumn": "location_id", - "joinColumnParam": "", - "skipColumns": [""], - "disaggregationColumns": [] + { + "type": "simple_column", + "alias": "location_id", + "column": "b.location_id" + }, + { + "type": "simple_column", + "alias": "location_uuid", + "column": "b.location_uuid" + }, + { + "type": "simple_column", + "alias": "location", + "column": "b.location" }, - "dynamicJsonQueryGenerationDirectives": { - "patientListGenerator": { - "useTemplate": "patient-list-with-contacts-template", - "useTemplateVersion": "1.0", - "generatingDirectives": { - "joinDirectives": { - "joinType": "INNER", - "joinCondition": "<> = <>", - "baseColumn": "person_id", - "templateColumn": "person_id" - } + { + "type": "simple_column", + "alias": "nw_dp_mh_f", + "column": "sum(b.nw_dp_mh_f)" + }, + { + "type": "simple_column", + "alias": "nw_dp_mh_m", + "column": "sum(b.nw_dp_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_nw_dp_mh", + "column": "sum(b.tot_nw_dp_mh)" + }, + { + "type": "simple_column", + "alias": "ct_dp_mh_f", + "column": "sum(b.ct_dp_mh_f)" + }, + { + "type": "simple_column", + "alias": "ct_dp_mh_m", + "column": "sum(b.ct_dp_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_ct_dp_mh", + "column": "sum(b.tot_ct_dp_mh)" + } + ], + "groupBy": { + "groupParam": "groupByParam", + "columns": ["b.location_id"], + "excludeParam": "excludeParam" + }, + "transFormDirectives": { + "joinColumn": "location_id", + "joinColumnParam": "", + "skipColumns": [""], + "disaggregationColumns": [] + }, + "dynamicJsonQueryGenerationDirectives": { + "patientListGenerator": { + "useTemplate": "patient-list-with-contacts-template", + "useTemplateVersion": "1.0", + "generatingDirectives": { + "joinDirectives": { + "joinType": "INNER", + "joinCondition": "<> = <>", + "baseColumn": "person_id", + "templateColumn": "person_id" } } } } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/feeding-and-eating-mh-aggregate.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/feeding-and-eating-mh-aggregate.json index 460034298..cd0f31b6c 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/feeding-and-eating-mh-aggregate.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/feeding-and-eating-mh-aggregate.json @@ -1,100 +1,99 @@ { - "name": "fedPlhivAggregate", - "version": "1.0", - "tag": "", - "description": "", - "uses": [ - { - "name": "fedPlhivBase", - "version": "1.0", - "type": "dataset_def" - } - ], - "sources": [ - { - "dataSet": "fedPlhivBase", - "alias": "b" - } - ], - "columns": [ - { - "type": "derived_column", - "alias": "join_location", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "1" - } - }, - { - "type": "simple_column", - "alias": "location_id", - "column": "b.location_id" - }, - { - "type": "simple_column", - "alias": "location_uuid", - "column": "b.location_uuid" - }, - { - "type": "simple_column", - "alias": "location", - "column": "b.location" - }, - { - "type": "simple_column", - "alias": "nw_fe_mh_f", - "column": "sum(b.nw_fe_mh_f)" - }, - { - "type": "simple_column", - "alias": "nw_fe_mh_m", - "column": "sum(b.nw_fe_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_nw_fe_mh", - "column": "sum(b.tot_nw_fe_mh)" - }, - { - "type": "simple_column", - "alias": "ct_fe_mh_f", - "column": "sum(b.ct_fe_mh_f)" - }, - { - "type": "simple_column", - "alias": "ct_fe_mh_m", - "column": "sum(b.ct_fe_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_ct_fe_mh", - "column": "sum(b.tot_ct_fe_mh)" + "name": "fedPlhivAggregate", + "version": "1.0", + "tag": "", + "description": "", + "uses": [ + { + "name": "fedPlhivBase", + "version": "1.0", + "type": "dataset_def" + } + ], + "sources": [ + { + "dataSet": "fedPlhivBase", + "alias": "b" + } + ], + "columns": [ + { + "type": "derived_column", + "alias": "join_location", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "1" } - ], - "groupBy": { - "groupParam": "groupByParam", - "columns": ["b.location_id"], - "excludeParam": "excludeParam" }, - "transFormDirectives": { - "joinColumn": "location_id", - "joinColumnParam": "", - "skipColumns": [""], - "disaggregationColumns": [] + { + "type": "simple_column", + "alias": "location_id", + "column": "b.location_id" + }, + { + "type": "simple_column", + "alias": "location_uuid", + "column": "b.location_uuid" + }, + { + "type": "simple_column", + "alias": "location", + "column": "b.location" }, - "dynamicJsonQueryGenerationDirectives": { - "patientListGenerator": { - "useTemplate": "patient-list-with-contacts-template", - "useTemplateVersion": "1.0", - "generatingDirectives": { - "joinDirectives": { - "joinType": "INNER", - "joinCondition": "<> = <>", - "baseColumn": "person_id", - "templateColumn": "person_id" - } + { + "type": "simple_column", + "alias": "nw_fe_mh_f", + "column": "sum(b.nw_fe_mh_f)" + }, + { + "type": "simple_column", + "alias": "nw_fe_mh_m", + "column": "sum(b.nw_fe_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_nw_fe_mh", + "column": "sum(b.tot_nw_fe_mh)" + }, + { + "type": "simple_column", + "alias": "ct_fe_mh_f", + "column": "sum(b.ct_fe_mh_f)" + }, + { + "type": "simple_column", + "alias": "ct_fe_mh_m", + "column": "sum(b.ct_fe_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_ct_fe_mh", + "column": "sum(b.tot_ct_fe_mh)" + } + ], + "groupBy": { + "groupParam": "groupByParam", + "columns": ["b.location_id"], + "excludeParam": "excludeParam" + }, + "transFormDirectives": { + "joinColumn": "location_id", + "joinColumnParam": "", + "skipColumns": [""], + "disaggregationColumns": [] + }, + "dynamicJsonQueryGenerationDirectives": { + "patientListGenerator": { + "useTemplate": "patient-list-with-contacts-template", + "useTemplateVersion": "1.0", + "generatingDirectives": { + "joinDirectives": { + "joinType": "INNER", + "joinCondition": "<> = <>", + "baseColumn": "person_id", + "templateColumn": "person_id" } } } } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/feeding-and-eating-mh-base.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/feeding-and-eating-mh-base.json index b892f6e9a..bbbd9bbed 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/feeding-and-eating-mh-base.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/feeding-and-eating-mh-base.json @@ -1,170 +1,169 @@ { - "name": "fedPlhivBase", - "version": "1.0", - "tag": "", - "description": "", - "uses": [], - "sources": [ - { - "table": "etl.ncd_monthly_report_dataset", - "alias": "nmrd" - }, - { - "table": "etl.hiv_monthly_report_dataset_v1_2", - "alias": "hmrd", - "join": { - "type": "INNER", - "joinCondition": "nmrd.person_id = hmrd.person_id AND hmrd.status = 'active'" - } - }, - { - "table": "etl.flat_patient_identifiers_v1", - "alias": "fi", - "join": { - "type": "LEFT", - "joinCondition": "nmrd.person_id = fi.patient_id" - } - }, - { - "table": "amrs.location", - "alias": "l", - "join": { - "type": "INNER", - "joinCondition": "nmrd.location_id = l.location_id" - } - }, - { - "table": "amrs.person", - "alias": "per", - "join": { - "type": "INNER", - "joinCondition": "nmrd.person_id = per.person_id" - } + "name": "fedPlhivBase", + "version": "1.0", + "tag": "", + "description": "", + "uses": [], + "sources": [ + { + "table": "etl.ncd_monthly_report_dataset", + "alias": "nmrd" + }, + { + "table": "etl.hiv_monthly_report_dataset_v1_2", + "alias": "hmrd", + "join": { + "type": "INNER", + "joinCondition": "nmrd.person_id = hmrd.person_id AND hmrd.status = 'active'" } - ], - "columns": [ - { - "type": "simple_column", - "alias": "location_uuid", - "column": "nmrd.location_uuid" - }, - { - "type": "simple_column", - "alias": "person_id", - "column": "nmrd.person_id" - }, - { - "type": "simple_column", - "alias": "ccc_number", - "column": "fi.ccc" - }, - { - "type": "simple_column", - "alias": "ovcid_id", - "column": "fi.ovcid" - }, - { - "type": "simple_column", - "alias": "upi_number", - "column": "fi.nupi" - }, - { - "type": "simple_column", - "alias": "age", - "column": "nmrd.age" - }, - { - "type": "simple_column", - "alias": "location_id", - "column": "nmrd.location_id" - }, - { - "type": "simple_column", - "alias": "location", - "column": "nmrd.clinic" - }, - { - "type": "derived_column", - "alias": "nw_fe_mh_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.is_feeding_and_eating_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "nw_fe_mh_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.is_feeding_and_eating_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } - }, + }, + { + "table": "etl.flat_patient_identifiers_v1", + "alias": "fi", + "join": { + "type": "LEFT", + "joinCondition": "nmrd.person_id = fi.patient_id" + } + }, + { + "table": "amrs.location", + "alias": "l", + "join": { + "type": "INNER", + "joinCondition": "nmrd.location_id = l.location_id" + } + }, + { + "table": "amrs.person", + "alias": "per", + "join": { + "type": "INNER", + "joinCondition": "nmrd.person_id = per.person_id" + } + } + ], + "columns": [ + { + "type": "simple_column", + "alias": "location_uuid", + "column": "nmrd.location_uuid" + }, + { + "type": "simple_column", + "alias": "person_id", + "column": "nmrd.person_id" + }, + { + "type": "simple_column", + "alias": "ccc_number", + "column": "fi.ccc" + }, + { + "type": "simple_column", + "alias": "ovcid_id", + "column": "fi.ovcid" + }, + { + "type": "simple_column", + "alias": "upi_number", + "column": "fi.nupi" + }, + { + "type": "simple_column", + "alias": "age", + "column": "nmrd.age" + }, + { + "type": "simple_column", + "alias": "location_id", + "column": "nmrd.location_id" + }, + { + "type": "simple_column", + "alias": "location", + "column": "nmrd.clinic" + }, + { + "type": "derived_column", + "alias": "nw_fe_mh_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.is_feeding_and_eating_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "nw_fe_mh_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.is_feeding_and_eating_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_nw_fe_mh", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.is_feeding_and_eating_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "ct_fe_mh_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.is_feeding_and_eating_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "ct_fe_mh_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.is_feeding_and_eating_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_ct_fe_mh", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.is_feeding_and_eating_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + } + ], + "filters": { + "conditionJoinOperator": "and", + "conditions": [ { - "type": "derived_column", - "alias": "tot_nw_fe_mh", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.is_feeding_and_eating_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.location_id in ?", + "parameterName": "locations" }, { - "type": "derived_column", - "alias": "ct_fe_mh_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.is_feeding_and_eating_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.endDate >= ?", + "parameterName": "startDate" }, { - "type": "derived_column", - "alias": "ct_fe_mh_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.is_feeding_and_eating_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.endDate <= ?", + "parameterName": "endDate" }, { - "type": "derived_column", - "alias": "tot_ct_fe_mh", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.is_feeding_and_eating_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.visit_this_month in ?", + "parameterName": "visitState" } - ], - "filters": { - "conditionJoinOperator": "and", - "conditions": [ - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.location_id in ?", - "parameterName": "locations" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.endDate >= ?", - "parameterName": "startDate" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.endDate <= ?", - "parameterName": "endDate" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.visit_this_month in ?", - "parameterName": "visitState" - } - ] - }, - "groupBy": { - "groupParam": "groupByParam", - "columns": ["nmrd.person_id"], - "excludeParam": "excludeParam" - }, - "paging": { - "offSetParam": "offSetParam", - "limitParam": "limitParam" - } + ] + }, + "groupBy": { + "groupParam": "groupByParam", + "columns": ["nmrd.person_id"], + "excludeParam": "excludeParam" + }, + "paging": { + "offSetParam": "offSetParam", + "limitParam": "limitParam" } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/general-mental-disorder-aggregate.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/general-mental-disorder-aggregate.json index e45bf535e..f2664baaf 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/general-mental-disorder-aggregate.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/general-mental-disorder-aggregate.json @@ -1,100 +1,99 @@ { - "name": "genMDPlhivAggregate", - "version": "1.0", - "tag": "", - "description": "", - "uses": [ - { - "name": "genMDPlhivBase", - "version": "1.0", - "type": "dataset_def" - } - ], - "sources": [ - { - "dataSet": "genMDPlhivBase", - "alias": "b" - } - ], - "columns": [ - { - "type": "derived_column", - "alias": "join_location", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "1" - } - }, - { - "type": "simple_column", - "alias": "location_id", - "column": "b.location_id" - }, - { - "type": "simple_column", - "alias": "location_uuid", - "column": "b.location_uuid" - }, - { - "type": "simple_column", - "alias": "location", - "column": "b.location" - }, - { - "type": "simple_column", - "alias": "nw_mh_f", - "column": "sum(b.nw_mh_f)" - }, - { - "type": "simple_column", - "alias": "nw_mh_m", - "column": "sum(b.nw_mh_m)" - }, - { - "type": "simple_column", - "alias": "nw_mh", - "column": "sum(b.nw_mh)" - }, - { - "type": "simple_column", - "alias": "ct_mh_f", - "column": "sum(b.ct_mh_f)" - }, - { - "type": "simple_column", - "alias": "ct_mh_m", - "column": "sum(b.ct_mh_m)" - }, - { - "type": "simple_column", - "alias": "ct_mh", - "column": "sum(b.ct_mh)" + "name": "genMDPlhivAggregate", + "version": "1.0", + "tag": "", + "description": "", + "uses": [ + { + "name": "genMDPlhivBase", + "version": "1.0", + "type": "dataset_def" + } + ], + "sources": [ + { + "dataSet": "genMDPlhivBase", + "alias": "b" + } + ], + "columns": [ + { + "type": "derived_column", + "alias": "join_location", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "1" } - ], - "groupBy": { - "groupParam": "groupByParam", - "columns": ["b.location_id"], - "excludeParam": "excludeParam" }, - "transFormDirectives": { - "joinColumn": "location_id", - "joinColumnParam": "", - "skipColumns": [""], - "disaggregationColumns": [] + { + "type": "simple_column", + "alias": "location_id", + "column": "b.location_id" + }, + { + "type": "simple_column", + "alias": "location_uuid", + "column": "b.location_uuid" + }, + { + "type": "simple_column", + "alias": "location", + "column": "b.location" }, - "dynamicJsonQueryGenerationDirectives": { - "patientListGenerator": { - "useTemplate": "patient-list-with-contacts-template", - "useTemplateVersion": "1.0", - "generatingDirectives": { - "joinDirectives": { - "joinType": "INNER", - "joinCondition": "<> = <>", - "baseColumn": "person_id", - "templateColumn": "person_id" - } + { + "type": "simple_column", + "alias": "nw_mh_f", + "column": "sum(b.nw_mh_f)" + }, + { + "type": "simple_column", + "alias": "nw_mh_m", + "column": "sum(b.nw_mh_m)" + }, + { + "type": "simple_column", + "alias": "nw_mh", + "column": "sum(b.nw_mh)" + }, + { + "type": "simple_column", + "alias": "ct_mh_f", + "column": "sum(b.ct_mh_f)" + }, + { + "type": "simple_column", + "alias": "ct_mh_m", + "column": "sum(b.ct_mh_m)" + }, + { + "type": "simple_column", + "alias": "ct_mh", + "column": "sum(b.ct_mh)" + } + ], + "groupBy": { + "groupParam": "groupByParam", + "columns": ["b.location_id"], + "excludeParam": "excludeParam" + }, + "transFormDirectives": { + "joinColumn": "location_id", + "joinColumnParam": "", + "skipColumns": [""], + "disaggregationColumns": [] + }, + "dynamicJsonQueryGenerationDirectives": { + "patientListGenerator": { + "useTemplate": "patient-list-with-contacts-template", + "useTemplateVersion": "1.0", + "generatingDirectives": { + "joinDirectives": { + "joinType": "INNER", + "joinCondition": "<> = <>", + "baseColumn": "person_id", + "templateColumn": "person_id" } } } } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/general-mental-disorder-base.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/general-mental-disorder-base.json index 7353dd08a..d9ecc9f21 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/general-mental-disorder-base.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/general-mental-disorder-base.json @@ -1,170 +1,169 @@ { - "name": "genMDPlhivBase", - "version": "1.0", - "tag": "", - "description": "", - "uses": [], - "sources": [ - { - "table": "etl.ncd_monthly_report_dataset", - "alias": "nmrd" - }, - { - "table": "etl.hiv_monthly_report_dataset_v1_2", - "alias": "hmrd", - "join": { - "type": "INNER", - "joinCondition": "nmrd.person_id = hmrd.person_id AND hmrd.status = 'active'" - } - }, - { - "table": "etl.flat_patient_identifiers_v1", - "alias": "fi", - "join": { - "type": "LEFT", - "joinCondition": "nmrd.person_id = fi.patient_id" - } - }, - { - "table": "amrs.location", - "alias": "l", - "join": { - "type": "INNER", - "joinCondition": "nmrd.location_id = l.location_id" - } - }, - { - "table": "amrs.person", - "alias": "per", - "join": { - "type": "INNER", - "joinCondition": "nmrd.person_id = per.person_id" - } + "name": "genMDPlhivBase", + "version": "1.0", + "tag": "", + "description": "", + "uses": [], + "sources": [ + { + "table": "etl.ncd_monthly_report_dataset", + "alias": "nmrd" + }, + { + "table": "etl.hiv_monthly_report_dataset_v1_2", + "alias": "hmrd", + "join": { + "type": "INNER", + "joinCondition": "nmrd.person_id = hmrd.person_id AND hmrd.status = 'active'" } - ], - "columns": [ - { - "type": "simple_column", - "alias": "location_uuid", - "column": "nmrd.location_uuid" - }, - { - "type": "simple_column", - "alias": "person_id", - "column": "nmrd.person_id" - }, - { - "type": "simple_column", - "alias": "ccc_number", - "column": "fi.ccc" - }, - { - "type": "simple_column", - "alias": "ovcid_id", - "column": "fi.ovcid" - }, - { - "type": "simple_column", - "alias": "upi_number", - "column": "fi.nupi" - }, - { - "type": "simple_column", - "alias": "age", - "column": "nmrd.age" - }, - { - "type": "simple_column", - "alias": "location_id", - "column": "nmrd.location_id" - }, - { - "type": "simple_column", - "alias": "location", - "column": "nmrd.clinic" - }, - { - "type": "derived_column", - "alias": "nw_mh_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.has_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "nw_mh_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.has_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } - }, + }, + { + "table": "etl.flat_patient_identifiers_v1", + "alias": "fi", + "join": { + "type": "LEFT", + "joinCondition": "nmrd.person_id = fi.patient_id" + } + }, + { + "table": "amrs.location", + "alias": "l", + "join": { + "type": "INNER", + "joinCondition": "nmrd.location_id = l.location_id" + } + }, + { + "table": "amrs.person", + "alias": "per", + "join": { + "type": "INNER", + "joinCondition": "nmrd.person_id = per.person_id" + } + } + ], + "columns": [ + { + "type": "simple_column", + "alias": "location_uuid", + "column": "nmrd.location_uuid" + }, + { + "type": "simple_column", + "alias": "person_id", + "column": "nmrd.person_id" + }, + { + "type": "simple_column", + "alias": "ccc_number", + "column": "fi.ccc" + }, + { + "type": "simple_column", + "alias": "ovcid_id", + "column": "fi.ovcid" + }, + { + "type": "simple_column", + "alias": "upi_number", + "column": "fi.nupi" + }, + { + "type": "simple_column", + "alias": "age", + "column": "nmrd.age" + }, + { + "type": "simple_column", + "alias": "location_id", + "column": "nmrd.location_id" + }, + { + "type": "simple_column", + "alias": "location", + "column": "nmrd.clinic" + }, + { + "type": "derived_column", + "alias": "nw_mh_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.has_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "nw_mh_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.has_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "nw_mh", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.has_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "ct_mh_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.has_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "ct_mh_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.has_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "ct_mh", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.has_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + } + ], + "filters": { + "conditionJoinOperator": "and", + "conditions": [ { - "type": "derived_column", - "alias": "nw_mh", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.has_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.location_id in ?", + "parameterName": "locations" }, { - "type": "derived_column", - "alias": "ct_mh_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.has_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.endDate >= ?", + "parameterName": "startDate" }, { - "type": "derived_column", - "alias": "ct_mh_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.has_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.endDate <= ?", + "parameterName": "endDate" }, { - "type": "derived_column", - "alias": "ct_mh", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.has_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.visit_this_month in ?", + "parameterName": "visitState" } - ], - "filters": { - "conditionJoinOperator": "and", - "conditions": [ - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.location_id in ?", - "parameterName": "locations" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.endDate >= ?", - "parameterName": "startDate" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.endDate <= ?", - "parameterName": "endDate" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.visit_this_month in ?", - "parameterName": "visitState" - } - ] - }, - "groupBy": { - "groupParam": "groupByParam", - "columns": ["nmrd.person_id"], - "excludeParam": "excludeParam" - }, - "paging": { - "offSetParam": "offSetParam", - "limitParam": "limitParam" - } + ] + }, + "groupBy": { + "groupParam": "groupByParam", + "columns": ["nmrd.person_id"], + "excludeParam": "excludeParam" + }, + "paging": { + "offSetParam": "offSetParam", + "limitParam": "limitParam" } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/mh-aggregate.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/mh-aggregate.json index 5e4217336..2b2914a72 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/mh-aggregate.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/mh-aggregate.json @@ -1,295 +1,294 @@ { - "name": "mhPlhivAggregate", - "version": "1.0", - "tag": "", - "description": "", - "uses": [ - { - "name": "mhPlhivBase", - "version": "1.0", - "type": "dataset_def" - } - ], - "sources": [ - { - "dataSet": "mhPlhivBase", - "alias": "b" - } - ], - "columns": [ - { - "type": "derived_column", - "alias": "join_location", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "1" - } - }, - { - "type": "simple_column", - "alias": "location_id", - "column": "b.location_id" - }, - { - "type": "simple_column", - "alias": "location_uuid", - "column": "b.location_uuid" - }, - { - "type": "simple_column", - "alias": "location", - "column": "b.location" - }, - { - "type": "simple_column", - "alias": "nw_dp_mh_f", - "column": "sum(b.nw_dp_mh_f)" - }, - { - "type": "simple_column", - "alias": "nw_dp_mh_m", - "column": "sum(b.nw_dp_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_nw_dp_mh", - "column": "sum(b.tot_nw_dp_mh)" - }, - { - "type": "simple_column", - "alias": "ct_dp_mh_f", - "column": "sum(b.ct_dp_mh_f)" - }, - { - "type": "simple_column", - "alias": "ct_dp_mh_m", - "column": "sum(b.ct_dp_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_ct_dp_mh", - "column": "sum(b.tot_ct_dp_mh)" - }, - { - "type": "simple_column", - "alias": "nw_anx_mh_f", - "column": "sum(b.nw_anx_mh_f)" - }, - { - "type": "simple_column", - "alias": "nw_anx_mh_m", - "column": "sum(b.nw_anx_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_nw_anx_mh", - "column": "sum(b.tot_nw_anx_mh)" - }, - { - "type": "simple_column", - "alias": "ct_anx_mh_f", - "column": "sum(b.ct_anx_mh_f)" - }, - { - "type": "simple_column", - "alias": "ct_anx_mh_m", - "column": "sum(b.ct_anx_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_ct_anx_mh", - "column": "sum(b.tot_ct_anx_mh)" - }, - { - "type": "simple_column", - "alias": "nw_bip_mh_f", - "column": "sum(b.nw_bip_mh_f)" - }, - { - "type": "simple_column", - "alias": "nw_bip_mh_m", - "column": "sum(b.nw_bip_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_nw_bip_mh", - "column": "sum(b.tot_nw_bip_mh)" - }, - { - "type": "simple_column", - "alias": "ct_bip_mh_f", - "column": "sum(b.ct_bip_mh_f)" - }, - { - "type": "simple_column", - "alias": "ct_bip_mh_m", - "column": "sum(b.ct_bip_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_ct_bip_mh", - "column": "sum(b.tot_ct_bip_mh)" - }, - { - "type": "simple_column", - "alias": "nw_per_mh_f", - "column": "sum(b.nw_per_mh_f)" - }, - { - "type": "simple_column", - "alias": "nw_per_mh_m", - "column": "sum(b.nw_per_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_nw_per_mh", - "column": "sum(b.tot_nw_per_mh)" - }, - { - "type": "simple_column", - "alias": "ct_per_mh_f", - "column": "sum(b.ct_per_mh_f)" - }, - { - "type": "simple_column", - "alias": "ct_per_mh_m", - "column": "sum(b.ct_per_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_ct_per_mh", - "column": "sum(b.tot_ct_per_mh)" - }, - { - "type": "simple_column", - "alias": "nw_fe_mh_f", - "column": "sum(b.nw_fe_mh_f)" - }, - { - "type": "simple_column", - "alias": "nw_fe_mh_m", - "column": "sum(b.nw_fe_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_nw_fe_mh", - "column": "sum(b.tot_nw_fe_mh)" - }, - { - "type": "simple_column", - "alias": "ct_fe_mh_f", - "column": "sum(b.ct_fe_mh_f)" - }, - { - "type": "simple_column", - "alias": "ct_fe_mh_m", - "column": "sum(b.ct_fe_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_ct_fe_mh", - "column": "sum(b.tot_ct_fe_mh)" - }, - { - "type": "simple_column", - "alias": "nw_obs_mh_f", - "column": "sum(b.nw_obs_mh_f)" - }, - { - "type": "simple_column", - "alias": "nw_obs_mh_m", - "column": "sum(b.nw_obs_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_nw_obs_mh", - "column": "sum(b.tot_nw_obs_mh)" - }, - { - "type": "simple_column", - "alias": "ct_obs_mh_f", - "column": "sum(b.ct_obs_mh_f)" - }, - { - "type": "simple_column", - "alias": "ct_obs_mh_m", - "column": "sum(b.ct_obs_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_ct_obs_mh", - "column": "sum(b.tot_ct_obs_mh)" - }, - { - "type": "simple_column", - "alias": "nw_mh_f", - "column": "sum(b.nw_mh_f)" - }, - { - "type": "simple_column", - "alias": "nw_mh_m", - "column": "sum(b.nw_mh_m)" - }, - { - "type": "simple_column", - "alias": "nw_mh", - "column": "sum(b.nw_mh)" - }, - { - "type": "simple_column", - "alias": "ct_mh_f", - "column": "sum(b.ct_mh_f)" - }, - { - "type": "simple_column", - "alias": "ct_mh_m", - "column": "sum(b.ct_mh_m)" - }, - { - "type": "simple_column", - "alias": "ct_mh", - "column": "sum(b.ct_mh)" - }, - { - "type": "simple_column", - "alias": "tot_nw_mh", - "column": "sum(b.tot_nw_mh)" - }, - { - "type": "simple_column", - "alias": "tot_ct_mh", - "column": "sum(b.tot_ct_mh)" - }, - { - "type": "simple_column", - "alias": "tot_mh", - "column": "sum(b.tot_mh)" + "name": "mhPlhivAggregate", + "version": "1.0", + "tag": "", + "description": "", + "uses": [ + { + "name": "mhPlhivBase", + "version": "1.0", + "type": "dataset_def" + } + ], + "sources": [ + { + "dataSet": "mhPlhivBase", + "alias": "b" + } + ], + "columns": [ + { + "type": "derived_column", + "alias": "join_location", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "1" } - ], - "groupBy": { - "groupParam": "groupByParam", - "columns": ["b.location_id"], - "excludeParam": "excludeParam" - }, - "transFormDirectives": { - "joinColumn": "location_id", - "joinColumnParam": "", - "skipColumns": [""], - "disaggregationColumns": [] - }, - "dynamicJsonQueryGenerationDirectives": { - "patientListGenerator": { - "useTemplate": "patient-list-with-contacts-template", - "useTemplateVersion": "1.0", - "generatingDirectives": { - "joinDirectives": { - "joinType": "INNER", - "joinCondition": "<> = <>", - "baseColumn": "person_id", - "templateColumn": "person_id" - } + }, + { + "type": "simple_column", + "alias": "location_id", + "column": "b.location_id" + }, + { + "type": "simple_column", + "alias": "location_uuid", + "column": "b.location_uuid" + }, + { + "type": "simple_column", + "alias": "location", + "column": "b.location" + }, + { + "type": "simple_column", + "alias": "nw_dp_mh_f", + "column": "sum(b.nw_dp_mh_f)" + }, + { + "type": "simple_column", + "alias": "nw_dp_mh_m", + "column": "sum(b.nw_dp_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_nw_dp_mh", + "column": "sum(b.tot_nw_dp_mh)" + }, + { + "type": "simple_column", + "alias": "ct_dp_mh_f", + "column": "sum(b.ct_dp_mh_f)" + }, + { + "type": "simple_column", + "alias": "ct_dp_mh_m", + "column": "sum(b.ct_dp_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_ct_dp_mh", + "column": "sum(b.tot_ct_dp_mh)" + }, + { + "type": "simple_column", + "alias": "nw_anx_mh_f", + "column": "sum(b.nw_anx_mh_f)" + }, + { + "type": "simple_column", + "alias": "nw_anx_mh_m", + "column": "sum(b.nw_anx_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_nw_anx_mh", + "column": "sum(b.tot_nw_anx_mh)" + }, + { + "type": "simple_column", + "alias": "ct_anx_mh_f", + "column": "sum(b.ct_anx_mh_f)" + }, + { + "type": "simple_column", + "alias": "ct_anx_mh_m", + "column": "sum(b.ct_anx_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_ct_anx_mh", + "column": "sum(b.tot_ct_anx_mh)" + }, + { + "type": "simple_column", + "alias": "nw_bip_mh_f", + "column": "sum(b.nw_bip_mh_f)" + }, + { + "type": "simple_column", + "alias": "nw_bip_mh_m", + "column": "sum(b.nw_bip_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_nw_bip_mh", + "column": "sum(b.tot_nw_bip_mh)" + }, + { + "type": "simple_column", + "alias": "ct_bip_mh_f", + "column": "sum(b.ct_bip_mh_f)" + }, + { + "type": "simple_column", + "alias": "ct_bip_mh_m", + "column": "sum(b.ct_bip_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_ct_bip_mh", + "column": "sum(b.tot_ct_bip_mh)" + }, + { + "type": "simple_column", + "alias": "nw_per_mh_f", + "column": "sum(b.nw_per_mh_f)" + }, + { + "type": "simple_column", + "alias": "nw_per_mh_m", + "column": "sum(b.nw_per_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_nw_per_mh", + "column": "sum(b.tot_nw_per_mh)" + }, + { + "type": "simple_column", + "alias": "ct_per_mh_f", + "column": "sum(b.ct_per_mh_f)" + }, + { + "type": "simple_column", + "alias": "ct_per_mh_m", + "column": "sum(b.ct_per_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_ct_per_mh", + "column": "sum(b.tot_ct_per_mh)" + }, + { + "type": "simple_column", + "alias": "nw_fe_mh_f", + "column": "sum(b.nw_fe_mh_f)" + }, + { + "type": "simple_column", + "alias": "nw_fe_mh_m", + "column": "sum(b.nw_fe_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_nw_fe_mh", + "column": "sum(b.tot_nw_fe_mh)" + }, + { + "type": "simple_column", + "alias": "ct_fe_mh_f", + "column": "sum(b.ct_fe_mh_f)" + }, + { + "type": "simple_column", + "alias": "ct_fe_mh_m", + "column": "sum(b.ct_fe_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_ct_fe_mh", + "column": "sum(b.tot_ct_fe_mh)" + }, + { + "type": "simple_column", + "alias": "nw_obs_mh_f", + "column": "sum(b.nw_obs_mh_f)" + }, + { + "type": "simple_column", + "alias": "nw_obs_mh_m", + "column": "sum(b.nw_obs_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_nw_obs_mh", + "column": "sum(b.tot_nw_obs_mh)" + }, + { + "type": "simple_column", + "alias": "ct_obs_mh_f", + "column": "sum(b.ct_obs_mh_f)" + }, + { + "type": "simple_column", + "alias": "ct_obs_mh_m", + "column": "sum(b.ct_obs_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_ct_obs_mh", + "column": "sum(b.tot_ct_obs_mh)" + }, + { + "type": "simple_column", + "alias": "nw_mh_f", + "column": "sum(b.nw_mh_f)" + }, + { + "type": "simple_column", + "alias": "nw_mh_m", + "column": "sum(b.nw_mh_m)" + }, + { + "type": "simple_column", + "alias": "nw_mh", + "column": "sum(b.nw_mh)" + }, + { + "type": "simple_column", + "alias": "ct_mh_f", + "column": "sum(b.ct_mh_f)" + }, + { + "type": "simple_column", + "alias": "ct_mh_m", + "column": "sum(b.ct_mh_m)" + }, + { + "type": "simple_column", + "alias": "ct_mh", + "column": "sum(b.ct_mh)" + }, + { + "type": "simple_column", + "alias": "tot_nw_mh", + "column": "sum(b.tot_nw_mh)" + }, + { + "type": "simple_column", + "alias": "tot_ct_mh", + "column": "sum(b.tot_ct_mh)" + }, + { + "type": "simple_column", + "alias": "tot_mh", + "column": "sum(b.tot_mh)" + } + ], + "groupBy": { + "groupParam": "groupByParam", + "columns": ["b.location_id"], + "excludeParam": "excludeParam" + }, + "transFormDirectives": { + "joinColumn": "location_id", + "joinColumnParam": "", + "skipColumns": [""], + "disaggregationColumns": [] + }, + "dynamicJsonQueryGenerationDirectives": { + "patientListGenerator": { + "useTemplate": "patient-list-with-contacts-template", + "useTemplateVersion": "1.0", + "generatingDirectives": { + "joinDirectives": { + "joinType": "INNER", + "joinCondition": "<> = <>", + "baseColumn": "person_id", + "templateColumn": "person_id" } } } } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/mh-base.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/mh-base.json index f417f497f..a5dcfa271 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/mh-base.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/mh-base.json @@ -429,7 +429,7 @@ }, { "type": "derived_column", - "alias": "tot_ct_mh", + "alias": "tot_ct_mh", "expressionType": "simple_expression", "expressionOptions": { "expression": "IF((nmrd.has_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/ocd-aggregate.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/ocd-aggregate.json index fcd2004b6..67e43f58b 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/ocd-aggregate.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/ocd-aggregate.json @@ -1,100 +1,99 @@ { - "name": "ocdPlhivAggregate", - "version": "1.0", - "tag": "", - "description": "", - "uses": [ - { - "name": "ocdPlhivBase", - "version": "1.0", - "type": "dataset_def" - } - ], - "sources": [ - { - "dataSet": "ocdPlhivBase", - "alias": "b" - } - ], - "columns": [ - { - "type": "derived_column", - "alias": "join_location", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "1" - } - }, - { - "type": "simple_column", - "alias": "location_id", - "column": "b.location_id" - }, - { - "type": "simple_column", - "alias": "location_uuid", - "column": "b.location_uuid" - }, - { - "type": "simple_column", - "alias": "location", - "column": "b.location" - }, - { - "type": "simple_column", - "alias": "nw_obs_mh_f", - "column": "sum(b.nw_obs_mh_f)" - }, - { - "type": "simple_column", - "alias": "nw_obs_mh_m", - "column": "sum(b.nw_obs_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_nw_obs_mh", - "column": "sum(b.tot_nw_obs_mh)" - }, - { - "type": "simple_column", - "alias": "ct_obs_mh_f", - "column": "sum(b.ct_obs_mh_f)" - }, - { - "type": "simple_column", - "alias": "ct_obs_mh_m", - "column": "sum(b.ct_obs_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_ct_obs_mh", - "column": "sum(b.tot_ct_obs_mh)" + "name": "ocdPlhivAggregate", + "version": "1.0", + "tag": "", + "description": "", + "uses": [ + { + "name": "ocdPlhivBase", + "version": "1.0", + "type": "dataset_def" + } + ], + "sources": [ + { + "dataSet": "ocdPlhivBase", + "alias": "b" + } + ], + "columns": [ + { + "type": "derived_column", + "alias": "join_location", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "1" } - ], - "groupBy": { - "groupParam": "groupByParam", - "columns": ["b.location_id"], - "excludeParam": "excludeParam" }, - "transFormDirectives": { - "joinColumn": "location_id", - "joinColumnParam": "", - "skipColumns": [""], - "disaggregationColumns": [] + { + "type": "simple_column", + "alias": "location_id", + "column": "b.location_id" + }, + { + "type": "simple_column", + "alias": "location_uuid", + "column": "b.location_uuid" + }, + { + "type": "simple_column", + "alias": "location", + "column": "b.location" }, - "dynamicJsonQueryGenerationDirectives": { - "patientListGenerator": { - "useTemplate": "patient-list-with-contacts-template", - "useTemplateVersion": "1.0", - "generatingDirectives": { - "joinDirectives": { - "joinType": "INNER", - "joinCondition": "<> = <>", - "baseColumn": "person_id", - "templateColumn": "person_id" - } + { + "type": "simple_column", + "alias": "nw_obs_mh_f", + "column": "sum(b.nw_obs_mh_f)" + }, + { + "type": "simple_column", + "alias": "nw_obs_mh_m", + "column": "sum(b.nw_obs_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_nw_obs_mh", + "column": "sum(b.tot_nw_obs_mh)" + }, + { + "type": "simple_column", + "alias": "ct_obs_mh_f", + "column": "sum(b.ct_obs_mh_f)" + }, + { + "type": "simple_column", + "alias": "ct_obs_mh_m", + "column": "sum(b.ct_obs_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_ct_obs_mh", + "column": "sum(b.tot_ct_obs_mh)" + } + ], + "groupBy": { + "groupParam": "groupByParam", + "columns": ["b.location_id"], + "excludeParam": "excludeParam" + }, + "transFormDirectives": { + "joinColumn": "location_id", + "joinColumnParam": "", + "skipColumns": [""], + "disaggregationColumns": [] + }, + "dynamicJsonQueryGenerationDirectives": { + "patientListGenerator": { + "useTemplate": "patient-list-with-contacts-template", + "useTemplateVersion": "1.0", + "generatingDirectives": { + "joinDirectives": { + "joinType": "INNER", + "joinCondition": "<> = <>", + "baseColumn": "person_id", + "templateColumn": "person_id" } } } } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/ocd-base.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/ocd-base.json index cd2113100..fc6fd78ff 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/ocd-base.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/ocd-base.json @@ -1,170 +1,169 @@ { - "name": "ocdPlhivBase", - "version": "1.0", - "tag": "", - "description": "", - "uses": [], - "sources": [ - { - "table": "etl.ncd_monthly_report_dataset", - "alias": "nmrd" - }, - { - "table": "etl.hiv_monthly_report_dataset_v1_2", - "alias": "hmrd", - "join": { - "type": "INNER", - "joinCondition": "nmrd.person_id = hmrd.person_id AND hmrd.status = 'active'" - } - }, - { - "table": "etl.flat_patient_identifiers_v1", - "alias": "fi", - "join": { - "type": "LEFT", - "joinCondition": "nmrd.person_id = fi.patient_id" - } - }, - { - "table": "amrs.location", - "alias": "l", - "join": { - "type": "INNER", - "joinCondition": "nmrd.location_id = l.location_id" - } - }, - { - "table": "amrs.person", - "alias": "per", - "join": { - "type": "INNER", - "joinCondition": "nmrd.person_id = per.person_id" - } + "name": "ocdPlhivBase", + "version": "1.0", + "tag": "", + "description": "", + "uses": [], + "sources": [ + { + "table": "etl.ncd_monthly_report_dataset", + "alias": "nmrd" + }, + { + "table": "etl.hiv_monthly_report_dataset_v1_2", + "alias": "hmrd", + "join": { + "type": "INNER", + "joinCondition": "nmrd.person_id = hmrd.person_id AND hmrd.status = 'active'" } - ], - "columns": [ - { - "type": "simple_column", - "alias": "location_uuid", - "column": "nmrd.location_uuid" - }, - { - "type": "simple_column", - "alias": "person_id", - "column": "nmrd.person_id" - }, - { - "type": "simple_column", - "alias": "ccc_number", - "column": "fi.ccc" - }, - { - "type": "simple_column", - "alias": "ovcid_id", - "column": "fi.ovcid" - }, - { - "type": "simple_column", - "alias": "upi_number", - "column": "fi.nupi" - }, - { - "type": "simple_column", - "alias": "age", - "column": "nmrd.age" - }, - { - "type": "simple_column", - "alias": "location_id", - "column": "nmrd.location_id" - }, - { - "type": "simple_column", - "alias": "location", - "column": "nmrd.clinic" - }, - { - "type": "derived_column", - "alias": "nw_obs_mh_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.is_ocd_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "nw_obs_mh_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.is_ocd_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } - }, + }, + { + "table": "etl.flat_patient_identifiers_v1", + "alias": "fi", + "join": { + "type": "LEFT", + "joinCondition": "nmrd.person_id = fi.patient_id" + } + }, + { + "table": "amrs.location", + "alias": "l", + "join": { + "type": "INNER", + "joinCondition": "nmrd.location_id = l.location_id" + } + }, + { + "table": "amrs.person", + "alias": "per", + "join": { + "type": "INNER", + "joinCondition": "nmrd.person_id = per.person_id" + } + } + ], + "columns": [ + { + "type": "simple_column", + "alias": "location_uuid", + "column": "nmrd.location_uuid" + }, + { + "type": "simple_column", + "alias": "person_id", + "column": "nmrd.person_id" + }, + { + "type": "simple_column", + "alias": "ccc_number", + "column": "fi.ccc" + }, + { + "type": "simple_column", + "alias": "ovcid_id", + "column": "fi.ovcid" + }, + { + "type": "simple_column", + "alias": "upi_number", + "column": "fi.nupi" + }, + { + "type": "simple_column", + "alias": "age", + "column": "nmrd.age" + }, + { + "type": "simple_column", + "alias": "location_id", + "column": "nmrd.location_id" + }, + { + "type": "simple_column", + "alias": "location", + "column": "nmrd.clinic" + }, + { + "type": "derived_column", + "alias": "nw_obs_mh_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.is_ocd_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "nw_obs_mh_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.is_ocd_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_nw_obs_mh", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.is_ocd_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "ct_obs_mh_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.is_ocd_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "ct_obs_mh_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.is_ocd_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_ct_obs_mh", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.is_ocd_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + } + ], + "filters": { + "conditionJoinOperator": "and", + "conditions": [ { - "type": "derived_column", - "alias": "tot_nw_obs_mh", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.is_ocd_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.location_id in ?", + "parameterName": "locations" }, { - "type": "derived_column", - "alias": "ct_obs_mh_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.is_ocd_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.endDate >= ?", + "parameterName": "startDate" }, { - "type": "derived_column", - "alias": "ct_obs_mh_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.is_ocd_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.endDate <= ?", + "parameterName": "endDate" }, { - "type": "derived_column", - "alias": "tot_ct_obs_mh", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.is_ocd_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.visit_this_month in ?", + "parameterName": "visitState" } - ], - "filters": { - "conditionJoinOperator": "and", - "conditions": [ - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.location_id in ?", - "parameterName": "locations" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.endDate >= ?", - "parameterName": "startDate" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.endDate <= ?", - "parameterName": "endDate" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.visit_this_month in ?", - "parameterName": "visitState" - } - ] - }, - "groupBy": { - "groupParam": "groupByParam", - "columns": ["nmrd.person_id"], - "excludeParam": "excludeParam" - }, - "paging": { - "offSetParam": "offSetParam", - "limitParam": "limitParam" - } + ] + }, + "groupBy": { + "groupParam": "groupByParam", + "columns": ["nmrd.person_id"], + "excludeParam": "excludeParam" + }, + "paging": { + "offSetParam": "offSetParam", + "limitParam": "limitParam" } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/personality-mh-aggregate.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/personality-mh-aggregate.json index ff59e2372..15351177a 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/personality-mh-aggregate.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/personality-mh-aggregate.json @@ -1,100 +1,99 @@ { - "name": "perPlhivAggregate", - "version": "1.0", - "tag": "", - "description": "", - "uses": [ - { - "name": "perPlhivBase", - "version": "1.0", - "type": "dataset_def" - } - ], - "sources": [ - { - "dataSet": "perPlhivBase", - "alias": "b" - } - ], - "columns": [ - { - "type": "derived_column", - "alias": "join_location", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "1" - } - }, - { - "type": "simple_column", - "alias": "location_id", - "column": "b.location_id" - }, - { - "type": "simple_column", - "alias": "location_uuid", - "column": "b.location_uuid" - }, - { - "type": "simple_column", - "alias": "location", - "column": "b.location" - }, - { - "type": "simple_column", - "alias": "nw_per_mh_f", - "column": "sum(b.nw_per_mh_f)" - }, - { - "type": "simple_column", - "alias": "nw_per_mh_m", - "column": "sum(b.nw_per_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_nw_per_mh", - "column": "sum(b.tot_nw_per_mh)" - }, - { - "type": "simple_column", - "alias": "ct_per_mh_f", - "column": "sum(b.ct_per_mh_f)" - }, - { - "type": "simple_column", - "alias": "ct_per_mh_m", - "column": "sum(b.ct_per_mh_m)" - }, - { - "type": "simple_column", - "alias": "tot_ct_per_mh", - "column": "sum(b.tot_ct_per_mh)" + "name": "perPlhivAggregate", + "version": "1.0", + "tag": "", + "description": "", + "uses": [ + { + "name": "perPlhivBase", + "version": "1.0", + "type": "dataset_def" + } + ], + "sources": [ + { + "dataSet": "perPlhivBase", + "alias": "b" + } + ], + "columns": [ + { + "type": "derived_column", + "alias": "join_location", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "1" } - ], - "groupBy": { - "groupParam": "groupByParam", - "columns": ["b.location_id"], - "excludeParam": "excludeParam" }, - "transFormDirectives": { - "joinColumn": "location_id", - "joinColumnParam": "", - "skipColumns": [""], - "disaggregationColumns": [] + { + "type": "simple_column", + "alias": "location_id", + "column": "b.location_id" + }, + { + "type": "simple_column", + "alias": "location_uuid", + "column": "b.location_uuid" + }, + { + "type": "simple_column", + "alias": "location", + "column": "b.location" }, - "dynamicJsonQueryGenerationDirectives": { - "patientListGenerator": { - "useTemplate": "patient-list-with-contacts-template", - "useTemplateVersion": "1.0", - "generatingDirectives": { - "joinDirectives": { - "joinType": "INNER", - "joinCondition": "<> = <>", - "baseColumn": "person_id", - "templateColumn": "person_id" - } + { + "type": "simple_column", + "alias": "nw_per_mh_f", + "column": "sum(b.nw_per_mh_f)" + }, + { + "type": "simple_column", + "alias": "nw_per_mh_m", + "column": "sum(b.nw_per_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_nw_per_mh", + "column": "sum(b.tot_nw_per_mh)" + }, + { + "type": "simple_column", + "alias": "ct_per_mh_f", + "column": "sum(b.ct_per_mh_f)" + }, + { + "type": "simple_column", + "alias": "ct_per_mh_m", + "column": "sum(b.ct_per_mh_m)" + }, + { + "type": "simple_column", + "alias": "tot_ct_per_mh", + "column": "sum(b.tot_ct_per_mh)" + } + ], + "groupBy": { + "groupParam": "groupByParam", + "columns": ["b.location_id"], + "excludeParam": "excludeParam" + }, + "transFormDirectives": { + "joinColumn": "location_id", + "joinColumnParam": "", + "skipColumns": [""], + "disaggregationColumns": [] + }, + "dynamicJsonQueryGenerationDirectives": { + "patientListGenerator": { + "useTemplate": "patient-list-with-contacts-template", + "useTemplateVersion": "1.0", + "generatingDirectives": { + "joinDirectives": { + "joinType": "INNER", + "joinCondition": "<> = <>", + "baseColumn": "person_id", + "templateColumn": "person_id" } } } } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/personality-mh-base.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/personality-mh-base.json index 8dcc0b620..2fe504d26 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/personality-mh-base.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/personality-mh-base.json @@ -1,170 +1,169 @@ { - "name": "perPlhivBase", - "version": "1.0", - "tag": "", - "description": "", - "uses": [], - "sources": [ - { - "table": "etl.ncd_monthly_report_dataset", - "alias": "nmrd" - }, - { - "table": "etl.hiv_monthly_report_dataset_v1_2", - "alias": "hmrd", - "join": { - "type": "INNER", - "joinCondition": "nmrd.person_id = hmrd.person_id AND hmrd.status = 'active'" - } - }, - { - "table": "etl.flat_patient_identifiers_v1", - "alias": "fi", - "join": { - "type": "LEFT", - "joinCondition": "nmrd.person_id = fi.patient_id" - } - }, - { - "table": "amrs.location", - "alias": "l", - "join": { - "type": "INNER", - "joinCondition": "nmrd.location_id = l.location_id" - } - }, - { - "table": "amrs.person", - "alias": "per", - "join": { - "type": "INNER", - "joinCondition": "nmrd.person_id = per.person_id" - } + "name": "perPlhivBase", + "version": "1.0", + "tag": "", + "description": "", + "uses": [], + "sources": [ + { + "table": "etl.ncd_monthly_report_dataset", + "alias": "nmrd" + }, + { + "table": "etl.hiv_monthly_report_dataset_v1_2", + "alias": "hmrd", + "join": { + "type": "INNER", + "joinCondition": "nmrd.person_id = hmrd.person_id AND hmrd.status = 'active'" } - ], - "columns": [ - { - "type": "simple_column", - "alias": "location_uuid", - "column": "nmrd.location_uuid" - }, - { - "type": "simple_column", - "alias": "person_id", - "column": "nmrd.person_id" - }, - { - "type": "simple_column", - "alias": "ccc_number", - "column": "fi.ccc" - }, - { - "type": "simple_column", - "alias": "ovcid_id", - "column": "fi.ovcid" - }, - { - "type": "simple_column", - "alias": "upi_number", - "column": "fi.nupi" - }, - { - "type": "simple_column", - "alias": "age", - "column": "nmrd.age" - }, - { - "type": "simple_column", - "alias": "location_id", - "column": "nmrd.location_id" - }, - { - "type": "simple_column", - "alias": "location", - "column": "nmrd.clinic" - }, - { - "type": "derived_column", - "alias": "nw_per_mh_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.is_personality_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "nw_per_mh_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.is_personality_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } - }, + }, + { + "table": "etl.flat_patient_identifiers_v1", + "alias": "fi", + "join": { + "type": "LEFT", + "joinCondition": "nmrd.person_id = fi.patient_id" + } + }, + { + "table": "amrs.location", + "alias": "l", + "join": { + "type": "INNER", + "joinCondition": "nmrd.location_id = l.location_id" + } + }, + { + "table": "amrs.person", + "alias": "per", + "join": { + "type": "INNER", + "joinCondition": "nmrd.person_id = per.person_id" + } + } + ], + "columns": [ + { + "type": "simple_column", + "alias": "location_uuid", + "column": "nmrd.location_uuid" + }, + { + "type": "simple_column", + "alias": "person_id", + "column": "nmrd.person_id" + }, + { + "type": "simple_column", + "alias": "ccc_number", + "column": "fi.ccc" + }, + { + "type": "simple_column", + "alias": "ovcid_id", + "column": "fi.ovcid" + }, + { + "type": "simple_column", + "alias": "upi_number", + "column": "fi.nupi" + }, + { + "type": "simple_column", + "alias": "age", + "column": "nmrd.age" + }, + { + "type": "simple_column", + "alias": "location_id", + "column": "nmrd.location_id" + }, + { + "type": "simple_column", + "alias": "location", + "column": "nmrd.clinic" + }, + { + "type": "derived_column", + "alias": "nw_per_mh_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.is_personality_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "nw_per_mh_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.is_personality_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_nw_per_mh", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.is_personality_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "ct_per_mh_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.is_personality_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "ct_per_mh_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.is_personality_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_ct_per_mh", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.is_personality_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + } + ], + "filters": { + "conditionJoinOperator": "and", + "conditions": [ { - "type": "derived_column", - "alias": "tot_nw_per_mh", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.is_personality_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.location_id in ?", + "parameterName": "locations" }, { - "type": "derived_column", - "alias": "ct_per_mh_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.is_personality_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.endDate >= ?", + "parameterName": "startDate" }, { - "type": "derived_column", - "alias": "ct_per_mh_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.is_personality_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.endDate <= ?", + "parameterName": "endDate" }, { - "type": "derived_column", - "alias": "tot_ct_per_mh", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.is_personality_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.visit_this_month in ?", + "parameterName": "visitState" } - ], - "filters": { - "conditionJoinOperator": "and", - "conditions": [ - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.location_id in ?", - "parameterName": "locations" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.endDate >= ?", - "parameterName": "startDate" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.endDate <= ?", - "parameterName": "endDate" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.visit_this_month in ?", - "parameterName": "visitState" - } - ] - }, - "groupBy": { - "groupParam": "groupByParam", - "columns": ["nmrd.person_id"], - "excludeParam": "excludeParam" - }, - "paging": { - "offSetParam": "offSetParam", - "limitParam": "limitParam" - } + ] + }, + "groupBy": { + "groupParam": "groupByParam", + "columns": ["nmrd.person_id"], + "excludeParam": "excludeParam" + }, + "paging": { + "offSetParam": "offSetParam", + "limitParam": "limitParam" } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/status-sub-total-aggregate.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/status-sub-total-aggregate.json index 115c3427e..ca33d177d 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/status-sub-total-aggregate.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/status-sub-total-aggregate.json @@ -1,80 +1,79 @@ { - "name": "stMDPlhivAggregate", - "version": "1.0", - "tag": "", - "description": "", - "uses": [ - { - "name": "stMDPlhivBase", - "version": "1.0", - "type": "dataset_def" - } - ], - "sources": [ - { - "dataSet": "stMDPlhivBase", - "alias": "b" - } - ], - "columns": [ - { - "type": "derived_column", - "alias": "join_location", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "1" - } - }, - { - "type": "simple_column", - "alias": "location_id", - "column": "b.location_id" - }, - { - "type": "simple_column", - "alias": "location_uuid", - "column": "b.location_uuid" - }, - { - "type": "simple_column", - "alias": "location", - "column": "b.location" - }, - { - "type": "simple_column", - "alias": "tot_nw_mh", - "column": "sum(b.tot_nw_mh)" - }, - { - "type": "simple_column", - "alias": "tot_ct_mh", - "column": "sum(b.tot_ct_mh)" + "name": "stMDPlhivAggregate", + "version": "1.0", + "tag": "", + "description": "", + "uses": [ + { + "name": "stMDPlhivBase", + "version": "1.0", + "type": "dataset_def" + } + ], + "sources": [ + { + "dataSet": "stMDPlhivBase", + "alias": "b" + } + ], + "columns": [ + { + "type": "derived_column", + "alias": "join_location", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "1" } - ], - "groupBy": { - "groupParam": "groupByParam", - "columns": ["b.location_id"], - "excludeParam": "excludeParam" }, - "transFormDirectives": { - "joinColumn": "location_id", - "joinColumnParam": "", - "skipColumns": [""], - "disaggregationColumns": [] + { + "type": "simple_column", + "alias": "location_id", + "column": "b.location_id" }, - "dynamicJsonQueryGenerationDirectives": { - "patientListGenerator": { - "useTemplate": "patient-list-with-contacts-template", - "useTemplateVersion": "1.0", - "generatingDirectives": { - "joinDirectives": { - "joinType": "INNER", - "joinCondition": "<> = <>", - "baseColumn": "person_id", - "templateColumn": "person_id" - } + { + "type": "simple_column", + "alias": "location_uuid", + "column": "b.location_uuid" + }, + { + "type": "simple_column", + "alias": "location", + "column": "b.location" + }, + { + "type": "simple_column", + "alias": "tot_nw_mh", + "column": "sum(b.tot_nw_mh)" + }, + { + "type": "simple_column", + "alias": "tot_ct_mh", + "column": "sum(b.tot_ct_mh)" + } + ], + "groupBy": { + "groupParam": "groupByParam", + "columns": ["b.location_id"], + "excludeParam": "excludeParam" + }, + "transFormDirectives": { + "joinColumn": "location_id", + "joinColumnParam": "", + "skipColumns": [""], + "disaggregationColumns": [] + }, + "dynamicJsonQueryGenerationDirectives": { + "patientListGenerator": { + "useTemplate": "patient-list-with-contacts-template", + "useTemplateVersion": "1.0", + "generatingDirectives": { + "joinDirectives": { + "joinType": "INNER", + "joinCondition": "<> = <>", + "baseColumn": "person_id", + "templateColumn": "person_id" } } } } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/status-sub-total-base.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/status-sub-total-base.json index faf29e1d0..e3b4874e3 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/status-sub-total-base.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/status-sub-total-base.json @@ -1,138 +1,137 @@ { - "name": "stMDPlhivBase", - "version": "1.0", - "tag": "", - "description": "", - "uses": [], - "sources": [ - { - "table": "etl.ncd_monthly_report_dataset", - "alias": "nmrd" - }, - { - "table": "etl.hiv_monthly_report_dataset_v1_2", - "alias": "hmrd", - "join": { - "type": "INNER", - "joinCondition": "nmrd.person_id = hmrd.person_id AND hmrd.status = 'active'" - } - }, - { - "table": "etl.flat_patient_identifiers_v1", - "alias": "fi", - "join": { - "type": "LEFT", - "joinCondition": "nmrd.person_id = fi.patient_id" - } - }, - { - "table": "amrs.location", - "alias": "l", - "join": { - "type": "INNER", - "joinCondition": "nmrd.location_id = l.location_id" - } - }, - { - "table": "amrs.person", - "alias": "per", - "join": { - "type": "INNER", - "joinCondition": "nmrd.person_id = per.person_id" - } + "name": "stMDPlhivBase", + "version": "1.0", + "tag": "", + "description": "", + "uses": [], + "sources": [ + { + "table": "etl.ncd_monthly_report_dataset", + "alias": "nmrd" + }, + { + "table": "etl.hiv_monthly_report_dataset_v1_2", + "alias": "hmrd", + "join": { + "type": "INNER", + "joinCondition": "nmrd.person_id = hmrd.person_id AND hmrd.status = 'active'" } - ], - "columns": [ - { - "type": "simple_column", - "alias": "location_uuid", - "column": "nmrd.location_uuid" - }, - { - "type": "simple_column", - "alias": "person_id", - "column": "nmrd.person_id" - }, - { - "type": "simple_column", - "alias": "ccc_number", - "column": "fi.ccc" - }, - { - "type": "simple_column", - "alias": "ovcid_id", - "column": "fi.ovcid" - }, - { - "type": "simple_column", - "alias": "upi_number", - "column": "fi.nupi" - }, - { - "type": "simple_column", - "alias": "age", - "column": "nmrd.age" - }, + }, + { + "table": "etl.flat_patient_identifiers_v1", + "alias": "fi", + "join": { + "type": "LEFT", + "joinCondition": "nmrd.person_id = fi.patient_id" + } + }, + { + "table": "amrs.location", + "alias": "l", + "join": { + "type": "INNER", + "joinCondition": "nmrd.location_id = l.location_id" + } + }, + { + "table": "amrs.person", + "alias": "per", + "join": { + "type": "INNER", + "joinCondition": "nmrd.person_id = per.person_id" + } + } + ], + "columns": [ + { + "type": "simple_column", + "alias": "location_uuid", + "column": "nmrd.location_uuid" + }, + { + "type": "simple_column", + "alias": "person_id", + "column": "nmrd.person_id" + }, + { + "type": "simple_column", + "alias": "ccc_number", + "column": "fi.ccc" + }, + { + "type": "simple_column", + "alias": "ovcid_id", + "column": "fi.ovcid" + }, + { + "type": "simple_column", + "alias": "upi_number", + "column": "fi.nupi" + }, + { + "type": "simple_column", + "alias": "age", + "column": "nmrd.age" + }, + { + "type": "simple_column", + "alias": "location_id", + "column": "nmrd.location_id" + }, + { + "type": "simple_column", + "alias": "location", + "column": "nmrd.clinic" + }, + { + "type": "derived_column", + "alias": "tot_nw_mh", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.has_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_ct_mh", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.has_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + } + ], + "filters": { + "conditionJoinOperator": "and", + "conditions": [ { - "type": "simple_column", - "alias": "location_id", - "column": "nmrd.location_id" + "filterType": "tableColumns", + "conditionExpression": "nmrd.location_id in ?", + "parameterName": "locations" }, { - "type": "simple_column", - "alias": "location", - "column": "nmrd.clinic" + "filterType": "tableColumns", + "conditionExpression": "nmrd.endDate >= ?", + "parameterName": "startDate" }, { - "type": "derived_column", - "alias": "tot_nw_mh", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.has_mhd = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.endDate <= ?", + "parameterName": "endDate" }, { - "type": "derived_column", - "alias": "tot_ct_mh", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.has_mhd = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.visit_this_month in ?", + "parameterName": "visitState" } - ], - "filters": { - "conditionJoinOperator": "and", - "conditions": [ - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.location_id in ?", - "parameterName": "locations" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.endDate >= ?", - "parameterName": "startDate" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.endDate <= ?", - "parameterName": "endDate" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.visit_this_month in ?", - "parameterName": "visitState" - } - ] - }, - "groupBy": { - "groupParam": "groupByParam", - "columns": ["nmrd.person_id"], - "excludeParam": "excludeParam" - }, - "paging": { - "offSetParam": "offSetParam", - "limitParam": "limitParam" - } + ] + }, + "groupBy": { + "groupParam": "groupByParam", + "columns": ["nmrd.person_id"], + "excludeParam": "excludeParam" + }, + "paging": { + "offSetParam": "offSetParam", + "limitParam": "limitParam" } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/total-mh-aggregate.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/total-mh-aggregate.json index a6989fab3..a563ddce9 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/total-mh-aggregate.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/total-mh-aggregate.json @@ -1,75 +1,74 @@ { - "name": "totMDPlhivAggregate", - "version": "1.0", - "tag": "", - "description": "", - "uses": [ - { - "name": "totMDPlhivBase", - "version": "1.0", - "type": "dataset_def" - } - ], - "sources": [ - { - "dataSet": "totMDPlhivBase", - "alias": "b" - } - ], - "columns": [ - { - "type": "derived_column", - "alias": "join_location", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "1" - } - }, - { - "type": "simple_column", - "alias": "location_id", - "column": "b.location_id" - }, - { - "type": "simple_column", - "alias": "location_uuid", - "column": "b.location_uuid" - }, - { - "type": "simple_column", - "alias": "location", - "column": "b.location" - }, - { - "type": "simple_column", - "alias": "tot_mh", - "column": "sum(b.tot_mh)" + "name": "totMDPlhivAggregate", + "version": "1.0", + "tag": "", + "description": "", + "uses": [ + { + "name": "totMDPlhivBase", + "version": "1.0", + "type": "dataset_def" + } + ], + "sources": [ + { + "dataSet": "totMDPlhivBase", + "alias": "b" + } + ], + "columns": [ + { + "type": "derived_column", + "alias": "join_location", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "1" } - ], - "groupBy": { - "groupParam": "groupByParam", - "columns": ["b.location_id"], - "excludeParam": "excludeParam" }, - "transFormDirectives": { - "joinColumn": "location_id", - "joinColumnParam": "", - "skipColumns": [""], - "disaggregationColumns": [] + { + "type": "simple_column", + "alias": "location_id", + "column": "b.location_id" + }, + { + "type": "simple_column", + "alias": "location_uuid", + "column": "b.location_uuid" }, - "dynamicJsonQueryGenerationDirectives": { - "patientListGenerator": { - "useTemplate": "patient-list-with-contacts-template", - "useTemplateVersion": "1.0", - "generatingDirectives": { - "joinDirectives": { - "joinType": "INNER", - "joinCondition": "<> = <>", - "baseColumn": "person_id", - "templateColumn": "person_id" - } + { + "type": "simple_column", + "alias": "location", + "column": "b.location" + }, + { + "type": "simple_column", + "alias": "tot_mh", + "column": "sum(b.tot_mh)" + } + ], + "groupBy": { + "groupParam": "groupByParam", + "columns": ["b.location_id"], + "excludeParam": "excludeParam" + }, + "transFormDirectives": { + "joinColumn": "location_id", + "joinColumnParam": "", + "skipColumns": [""], + "disaggregationColumns": [] + }, + "dynamicJsonQueryGenerationDirectives": { + "patientListGenerator": { + "useTemplate": "patient-list-with-contacts-template", + "useTemplateVersion": "1.0", + "generatingDirectives": { + "joinDirectives": { + "joinType": "INNER", + "joinCondition": "<> = <>", + "baseColumn": "person_id", + "templateColumn": "person_id" } } } } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/total-mh-base.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/total-mh-base.json index ab59943de..0cb65798c 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/total-mh-base.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/mental-health-disorder/total-mh-base.json @@ -1,130 +1,129 @@ { - "name": "totMDPlhivBase", - "version": "1.0", - "tag": "", - "description": "", - "uses": [], - "sources": [ - { - "table": "etl.ncd_monthly_report_dataset", - "alias": "nmrd" - }, - { - "table": "etl.hiv_monthly_report_dataset_v1_2", - "alias": "hmrd", - "join": { - "type": "INNER", - "joinCondition": "nmrd.person_id = hmrd.person_id AND hmrd.status = 'active'" - } - }, - { - "table": "etl.flat_patient_identifiers_v1", - "alias": "fi", - "join": { - "type": "LEFT", - "joinCondition": "nmrd.person_id = fi.patient_id" - } - }, - { - "table": "amrs.location", - "alias": "l", - "join": { - "type": "INNER", - "joinCondition": "nmrd.location_id = l.location_id" - } - }, - { - "table": "amrs.person", - "alias": "per", - "join": { - "type": "INNER", - "joinCondition": "nmrd.person_id = per.person_id" - } + "name": "totMDPlhivBase", + "version": "1.0", + "tag": "", + "description": "", + "uses": [], + "sources": [ + { + "table": "etl.ncd_monthly_report_dataset", + "alias": "nmrd" + }, + { + "table": "etl.hiv_monthly_report_dataset_v1_2", + "alias": "hmrd", + "join": { + "type": "INNER", + "joinCondition": "nmrd.person_id = hmrd.person_id AND hmrd.status = 'active'" } - ], - "columns": [ - { - "type": "simple_column", - "alias": "location_uuid", - "column": "nmrd.location_uuid" - }, - { - "type": "simple_column", - "alias": "person_id", - "column": "nmrd.person_id" - }, - { - "type": "simple_column", - "alias": "ccc_number", - "column": "fi.ccc" - }, - { - "type": "simple_column", - "alias": "ovcid_id", - "column": "fi.ovcid" - }, - { - "type": "simple_column", - "alias": "upi_number", - "column": "fi.nupi" - }, + }, + { + "table": "etl.flat_patient_identifiers_v1", + "alias": "fi", + "join": { + "type": "LEFT", + "joinCondition": "nmrd.person_id = fi.patient_id" + } + }, + { + "table": "amrs.location", + "alias": "l", + "join": { + "type": "INNER", + "joinCondition": "nmrd.location_id = l.location_id" + } + }, + { + "table": "amrs.person", + "alias": "per", + "join": { + "type": "INNER", + "joinCondition": "nmrd.person_id = per.person_id" + } + } + ], + "columns": [ + { + "type": "simple_column", + "alias": "location_uuid", + "column": "nmrd.location_uuid" + }, + { + "type": "simple_column", + "alias": "person_id", + "column": "nmrd.person_id" + }, + { + "type": "simple_column", + "alias": "ccc_number", + "column": "fi.ccc" + }, + { + "type": "simple_column", + "alias": "ovcid_id", + "column": "fi.ovcid" + }, + { + "type": "simple_column", + "alias": "upi_number", + "column": "fi.nupi" + }, + { + "type": "simple_column", + "alias": "age", + "column": "nmrd.age" + }, + { + "type": "simple_column", + "alias": "location_id", + "column": "nmrd.location_id" + }, + { + "type": "simple_column", + "alias": "location", + "column": "nmrd.clinic" + }, + { + "type": "derived_column", + "alias": "tot_mh", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.has_mhd = 1), 1, 0)" + } + } + ], + "filters": { + "conditionJoinOperator": "and", + "conditions": [ { - "type": "simple_column", - "alias": "age", - "column": "nmrd.age" + "filterType": "tableColumns", + "conditionExpression": "nmrd.location_id in ?", + "parameterName": "locations" }, { - "type": "simple_column", - "alias": "location_id", - "column": "nmrd.location_id" + "filterType": "tableColumns", + "conditionExpression": "nmrd.endDate >= ?", + "parameterName": "startDate" }, { - "type": "simple_column", - "alias": "location", - "column": "nmrd.clinic" + "filterType": "tableColumns", + "conditionExpression": "nmrd.endDate <= ?", + "parameterName": "endDate" }, { - "type": "derived_column", - "alias": "tot_mh", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.has_mhd = 1), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.visit_this_month in ?", + "parameterName": "visitState" } - ], - "filters": { - "conditionJoinOperator": "and", - "conditions": [ - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.location_id in ?", - "parameterName": "locations" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.endDate >= ?", - "parameterName": "startDate" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.endDate <= ?", - "parameterName": "endDate" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.visit_this_month in ?", - "parameterName": "visitState" - } - ] - }, - "groupBy": { - "groupParam": "groupByParam", - "columns": ["nmrd.person_id"], - "excludeParam": "excludeParam" - }, - "paging": { - "offSetParam": "offSetParam", - "limitParam": "limitParam" - } + ] + }, + "groupBy": { + "groupParam": "groupByParam", + "columns": ["nmrd.person_id"], + "excludeParam": "excludeParam" + }, + "paging": { + "offSetParam": "offSetParam", + "limitParam": "limitParam" } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/neurological-disease/neuro-aggregate.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/neurological-disease/neuro-aggregate.json index 611868220..ee8dae2b8 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/neurological-disease/neuro-aggregate.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/neurological-disease/neuro-aggregate.json @@ -1,175 +1,174 @@ { - "name": "neuPlhivAggregate", - "version": "1.0", - "tag": "", - "description": "", - "uses": [ - { - "name": "neuPlhivBase", - "version": "1.0", - "type": "dataset_def" - } - ], - "sources": [ - { - "dataSet": "neuPlhivBase", - "alias": "b" - } - ], - "columns": [ - { - "type": "derived_column", - "alias": "join_location", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "1" - } - }, - { - "type": "simple_column", - "alias": "location_id", - "column": "b.location_id" - }, - { - "type": "simple_column", - "alias": "location_uuid", - "column": "b.location_uuid" - }, - { - "type": "simple_column", - "alias": "location", - "column": "b.location" - }, - { - "type": "simple_column", - "alias": "mg_nw_m", - "column": "sum(b.mg_nw_m)" - }, - { - "type": "simple_column", - "alias": "mg_nw_f", - "column": "sum(b.mg_nw_f)" - }, - { - "type": "simple_column", - "alias": "tot_mg_nw", - "column": "sum(b.tot_mg_nw)" - }, - { - "type": "simple_column", - "alias": "mg_ct_m", - "column": "sum(b.mg_ct_m)" - }, - { - "type": "simple_column", - "alias": "mg_ct_f", - "column": "sum(b.mg_ct_f)" - }, - { - "type": "simple_column", - "alias": "tot_mg_ct", - "column": "sum(b.tot_mg_ct)" - }, - { - "type": "simple_column", - "alias": "cnv_nw_m", - "column": "sum(b.cnv_nw_m)" - }, - { - "type": "simple_column", - "alias": "cnv_nw_f", - "column": "sum(b.cnv_nw_f)" - }, - { - "type": "simple_column", - "alias": "tot_cnv_nw", - "column": "sum(b.tot_cnv_nw)" - }, - { - "type": "simple_column", - "alias": "cnv_ct_m", - "column": "sum(b.cnv_ct_m)" - }, - { - "type": "simple_column", - "alias": "cnv_ct_f", - "column": "sum(b.cnv_ct_f)" - }, - { - "type": "simple_column", - "alias": "tot_cnv_ct", - "column": "sum(b.tot_cnv_ct)" - }, - { - "type": "simple_column", - "alias": "sub_tot_nw_neu_m", - "column": "sum(b.sub_tot_nw_neu_m)" - }, - { - "type": "simple_column", - "alias": "sub_tot_nw_neu_f", - "column": "sum(b.sub_tot_nw_neu_f)" - }, - { - "type": "simple_column", - "alias": "sub_tot_nw_neu", - "column": "sum(b.sub_tot_nw_neu)" - }, - { - "type": "simple_column", - "alias": "sub_tot_ct_neu_m", - "column": "sum(b.sub_tot_ct_neu_m)" - }, - { - "type": "simple_column", - "alias": "sub_tot_ct_neu_f", - "column": "sum(b.sub_tot_ct_neu_f)" - }, - { - "type": "simple_column", - "alias": "sub_tot_ct_neu", - "column": "sum(b.sub_tot_ct_neu)" - }, - { - "type": "simple_column", - "alias": "tot_nw_neu", - "column": "sum(b.tot_nw_neu)" - }, - { - "type": "simple_column", - "alias": "tot_ct_neu", - "column": "sum(b.tot_ct_neu)" - }, - { - "type": "simple_column", - "alias": "tot_neu", - "column": "sum(b.tot_neu)" + "name": "neuPlhivAggregate", + "version": "1.0", + "tag": "", + "description": "", + "uses": [ + { + "name": "neuPlhivBase", + "version": "1.0", + "type": "dataset_def" + } + ], + "sources": [ + { + "dataSet": "neuPlhivBase", + "alias": "b" + } + ], + "columns": [ + { + "type": "derived_column", + "alias": "join_location", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "1" } - ], - "groupBy": { - "groupParam": "groupByParam", - "columns": ["b.location_id"], - "excludeParam": "excludeParam" - }, - "transFormDirectives": { - "joinColumn": "location_id", - "joinColumnParam": "", - "skipColumns": [""], - "disaggregationColumns": [] - }, - "dynamicJsonQueryGenerationDirectives": { - "patientListGenerator": { - "useTemplate": "patient-list-with-contacts-template", - "useTemplateVersion": "1.0", - "generatingDirectives": { - "joinDirectives": { - "joinType": "INNER", - "joinCondition": "<> = <>", - "baseColumn": "person_id", - "templateColumn": "person_id" - } + }, + { + "type": "simple_column", + "alias": "location_id", + "column": "b.location_id" + }, + { + "type": "simple_column", + "alias": "location_uuid", + "column": "b.location_uuid" + }, + { + "type": "simple_column", + "alias": "location", + "column": "b.location" + }, + { + "type": "simple_column", + "alias": "mg_nw_m", + "column": "sum(b.mg_nw_m)" + }, + { + "type": "simple_column", + "alias": "mg_nw_f", + "column": "sum(b.mg_nw_f)" + }, + { + "type": "simple_column", + "alias": "tot_mg_nw", + "column": "sum(b.tot_mg_nw)" + }, + { + "type": "simple_column", + "alias": "mg_ct_m", + "column": "sum(b.mg_ct_m)" + }, + { + "type": "simple_column", + "alias": "mg_ct_f", + "column": "sum(b.mg_ct_f)" + }, + { + "type": "simple_column", + "alias": "tot_mg_ct", + "column": "sum(b.tot_mg_ct)" + }, + { + "type": "simple_column", + "alias": "cnv_nw_m", + "column": "sum(b.cnv_nw_m)" + }, + { + "type": "simple_column", + "alias": "cnv_nw_f", + "column": "sum(b.cnv_nw_f)" + }, + { + "type": "simple_column", + "alias": "tot_cnv_nw", + "column": "sum(b.tot_cnv_nw)" + }, + { + "type": "simple_column", + "alias": "cnv_ct_m", + "column": "sum(b.cnv_ct_m)" + }, + { + "type": "simple_column", + "alias": "cnv_ct_f", + "column": "sum(b.cnv_ct_f)" + }, + { + "type": "simple_column", + "alias": "tot_cnv_ct", + "column": "sum(b.tot_cnv_ct)" + }, + { + "type": "simple_column", + "alias": "sub_tot_nw_neu_m", + "column": "sum(b.sub_tot_nw_neu_m)" + }, + { + "type": "simple_column", + "alias": "sub_tot_nw_neu_f", + "column": "sum(b.sub_tot_nw_neu_f)" + }, + { + "type": "simple_column", + "alias": "sub_tot_nw_neu", + "column": "sum(b.sub_tot_nw_neu)" + }, + { + "type": "simple_column", + "alias": "sub_tot_ct_neu_m", + "column": "sum(b.sub_tot_ct_neu_m)" + }, + { + "type": "simple_column", + "alias": "sub_tot_ct_neu_f", + "column": "sum(b.sub_tot_ct_neu_f)" + }, + { + "type": "simple_column", + "alias": "sub_tot_ct_neu", + "column": "sum(b.sub_tot_ct_neu)" + }, + { + "type": "simple_column", + "alias": "tot_nw_neu", + "column": "sum(b.tot_nw_neu)" + }, + { + "type": "simple_column", + "alias": "tot_ct_neu", + "column": "sum(b.tot_ct_neu)" + }, + { + "type": "simple_column", + "alias": "tot_neu", + "column": "sum(b.tot_neu)" + } + ], + "groupBy": { + "groupParam": "groupByParam", + "columns": ["b.location_id"], + "excludeParam": "excludeParam" + }, + "transFormDirectives": { + "joinColumn": "location_id", + "joinColumnParam": "", + "skipColumns": [""], + "disaggregationColumns": [] + }, + "dynamicJsonQueryGenerationDirectives": { + "patientListGenerator": { + "useTemplate": "patient-list-with-contacts-template", + "useTemplateVersion": "1.0", + "generatingDirectives": { + "joinDirectives": { + "joinType": "INNER", + "joinCondition": "<> = <>", + "baseColumn": "person_id", + "templateColumn": "person_id" } } } } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/neurological-disease/neuro-base.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/neurological-disease/neuro-base.json index e305c787c..b5493a544 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/neurological-disease/neuro-base.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/neurological-disease/neuro-base.json @@ -1,290 +1,289 @@ { - "name": "neuPlhivBase", - "version": "1.0", - "tag": "", - "description": "", - "uses": [], - "sources": [ - { - "table": "etl.ncd_monthly_report_dataset", - "alias": "nmrd" - }, - { - "table": "etl.hiv_monthly_report_dataset_v1_2", - "alias": "hmrd", - "join": { - "type": "INNER", - "joinCondition": "nmrd.person_id = hmrd.person_id AND nmrd.endDate = hmrd.endDate AND hmrd.status = 'active'" - } - }, - { - "table": "etl.flat_patient_identifiers_v1", - "alias": "fi", - "join": { - "type": "LEFT", - "joinCondition": "nmrd.person_id = fi.patient_id" - } - }, - { - "table": "amrs.location", - "alias": "l", - "join": { - "type": "INNER", - "joinCondition": "nmrd.location_id = l.location_id" - } - }, - { - "table": "amrs.person", - "alias": "per", - "join": { - "type": "INNER", - "joinCondition": "nmrd.person_id = per.person_id" - } + "name": "neuPlhivBase", + "version": "1.0", + "tag": "", + "description": "", + "uses": [], + "sources": [ + { + "table": "etl.ncd_monthly_report_dataset", + "alias": "nmrd" + }, + { + "table": "etl.hiv_monthly_report_dataset_v1_2", + "alias": "hmrd", + "join": { + "type": "INNER", + "joinCondition": "nmrd.person_id = hmrd.person_id AND nmrd.endDate = hmrd.endDate AND hmrd.status = 'active'" } - ], - "columns": [ - { - "type": "simple_column", - "alias": "location_uuid", - "column": "nmrd.location_uuid" - }, - { - "type": "simple_column", - "alias": "person_id", - "column": "nmrd.person_id" - }, - { - "type": "simple_column", - "alias": "ccc_number", - "column": "fi.ccc" - }, - { - "type": "simple_column", - "alias": "ovcid_id", - "column": "fi.ovcid" - }, - { - "type": "simple_column", - "alias": "upi_number", - "column": "fi.nupi" - }, - { - "type": "simple_column", - "alias": "age", - "column": "nmrd.age" - }, - { - "type": "simple_column", - "alias": "location_id", - "column": "nmrd.location_id" - }, - { - "type": "simple_column", - "alias": "location", - "column": "nmrd.clinic" - }, - { - "type": "derived_column", - "alias": "mg_nw_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.has_migraine = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "mg_nw_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.has_migraine = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "tot_mg_nw", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF(((nmrd.gender = 'M' OR nmrd.gender = 'F') AND nmrd.has_migraine = 1 and hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "mg_ct_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.has_migraine = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "mg_ct_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.has_migraine = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "tot_mg_ct", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF(((nmrd.gender = 'M' OR nmrd.gender = 'F') AND nmrd.has_migraine = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "cnv_nw_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.has_convulsive_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "cnv_nw_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.has_convulsive_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "tot_cnv_nw", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF(((nmrd.gender = 'M' OR nmrd.gender = 'F') AND nmrd.has_convulsive_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "cnv_ct_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.has_convulsive_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "cnv_ct_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.has_convulsive_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "tot_cnv_ct", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF(((nmrd.gender = 'M' OR nmrd.gender = 'F') AND nmrd.has_convulsive_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "sub_tot_nw_neu_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.has_neurological_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "sub_tot_nw_neu_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.has_neurological_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "sub_tot_nw_neu", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.has_neurological_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "sub_tot_ct_neu_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.has_neurological_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "sub_tot_ct_neu_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.has_neurological_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } - }, + }, + { + "table": "etl.flat_patient_identifiers_v1", + "alias": "fi", + "join": { + "type": "LEFT", + "joinCondition": "nmrd.person_id = fi.patient_id" + } + }, + { + "table": "amrs.location", + "alias": "l", + "join": { + "type": "INNER", + "joinCondition": "nmrd.location_id = l.location_id" + } + }, + { + "table": "amrs.person", + "alias": "per", + "join": { + "type": "INNER", + "joinCondition": "nmrd.person_id = per.person_id" + } + } + ], + "columns": [ + { + "type": "simple_column", + "alias": "location_uuid", + "column": "nmrd.location_uuid" + }, + { + "type": "simple_column", + "alias": "person_id", + "column": "nmrd.person_id" + }, + { + "type": "simple_column", + "alias": "ccc_number", + "column": "fi.ccc" + }, + { + "type": "simple_column", + "alias": "ovcid_id", + "column": "fi.ovcid" + }, + { + "type": "simple_column", + "alias": "upi_number", + "column": "fi.nupi" + }, + { + "type": "simple_column", + "alias": "age", + "column": "nmrd.age" + }, + { + "type": "simple_column", + "alias": "location_id", + "column": "nmrd.location_id" + }, + { + "type": "simple_column", + "alias": "location", + "column": "nmrd.clinic" + }, + { + "type": "derived_column", + "alias": "mg_nw_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.has_migraine = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "mg_nw_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.has_migraine = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_mg_nw", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF(((nmrd.gender = 'M' OR nmrd.gender = 'F') AND nmrd.has_migraine = 1 and hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "mg_ct_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.has_migraine = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "mg_ct_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.has_migraine = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_mg_ct", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF(((nmrd.gender = 'M' OR nmrd.gender = 'F') AND nmrd.has_migraine = 1 and hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "cnv_nw_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.has_convulsive_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "cnv_nw_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.has_convulsive_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_cnv_nw", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF(((nmrd.gender = 'M' OR nmrd.gender = 'F') AND nmrd.has_convulsive_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "cnv_ct_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.has_convulsive_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "cnv_ct_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.has_convulsive_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_cnv_ct", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF(((nmrd.gender = 'M' OR nmrd.gender = 'F') AND nmrd.has_convulsive_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "sub_tot_nw_neu_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.has_neurological_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "sub_tot_nw_neu_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.has_neurological_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "sub_tot_nw_neu", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.has_neurological_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "sub_tot_ct_neu_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.has_neurological_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "sub_tot_ct_neu_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.has_neurological_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "sub_tot_ct_neu", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.has_neurological_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_nw_neu", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.has_neurological_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_ct_neu", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.has_neurological_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_neu", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.has_neurological_disorder = 1), 1, 0)" + } + } + ], + "filters": { + "conditionJoinOperator": "and", + "conditions": [ { - "type": "derived_column", - "alias": "sub_tot_ct_neu", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.has_neurological_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.location_id in ?", + "parameterName": "locations" }, { - "type": "derived_column", - "alias": "tot_nw_neu", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.has_neurological_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.endDate >= ?", + "parameterName": "startDate" }, { - "type": "derived_column", - "alias": "tot_ct_neu", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.has_neurological_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.endDate <= ?", + "parameterName": "endDate" }, { - "type": "derived_column", - "alias": "tot_neu", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.has_neurological_disorder = 1), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.visit_this_month in ?", + "parameterName": "visitState" } - ], - "filters": { - "conditionJoinOperator": "and", - "conditions": [ - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.location_id in ?", - "parameterName": "locations" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.endDate >= ?", - "parameterName": "startDate" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.endDate <= ?", - "parameterName": "endDate" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.visit_this_month in ?", - "parameterName": "visitState" - } - ] - }, - "groupBy": { - "groupParam": "groupByParam", - "columns": ["hmrd.person_id"], - "excludeParam": "excludeParam" - }, - "paging": { - "offSetParam": "offSetParam", - "limitParam": "limitParam" - } + ] + }, + "groupBy": { + "groupParam": "groupByParam", + "columns": ["hmrd.person_id"], + "excludeParam": "excludeParam" + }, + "paging": { + "offSetParam": "offSetParam", + "limitParam": "limitParam" } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/rheumatologic-disease/rheu-aggregate.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/rheumatologic-disease/rheu-aggregate.json index 142b639c2..a9f7690d4 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/rheumatologic-disease/rheu-aggregate.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/rheumatologic-disease/rheu-aggregate.json @@ -1,238 +1,237 @@ { - "name": "rhePlhivAggregate", - "version": "1.0", - "tag": "", - "description": "", - "uses": [ - { - "name": "rhePlhivBase", - "version": "1.0", - "type": "dataset_def" - } - ], - "sources": [ - { - "dataSet": "rhePlhivBase", - "alias": "b" - } - ], - "columns": [ - { - "type": "derived_column", - "alias": "join_location", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "1" - } - }, - { - "type": "simple_column", - "alias": "location_id", - "column": "b.location_id" - }, - { - "type": "simple_column", - "alias": "location_uuid", - "column": "b.location_uuid" - }, - { - "type": "simple_column", - "alias": "location", - "column": "b.location" - }, - { - "type": "derived_column", - "alias": "ra_nw_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.ra_nw_m)" - } - }, - { - "type": "derived_column", - "alias": "ra_nw_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.ra_nw_f)" - } - }, - { - "type": "derived_column", - "alias": "tot_ra_nw", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.tot_ra_nw)" - } - }, - { - "type": "derived_column", - "alias": "ra_ct_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.ra_ct_m)" - } - }, - { - "type": "derived_column", - "alias": "ra_ct_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.ra_ct_f)" - } - }, - { - "type": "derived_column", - "alias": "tot_ra_ct", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.tot_ra_ct)" - } - }, - { - "type": "derived_column", - "alias": "sle_nw_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.sle_nw_m)" - } - }, - { - "type": "derived_column", - "alias": "sle_nw_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.sle_nw_f)" - } - }, - { - "type": "derived_column", - "alias": "tot_sle_nw", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.tot_sle_nw)" - } - }, - { - "type": "derived_column", - "alias": "sle_ct_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.sle_ct_m)" - } - }, - { - "type": "derived_column", - "alias": "sle_ct_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.sle_ct_f)" - } - }, - { - "type": "derived_column", - "alias": "tot_sle_ct", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.tot_sle_ct)" - } - }, - { - "type": "derived_column", - "alias": "sub_tot_nw_rhe_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.sub_tot_nw_rhe_m)" - } - }, - { - "type": "derived_column", - "alias": "sub_tot_nw_rhe_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.sub_tot_nw_rhe_f)" - } - }, - { - "type": "derived_column", - "alias": "sub_tot_nw_rhe", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.sub_tot_nw_rhe)" - } - }, - { - "type": "derived_column", - "alias": "sub_tot_ct_rhe_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.sub_tot_ct_rhe_m)" - } - }, - { - "type": "derived_column", - "alias": "sub_tot_ct_rhe_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.sub_tot_ct_rhe_f)" - } - }, - { - "type": "derived_column", - "alias": "sub_tot_ct_rhe", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.sub_tot_ct_rhe)" - } - }, - { - "type": "derived_column", - "alias": "tot_nw_rhe", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.tot_nw_rhe)" - } - }, - { - "type": "derived_column", - "alias": "tot_ct_rhe", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.tot_ct_rhe)" - } - }, - { - "type": "derived_column", - "alias": "tot_rhe", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "sum(b.tot_rhe)" - } - } - ], - "groupBy": { - "groupParam": "groupByParam", - "columns": ["b.location_id"], - "excludeParam": "excludeParam" - }, - "transFormDirectives": { - "joinColumn": "location_id", - "joinColumnParam": "", - "skipColumns": [""], - "disaggregationColumns": [] - }, - "dynamicJsonQueryGenerationDirectives": { - "patientListGenerator": { - "useTemplate": "patient-list-with-contacts-template", - "useTemplateVersion": "1.0", - "generatingDirectives": { - "joinDirectives": { - "joinType": "INNER", - "joinCondition": "<> = <>", - "baseColumn": "person_id", - "templateColumn": "person_id" - } + "name": "rhePlhivAggregate", + "version": "1.0", + "tag": "", + "description": "", + "uses": [ + { + "name": "rhePlhivBase", + "version": "1.0", + "type": "dataset_def" + } + ], + "sources": [ + { + "dataSet": "rhePlhivBase", + "alias": "b" + } + ], + "columns": [ + { + "type": "derived_column", + "alias": "join_location", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "1" + } + }, + { + "type": "simple_column", + "alias": "location_id", + "column": "b.location_id" + }, + { + "type": "simple_column", + "alias": "location_uuid", + "column": "b.location_uuid" + }, + { + "type": "simple_column", + "alias": "location", + "column": "b.location" + }, + { + "type": "derived_column", + "alias": "ra_nw_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.ra_nw_m)" + } + }, + { + "type": "derived_column", + "alias": "ra_nw_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.ra_nw_f)" + } + }, + { + "type": "derived_column", + "alias": "tot_ra_nw", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.tot_ra_nw)" + } + }, + { + "type": "derived_column", + "alias": "ra_ct_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.ra_ct_m)" + } + }, + { + "type": "derived_column", + "alias": "ra_ct_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.ra_ct_f)" + } + }, + { + "type": "derived_column", + "alias": "tot_ra_ct", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.tot_ra_ct)" + } + }, + { + "type": "derived_column", + "alias": "sle_nw_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.sle_nw_m)" + } + }, + { + "type": "derived_column", + "alias": "sle_nw_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.sle_nw_f)" + } + }, + { + "type": "derived_column", + "alias": "tot_sle_nw", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.tot_sle_nw)" + } + }, + { + "type": "derived_column", + "alias": "sle_ct_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.sle_ct_m)" + } + }, + { + "type": "derived_column", + "alias": "sle_ct_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.sle_ct_f)" + } + }, + { + "type": "derived_column", + "alias": "tot_sle_ct", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.tot_sle_ct)" + } + }, + { + "type": "derived_column", + "alias": "sub_tot_nw_rhe_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.sub_tot_nw_rhe_m)" + } + }, + { + "type": "derived_column", + "alias": "sub_tot_nw_rhe_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.sub_tot_nw_rhe_f)" + } + }, + { + "type": "derived_column", + "alias": "sub_tot_nw_rhe", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.sub_tot_nw_rhe)" + } + }, + { + "type": "derived_column", + "alias": "sub_tot_ct_rhe_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.sub_tot_ct_rhe_m)" + } + }, + { + "type": "derived_column", + "alias": "sub_tot_ct_rhe_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.sub_tot_ct_rhe_f)" + } + }, + { + "type": "derived_column", + "alias": "sub_tot_ct_rhe", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.sub_tot_ct_rhe)" + } + }, + { + "type": "derived_column", + "alias": "tot_nw_rhe", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.tot_nw_rhe)" + } + }, + { + "type": "derived_column", + "alias": "tot_ct_rhe", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.tot_ct_rhe)" + } + }, + { + "type": "derived_column", + "alias": "tot_rhe", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "sum(b.tot_rhe)" + } + } + ], + "groupBy": { + "groupParam": "groupByParam", + "columns": ["b.location_id"], + "excludeParam": "excludeParam" + }, + "transFormDirectives": { + "joinColumn": "location_id", + "joinColumnParam": "", + "skipColumns": [""], + "disaggregationColumns": [] + }, + "dynamicJsonQueryGenerationDirectives": { + "patientListGenerator": { + "useTemplate": "patient-list-with-contacts-template", + "useTemplateVersion": "1.0", + "generatingDirectives": { + "joinDirectives": { + "joinType": "INNER", + "joinCondition": "<> = <>", + "baseColumn": "person_id", + "templateColumn": "person_id" } } } } - \ No newline at end of file +} diff --git a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/rheumatologic-disease/rheu-base.json b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/rheumatologic-disease/rheu-base.json index 1cd6e23a2..85480798f 100644 --- a/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/rheumatologic-disease/rheu-base.json +++ b/app/reporting-framework/json-reports/plhiv-ncd-v2-reports/disaggregations/rheumatologic-disease/rheu-base.json @@ -1,290 +1,289 @@ { - "name": "rhePlhivBase", - "version": "1.0", - "tag": "", - "description": "", - "uses": [], - "sources": [ - { - "table": "etl.ncd_monthly_report_dataset", - "alias": "nmrd" - }, - { - "table": "etl.hiv_monthly_report_dataset_v1_2", - "alias": "hmrd", - "join": { - "type": "LEFT", - "joinCondition": "nmrd.person_id = hmrd.person_id AND nmrd.endDate = hmrd.endDate AND hmrd.status = 'active'" - } - }, - { - "table": "etl.flat_patient_identifiers_v1", - "alias": "fi", - "join": { - "type": "LEFT", - "joinCondition": "nmrd.person_id = fi.patient_id" - } - }, - { - "table": "amrs.location", - "alias": "l", - "join": { - "type": "INNER", - "joinCondition": "nmrd.location_id = l.location_id" - } - }, - { - "table": "amrs.person", - "alias": "per", - "join": { - "type": "INNER", - "joinCondition": "nmrd.person_id = per.person_id" - } - } - ], - "columns": [ - { - "type": "simple_column", - "alias": "location_uuid", - "column": "nmrd.location_uuid" - }, - { - "type": "simple_column", - "alias": "person_id", - "column": "nmrd.person_id" - }, - { - "type": "simple_column", - "alias": "ccc_number", - "column": "fi.ccc" - }, - { - "type": "simple_column", - "alias": "ovcid_id", - "column": "fi.ovcid" - }, - { - "type": "simple_column", - "alias": "upi_number", - "column": "fi.nupi" - }, - { - "type": "simple_column", - "alias": "age", - "column": "nmrd.age" - }, - { - "type": "simple_column", - "alias": "location_id", - "column": "nmrd.location_id" - }, - { - "type": "simple_column", - "alias": "location", - "column": "nmrd.clinic" - }, - { - "type": "derived_column", - "alias": "ra_nw_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.has_arthritis = 1 AND hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "ra_nw_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.has_arthritis = 1 AND hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "tot_ra_nw", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF(((nmrd.gender = 'F' OR nmrd.gender = 'M') AND nmrd.has_arthritis = 1 AND hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "ra_ct_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.has_arthritis = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "ra_ct_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.has_arthritis = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "tot_ra_ct", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF(((nmrd.gender = 'F' OR nmrd.gender = 'M') AND nmrd.has_arthritis = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "sle_nw_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.has_SLE = 1 AND hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "sle_nw_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.has_SLE = 1 AND hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "tot_sle_nw", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF(((nmrd.gender = 'F' OR nmrd.gender = 'M') AND nmrd.has_SLE = 1 AND hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "sle_ct_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.has_SLE = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "sle_ct_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.has_SLE = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "tot_sle_ct", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF(((nmrd.gender = 'M' OR nmrd.gender = 'F') AND nmrd.has_SLE = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "sub_tot_nw_rhe_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.has_rheumatologic_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "sub_tot_nw_rhe_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.has_rheumatologic_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "sub_tot_nw_rhe", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF(((nmrd.gender = 'M' OR nmrd.gender = 'F') AND nmrd.has_rheumatologic_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "sub_tot_ct_rhe_m", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'M' AND nmrd.has_rheumatologic_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } - }, - { - "type": "derived_column", - "alias": "sub_tot_ct_rhe_f", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.gender = 'F' AND nmrd.has_rheumatologic_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } - }, + "name": "rhePlhivBase", + "version": "1.0", + "tag": "", + "description": "", + "uses": [], + "sources": [ + { + "table": "etl.ncd_monthly_report_dataset", + "alias": "nmrd" + }, + { + "table": "etl.hiv_monthly_report_dataset_v1_2", + "alias": "hmrd", + "join": { + "type": "LEFT", + "joinCondition": "nmrd.person_id = hmrd.person_id AND nmrd.endDate = hmrd.endDate AND hmrd.status = 'active'" + } + }, + { + "table": "etl.flat_patient_identifiers_v1", + "alias": "fi", + "join": { + "type": "LEFT", + "joinCondition": "nmrd.person_id = fi.patient_id" + } + }, + { + "table": "amrs.location", + "alias": "l", + "join": { + "type": "INNER", + "joinCondition": "nmrd.location_id = l.location_id" + } + }, + { + "table": "amrs.person", + "alias": "per", + "join": { + "type": "INNER", + "joinCondition": "nmrd.person_id = per.person_id" + } + } + ], + "columns": [ + { + "type": "simple_column", + "alias": "location_uuid", + "column": "nmrd.location_uuid" + }, + { + "type": "simple_column", + "alias": "person_id", + "column": "nmrd.person_id" + }, + { + "type": "simple_column", + "alias": "ccc_number", + "column": "fi.ccc" + }, + { + "type": "simple_column", + "alias": "ovcid_id", + "column": "fi.ovcid" + }, + { + "type": "simple_column", + "alias": "upi_number", + "column": "fi.nupi" + }, + { + "type": "simple_column", + "alias": "age", + "column": "nmrd.age" + }, + { + "type": "simple_column", + "alias": "location_id", + "column": "nmrd.location_id" + }, + { + "type": "simple_column", + "alias": "location", + "column": "nmrd.clinic" + }, + { + "type": "derived_column", + "alias": "ra_nw_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.has_arthritis = 1 AND hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "ra_nw_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.has_arthritis = 1 AND hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_ra_nw", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF(((nmrd.gender = 'F' OR nmrd.gender = 'M') AND nmrd.has_arthritis = 1 AND hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "ra_ct_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.has_arthritis = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "ra_ct_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.has_arthritis = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_ra_ct", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF(((nmrd.gender = 'F' OR nmrd.gender = 'M') AND nmrd.has_arthritis = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "sle_nw_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.has_SLE = 1 AND hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "sle_nw_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.has_SLE = 1 AND hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_sle_nw", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF(((nmrd.gender = 'F' OR nmrd.gender = 'M') AND nmrd.has_SLE = 1 AND hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "sle_ct_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.has_SLE = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "sle_ct_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.has_SLE = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_sle_ct", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF(((nmrd.gender = 'M' OR nmrd.gender = 'F') AND nmrd.has_SLE = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "sub_tot_nw_rhe_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.has_rheumatologic_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "sub_tot_nw_rhe_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.has_rheumatologic_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "sub_tot_nw_rhe", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF(((nmrd.gender = 'M' OR nmrd.gender = 'F') AND nmrd.has_rheumatologic_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "sub_tot_ct_rhe_m", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'M' AND nmrd.has_rheumatologic_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "sub_tot_ct_rhe_f", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.gender = 'F' AND nmrd.has_rheumatologic_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "sub_tot_ct_rhe", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF(((nmrd.gender = 'F' OR nmrd.gender = 'M') AND nmrd.has_rheumatologic_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_nw_rhe", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.has_rheumatologic_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_ct_rhe", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.has_rheumatologic_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" + } + }, + { + "type": "derived_column", + "alias": "tot_rhe", + "expressionType": "simple_expression", + "expressionOptions": { + "expression": "IF((nmrd.has_rheumatologic_disorder = 1), 1, 0)" + } + } + ], + "filters": { + "conditionJoinOperator": "and", + "conditions": [ { - "type": "derived_column", - "alias": "sub_tot_ct_rhe", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF(((nmrd.gender = 'F' OR nmrd.gender = 'M') AND nmrd.has_rheumatologic_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.location_id in ?", + "parameterName": "locations" }, { - "type": "derived_column", - "alias": "tot_nw_rhe", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.has_rheumatologic_disorder = 1 AND hmrd.started_art_this_month = 1), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.endDate >= ?", + "parameterName": "startDate" }, { - "type": "derived_column", - "alias": "tot_ct_rhe", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.has_rheumatologic_disorder = 1 AND hmrd.on_art_this_month = 1 AND hmrd.started_art_this_month = 0), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.endDate <= ?", + "parameterName": "endDate" }, { - "type": "derived_column", - "alias": "tot_rhe", - "expressionType": "simple_expression", - "expressionOptions": { - "expression": "IF((nmrd.has_rheumatologic_disorder = 1), 1, 0)" - } + "filterType": "tableColumns", + "conditionExpression": "nmrd.visit_this_month in ?", + "parameterName": "visitState" } - ], - "filters": { - "conditionJoinOperator": "and", - "conditions": [ - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.location_id in ?", - "parameterName": "locations" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.endDate >= ?", - "parameterName": "startDate" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.endDate <= ?", - "parameterName": "endDate" - }, - { - "filterType": "tableColumns", - "conditionExpression": "nmrd.visit_this_month in ?", - "parameterName": "visitState" - } - ] - }, - "groupBy": { - "groupParam": "groupByParam", - "columns": ["nmrd.person_id"], - "excludeParam": "excludeParam" - }, - "paging": { - "offSetParam": "offSetParam", - "limitParam": "limitParam" - } + ] + }, + "groupBy": { + "groupParam": "groupByParam", + "columns": ["nmrd.person_id"], + "excludeParam": "excludeParam" + }, + "paging": { + "offSetParam": "offSetParam", + "limitParam": "limitParam" } - \ No newline at end of file +} diff --git a/app/routes/plhiv-ncd-v2-report.route.js b/app/routes/plhiv-ncd-v2-report.route.js index 9a239d6dd..c3142b4e9 100644 --- a/app/routes/plhiv-ncd-v2-report.route.js +++ b/app/routes/plhiv-ncd-v2-report.route.js @@ -73,7 +73,7 @@ const routes = [ requestParams.currentView === 'monthly' ? [0, 1] : [1]; let reportParams = etlHelpers.getReportParams( 'plhiv-ncd-v2-monthly-report', - ['startDate','endDate', 'locationUuids'], + ['startDate', 'endDate', 'locationUuids'], requestParams ); delete reportParams.requestParams['gender']; diff --git a/service/plhiv-ncd-v2/plhiv-ncd-v2-summary.service.js b/service/plhiv-ncd-v2/plhiv-ncd-v2-summary.service.js index 0ef7f02d8..d5f228bdc 100644 --- a/service/plhiv-ncd-v2/plhiv-ncd-v2-summary.service.js +++ b/service/plhiv-ncd-v2/plhiv-ncd-v2-summary.service.js @@ -16,7 +16,6 @@ export class PLHIVNCDv2SummaryReportService extends MultiDatasetPatientlistRepor } generateReport(additionalParams) { - console.log("params: ", this.params, additionalParams) const that = this; return new Promise((resolve, reject) => { that