Search in sources :

Example 1 with EmrApiActivator

use of org.openmrs.module.emrapi.EmrApiActivator in project openmrs-module-mirebalais by PIH.

the class MirebalaisHospitalActivatorIT method beforeEachTest.

@Before
public void beforeEachTest() throws Exception {
    initializeInMemoryDatabase();
    executeDataSet("requiredDataTestDataset.xml");
    executeDataSet("globalPropertiesTestDataset.xml");
    executeDataSet("serializedReportingDataset.xml");
    executeDataSet("fromMirebalaisMetadataModule.xml");
    authenticate();
    deployService.installBundle(conceptsFromMetadataSharing);
    personAttributeTypeBundle.install();
    // run the emrapi activator
    EmrApiActivator emrApiActivator = new EmrApiActivator();
    emrApiActivator.started();
    // set up metatdata from pih core first
    PihCoreActivator pihCoreActivator = new PihCoreActivator();
    Config config = mock(Config.class);
    when(config.getCountry()).thenReturn(ConfigDescriptor.Country.HAITI);
    when(config.getSite()).thenReturn(ConfigDescriptor.Site.MIREBALAIS);
    when(config.getBiometricsConfig()).thenReturn(new BiometricsConfigDescriptor());
    pihCoreActivator.setConfig(config);
    pihCoreActivator.started();
    MirebalaisHospitalActivator activator = new MirebalaisHospitalActivator();
    activator.setTestMode(true);
    activator.contextRefreshed();
    activator.started();
}
Also used : EmrApiActivator(org.openmrs.module.emrapi.EmrApiActivator) BiometricsConfigDescriptor(org.openmrs.module.pihcore.config.registration.BiometricsConfigDescriptor) PihCoreActivator(org.openmrs.module.pihcore.PihCoreActivator) Config(org.openmrs.module.pihcore.config.Config) MirebalaisHospitalActivator(org.openmrs.module.mirebalais.MirebalaisHospitalActivator) Before(org.junit.Before)

Example 2 with EmrApiActivator

use of org.openmrs.module.emrapi.EmrApiActivator in project openmrs-module-mirebalais by PIH.

the class ZlEmrIdCardPrinterTest method setup.

@Before
public void setup() throws Exception {
    EmrApiActivator emrApiActivator = new EmrApiActivator();
    emrApiActivator.started();
    PrinterModuleActivator printerModuleActivator = new PrinterModuleActivator();
    // Create Location Attribute Types Needed
    printerModuleActivator.started();
    locationTagBundle.install();
    locationAttributeTypeBundle.install();
    // to install primary identifier type
    haitiMetadataBundle.install();
    // Install Location Metadata for distribution
    mirebalaisLocationsBundle.install();
    // Install Patient Identifier Types for distribution
    pihHaitiPatientIdentifierTypeBundle.install();
    // Install Person Attribute Types for distribution
    personAttributeTypeBundle.install();
    // Instal Person Attribute Types provided by Haiti Core
    haitiPersonAttributeTypeBundle.install();
    // Install address template needed for layout on id card
    addressBundle.installAddressTemplate();
    // Register print handlers
    PrinterSetup.registerPrintHandlers(printerService);
    Config config = mock(Config.class);
    when(config.getCountry()).thenReturn(ConfigDescriptor.Country.HAITI);
    when(config.getSite()).thenReturn(ConfigDescriptor.Site.MIREBALAIS);
    LocationTagSetup.setupLocationTags(locationService, config);
    MetadataMappingsSetup.setupPrimaryIdentifierTypeBasedOnCountry(metadataMappingService, patientService, config);
}
Also used : EmrApiActivator(org.openmrs.module.emrapi.EmrApiActivator) Config(org.openmrs.module.pihcore.config.Config) PrinterModuleActivator(org.openmrs.module.printer.PrinterModuleActivator) Before(org.junit.Before)

Example 3 with EmrApiActivator

use of org.openmrs.module.emrapi.EmrApiActivator in project openmrs-module-mirebalais by PIH.

the class WristbandComponentTest method setup.

@Before
public void setup() throws Exception {
    executeDataSet("wristbandTestDataset.xml");
    EmrApiActivator emrApiActivator = new EmrApiActivator();
    emrApiActivator.started();
    Config config = mock(Config.class);
    when(config.getCountry()).thenReturn(ConfigDescriptor.Country.HAITI);
    when(config.getSite()).thenReturn(ConfigDescriptor.Site.MIREBALAIS);
    MetadataMappingsSetup.setupPrimaryIdentifierTypeBasedOnCountry(metadataMappingService, patientService, config);
}
Also used : EmrApiActivator(org.openmrs.module.emrapi.EmrApiActivator) Config(org.openmrs.module.pihcore.config.Config) Before(org.junit.Before)

Example 4 with EmrApiActivator

use of org.openmrs.module.emrapi.EmrApiActivator in project openmrs-module-mirebalais by PIH.

the class MirebalaisHospitalActivatorComponentTest method beforeEachTest.

@Before
public void beforeEachTest() throws Exception {
    initializeInMemoryDatabase();
    executeDataSet("requiredDataTestDataset.xml");
    executeDataSet("globalPropertiesTestDataset.xml");
    executeDataSet("mirebalaisProviderIdentifierGeneratorComponentTestDataset.xml");
    executeDataSet("fromMirebalaisMetadataModule.xml");
    executeDataSet("serializedReportingDataset.xml");
    authenticate();
    deployService.installBundle(conceptsFromMetadataSharing);
    haitiPersonAttributeTypeBundle.install();
    // run the emrapi activator
    emrApiActivator = new EmrApiActivator();
    emrApiActivator.started();
    // run the appointmentschedulingui manager
    appointmentSchedulingUIActivator = new AppointmentSchedulingUIActivator();
    appointmentSchedulingUIActivator.started();
    // set up metadata from pih core first
    pihCoreActivator = new PihCoreActivator();
    Config config = mock(Config.class);
    when(config.getCountry()).thenReturn(ConfigDescriptor.Country.HAITI);
    when(config.getSite()).thenReturn(ConfigDescriptor.Site.MIREBALAIS);
    when(config.getBiometricsConfig()).thenReturn(new BiometricsConfigDescriptor());
    pihCoreActivator.setConfig(config);
    pihCoreActivator.started();
    mirebalaisHospitalActivator = new MirebalaisHospitalActivator();
    // TODO: get ReportSetup to work while testing so we no longer need this
    mirebalaisHospitalActivator.setTestMode(true);
    mirebalaisHospitalActivator.willRefreshContext();
    mirebalaisHospitalActivator.contextRefreshed();
    mirebalaisHospitalActivator.willStart();
    mirebalaisHospitalActivator.started();
}
Also used : EmrApiActivator(org.openmrs.module.emrapi.EmrApiActivator) BiometricsConfigDescriptor(org.openmrs.module.pihcore.config.registration.BiometricsConfigDescriptor) PihCoreActivator(org.openmrs.module.pihcore.PihCoreActivator) Config(org.openmrs.module.pihcore.config.Config) AppointmentSchedulingUIActivator(org.openmrs.module.appointmentschedulingui.AppointmentSchedulingUIActivator) MirebalaisHospitalActivator(org.openmrs.module.mirebalais.MirebalaisHospitalActivator) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)4 EmrApiActivator (org.openmrs.module.emrapi.EmrApiActivator)4 Config (org.openmrs.module.pihcore.config.Config)4 MirebalaisHospitalActivator (org.openmrs.module.mirebalais.MirebalaisHospitalActivator)2 PihCoreActivator (org.openmrs.module.pihcore.PihCoreActivator)2 BiometricsConfigDescriptor (org.openmrs.module.pihcore.config.registration.BiometricsConfigDescriptor)2 AppointmentSchedulingUIActivator (org.openmrs.module.appointmentschedulingui.AppointmentSchedulingUIActivator)1 PrinterModuleActivator (org.openmrs.module.printer.PrinterModuleActivator)1