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