Search in sources :

Example 16 with DocumentedDefinition

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

the class PihCohortDefinitionLibrary method getDiedExitFromLocationDuringPeriodNotSoonAfterAdmission.

@DocumentedDefinition(value = "diedExitFromLocationDuringPeriodNotSoonAfterAdmission")
public CohortDefinition getDiedExitFromLocationDuringPeriodNotSoonAfterAdmission() {
    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 NOT 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 17 with DocumentedDefinition

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

the class PihCohortDefinitionLibrary method getTransferOutOfLocationDuringPeriod.

@DocumentedDefinition(value = "transferOutOfLocationDuringPeriod")
public CohortDefinition getTransferOutOfLocationDuringPeriod() {
    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("outOfWard", "mirebalaisreports.parameter.outOfWard", Location.class));
    return new MappedParametersCohortDefinition(cd, "onOrAfter", "startDate", "onOrBefore", "endDate", "outOfWard", "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 18 with DocumentedDefinition

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

the class PihCohortDefinitionLibrary method getTestPatients.

@DocumentedDefinition(value = "testPatients")
public CohortDefinition getTestPatients() {
    PersonAttributeCohortDefinition test = new PersonAttributeCohortDefinition();
    test.setAttributeType(emrApiProperties.getTestPatientPersonAttributeType());
    // the method add value has a bug, using set values for now
    test.setValues(Arrays.asList("true"));
    return test;
}
Also used : PersonAttributeCohortDefinition(org.openmrs.module.reporting.cohort.definition.PersonAttributeCohortDefinition) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Example 19 with DocumentedDefinition

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

the class PihCohortDefinitionLibrary method getAdmissionAtLocationDuringPeriod.

@DocumentedDefinition(value = "admissionAtLocationDuringPeriod")
public CohortDefinition getAdmissionAtLocationDuringPeriod() {
    EncounterCohortDefinition cd = new EncounterCohortDefinition();
    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.location", Location.class));
    cd.addEncounterType(encounterService.getEncounterTypeByUuid(PihEmrConfigConstants.ENCOUNTERTYPE_ADMISSION_UUID));
    return new MappedParametersCohortDefinition(cd, "onOrAfter", "startDate", "onOrBefore", "endDate", "locationList", "location");
}
Also used : Parameter(org.openmrs.module.reporting.evaluation.parameter.Parameter) EncounterCohortDefinition(org.openmrs.module.reporting.cohort.definition.EncounterCohortDefinition) DiedSoonAfterEncounterCohortDefinition(org.openmrs.module.pihcore.reporting.cohort.definition.DiedSoonAfterEncounterCohortDefinition) 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 20 with DocumentedDefinition

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

the class PihCohortDefinitionLibrary method getDiedSoonAfterAdmissionDuringPeriod.

@DocumentedDefinition(value = "diedSoonAfterAdmissionDuringPeriod")
public CohortDefinition getDiedSoonAfterAdmissionDuringPeriod() {
    DiedSoonAfterEncounterCohortDefinition cd = new DiedSoonAfterEncounterCohortDefinition();
    cd.setEncounterType(emrApiProperties.getAdmissionEncounterType());
    cd.addParameter(new Parameter("diedOnOrAfter", "mirebalaisreports.parameter.diedOnOrAfter", Date.class));
    cd.addParameter(new Parameter("diedOnOrBefore", "mirebalaisreports.parameter.diedOnOrBefore", Date.class));
    return new MappedParametersCohortDefinition(cd, "diedOnOrAfter", "startDate", "diedOnOrBefore", "endDate");
}
Also used : DiedSoonAfterEncounterCohortDefinition(org.openmrs.module.pihcore.reporting.cohort.definition.DiedSoonAfterEncounterCohortDefinition) Parameter(org.openmrs.module.reporting.evaluation.parameter.Parameter) Date(java.util.Date) MappedParametersCohortDefinition(org.openmrs.module.reporting.cohort.definition.MappedParametersCohortDefinition) 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