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;
}
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");
}
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;
}
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");
}
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");
}
Aggregations