Skip to content

Commit

Permalink
Merge branch 'master' into POC-372
Browse files Browse the repository at this point in the history
  • Loading branch information
drizzentic authored Aug 3, 2023
2 parents e7745c7 + d227fe1 commit 1fbd16f
Show file tree
Hide file tree
Showing 49 changed files with 1,729 additions and 1,232 deletions.
12 changes: 12 additions & 0 deletions app/reporting-framework/base-mysql.report.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ import * as hiv_cervical_cancer_monthly_summary_lesions_pcf_aggregate from './js
import * as defaulter_list_aggregate from './json-reports/defaulter-list-aggregate.json';
import * as defaulter_list_base from './json-reports/defaulter-list-base.json';

// ML Weekly Predictions
import * as ml_weekly_predictions_aggregate from './json-reports/ml-predictions/ml-weekly-predictions-aggregate.json';
import * as ml_weekly_predictions_base from './json-reports/ml-predictions/ml-weekly-predictions-base.json';

//clinic clow report
import * as clinic_flow_provider_statistics_aggregate from './json-reports/clinic-flow-provider-statistics-aggregate.json';
import * as clinic_flow_provider_statistics_base from './json-reports/clinic-flow-provider-statistics-base.json';
Expand Down Expand Up @@ -1271,6 +1275,14 @@ export class BaseMysqlReport {
defaulterListBase: this.cloneJsonSchema(defaulter_list_base)
});
break;
case 'mlWeeklyPredictionsAggregate':
resolve({
main: this.cloneJsonSchema(ml_weekly_predictions_aggregate),
mlWeeklyPredictionsBase: this.cloneJsonSchema(
ml_weekly_predictions_base
)
});
break;
case 'clinicFlowProviderStatisticsAggregate':
resolve({
main: this.cloneJsonSchema(
Expand Down
27 changes: 27 additions & 0 deletions app/reporting-framework/json-reports/clinical-reminder-report.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@
"joinCondition": "t3.person_uuid = t1.uuid"
}
},
{
"table": "predictions.ml_weekly_predictions",
"alias": "mwl",
"join": {
"type": "left",
"joinCondition": "mwl.person_id = t1.person_id"
}
},
{
"table": "amrs.relationship",
"alias": "t6",
Expand Down Expand Up @@ -282,6 +290,21 @@
"alias": "vl_error_date",
"column": "t2.test_datetime"
},
{
"type": "simple_column",
"alias": "predicted_risk",
"column": "mwl.predicted_risk"
},
{
"type": "simple_column",
"alias": "predicted_prob_disengage",
"column": "mwl.predicted_prob_disengage"
},
{
"type": "simple_column",
"alias": "prediction_generated_date",
"column": "mwl.prediction_generated_date"
},
{
"type": "simple_column",
"alias": "test_date",
Expand Down Expand Up @@ -485,6 +508,10 @@
{
"column": "t1.encounter_datetime",
"order": "desc"
},
{
"column": "mwl.prediction_generated_date",
"order": "desc"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@
{
"table": "etl.dc_monthly_report_dataset",
"alias": "dcr"
},
{
"table": "(SELECT fli.person_id, fli.hiv_viral_load as vl_1, fli.test_datetime as vl_1_date FROM etl.flat_labs_and_imaging fli INNER JOIN (SELECT person_id, MAX(test_datetime) AS max_vl_1_date FROM etl.flat_labs_and_imaging fli where fli.hiv_viral_load is not null GROUP BY person_id) max_dates ON fli.person_id = max_dates.person_id AND fli.test_datetime = max_dates.max_vl_1_date and fli.hiv_viral_load is not null)",
"alias": "fli_latest_vl",
"join": {
"type": "LEFT",
"joinCondition": "fli_latest_vl.person_id = dcr.person_id"
}
},
{
"table": "etl.flat_patient_identifiers_v1",
"alias": "flat_identifiers",
"join": {
"type": "LEFT",
"joinCondition": "dcr.person_id = flat_identifiers.patient_id"
}
}
],
"columns": [
Expand All @@ -16,6 +32,21 @@
"alias": "persons_id",
"column": "dcr.person_id"
},
{
"type": "simple_column",
"alias": "ccc_number",
"column": "flat_identifiers.ccc"
},
{
"type": "simple_column",
"alias": "ovcid_id",
"column": "flat_identifiers.ovcid"
},
{
"type": "simple_column",
"alias": "upi_number",
"column": "flat_identifiers.nupi"
},
{
"type": "derived_column",
"alias": "total_eligible_for_dc",
Expand Down Expand Up @@ -83,7 +114,7 @@
{
"type": "simple_column",
"alias": "vl_1",
"column": "dcr.vl_1"
"column": "fli_latest_vl.vl_1"
},
{
"type": "simple_column",
Expand All @@ -93,7 +124,7 @@
{
"type": "simple_column",
"alias": "vl_1_date",
"column": "dcr.vl_1_date"
"column": "fli_latest_vl.vl_1_date"
},
{
"type": "simple_column",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "mlWeeklyPredictionsAggregate",
"version": "1.0",
"tag": "",
"description": "",
"uses": [
{
"name": "mlWeeklyPredictionsBase",
"version": "1.0",
"type": "dataset_def"
}
],
"sources": [
{
"dataSet": "mlWeeklyPredictionsBase",
"alias": "t2"
}
],
"columns": [
{
"type": "simple_column",
"alias": "person_id",
"column": "t2.person_id"
},
{
"type": "simple_column",
"alias": "total_predictions",
"column": "count(distinct t2.person_id)"
}
],
"groupBy": {
"groupParam": "groupByParam",
"columns": ["person_id"],
"excludeParam": "excludeParam"
},
"dynamicJsonQueryGenerationDirectives": {
"patientListGenerator": {
"useTemplate": "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 1fbd16f

Please sign in to comment.