Search in sources :

Example 6 with Parameter

use of org.openmrs.module.reporting.evaluation.parameter.Parameter in project openmrs-module-pihcore by PIH.

the class PihCohortDefinitionLibrary method lastDispositionBeforeExitHelper.

private CohortDefinition lastDispositionBeforeExitHelper(Concept disposition) {
    LastDispositionBeforeExitCohortDefinition cd = new LastDispositionBeforeExitCohortDefinition();
    cd.addParameter(new Parameter("exitOnOrAfter", "mirebalaisreports.parameter.exitOnOrAfter", Date.class));
    cd.addParameter(new Parameter("exitOnOrBefore", "mirebalaisreports.parameter.exitOnOrBefore", Date.class));
    cd.addParameter(new Parameter("exitFromWard", "mirebalaisreports.parameter.exitFromWard", Location.class));
    cd.setDispositionsToConsider(getDispositionsToConsiderAsExit());
    cd.addDisposition(disposition);
    return new MappedParametersCohortDefinition(cd, "exitOnOrAfter", "startDate", "exitOnOrBefore", "endDate", "exitFromWard", "location");
}
Also used : Parameter(org.openmrs.module.reporting.evaluation.parameter.Parameter) LastDispositionBeforeExitCohortDefinition(org.openmrs.module.pihcore.reporting.cohort.definition.LastDispositionBeforeExitCohortDefinition) Date(java.util.Date) Location(org.openmrs.Location) MappedParametersCohortDefinition(org.openmrs.module.reporting.cohort.definition.MappedParametersCohortDefinition)

Example 7 with Parameter

use of org.openmrs.module.reporting.evaluation.parameter.Parameter 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 8 with Parameter

use of org.openmrs.module.reporting.evaluation.parameter.Parameter in project openmrs-module-pihcore by PIH.

the class PihCohortDefinitionLibrary method getSpecificCodedDiagnosesBetweenDates.

@DocumentedDefinition(value = "specificCodedDiagnosesBetweenDates")
public DiagnosisCohortDefinition getSpecificCodedDiagnosesBetweenDates() {
    DiagnosisCohortDefinition cd = new DiagnosisCohortDefinition();
    cd.addParameter(new Parameter("onOrAfter", "reporting.parameter.onOrAfter", Date.class));
    cd.addParameter(new Parameter("onOrBefore", "reporting.parameter.onOrBefore", Date.class));
    cd.addParameter(new Parameter("codedDiagnoses", "mirebalaisreports.parameter.codedDiagnoses", Concept.class, List.class, null));
    return cd;
}
Also used : Concept(org.openmrs.Concept) Parameter(org.openmrs.module.reporting.evaluation.parameter.Parameter) List(java.util.List) Date(java.util.Date) DiagnosisCohortDefinition(org.openmrs.module.pihcore.reporting.cohort.definition.DiagnosisCohortDefinition) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Example 9 with Parameter

use of org.openmrs.module.reporting.evaluation.parameter.Parameter 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(Metadata.lookup(EncounterTypes.ADMISSION));
    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 10 with Parameter

use of org.openmrs.module.reporting.evaluation.parameter.Parameter 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

Parameter (org.openmrs.module.reporting.evaluation.parameter.Parameter)12 Date (java.util.Date)11 Location (org.openmrs.Location)7 MappedParametersCohortDefinition (org.openmrs.module.reporting.cohort.definition.MappedParametersCohortDefinition)6 DocumentedDefinition (org.openmrs.module.reporting.definition.library.DocumentedDefinition)6 Test (org.junit.Test)2 BaseInpatientReportTest (org.openmrs.module.pihcore.reporting.BaseInpatientReportTest)2 DiedSoonAfterEncounterCohortDefinition (org.openmrs.module.pihcore.reporting.cohort.definition.DiedSoonAfterEncounterCohortDefinition)2 InpatientLocationCohortDefinition (org.openmrs.module.pihcore.reporting.cohort.definition.InpatientLocationCohortDefinition)2 InpatientTransferCohortDefinition (org.openmrs.module.pihcore.reporting.cohort.definition.InpatientTransferCohortDefinition)2 EvaluatedCohort (org.openmrs.module.reporting.cohort.EvaluatedCohort)2 EvaluationContext (org.openmrs.module.reporting.evaluation.EvaluationContext)2 List (java.util.List)1 BaseMatcher (org.hamcrest.BaseMatcher)1 Description (org.hamcrest.Description)1 Concept (org.openmrs.Concept)1 DiagnosisCohortDefinition (org.openmrs.module.pihcore.reporting.cohort.definition.DiagnosisCohortDefinition)1 LastDispositionBeforeExitCohortDefinition (org.openmrs.module.pihcore.reporting.cohort.definition.LastDispositionBeforeExitCohortDefinition)1 EncounterCohortDefinition (org.openmrs.module.reporting.cohort.definition.EncounterCohortDefinition)1 EncounterWithCodedObsCohortDefinition (org.openmrs.module.reporting.cohort.definition.EncounterWithCodedObsCohortDefinition)1