Search in sources :

Example 1 with DocumentedDefinition

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

the class PihCohortDefinitionLibrary method getTransferInToLocationDuringPeriod.

@DocumentedDefinition(value = "transferInToLocationDuringPeriod")
public CohortDefinition getTransferInToLocationDuringPeriod() {
    InpatientTransferCohortDefinition cd = new InpatientTransferCohortDefinition();
    cd.addParameter(new Parameter("onOrAfter", "reporting.parameter.onOrAfter", Date.class));
    cd.addParameter(new Parameter("onOrBefore", "reporting.parameter.onOrBefore", Date.class));
    cd.addParameter(new Parameter("inToWard", "mirebalaisreports.parameter.inToWard", Location.class));
    return new MappedParametersCohortDefinition(cd, "onOrAfter", "startDate", "onOrBefore", "endDate", "inToWard", "location");
}
Also used : Parameter(org.openmrs.module.reporting.evaluation.parameter.Parameter) InpatientTransferCohortDefinition(org.openmrs.module.pihcore.reporting.cohort.definition.InpatientTransferCohortDefinition) 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 2 with DocumentedDefinition

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

the class PihCohortDefinitionLibrary method getExcludeTestPatients.

@DocumentedDefinition(value = "excludeTestPatients")
public CohortDefinition getExcludeTestPatients() {
    CohortDefinition test = getTestPatients();
    CompositionCohortDefinition excludeTestPatientsCohortDefinition = new CompositionCohortDefinition();
    excludeTestPatientsCohortDefinition.addSearch("test", map(test, ""));
    excludeTestPatientsCohortDefinition.setCompositionString("NOT test");
    return excludeTestPatientsCohortDefinition;
}
Also used : CompositionCohortDefinition(org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition) PersonAttributeCohortDefinition(org.openmrs.module.reporting.cohort.definition.PersonAttributeCohortDefinition) EncounterCohortDefinition(org.openmrs.module.reporting.cohort.definition.EncounterCohortDefinition) DiedSoonAfterEncounterCohortDefinition(org.openmrs.module.pihcore.reporting.cohort.definition.DiedSoonAfterEncounterCohortDefinition) LastDispositionBeforeExitCohortDefinition(org.openmrs.module.pihcore.reporting.cohort.definition.LastDispositionBeforeExitCohortDefinition) InpatientLocationCohortDefinition(org.openmrs.module.pihcore.reporting.cohort.definition.InpatientLocationCohortDefinition) DiagnosisCohortDefinition(org.openmrs.module.pihcore.reporting.cohort.definition.DiagnosisCohortDefinition) MappedParametersCohortDefinition(org.openmrs.module.reporting.cohort.definition.MappedParametersCohortDefinition) CohortDefinition(org.openmrs.module.reporting.cohort.definition.CohortDefinition) EncounterWithCodedObsCohortDefinition(org.openmrs.module.reporting.cohort.definition.EncounterWithCodedObsCohortDefinition) InpatientTransferCohortDefinition(org.openmrs.module.pihcore.reporting.cohort.definition.InpatientTransferCohortDefinition) CompositionCohortDefinition(org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Example 3 with DocumentedDefinition

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

the class PihCohortDefinitionLibrary method getDiedExitFromLocationDuringPeriodSoonAfterAdmission.

@DocumentedDefinition(value = "diedExitFromLocationDuringPeriodSoonAfterAdmission")
public CohortDefinition getDiedExitFromLocationDuringPeriodSoonAfterAdmission() {
    CohortDefinition diedSoonAfterAdmission = getDiedSoonAfterAdmissionDuringPeriod();
    CohortDefinition diedExit = getDiedExitFromLocationDuringPeriod();
    CompositionCohortDefinition deathsEarly = new CompositionCohortDefinition();
    deathsEarly.addParameter(parameter(Date.class, "startDate"));
    deathsEarly.addParameter(parameter(Date.class, "endDate"));
    deathsEarly.addParameter(parameter(Location.class, "location"));
    deathsEarly.addSearch("died", Mapped.mapStraightThrough(diedExit));
    deathsEarly.addSearch("diedSoon", Mapped.mapStraightThrough(diedSoonAfterAdmission));
    deathsEarly.setCompositionString("died AND diedSoon");
    return diedExit;
}
Also used : CompositionCohortDefinition(org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition) PersonAttributeCohortDefinition(org.openmrs.module.reporting.cohort.definition.PersonAttributeCohortDefinition) EncounterCohortDefinition(org.openmrs.module.reporting.cohort.definition.EncounterCohortDefinition) DiedSoonAfterEncounterCohortDefinition(org.openmrs.module.pihcore.reporting.cohort.definition.DiedSoonAfterEncounterCohortDefinition) LastDispositionBeforeExitCohortDefinition(org.openmrs.module.pihcore.reporting.cohort.definition.LastDispositionBeforeExitCohortDefinition) InpatientLocationCohortDefinition(org.openmrs.module.pihcore.reporting.cohort.definition.InpatientLocationCohortDefinition) DiagnosisCohortDefinition(org.openmrs.module.pihcore.reporting.cohort.definition.DiagnosisCohortDefinition) MappedParametersCohortDefinition(org.openmrs.module.reporting.cohort.definition.MappedParametersCohortDefinition) CohortDefinition(org.openmrs.module.reporting.cohort.definition.CohortDefinition) EncounterWithCodedObsCohortDefinition(org.openmrs.module.reporting.cohort.definition.EncounterWithCodedObsCohortDefinition) InpatientTransferCohortDefinition(org.openmrs.module.pihcore.reporting.cohort.definition.InpatientTransferCohortDefinition) CompositionCohortDefinition(org.openmrs.module.reporting.cohort.definition.CompositionCohortDefinition) Date(java.util.Date) Location(org.openmrs.Location) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Example 4 with DocumentedDefinition

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

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

the class PihEncounterDataLibrary method getAllProviders.

@DocumentedDefinition
public EncounterDataDefinition getAllProviders() {
    EncounterProviderDataDefinition dd = new EncounterProviderDataDefinition();
    dd.setSingleProvider(false);
    ChainedConverter itemConverter = new ChainedConverter(new PropertyConverter(Provider.class, "person"), new PropertyConverter(Person.class, "personName"), new ObjectFormatter("{givenName} {familyName}"));
    return new ConvertedEncounterDataDefinition(dd, new CollectionConverter(itemConverter, false, null), new ObjectFormatter(", "));
}
Also used : ChainedConverter(org.openmrs.module.reporting.data.converter.ChainedConverter) ObjectFormatter(org.openmrs.module.reporting.data.converter.ObjectFormatter) ConvertedEncounterDataDefinition(org.openmrs.module.reporting.data.encounter.definition.ConvertedEncounterDataDefinition) PropertyConverter(org.openmrs.module.reporting.data.converter.PropertyConverter) EncounterProviderDataDefinition(org.openmrs.module.reporting.data.encounter.definition.EncounterProviderDataDefinition) Person(org.openmrs.Person) CollectionConverter(org.openmrs.module.reporting.data.converter.CollectionConverter) Provider(org.openmrs.Provider) 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