Skip to content

Commit

Permalink
Merge pull request #1370 from hiqedme/POC-392
Browse files Browse the repository at this point in the history
Poc 392
  • Loading branch information
Alfred-Mutai authored Feb 15, 2024
2 parents 2856caa + da8df1f commit ac4468d
Show file tree
Hide file tree
Showing 14 changed files with 3,902 additions and 3 deletions.
43 changes: 42 additions & 1 deletion app/reporting-framework/base-mysql.report.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,13 @@ import * as rhe_plhiv_aggregate from './json-reports/plhiv-ncd-v2-reports/disagg

import * as kd_plhiv_base from './json-reports/plhiv-ncd-v2-reports/disaggregations/kidney-disease/kd-base.json';
import * as kd_plhiv_aggregate from './json-reports/plhiv-ncd-v2-reports/disaggregations/kidney-disease/kd-aggregate.json';
//ahd report
import * as ahd_monthly_summary from './json-reports/ahd_reports/ahd-monthly.json';
import * as ahd_monthly_aggregate from './json-reports/ahd_reports/ahd-monthly-aggregate.json';
import * as ahd_cohort_monthly_aggregate from './json-reports/ahd_reports/ahd-cohort-monthly-aggregate.json';
import * as ahd_monthly_dataset_base from './json-reports/ahd_reports/ahd-monthly-dataset-base.json';
import * as ahd_cohort_monthly_dataset_base from './json-reports/ahd_reports/ahd-cohort-monthly-dataset-base.json';
import * as ahd_monthly_patient_list_template from './json-reports/ahd_reports/ahd_monthly_patient_list_template_post.json';
export class BaseMysqlReport {
constructor(reportName, params) {
this.reportName = reportName;
Expand Down Expand Up @@ -1027,6 +1034,40 @@ export class BaseMysqlReport {
prepDatasetReport: this.cloneJsonSchema(prep_dataset_report)
});
break;
case 'ahd-monthly-summary':
resolve({
main: this.cloneJsonSchema(ahd_monthly_summary)
});
break;
case 'ahdMonthlySummaryReport':
resolve({
main: this.cloneJsonSchema(ahd_monthly_summary),
ahdMonthlyDataSetBase: this.cloneJsonSchema(
ahd_monthly_dataset_base
)
});
break;
case 'ahd-monthly-report-patient-list-template':
resolve({
main: this.cloneJsonSchema(ahd_monthly_patient_list_template)
});
break;
case 'ahdMonthlyAggregate':
resolve({
main: this.cloneJsonSchema(ahd_monthly_aggregate),
ahdMonthlyDataSetBase: this.cloneJsonSchema(
ahd_monthly_dataset_base
)
});
break;
case 'ahdCohortMonthlyAggregate':
resolve({
main: this.cloneJsonSchema(ahd_cohort_monthly_aggregate),
ahdCohortMonthlyDataSetBase: this.cloneJsonSchema(
ahd_cohort_monthly_dataset_base
)
});
break;
case 'surgeBaselineReport':
resolve({
main: this.cloneJsonSchema(ltfu_surge_baseline_aggregate_report),
Expand Down Expand Up @@ -1980,7 +2021,7 @@ export class BaseMysqlReport {
});
})
.catch((error) => {
// console.error('Error Executing Mysql Query', error);
console.error('Error Executing Mysql Query', error);
reject(error);
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,300 @@
{
"name": "ahdCohortMonthlyAggregate",
"version": "1.0",
"tag": "",
"uses": [
{
"name": "ahdCohortMonthlyDataSetBase",
"version": "1.0",
"type": "dataset_def"
}
],
"sources": [
{
"dataSet": "ahdCohortMonthlyDataSetBase",
"alias": "ahd_base"
}
],
"columns": [
{
"type": "simple_column",
"alias": "Reporting_Month",
"column": "ahd_base.reporting_month"
},
{
"type": "simple_column",
"alias": "location_id",
"column": "ahd_base.location_id"
},
{
"type": "simple_column",
"alias": "location",
"column": "ahd_base.location"
},
{
"type": "derived_column",
"alias": "cd4_justification_female_less_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.cd4_justification_female_less_than_15)"
}
},
{
"type": "derived_column",
"alias": "cd4_justification_female_more_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.cd4_justification_female_more_than_15)"
}
},
{
"type": "derived_column",
"alias": "cd4_justification_male_less_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.cd4_justification_male_less_than_15)"
}
},
{
"type": "derived_column",
"alias": "cd4_justification_male_more_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.cd4_justification_male_more_than_15)"
}
},
{
"type": "derived_column",
"alias": "cd4_justification",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.cd4_justification)"
}
},
{
"type": "derived_column",
"alias": "delayed_art_due_to_cm_female_less_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.delayed_art_due_to_cm_female_less_than_15)"
}
},
{
"type": "derived_column",
"alias": "delayed_art_due_to_cm_female_more_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.delayed_art_due_to_cm_female_more_than_15)"
}
},
{
"type": "derived_column",
"alias": "delayed_art_due_to_cm_male_less_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.delayed_art_due_to_cm_male_less_than_15)"
}
},
{
"type": "derived_column",
"alias": "delayed_art_due_to_cm_male_more_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.delayed_art_due_to_cm_male_more_than_15)"
}
},
{
"type": "derived_column",
"alias": "delayed_art_due_to_cm",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.delayed_art_due_to_cm)"
}
},
{
"type": "derived_column",
"alias": "started_cm_6mons_female_less_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.started_cm_6mons_female_less_than_15)"
}
},
{
"type": "derived_column",
"alias": "started_cm_6mons_female_more_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.started_cm_6mons_female_more_than_15)"
}
},
{
"type": "derived_column",
"alias": "started_cm_6mons_male_less_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.started_cm_6mons_male_less_than_15)"
}
},
{
"type": "derived_column",
"alias": "started_cm_6mons_male_more_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.started_cm_6mons_male_more_than_15)"
}
},
{
"type": "derived_column",
"alias": "started_cm_6mons",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.started_cm_6mons)"
}
},
{
"type": "derived_column",
"alias": "started_cm_12mons_female_less_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.started_cm_12mons_female_less_than_15)"
}
},
{
"type": "derived_column",
"alias": "started_cm_12mons_female_more_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.started_cm_12mons_female_more_than_15)"
}
},
{
"type": "derived_column",
"alias": "started_cm_12mons_male_less_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.started_cm_12mons_male_less_than_15)"
}
},
{
"type": "derived_column",
"alias": "started_cm_12mons_male_more_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.started_cm_12mons_male_more_than_15)"
}
},
{
"type": "derived_column",
"alias": "started_cm_12mons",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.started_cm_12mons)"
}
},
{
"type": "derived_column",
"alias": "started_cm_6mons_cd4_done_female_less_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.started_cm_6mons_cd4_done_female_less_than_15)"
}
},
{
"type": "derived_column",
"alias": "started_cm_6mons_cd4_done_female_more_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.started_cm_6mons_cd4_done_female_more_than_15)"
}
},
{
"type": "derived_column",
"alias": "started_cm_6mons_cd4_done_male_less_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.started_cm_6mons_cd4_done_male_less_than_15)"
}
},
{
"type": "derived_column",
"alias": "started_cm_6mons_cd4_done_male_more_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.started_cm_6mons_cd4_done_male_more_than_15)"
}
},
{
"type": "derived_column",
"alias": "started_cm_6mons_cd4_done",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.started_cm_6mons_cd4_done)"
}
},
{
"type": "derived_column",
"alias": "started_cm_12mons_cd4_done_female_less_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.started_cm_12mons_cd4_done_female_less_than_15)"
}
},
{
"type": "derived_column",
"alias": "started_cm_12mons_cd4_done_female_more_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.started_cm_12mons_cd4_done_female_more_than_15)"
}
},
{
"type": "derived_column",
"alias": "started_cm_12mons_cd4_done_male_less_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.started_cm_12mons_cd4_done_male_less_than_15)"
}
},
{
"type": "derived_column",
"alias": "started_cm_12mons_cd4_done_male_more_than_15",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.started_cm_12mons_cd4_done_male_more_than_15)"
}
},
{
"type": "derived_column",
"alias": "started_cm_12mons_cd4_done",
"expressionType": "simple_expression",
"expressionOptions": {
"expression": "SUM(ahd_base.started_cm_12mons_cd4_done)"
}
}
],
"groupBy": {
"groupParam": "groupByParam",
"columns": ["ahd_base.location_id", "ahd_base.reporting_month"],
"excludeParam": "excludeParam"
},
"transFormDirectives": {
"joinColumn": "location_id",
"joinColumnParam": "",
"skipColumns": [""],
"disaggregationColumns": []
},
"dynamicJsonQueryGenerationDirectives": {
"patientListGenerator": {
"useTemplate": "ahd-monthly-report-patient-list-template",
"useTemplateVersion": "1.0",
"generatingDirectives": {
"joinDirectives": {
"joinType": "INNER",
"joinCondition": "<<base_column>> = <<template_column>>",
"baseColumn": "person_id",
"templateColumn": "person_id"
}
}
}
}
}
Loading

0 comments on commit ac4468d

Please sign in to comment.