Skip to content

Commit

Permalink
adding event driven indicators (#1332)
Browse files Browse the repository at this point in the history
* adding event driven indicators

* Update build-json-schema.js

* Update build-json-schema.js

---------

Co-authored-by: Drizzentic <[email protected]>
  • Loading branch information
sharleenawinja and drizzentic authored Oct 5, 2023
1 parent abcfbb7 commit e049e6e
Show file tree
Hide file tree
Showing 55 changed files with 3,996 additions and 657 deletions.
9 changes: 9 additions & 0 deletions app/reporting-framework/base-mysql.report.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ import * as reasons_for_initiation_prep_base from './json-reports/prep-monthly/d
import * as new_for_prep_aggregate from './json-reports/prep-monthly/disaggregations/new/new-for-prep-aggregate.json';
import * as new_for_prep_base from './json-reports/prep-monthly/disaggregations/new/new-for-prep-base.json';

import * as prep_event_driven_aggregate from './json-reports/prep-monthly/disaggregations/event-driven/prep-event-driven-aggregate.json';
import * as prep_event_driven_base from './json-reports/prep-monthly/disaggregations/event-driven/prep-event-driven-base.json';

import * as restarting_prep_aggregate from './json-reports/prep-monthly/disaggregations/restarting/restarting-prep-aggregate.json';
import * as restarting_prep_base from './json-reports/prep-monthly/disaggregations/restarting/restarting-prep-base.json';

Expand Down Expand Up @@ -1418,6 +1421,12 @@ export class BaseMysqlReport {
newForPrepBase: this.cloneJsonSchema(new_for_prep_base)
});
break;
case 'eventDrivenPrepAggregate':
resolve({
main: this.cloneJsonSchema(prep_event_driven_aggregate),
eventDrivenPrepBase: this.cloneJsonSchema(prep_event_driven_base)
});
break;
case 'restartingPrepAggregate':
resolve({
main: this.cloneJsonSchema(restarting_prep_aggregate),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,11 @@
"type": "simple_column",
"alias": "total_yy_pbfw",
"column": "sum(b.total_yy_pbfw)"
},
{
"type": "simple_column",
"alias": "total_reason_for_discontinuation_other_reasons",
"column": "sum(b.total_reason_for_discontinuation_other_reasons)"
}
],
"groupBy": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"uses": [],
"sources": [
{
"table": "etl.prep_monthly_report_dataset_v3",
"table": "etl.prep_monthly_report_dataset_v5",
"alias": "pd"
},
{
Expand Down Expand Up @@ -1743,6 +1743,14 @@
"expressionOptions": {
"expression": "if(((pd.discontinued_from_prep_this_month = 1 AND pd.reason_for_discontinuation = '5622') AND pd.population_type = 9), 1, NULL)"
}
},
{
"type": "derived_column",
"alias": "total_reason_for_discontinuation_other_reasons",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "if((pd.discontinued_from_prep_this_month = 1 AND pd.reason_for_discontinuation = '5622'), 1, NULL)"
}
}
],
"filters": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,11 @@
"type": "simple_column",
"alias": "total_vv_pbfw",
"column": "sum(b.total_vv_pbfw)"
},
{
"type": "simple_column",
"alias": "total_reason_for_discontinuation_died",
"column": "sum(b.total_reason_for_discontinuation_died)"
}
],
"groupBy": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"uses": [],
"sources": [
{
"table": "etl.prep_monthly_report_dataset_v3",
"table": "etl.prep_monthly_report_dataset_v5",
"alias": "pd"
},
{
Expand Down Expand Up @@ -1743,6 +1743,14 @@
"expressionOptions": {
"expression": "if(((pd.discontinued_from_prep_this_month = 1 AND pd.reason_for_discontinuation = '1593') AND pd.population_type = 9), 1, NULL)"
}
},
{
"type": "derived_column",
"alias": "total_reason_for_discontinuation_died",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "if((pd.discontinued_from_prep_this_month = 1 AND pd.reason_for_discontinuation = '1593'), 1, NULL)"
}
}
],
"filters": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,11 @@
"type": "simple_column",
"alias": "total_st_pbfw",
"column": "sum(b.total_st_pbfw)"
},
{
"type": "simple_column",
"alias": "total_discontinued_prep_this_month",
"column": "sum(b.total_discontinued_prep_this_month)"
}
],
"groupBy": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"uses": [],
"sources": [
{
"table": "etl.prep_monthly_report_dataset_v3",
"table": "etl.prep_monthly_report_dataset_v5",
"alias": "pd"
},
{
Expand Down Expand Up @@ -818,7 +818,7 @@
"alias": "total_st_mahr",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "if((pd.discontinued_from_prep_this_month = 1 AND (pd.old_population_type = 300 OR pd.population_type = 4)), 1, NULL)"
"expression": "if((pd.discontinued_from_prep_this_month = 1 AND (pd.old_population_type = 300 OR pd.population_type = 4) AND pd.gender = 'M'), 1, NULL)"
}
},
{
Expand Down Expand Up @@ -1741,6 +1741,14 @@
"expression": "if((pd.discontinued_from_prep_this_month = 1 AND pd.population_type = 9), 1, NULL)"
}
},
{
"type": "derived_column",
"alias": "total_discontinued_prep_this_month",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "if((pd.discontinued_from_prep_this_month = 1), 1, NULL)"
}
},
{
"type": "derived_column",
"alias": "month",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,11 @@
"type": "simple_column",
"alias": "total_mm_pbfw",
"column": "sum(b.total_mm_pbfw)"
},
{
"type": "simple_column",
"alias": "total_reason_for_discontinuation_low_risk",
"column": "sum(b.total_reason_for_discontinuation_low_risk)"
}
],
"groupBy": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"uses": [],
"sources": [
{
"table": "etl.prep_monthly_report_dataset_v3",
"table": "etl.prep_monthly_report_dataset_v5",
"alias": "pd"
},
{
Expand Down Expand Up @@ -1743,6 +1743,14 @@
"expressionOptions": {
"expression": "if(((pd.discontinued_from_prep_this_month = 1 AND pd.reason_for_discontinuation = '9777') AND pd.population_type = 9), 1, NULL)"
}
},
{
"type": "derived_column",
"alias": "total_reason_for_discontinuation_low_risk",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "if((pd.discontinued_from_prep_this_month = 1 AND pd.reason_for_discontinuation = '9777'), 1, NULL)"
}
}
],
"filters": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,11 @@
"type": "simple_column",
"alias": "total_xx_pbfw",
"column": "sum(b.total_xx_pbfw)"
},
{
"type": "simple_column",
"alias": "total_reason_for_discontinuation_missed_drug_pickup",
"column": "sum(b.total_reason_for_discontinuation_missed_drug_pickup)"
}
],
"groupBy": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"uses": [],
"sources": [
{
"table": "etl.prep_monthly_report_dataset_v3",
"table": "etl.prep_monthly_report_dataset_v5",
"alias": "pd"
},
{
Expand Down Expand Up @@ -1743,6 +1743,14 @@
"expressionOptions": {
"expression": "if(((pd.discontinued_from_prep_this_month = 1 AND pd.reason_for_discontinuation = '1448') AND pd.population_type = 9), 1, NULL)"
}
},
{
"type": "derived_column",
"alias": "total_reason_for_discontinuation_missed_drug_pickup",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "if((pd.discontinued_from_prep_this_month = 1 AND pd.reason_for_discontinuation = '1448'), 1, NULL)"
}
}
],
"filters": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,11 @@
"type": "simple_column",
"alias": "total_pp_pbfw",
"column": "sum(b.total_pp_pbfw)"
},
{
"type": "simple_column",
"alias": "total_reason_for_discontinuation_non_adherence",
"column": "sum(b.total_reason_for_discontinuation_non_adherence)"
}
],
"groupBy": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"uses": [],
"sources": [
{
"table": "etl.prep_monthly_report_dataset_v3",
"table": "etl.prep_monthly_report_dataset_v5",
"alias": "pd"
},
{
Expand Down Expand Up @@ -1743,6 +1743,14 @@
"expressionOptions": {
"expression": "if(((pd.discontinued_from_prep_this_month = 1 AND pd.reason_for_discontinuation = '1434') AND pd.population_type = 9), 1, NULL)"
}
},
{
"type": "derived_column",
"alias": "total_reason_for_discontinuation_non_adherence",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "if((pd.discontinued_from_prep_this_month = 1 AND pd.reason_for_discontinuation = '1434'), 1, NULL)"
}
}
],
"filters": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,11 @@
"type": "simple_column",
"alias": "total_ss_pbfw",
"column": "sum(b.total_ss_pbfw)"
},
{
"type": "simple_column",
"alias": "total_reason_for_discontinuation_partner_refusal",
"column": "sum(b.total_reason_for_discontinuation_partner_refusal)"
}
],
"groupBy": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"uses": [],
"sources": [
{
"table": "etl.prep_monthly_report_dataset_v3",
"table": "etl.prep_monthly_report_dataset_v5",
"alias": "pd"
},
{
Expand Down Expand Up @@ -1743,6 +1743,14 @@
"expressionOptions": {
"expression": "if(((pd.discontinued_from_prep_this_month = 1 AND pd.reason_for_discontinuation = '1958') AND pd.population_type = 9), 1, NULL)"
}
},
{
"type": "derived_column",
"alias": "total_reason_for_discontinuation_partner_refusal",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "if((pd.discontinued_from_prep_this_month = 1 AND pd.reason_for_discontinuation = '1958'), 1, NULL)"
}
}
],
"filters": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,11 @@
"type": "simple_column",
"alias": "total_tt_pbfw",
"column": "sum(b.total_tt_pbfw)"
},
{
"type": "simple_column",
"alias": "total_reason_for_discontinuation_partner_violence",
"column": "sum(b.total_reason_for_discontinuation_partner_violence)"
}
],
"groupBy": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"uses": [],
"sources": [
{
"table": "etl.prep_monthly_report_dataset_v3",
"table": "etl.prep_monthly_report_dataset_v5",
"alias": "pd"
},
{
Expand Down Expand Up @@ -1743,6 +1743,14 @@
"expressionOptions": {
"expression": "if(((pd.discontinued_from_prep_this_month = 1 AND pd.reason_for_discontinuation = '9761') AND pd.population_type = 9), 1, NULL)"
}
},
{
"type": "derived_column",
"alias": "total_reason_for_discontinuation_partner_violence",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "if((pd.discontinued_from_prep_this_month = 1 AND pd.reason_for_discontinuation = '9761'), 1, NULL)"
}
}
],
"filters": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,11 @@
"type": "simple_column",
"alias": "total_nn_pbfw",
"column": "sum(b.total_nn_pbfw)"
},
{
"type": "simple_column",
"alias": "total_reason_for_discontinuation_side_effects",
"column": "sum(b.total_reason_for_discontinuation_side_effects)"
}
],
"groupBy": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"uses": [],
"sources": [
{
"table": "etl.prep_monthly_report_dataset_v3",
"table": "etl.prep_monthly_report_dataset_v5",
"alias": "pd"
},
{
Expand Down Expand Up @@ -1743,6 +1743,14 @@
"expressionOptions": {
"expression": "if(((pd.discontinued_from_prep_this_month = 1 AND pd.reason_for_discontinuation = '1664') AND pd.population_type = 9), 1, NULL)"
}
},
{
"type": "derived_column",
"alias": "total_reason_for_discontinuation_side_effects",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "if((pd.discontinued_from_prep_this_month = 1 AND pd.reason_for_discontinuation = '1664'), 1, NULL)"
}
}
],
"filters": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,11 @@
"type": "simple_column",
"alias": "total_ll_pbfw",
"column": "sum(b.total_ll_pbfw)"
},
{
"type": "simple_column",
"alias": "total_reason_for_discontinuation_tested_positive",
"column": "sum(b.total_reason_for_discontinuation_tested_positive)"
}
],
"groupBy": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"uses": [],
"sources": [
{
"table": "etl.prep_monthly_report_dataset_v3",
"table": "etl.prep_monthly_report_dataset_v5",
"alias": "pd"
},
{
Expand Down Expand Up @@ -1743,6 +1743,14 @@
"expressionOptions": {
"expression": "if(((pd.discontinued_from_prep_this_month = 1 AND pd.reason_for_discontinuation = '1169') AND pd.population_type = 9), 1, NULL)"
}
},
{
"type": "derived_column",
"alias": "total_reason_for_discontinuation_tested_positive",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "if((pd.discontinued_from_prep_this_month = 1 AND pd.reason_for_discontinuation = '1169'), 1, NULL)"
}
}
],
"filters": {
Expand Down
Loading

0 comments on commit e049e6e

Please sign in to comment.