Search in sources :

Example 1 with ConvertedPatientDataDefinition

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);
}
Also used : EncountersForPatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.EncountersForPatientDataDefinition) ConvertedPatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.ConvertedPatientDataDefinition)

Example 2 with ConvertedPatientDataDefinition

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;
    }
}
Also used : PatientIdentifierDataDefinition(org.openmrs.module.reporting.data.patient.definition.PatientIdentifierDataDefinition) ConvertedPatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.ConvertedPatientDataDefinition)

Example 3 with ConvertedPatientDataDefinition

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));
}
Also used : EncountersForPatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.EncountersForPatientDataDefinition) EarliestCreatedConverter(org.openmrs.module.reporting.data.converter.EarliestCreatedConverter) ConvertedPatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.ConvertedPatientDataDefinition)

Example 4 with ConvertedPatientDataDefinition

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}"));
}
Also used : MappedData(org.openmrs.module.reporting.data.MappedData) AgeConverter(org.openmrs.module.reporting.data.converter.AgeConverter) PatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.PatientDataDefinition) PersonToPatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.PersonToPatientDataDefinition) ConvertedPatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.ConvertedPatientDataDefinition) EncountersForPatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.EncountersForPatientDataDefinition) AgeAtDateOfOtherDataDefinition(org.openmrs.module.reporting.data.person.definition.AgeAtDateOfOtherDataDefinition) PersonToPatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.PersonToPatientDataDefinition) ConvertedPatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.ConvertedPatientDataDefinition) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Example 5 with ConvertedPatientDataDefinition

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);
}
Also used : EncountersForPatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.EncountersForPatientDataDefinition) ConvertedPatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.ConvertedPatientDataDefinition)

Aggregations

ConvertedPatientDataDefinition (org.openmrs.module.reporting.data.patient.definition.ConvertedPatientDataDefinition)8 EncountersForPatientDataDefinition (org.openmrs.module.reporting.data.patient.definition.EncountersForPatientDataDefinition)6 PatientIdentifierDataDefinition (org.openmrs.module.reporting.data.patient.definition.PatientIdentifierDataDefinition)2 DocumentedDefinition (org.openmrs.module.reporting.definition.library.DocumentedDefinition)2 ComparableComparator (org.apache.commons.collections.comparators.ComparableComparator)1 PatientIdentifier (org.openmrs.PatientIdentifier)1 MappedData (org.openmrs.module.reporting.data.MappedData)1 AgeConverter (org.openmrs.module.reporting.data.converter.AgeConverter)1 CollectionConverter (org.openmrs.module.reporting.data.converter.CollectionConverter)1 EarliestCreatedConverter (org.openmrs.module.reporting.data.converter.EarliestCreatedConverter)1 PropertyConverter (org.openmrs.module.reporting.data.converter.PropertyConverter)1 PatientDataDefinition (org.openmrs.module.reporting.data.patient.definition.PatientDataDefinition)1 PersonToPatientDataDefinition (org.openmrs.module.reporting.data.patient.definition.PersonToPatientDataDefinition)1 AgeAtDateOfOtherDataDefinition (org.openmrs.module.reporting.data.person.definition.AgeAtDateOfOtherDataDefinition)1