Search in sources :

Example 1 with MirebalaisHospitalService

use of org.openmrs.module.mirebalais.api.MirebalaisHospitalService in project openmrs-module-mirebalais by PIH.

the class MirebalaisHospitalActivatorIT method testThatActivatorDoesAllSetup.

@Test
@DirtiesContext
public void testThatActivatorDoesAllSetup() throws Exception {
    MirebalaisHospitalService service = Context.getService(MirebalaisHospitalService.class);
    IdentifierSourceService identifierSourceService = Context.getService(IdentifierSourceService.class);
    LocationService locationService = Context.getLocationService();
    /**
     *        ConfigureIdGenerators configureIdGenerators = new ConfigureIdGenerators(identifierSourceService, locationService);
     *
     *        IdentifierPool localZlIdentifierPool = service.getLocalZlIdentifierPool();
     *        RemoteIdentifierSource remoteZlIdentifierSource = service.getRemoteZlIdentifierSource();
     *        SequentialIdentifierGenerator dossierSequenceGenerator = service.getDossierSequenceGenerator(PihCoreConstants.UHM_DOSSIER_NUMBER_IDENTIFIER_SOURCE_UUID);
     *
     *        PatientIdentifierType zlIdentifierType = Context.getPatientService().getPatientIdentifierTypeByUuid(HaitiPatientIdentifierTypes.ZL_EMR_ID.uuid());
     *        PatientIdentifierType dossierNumberIdentifierType = Context.getPatientService().getPatientIdentifierTypeByUuid(HaitiPatientIdentifierTypes.DOSSIER_NUMBER.uuid());
     *
     *        AutoGenerationOption autoGenerationOption = Context.getService(IdentifierSourceService.class).getAutoGenerationOption(zlIdentifierType);
     *
     *        assertEquals(HaitiPatientIdentifierTypes.ZL_EMR_ID.uuid(), zlIdentifierType.getUuid());
     *        assertEquals(zlIdentifierType, autoGenerationOption.getIdentifierType());
     *        assertEquals(localZlIdentifierPool, autoGenerationOption.getSource());
     *
     *        assertEquals(PihCoreConstants.LOCAL_ZL_IDENTIFIER_POOL_UUID, localZlIdentifierPool.getUuid());
     *        assertEquals(PihCoreConstants.LOCAL_ZL_IDENTIFIER_POOL_BATCH_SIZE, localZlIdentifierPool.getBatchSize());
     *        assertEquals(PihCoreConstants.LOCAL_ZL_IDENTIFIER_POOL_MIN_POOL_SIZE, localZlIdentifierPool.getMinPoolSize());
     *
     *        assertEquals(PihCoreConstants.REMOTE_ZL_IDENTIFIER_SOURCE_UUID, remoteZlIdentifierSource.getUuid());
     *        assertEquals(configureIdGenerators.getRemoteZlIdentifierSourceUrl(), remoteZlIdentifierSource.getUrl());
     *        assertEquals(configureIdGenerators.getRemoteZlIdentifierSourceUsername(), remoteZlIdentifierSource.getUser());
     *        assertEquals(configureIdGenerators.getRemoteZlIdentifierSourcePassword(), remoteZlIdentifierSource.getPassword());
     *
     *        assertEquals("A", dossierSequenceGenerator.getPrefix());
     *        assertEquals(new Integer(7), dossierSequenceGenerator.getMaxLength());
     *        assertEquals(new Integer(7), dossierSequenceGenerator.getMinLength());
     *        assertEquals("0123456789", dossierSequenceGenerator.getBaseCharacterSet());
     *        assertEquals("000001", dossierSequenceGenerator.getFirstIdentifierBase());
     *        assertEquals(PihCoreConstants.UHM_DOSSIER_NUMBER_IDENTIFIER_SOURCE_UUID, dossierSequenceGenerator.getUuid());
     *        assertEquals(dossierNumberIdentifierType, dossierSequenceGenerator.getIdentifierType());
     *        assertEquals(2, Context.getService(IdentifierSourceService.class).getAutoGenerationOptions(dossierNumberIdentifierType).size());
     */
    assertNotNull(Context.getService(ImportPatientFromWebService.class).getRemoteServers().get("lacolline"));
}
Also used : LocationService(org.openmrs.api.LocationService) IdentifierSourceService(org.openmrs.module.idgen.service.IdentifierSourceService) MirebalaisHospitalService(org.openmrs.module.mirebalais.api.MirebalaisHospitalService) ImportPatientFromWebService(org.openmrs.module.importpatientfromws.api.ImportPatientFromWebService) BaseModuleContextSensitiveTest(org.openmrs.test.BaseModuleContextSensitiveTest) Test(org.junit.Test) DirtiesContext(org.springframework.test.annotation.DirtiesContext)

Aggregations

Test (org.junit.Test)1 LocationService (org.openmrs.api.LocationService)1 IdentifierSourceService (org.openmrs.module.idgen.service.IdentifierSourceService)1 ImportPatientFromWebService (org.openmrs.module.importpatientfromws.api.ImportPatientFromWebService)1 MirebalaisHospitalService (org.openmrs.module.mirebalais.api.MirebalaisHospitalService)1 BaseModuleContextSensitiveTest (org.openmrs.test.BaseModuleContextSensitiveTest)1 DirtiesContext (org.springframework.test.annotation.DirtiesContext)1