use of org.openmrs.module.reporting.cohort.definition.EncounterWithCodedObsCohortDefinition in project openmrs-module-pihcore by PIH.
the class DailyCheckInsDataSetManager method checkInWithOtherOrMissingReasons.
private Mapped<CohortDefinition> checkInWithOtherOrMissingReasons(String... excludeValues) {
EncounterWithCodedObsCohortDefinition cd = new EncounterWithCodedObsCohortDefinition();
cd.setName("mirebalaisreports.otherOrUnspecified");
cd.setDescription("{{ message \"mirebalaisreports.otherOrUnspecified\" }}");
cd.addParameter(new Parameter("onOrAfter", "On or after", Date.class));
cd.addParameter(new Parameter("onOrBefore", "On or before", Date.class));
cd.addParameter(new Parameter("locationList", "Locations", Location.class));
cd.addEncounterType(encounterService.getEncounterTypeByUuid(PihEmrConfigConstants.ENCOUNTERTYPE_CHECK_IN_UUID));
cd.setConcept(conceptService.getConceptByMapping("Type of HUM visit", "PIH"));
cd.setIncludeNoObsValue(true);
for (String excludeValue : excludeValues) {
cd.addExcludeCodedValue(conceptService.getConceptByMapping(excludeValue, "PIH"));
}
return Mapped.map(cd, "onOrAfter=${day},onOrBefore=${day+1d-1ms},locationList=${location}");
}
use of org.openmrs.module.reporting.cohort.definition.EncounterWithCodedObsCohortDefinition in project openmrs-module-pihcore by PIH.
the class PihCohortDefinitionLibrary method getClinicalCheckInAtLocation.
@DocumentedDefinition(value = "clinicalCheckInAtLocation")
public CohortDefinition getClinicalCheckInAtLocation() {
EncounterWithCodedObsCohortDefinition cd = new EncounterWithCodedObsCohortDefinition();
cd.addParameter(new Parameter("onOrAfter", "reporting.parameter.onOrAfter", Date.class));
cd.addParameter(new Parameter("onOrBefore", "reporting.parameter.onOrBefore", Date.class));
cd.addParameter(new Parameter("locationList", "reporting.parameter.locationList", Location.class));
cd.addEncounterType(encounterService.getEncounterTypeByUuid(PihEmrConfigConstants.ENCOUNTERTYPE_CHECK_IN_UUID));
cd.setConcept(conceptService.getConceptByMapping("Type of HUM visit", "PIH"));
cd.addIncludeCodedValue(conceptService.getConceptByMapping("CLINICAL", "PIH"));
return new MappedParametersCohortDefinition(cd, "onOrAfter", "startDate", "onOrBefore", "endDate", "locationList", "location");
}
use of org.openmrs.module.reporting.cohort.definition.EncounterWithCodedObsCohortDefinition in project openmrs-module-pihcore by PIH.
the class DailyCheckInsDataSetManager method checkInWithReason.
private Mapped<CohortDefinition> checkInWithReason(String source, String code) {
EncounterWithCodedObsCohortDefinition cd = new EncounterWithCodedObsCohortDefinition();
cd.setName(code);
cd.setDescription("{{ conceptName \"" + source + ":" + code + "\" }}");
cd.addParameter(new Parameter("onOrAfter", "On or after", Date.class));
cd.addParameter(new Parameter("onOrBefore", "On or before", Date.class));
cd.addParameter(new Parameter("locationList", "Locations", Location.class));
cd.addEncounterType(encounterService.getEncounterTypeByUuid(PihEmrConfigConstants.ENCOUNTERTYPE_CHECK_IN_UUID));
cd.setConcept(conceptService.getConceptByMapping("Type of HUM visit", "PIH"));
cd.addIncludeCodedValue(conceptService.getConceptByMapping(code, source));
return Mapped.map(cd, "onOrAfter=${day},onOrBefore=${day+1d-1ms},locationList=${location}");
}
Aggregations