Search in sources :

Example 1 with MappedParametersEncounterQuery

use of org.openmrs.module.reporting.query.encounter.definition.MappedParametersEncounterQuery in project openmrs-module-pihcore by PIH.

the class PihEncounterQueryLibrary method getEncountersDuringPeriodAtLocation.

@DocumentedDefinition(value = "encountersDuringPeriodAtLocation")
public EncounterQuery getEncountersDuringPeriodAtLocation(List<EncounterType> encounterTypes) {
    BasicEncounterQuery q = new BasicEncounterQuery();
    q.setWhich(TimeQualifier.ANY);
    q.setEncounterTypes(encounterTypes);
    q.addParameter(parameter(Date.class, "onOrAfter"));
    q.addParameter(parameter(Date.class, "onOrBefore"));
    q.addParameter(parameter(Location.class, "locationList"));
    return new MappedParametersEncounterQuery(q, ObjectUtil.toMap("onOrAfter=startDate,onOrBefore=endDate,locationList=location"));
}
Also used : MappedParametersEncounterQuery(org.openmrs.module.reporting.query.encounter.definition.MappedParametersEncounterQuery) Date(java.util.Date) BasicEncounterQuery(org.openmrs.module.reporting.query.encounter.definition.BasicEncounterQuery) Location(org.openmrs.Location) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Aggregations

Date (java.util.Date)1 Location (org.openmrs.Location)1 DocumentedDefinition (org.openmrs.module.reporting.definition.library.DocumentedDefinition)1 BasicEncounterQuery (org.openmrs.module.reporting.query.encounter.definition.BasicEncounterQuery)1 MappedParametersEncounterQuery (org.openmrs.module.reporting.query.encounter.definition.MappedParametersEncounterQuery)1