Search in sources :

Example 1 with PrinterModuleActivator

use of org.openmrs.module.printer.PrinterModuleActivator 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 2 with PrinterModuleActivator

use of org.openmrs.module.printer.PrinterModuleActivator in project openmrs-module-pihcore 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();
    loadFromInitializer(Domain.LOCATIONS, "locations-base.csv");
    loadFromInitializer(Domain.LOCATIONS, "locations-site-mirebalais.csv");
    loadFromInitializer(Domain.PERSON_ATTRIBUTE_TYPES, "personAttributeTypes.csv");
    loadFromInitializer(Domain.PATIENT_IDENTIFIER_TYPES, "zlIdentifierTypes.csv");
    metadataDeployService.installBundle(testAddressBundle);
    // Register print handlers
    PrinterSetup.registerPrintHandlers(printerService);
    Config config = mock(Config.class);
    when(config.getCountry()).thenReturn(ConfigDescriptor.Country.HAITI);
    when(config.getSite()).thenReturn("MIREBALAIS");
    Location location = locationService.getLocation("Biwo Resepsyon");
    LocationTag tag = new LocationTag();
    tag.setName(PaperRecordConstants.LOCATION_TAG_MEDICAL_RECORD_LOCATION);
    locationService.saveLocationTag(tag);
    location.addTag(tag);
    MetadataMappingsSetup.setupPrimaryIdentifierTypeBasedOnCountry(metadataMappingService, patientService, config);
}
Also used : LocationTag(org.openmrs.LocationTag) EmrApiActivator(org.openmrs.module.emrapi.EmrApiActivator) Config(org.openmrs.module.pihcore.config.Config) PrinterModuleActivator(org.openmrs.module.printer.PrinterModuleActivator) Location(org.openmrs.Location) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)2 EmrApiActivator (org.openmrs.module.emrapi.EmrApiActivator)2 Config (org.openmrs.module.pihcore.config.Config)2 PrinterModuleActivator (org.openmrs.module.printer.PrinterModuleActivator)2 Location (org.openmrs.Location)1 LocationTag (org.openmrs.LocationTag)1