Search in sources :

Example 1 with EncounterWithCodedObsCohortDefinition

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}");
}
Also used : Parameter(org.openmrs.module.reporting.evaluation.parameter.Parameter) EncounterWithCodedObsCohortDefinition(org.openmrs.module.reporting.cohort.definition.EncounterWithCodedObsCohortDefinition) Date(java.util.Date) Location(org.openmrs.Location)

Example 2 with EncounterWithCodedObsCohortDefinition

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");
}
Also used : Parameter(org.openmrs.module.reporting.evaluation.parameter.Parameter) EncounterWithCodedObsCohortDefinition(org.openmrs.module.reporting.cohort.definition.EncounterWithCodedObsCohortDefinition) Date(java.util.Date) Location(org.openmrs.Location) MappedParametersCohortDefinition(org.openmrs.module.reporting.cohort.definition.MappedParametersCohortDefinition) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Example 3 with EncounterWithCodedObsCohortDefinition

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}");
}
Also used : Parameter(org.openmrs.module.reporting.evaluation.parameter.Parameter) EncounterWithCodedObsCohortDefinition(org.openmrs.module.reporting.cohort.definition.EncounterWithCodedObsCohortDefinition) Date(java.util.Date) Location(org.openmrs.Location)

Aggregations

Date (java.util.Date)3 Location (org.openmrs.Location)3 EncounterWithCodedObsCohortDefinition (org.openmrs.module.reporting.cohort.definition.EncounterWithCodedObsCohortDefinition)3 Parameter (org.openmrs.module.reporting.evaluation.parameter.Parameter)3 MappedParametersCohortDefinition (org.openmrs.module.reporting.cohort.definition.MappedParametersCohortDefinition)1 DocumentedDefinition (org.openmrs.module.reporting.definition.library.DocumentedDefinition)1