use of org.openmrs.module.pihcore.reporting.cohort.definition.DiagnosisCohortDefinition in project openmrs-module-pihcore by PIH.
the class PihCohortDefinitionLibrary method getSpecificCodedDiagnosesBetweenDates.
@DocumentedDefinition(value = "specificCodedDiagnosesBetweenDates")
public DiagnosisCohortDefinition getSpecificCodedDiagnosesBetweenDates() {
DiagnosisCohortDefinition cd = new DiagnosisCohortDefinition();
cd.addParameter(new Parameter("onOrAfter", "reporting.parameter.onOrAfter", Date.class));
cd.addParameter(new Parameter("onOrBefore", "reporting.parameter.onOrBefore", Date.class));
cd.addParameter(new Parameter("codedDiagnoses", "mirebalaisreports.parameter.codedDiagnoses", Concept.class, List.class, null));
return cd;
}
use of org.openmrs.module.pihcore.reporting.cohort.definition.DiagnosisCohortDefinition in project openmrs-module-pihcore by PIH.
the class DiagnosisCohortDefinitionEvaluatorTest method testEvaluateByCoded.
@Test
public void testEvaluateByCoded() throws Exception {
createDiagnosisObs();
DiagnosisCohortDefinition cd = new DiagnosisCohortDefinition();
cd.setCodedDiagnoses(Arrays.asList(conceptService.getConcept(9)));
EvaluatedCohort cohort = evaluator.evaluate(cd, new EvaluationContext());
assertThat(cohort, hasExactlyIds(6));
}
use of org.openmrs.module.pihcore.reporting.cohort.definition.DiagnosisCohortDefinition in project openmrs-module-pihcore by PIH.
the class DiagnosisCohortDefinitionEvaluatorTest method testEvaluateByCodedExclusions.
@Test
public void testEvaluateByCodedExclusions() throws Exception {
createDiagnosisObs();
DiagnosisCohortDefinition cd = new DiagnosisCohortDefinition();
cd.setExcludeCodedDiagnoses(Arrays.asList(conceptService.getConcept(9)));
EvaluatedCohort cohort = evaluator.evaluate(cd, new EvaluationContext());
// everyone with a coded diagnosis that isn't concept 9
assertThat(cohort, hasExactlyIds(2));
}
use of org.openmrs.module.pihcore.reporting.cohort.definition.DiagnosisCohortDefinition in project openmrs-module-pihcore by PIH.
the class DiagnosisCohortDefinitionEvaluatorTest method testEvaluateByAnyNonCoded.
@Test
public void testEvaluateByAnyNonCoded() throws Exception {
createDiagnosisObs();
DiagnosisCohortDefinition cd = new DiagnosisCohortDefinition();
cd.setIncludeAllNonCodedDiagnoses(true);
EvaluatedCohort cohort = evaluator.evaluate(cd, new EvaluationContext());
assertThat(cohort, hasExactlyIds(2, 7));
}
Aggregations