Search in sources :

Example 1 with PatientIdentifierDataDefinition

use of org.openmrs.module.reporting.data.patient.definition.PatientIdentifierDataDefinition 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 2 with PatientIdentifierDataDefinition

use of org.openmrs.module.reporting.data.patient.definition.PatientIdentifierDataDefinition in project openmrs-module-pihcore by PIH.

the class PihPatientDataLibrary method getAllPrimaryIdentifiers.

@DocumentedDefinition
public PatientDataDefinition getAllPrimaryIdentifiers() {
    PatientIdentifierDataDefinition d = new PatientIdentifierDataDefinition();
    d.setTypes(Arrays.asList(emrApiProperties.getPrimaryIdentifierType()));
    return d;
}
Also used : PatientIdentifierDataDefinition(org.openmrs.module.reporting.data.patient.definition.PatientIdentifierDataDefinition) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Example 3 with PatientIdentifierDataDefinition

use of org.openmrs.module.reporting.data.patient.definition.PatientIdentifierDataDefinition in project openmrs-module-mirebalais by PIH.

the class MirebalaisHospitalActivatorComponentTest method verifyDailyAppointmentsDataSetUpdated.

private void verifyDailyAppointmentsDataSetUpdated() {
    AppointmentDataSetDefinition dsd = (AppointmentDataSetDefinition) dataSetDefinitionService.getDefinition(AppointmentSchedulingUIConstants.DAILY_SCHEDULED_APPOINTMENT_DATA_SET_DEFINITION_UUID, AppointmentDataSetDefinition.class);
    RowPerObjectColumnDefinition identifierColumn = (RowPerObjectColumnDefinition) dsd.getColumnDefinition("identifier");
    PatientToAppointmentDataDefinition patientToAppointmentDataDefinition = (PatientToAppointmentDataDefinition) identifierColumn.getDataDefinition().getParameterizable();
    PatientIdentifierDataDefinition patientIdentifierDataDefinition = (PatientIdentifierDataDefinition) patientToAppointmentDataDefinition.getJoinedDefinition();
    assertThat(patientIdentifierDataDefinition.getTypes().size(), is(1));
    assertThat(patientIdentifierDataDefinition.getTypes().get(0), is(paperRecordProperties.getPaperRecordIdentifierType()));
}
Also used : AppointmentDataSetDefinition(org.openmrs.module.appointmentscheduling.reporting.dataset.definition.AppointmentDataSetDefinition) PatientIdentifierDataDefinition(org.openmrs.module.reporting.data.patient.definition.PatientIdentifierDataDefinition) PatientToAppointmentDataDefinition(org.openmrs.module.appointmentscheduling.reporting.data.definition.PatientToAppointmentDataDefinition) RowPerObjectColumnDefinition(org.openmrs.module.reporting.dataset.column.definition.RowPerObjectColumnDefinition)

Example 4 with PatientIdentifierDataDefinition

use of org.openmrs.module.reporting.data.patient.definition.PatientIdentifierDataDefinition in project openmrs-module-mirebalais by PIH.

the class AppointmentSchedulingSetup method customizeDailyAppointmentsDataSet.

public static void customizeDailyAppointmentsDataSet() {
    DataSetDefinitionService dataSetDefinitionService = Context.getService(DataSetDefinitionService.class);
    PaperRecordProperties paperRecordProperties = Context.getRegisteredComponents(PaperRecordProperties.class).get(0);
    AppointmentDataSetDefinition dsd = (AppointmentDataSetDefinition) dataSetDefinitionService.getDefinition(AppointmentSchedulingUIConstants.DAILY_SCHEDULED_APPOINTMENT_DATA_SET_DEFINITION_UUID, AppointmentDataSetDefinition.class);
    if (dsd == null || dsd.getId() == null) {
        throw new RuntimeException("Daily scheduled appointment data set definition not found");
    }
    // swap out the identifier column to show dossier number instead of primary identifier
    dsd.removeColumnDefinition("identifier");
    PatientIdentifierDataDefinition dd = new PatientIdentifierDataDefinition(null, paperRecordProperties.getPaperRecordIdentifierType());
    dd.setIncludeFirstNonNullOnly(true);
    dsd.addColumn("identifier", dd, "", new PropertyConverter(PatientIdentifier.class, "identifier"));
    dataSetDefinitionService.saveDefinition(dsd);
}
Also used : AppointmentDataSetDefinition(org.openmrs.module.appointmentscheduling.reporting.dataset.definition.AppointmentDataSetDefinition) PatientIdentifierDataDefinition(org.openmrs.module.reporting.data.patient.definition.PatientIdentifierDataDefinition) PropertyConverter(org.openmrs.module.reporting.data.converter.PropertyConverter) DataSetDefinitionService(org.openmrs.module.reporting.dataset.definition.service.DataSetDefinitionService) PaperRecordProperties(org.openmrs.module.paperrecord.PaperRecordProperties) PatientIdentifier(org.openmrs.PatientIdentifier)

Example 5 with PatientIdentifierDataDefinition

use of org.openmrs.module.reporting.data.patient.definition.PatientIdentifierDataDefinition in project openmrs-module-pihcore by PIH.

the class PihPatientDataLibrary method getAllDossierNumberIdentifiers.

@DocumentedDefinition("allDossierNumbers.identifier")
public PatientDataDefinition getAllDossierNumberIdentifiers() {
    PatientIdentifierDataDefinition pdd = new PatientIdentifierDataDefinition();
    pdd.setTypes(Arrays.asList(Metadata.lookup(PihHaitiPatientIdentifierTypes.DOSSIER_NUMBER)));
    CollectionConverter cc = new CollectionConverter(new PropertyConverter(PatientIdentifier.class, "identifier"), false, new ComparableComparator());
    return new ConvertedPatientDataDefinition(pdd, cc);
}
Also used : PatientIdentifierDataDefinition(org.openmrs.module.reporting.data.patient.definition.PatientIdentifierDataDefinition) PropertyConverter(org.openmrs.module.reporting.data.converter.PropertyConverter) ComparableComparator(org.apache.commons.collections.comparators.ComparableComparator) CollectionConverter(org.openmrs.module.reporting.data.converter.CollectionConverter) PatientIdentifier(org.openmrs.PatientIdentifier) ConvertedPatientDataDefinition(org.openmrs.module.reporting.data.patient.definition.ConvertedPatientDataDefinition) DocumentedDefinition(org.openmrs.module.reporting.definition.library.DocumentedDefinition)

Aggregations

PatientIdentifierDataDefinition (org.openmrs.module.reporting.data.patient.definition.PatientIdentifierDataDefinition)5 PatientIdentifier (org.openmrs.PatientIdentifier)2 AppointmentDataSetDefinition (org.openmrs.module.appointmentscheduling.reporting.dataset.definition.AppointmentDataSetDefinition)2 PropertyConverter (org.openmrs.module.reporting.data.converter.PropertyConverter)2 ConvertedPatientDataDefinition (org.openmrs.module.reporting.data.patient.definition.ConvertedPatientDataDefinition)2 DocumentedDefinition (org.openmrs.module.reporting.definition.library.DocumentedDefinition)2 ComparableComparator (org.apache.commons.collections.comparators.ComparableComparator)1 PatientToAppointmentDataDefinition (org.openmrs.module.appointmentscheduling.reporting.data.definition.PatientToAppointmentDataDefinition)1 PaperRecordProperties (org.openmrs.module.paperrecord.PaperRecordProperties)1 CollectionConverter (org.openmrs.module.reporting.data.converter.CollectionConverter)1 RowPerObjectColumnDefinition (org.openmrs.module.reporting.dataset.column.definition.RowPerObjectColumnDefinition)1 DataSetDefinitionService (org.openmrs.module.reporting.dataset.definition.service.DataSetDefinitionService)1