Search in sources :

Example 1 with ObsDataSetDefinition

use of org.openmrs.module.reporting.dataset.definition.ObsDataSetDefinition in project openmrs-module-pihcore by PIH.

the class BaseObsDataSetManager method constructDataSet.

public DataSetDefinition constructDataSet() {
    ObsDataSetDefinition dsd = new ObsDataSetDefinition();
    dsd.addParameter(new Parameter("startDate", "mirebalaisreports.parameter.startDate", Date.class));
    dsd.addParameter(new Parameter("endDate", "mirebalaisreports.parameter.endDate", Date.class));
    // Rows defined as patients who had an encounter of the configured types during the given period
    dsd.addRowFilter(Mapped.mapStraightThrough(new PatientObsQuery(cohortQueries.getExcludeTestPatients())));
    dsd.addRowFilter(Mapped.mapStraightThrough(obsQueries.getObsDuringPeriod(getQuestionConcepts())));
    // Define columns
    addPrimaryIdentifierColumns(dsd);
    addPatientNameColumns(dsd);
    addBirthDateAndAgeColumns(dsd);
    addGenderColumns(dsd);
    addCoreEncounterColumns(dsd);
    addAddressColumns(dsd);
    addPersonAttributeColumns(dsd);
    addObsColumns(dsd);
    return dsd;
}
Also used : ObsDataSetDefinition(org.openmrs.module.reporting.dataset.definition.ObsDataSetDefinition) PatientObsQuery(org.openmrs.module.reporting.query.obs.definition.PatientObsQuery) Parameter(org.openmrs.module.reporting.evaluation.parameter.Parameter) Date(java.util.Date)

Aggregations

Date (java.util.Date)1 ObsDataSetDefinition (org.openmrs.module.reporting.dataset.definition.ObsDataSetDefinition)1 Parameter (org.openmrs.module.reporting.evaluation.parameter.Parameter)1 PatientObsQuery (org.openmrs.module.reporting.query.obs.definition.PatientObsQuery)1