Search in sources :

Example 1 with IdentifierSource

use of org.openmrs.module.idgen.IdentifierSource in project openmrs-module-mirebalais by PIH.

the class MirebalaisHospitalServiceImpl method getIdentifierSource.

private <T extends IdentifierSource> T getIdentifierSource(String uuid, Class<T> sourceType) {
    IdentifierSourceService iss = Context.getService(IdentifierSourceService.class);
    IdentifierSource source = iss.getIdentifierSourceByUuid(uuid);
    if (source == null) {
        throw new IllegalStateException(sourceType.getSimpleName() + " has not been configured");
    }
    return (T) source;
}
Also used : IdentifierSourceService(org.openmrs.module.idgen.service.IdentifierSourceService) IdentifierSource(org.openmrs.module.idgen.IdentifierSource) RemoteIdentifierSource(org.openmrs.module.idgen.RemoteIdentifierSource)

Example 2 with IdentifierSource

use of org.openmrs.module.idgen.IdentifierSource in project openmrs-module-pihcore by PIH.

the class ConfigureHaitiIdGenerators method getIdentifierSource.

private <T extends IdentifierSource> T getIdentifierSource(String uuid, Class<T> sourceType) {
    IdentifierSourceService iss = Context.getService(IdentifierSourceService.class);
    IdentifierSource source = iss.getIdentifierSourceByUuid(uuid);
    if (source == null) {
        throw new IllegalStateException(sourceType.getSimpleName() + " has not been configured");
    }
    return (T) source;
}
Also used : IdentifierSourceService(org.openmrs.module.idgen.service.IdentifierSourceService) IdentifierSource(org.openmrs.module.idgen.IdentifierSource) RemoteIdentifierSource(org.openmrs.module.idgen.RemoteIdentifierSource)

Aggregations

IdentifierSource (org.openmrs.module.idgen.IdentifierSource)2 RemoteIdentifierSource (org.openmrs.module.idgen.RemoteIdentifierSource)2 IdentifierSourceService (org.openmrs.module.idgen.service.IdentifierSourceService)2