Search in sources :

Example 1 with AgeConverter

use of org.openmrs.module.reporting.data.converter.AgeConverter 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)

Aggregations

MappedData (org.openmrs.module.reporting.data.MappedData)1 AgeConverter (org.openmrs.module.reporting.data.converter.AgeConverter)1 ConvertedPatientDataDefinition (org.openmrs.module.reporting.data.patient.definition.ConvertedPatientDataDefinition)1 EncountersForPatientDataDefinition (org.openmrs.module.reporting.data.patient.definition.EncountersForPatientDataDefinition)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 DocumentedDefinition (org.openmrs.module.reporting.definition.library.DocumentedDefinition)1