use of org.openmrs.module.reporting.data.patient.definition.ConvertedPatientDataDefinition in project openmrs-module-pihcore by PIH.
the class PihPatientDataLibrary method getLastEncounter.
private PatientDataDefinition getLastEncounter(DataConverter... converters) {
EncountersForPatientDataDefinition visitEncounters = new EncountersForPatientDataDefinition();
visitEncounters.setOnlyInActiveVisit(true);
visitEncounters.setWhich(TimeQualifier.LAST);
return new ConvertedPatientDataDefinition(visitEncounters, converters);
}
use of org.openmrs.module.reporting.data.patient.definition.ConvertedPatientDataDefinition in project openmrs-module-pihcore by PIH.
the class PihPatientDataLibrary method getPreferredIdentifierOf.
private PatientDataDefinition getPreferredIdentifierOf(PatientIdentifierType patientIdentifierType, DataConverter... converters) {
PatientIdentifierDataDefinition dd = new PatientIdentifierDataDefinition(null, patientIdentifierType);
dd.setIncludeFirstNonNullOnly(true);
if (converters.length > 0) {
return new ConvertedPatientDataDefinition(dd, converters);
} else {
return dd;
}
}
use of org.openmrs.module.reporting.data.patient.definition.ConvertedPatientDataDefinition in project openmrs-module-pihcore by PIH.
the class PihPatientDataLibrary method getRegistrationEncounter.
private PatientDataDefinition getRegistrationEncounter(DataConverter... converters) {
EncountersForPatientDataDefinition registrationEncounters = new EncountersForPatientDataDefinition();
registrationEncounters.setTypes(Arrays.asList(Metadata.lookup(EncounterTypes.PATIENT_REGISTRATION)));
return new ConvertedPatientDataDefinition(registrationEncounters, converters(new EarliestCreatedConverter(Encounter.class), converters));
}
use of org.openmrs.module.reporting.data.patient.definition.ConvertedPatientDataDefinition in project openmrs-module-pihcore by PIH.
the class PihPatientDataLibrary method getRegistrationAge.
@DocumentedDefinition("registration.age")
public PatientDataDefinition getRegistrationAge() {
MappedData<PatientDataDefinition> effectiveDate = new MappedData<PatientDataDefinition>(getRegistrationDatetime(), null);
AgeAtDateOfOtherDataDefinition ageAtRegistration = new AgeAtDateOfOtherDataDefinition();
ageAtRegistration.setEffectiveDateDefinition(effectiveDate);
return new ConvertedPatientDataDefinition(new PersonToPatientDataDefinition(ageAtRegistration), new AgeConverter("{y:1}"));
}
use of org.openmrs.module.reporting.data.patient.definition.ConvertedPatientDataDefinition in project openmrs-module-pihcore by PIH.
the class PihPatientDataLibrary method getCheckinEncounter.
private PatientDataDefinition getCheckinEncounter(DataConverter... converters) {
EncountersForPatientDataDefinition checkinEncounters = new EncountersForPatientDataDefinition();
checkinEncounters.setTypes(Arrays.asList(Metadata.lookup(EncounterTypes.CHECK_IN)));
checkinEncounters.setOnlyInActiveVisit(true);
checkinEncounters.setWhich(TimeQualifier.FIRST);
return new ConvertedPatientDataDefinition(checkinEncounters, converters);
}
Aggregations