Search in sources :

Example 6 with DocumentedDefinition

use of org.openmrs.module.reporting.definition.library.DocumentedDefinition in project openmrs-module-pihcore by PIH.

the class PihEncounterDataLibrary method getSingleObsInEncounter.

@DocumentedDefinition
public EncounterDataDefinition getSingleObsInEncounter(Concept concept) {
    ObsForEncounterDataDefinition d = new ObsForEncounterDataDefinition();
    d.setQuestion(concept);
    d.setSingleObs(true);
    return d;
}
Also used : ObsForEncounterDataDefinition(org.openmrs.module.reporting.data.encounter.definition.ObsForEncounterDataDefinition) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Example 7 with DocumentedDefinition

use of org.openmrs.module.reporting.definition.library.DocumentedDefinition in project openmrs-module-pihcore by PIH.

the class PihEncounterDataLibrary method getNumberOfProviders.

@DocumentedDefinition
public EncounterDataDefinition getNumberOfProviders() {
    EncounterProviderDataDefinition dd = new EncounterProviderDataDefinition();
    dd.setSingleProvider(false);
    return new ConvertedEncounterDataDefinition(dd, new CountConverter());
}
Also used : CountConverter(org.openmrs.module.reporting.data.converter.CountConverter) ConvertedEncounterDataDefinition(org.openmrs.module.reporting.data.encounter.definition.ConvertedEncounterDataDefinition) EncounterProviderDataDefinition(org.openmrs.module.reporting.data.encounter.definition.EncounterProviderDataDefinition) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Example 8 with DocumentedDefinition

use of org.openmrs.module.reporting.definition.library.DocumentedDefinition in project openmrs-module-pihcore by PIH.

the class PihEncounterDataLibrary method getEncounterProvider.

@DocumentedDefinition
public EncounterDataDefinition getEncounterProvider() {
    EncounterProviderDataDefinition epdd = new EncounterProviderDataDefinition();
    epdd.setSingleProvider(true);
    return new ConvertedEncounterDataDefinition(epdd, new DataConverter[] { new ObjectFormatter() });
}
Also used : ObjectFormatter(org.openmrs.module.reporting.data.converter.ObjectFormatter) ConvertedEncounterDataDefinition(org.openmrs.module.reporting.data.encounter.definition.ConvertedEncounterDataDefinition) EncounterProviderDataDefinition(org.openmrs.module.reporting.data.encounter.definition.EncounterProviderDataDefinition) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Example 9 with DocumentedDefinition

use of org.openmrs.module.reporting.definition.library.DocumentedDefinition 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)

Example 10 with DocumentedDefinition

use of org.openmrs.module.reporting.definition.library.DocumentedDefinition in project openmrs-module-pihcore by PIH.

the class PihObsQueryLibrary method getObsDuringPeriod.

@DocumentedDefinition(value = "obsDuringPeriod")
public ObsQuery getObsDuringPeriod(List<Concept> questionConcepts) {
    BasicObsQuery q = new BasicObsQuery();
    q.setConceptList(questionConcepts);
    q.addParameter(parameter(Date.class, "onOrAfter"));
    q.addParameter(parameter(Date.class, "onOrBefore"));
    return new MappedParametersObsQuery(q, ObjectUtil.toMap("onOrAfter=startDate,onOrBefore=endDate"));
}
Also used : BasicObsQuery(org.openmrs.module.reporting.query.obs.definition.BasicObsQuery) MappedParametersObsQuery(org.openmrs.module.reporting.query.obs.definition.MappedParametersObsQuery) Date(java.util.Date) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Aggregations

DocumentedDefinition (org.openmrs.module.reporting.definition.library.DocumentedDefinition)29 Date (java.util.Date)11 Location (org.openmrs.Location)10 MappedParametersCohortDefinition (org.openmrs.module.reporting.cohort.definition.MappedParametersCohortDefinition)9 ConvertedEncounterDataDefinition (org.openmrs.module.reporting.data.encounter.definition.ConvertedEncounterDataDefinition)6 Parameter (org.openmrs.module.reporting.evaluation.parameter.Parameter)6 DiedSoonAfterEncounterCohortDefinition (org.openmrs.module.pihcore.reporting.cohort.definition.DiedSoonAfterEncounterCohortDefinition)5 InpatientTransferCohortDefinition (org.openmrs.module.pihcore.reporting.cohort.definition.InpatientTransferCohortDefinition)5 ObjectFormatter (org.openmrs.module.reporting.data.converter.ObjectFormatter)5 DiagnosisCohortDefinition (org.openmrs.module.pihcore.reporting.cohort.definition.DiagnosisCohortDefinition)4 InpatientLocationCohortDefinition (org.openmrs.module.pihcore.reporting.cohort.definition.InpatientLocationCohortDefinition)4 EncounterCohortDefinition (org.openmrs.module.reporting.cohort.definition.EncounterCohortDefinition)4 EncounterWithCodedObsCohortDefinition (org.openmrs.module.reporting.cohort.definition.EncounterWithCodedObsCohortDefinition)4 PersonAttributeCohortDefinition (org.openmrs.module.reporting.cohort.definition.PersonAttributeCohortDefinition)4 EncounterProviderDataDefinition (org.openmrs.module.reporting.data.encounter.definition.EncounterProviderDataDefinition)4 ObsForEncounterDataDefinition (org.openmrs.module.reporting.data.encounter.definition.ObsForEncounterDataDefinition)4 LastDispositionBeforeExitCohortDefinition (org.openmrs.module.pihcore.reporting.cohort.definition.LastDispositionBeforeExitCohortDefinition)3 CohortDefinition (org.openmrs.module.reporting.cohort.definition.CohortDefinition)3 CompositionCohortDefinition (org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition)3 PropertyConverter (org.openmrs.module.reporting.data.converter.PropertyConverter)3