Skip to content

Commit

Permalink
Merge pull request #1928 from patryllus/feat/moh-729-fmaps
Browse files Browse the repository at this point in the history
Feat/moh 729 fmaps
  • Loading branch information
njorocs authored Jun 26, 2024
2 parents 2afdc72 + 780e891 commit 61108f2
Show file tree
Hide file tree
Showing 6 changed files with 790 additions and 376 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,20 @@ public CohortDefinition agedAtLeastAgedAtMostDays(int minAge, int maxAge) {
cd.setMaxAgeUnit(DurationUnit.DAYS);
return cd;
}
/**
* patients who are at least minAge weeks old and at most weeks old on ${effectiveDate}
* @return CohortDefinition
*/
public CohortDefinition agedAtLeastAgedAtMostWeeks(int minAge, int maxAge) {
AgeCohortDefinition cd = new AgeCohortDefinition();
cd.setName("aged between "+minAge+" and "+maxAge+" days");
cd.addParameter(new Parameter("effectiveDate", "Effective Date", Date.class));
cd.setMinAge(minAge);
cd.setMaxAge(maxAge);
cd.setMinAgeUnit(DurationUnit.WEEKS);
cd.setMaxAgeUnit(DurationUnit.WEEKS);
return cd;
}

/**
* Patients who are female and at least 18 years old on ${effectiveDate}
Expand Down Expand Up @@ -440,4 +454,4 @@ public CohortDefinition getPatientsSeenOnDay(int day) {
return cd;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ public CohortDefinitionDimension datimFineAgeGroups() {
dim.addCohortDefinition("15+", map(commonCohortLibrary.agedAtLeast(15), "effectiveDate=${onDate}"));
//Age group in days
dim.addCohortDefinition("0-60", map(commonCohortLibrary.agedAtLeastAgedAtMostDays(0, 60),"effectiveDate=${onDate}"));
//fmaps
dim.addCohortDefinition("0-12", map(commonCohortLibrary.agedAtLeastAgedAtMostDays(1, 12),"effectiveDate=${onDate}"));
dim.addCohortDefinition("12-24", map(commonCohortLibrary.agedAtLeastAgedAtMostWeeks(12, 24),"effectiveDate=${onDate}"));
dim.addCohortDefinition("7-9", map(commonCohortLibrary.agedAtLeastAgedAtMostInMonths(7, 9),"effectiveDate=${onDate}"));
dim.addCohortDefinition("10-12", map(commonCohortLibrary.agedAtLeastAgedAtMostInMonths(10, 12),"effectiveDate=${onDate}"));
dim.addCohortDefinition("1+", map(commonCohortLibrary.agedAtLeast(1),"effectiveDate=${onDate}"));

return dim;
}
Expand Down Expand Up @@ -346,4 +352,4 @@ public CohortDefinitionDimension newOrRevisits() {
map(ReportingUtils.newAttendances(">=0"), "startDate=${startDate},endDate=${endDate}"));
return dim;
}
}
}
Loading

0 comments on commit 61108f2

Please sign in to comment.