Skip to content

Commit

Permalink
Merge pull request #6 from emaposse/REPORT-104
Browse files Browse the repository at this point in the history
REPORT-104-Fix Conflit Tamplate.
  • Loading branch information
steliomo authored Nov 13, 2019
2 parents 59def50 + f653f4f commit 298925b
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,60 @@ public CohortDefinition getPatientsActiveOnArtNotEligibleForDsd(final String coh

return dsd;
}

@DocumentedDefinition(value = "patientsActiveOnArtWhoInDt")
public CohortDefinition getPatientsActiveOnArtWhoInDt(final String cohortName) {
final CompositionCohortDefinition dsd = new CompositionCohortDefinition();

dsd.setName(cohortName);
dsd.addParameter(new Parameter("startDate", "Start Date", Date.class));
dsd.addParameter(new Parameter("endDate", "End Date", Date.class));
dsd.addParameter(new Parameter("location", "location", Location.class));

String mappings = "startDate=${startDate},endDate=${endDate},location=${location}";

dsd.addSearch(
"IN-ART",
EptsReportUtils.map(
getPatientsActiveOnArtExcludingPregnantBreastfeedingAndTb(""), mappings));

dsd.addSearch(
"QUARTERLY-DISPENSATION",
EptsReportUtils.map(
this.genericCohorts.generalSql(
"QUARTERLY-DISPENSATION",
DsdQueriesInterface.QUERY.findPatientWhoAreMdcQuarterlyDispensation),
mappings));

dsd.setCompositionString("(IN-ART AND QUARTERLY-DISPENSATION)");

return dsd;
}

@DocumentedDefinition(value = "patientsActiveOnArtWhoInDt")
public CohortDefinition getPatientsActiveOnArtElegibleDsdWhoInDt(final String cohortName) {
final CompositionCohortDefinition dsd = new CompositionCohortDefinition();

dsd.setName(cohortName);
dsd.addParameter(new Parameter("startDate", "Start Date", Date.class));
dsd.addParameter(new Parameter("endDate", "End Date", Date.class));
dsd.addParameter(new Parameter("location", "location", Location.class));

String mappings = "startDate=${startDate},endDate=${endDate},location=${location}";

dsd.addSearch(
"ELEGIBLE", EptsReportUtils.map(getPatientsActiveOnArtEligibleForDsd(""), mappings));

dsd.addSearch(
"QUARTERLY-DISPENSATION",
EptsReportUtils.map(
this.genericCohorts.generalSql(
"QUARTERLY-DISPENSATION",
DsdQueriesInterface.QUERY.findPatientWhoAreMdcQuarterlyDispensation),
mappings));

dsd.setCompositionString("(ELEGIBLE AND QUARTERLY-DISPENSATION)");

return dsd;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public DataSetDefinition constructEriDSDDataset() {
"age", EptsReportUtils.map(eptsCommonDimension.getEri2DsdDimension2(), mappings));
dsd.setName("Total");

// DSD: Denominator: Number of active patients on ART - (Non-pregnant and Non-Breastfeeding not
// on TB treatment)
dsd.addColumn(
"D1T",
"DSD D1 Total",
Expand Down Expand Up @@ -162,6 +164,29 @@ public DataSetDefinition constructEriDSDDataset() {
elegibleCohortQuery.getChild10To14ActiveOnArtNotElegibleDsd(""), mappings)),
mappings),
"");
// DSD: Numerator: Number of active on ART whose next ART pick-up is schedule for 83-97 days
// after the date of their last ART drug pick-up (DT) - (Non-pregnant and Non-Breastfeeding not
// on TB treatment)
dsd.addColumn(
"N1T",
"N1T Total",
EptsReportUtils.map(
eptsGeneralIndicator.getIndicator(
"TOTAL",
EptsReportUtils.map(dsdCohortQueries.getPatientsActiveOnArtWhoInDt(""), mappings)),
mappings),
"");

dsd.addColumn(
"N1SST",
"N1SST Total",
EptsReportUtils.map(
eptsGeneralIndicator.getIndicator(
"SUB TOTAL",
EptsReportUtils.map(
dsdCohortQueries.getPatientsActiveOnArtElegibleDsdWhoInDt(""), mappings)),
mappings),
"");

// addRow(
// dsd,
Expand Down
Binary file modified api/src/main/resources/IM_ER_Report.xls
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** */
package org.openmrs.module.eptsreports.reporting.intergrated.library.cohorts;

import static org.junit.Assert.assertFalse;
Expand Down

0 comments on commit 298925b

Please sign in to comment.