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);
}
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);
}
Aggregations