@Test
 public void test() throws Exception {
   for (int i = 0; i < OTHER_AES.length; i++) {
     String aet = OTHER_AES[i];
     config.registerAETitle(aet);
     config.persist(
         createDevice(
             OTHER_DEVICES[i],
             OTHER_ISSUER[i],
             OTHER_INST_CODES[i],
             aet,
             "localhost",
             OTHER_PORTS[i << 1],
             OTHER_PORTS[(i << 1) + 1]));
   }
   for (int i = OTHER_AES.length; i < OTHER_DEVICES.length; i++)
     config.persist(createDevice(OTHER_DEVICES[i]));
   config.persist(
       createHL7Device("hl7rcv", SITE_A, INST_A, PIX_MANAGER, "localhost", 2576, 12576));
   config.registerAETitle("DCM4CHEE");
   config.registerAETitle("DCM4CHEE_ADMIN");
   config.persist(createArchiveDevice("dcm4chee-arc"));
   config.findApplicationEntity("DCM4CHEE");
   if (config instanceof PreferencesArchiveConfiguration) export(System.getProperty("export"));
 }
 private Device createArchiveDevice(String name) throws Exception {
   ArchiveDevice device = new ArchiveDevice(name);
   device.setFuzzyAlgorithmClass("org.dcm4che.soundex.ESoundex");
   device.setConfigurationStaleTimeout(CONFIGURATION_STALE_TIMEOUT);
   setAttributeFilters(device);
   device.setKeyStoreURL("resource:dcm4chee-arc-key.jks");
   device.setKeyStoreType("JKS");
   device.setKeyStorePin("secret");
   device.setThisNodeCertificates(
       config.deviceRef(name), (X509Certificate) keystore.getCertificate(name));
   for (String other : OTHER_DEVICES)
     device.setAuthorizedNodeCertificates(
         config.deviceRef(other), (X509Certificate) keystore.getCertificate(other));
   Connection dicom = createConnection("dicom", "localhost", 11112);
   dicom.setMaxOpsInvoked(0);
   dicom.setMaxOpsPerformed(0);
   device.addConnection(dicom);
   Connection dicomTLS = new Connection("dicom-tls", "localhost", 2762);
   dicomTLS.setMaxOpsInvoked(0);
   dicomTLS.setMaxOpsPerformed(0);
   dicomTLS.setTlsCipherSuites(
       Connection.TLS_RSA_WITH_AES_128_CBC_SHA, Connection.TLS_RSA_WITH_3DES_EDE_CBC_SHA);
   device.addConnection(dicomTLS);
   ArchiveApplicationEntity ae =
       createAE("DCM4CHEE", IMAGE_TSUIDS, VIDEO_TSUIDS, OTHER_TSUIDS, null, PIX_MANAGER);
   device.addApplicationEntity(ae);
   ae.addConnection(dicom);
   ae.addConnection(dicomTLS);
   ArchiveApplicationEntity adminAE =
       createAdminAE(
           "DCM4CHEE_ADMIN", IMAGE_TSUIDS, VIDEO_TSUIDS, OTHER_TSUIDS, null, PIX_MANAGER);
   device.addApplicationEntity(adminAE);
   adminAE.addConnection(dicom);
   adminAE.addConnection(dicomTLS);
   ArchiveHL7Application hl7App = new ArchiveHL7Application("*");
   hl7App.setAcceptedMessageTypes(HL7_MESSAGE_TYPES);
   hl7App.setHL7DefaultCharacterSet("8859/1");
   hl7App.addTemplatesURI("adt2dcm", "resource:dcm4chee-arc-hl7-adt2dcm.xsl");
   device.addHL7Application(hl7App);
   Connection hl7 = new Connection("hl7", "localhost", 2575);
   device.addConnection(hl7);
   hl7App.addConnection(hl7);
   Connection hl7TLS = new Connection("hl7-tls", "localhost", 12575);
   hl7TLS.setTlsCipherSuites(
       Connection.TLS_RSA_WITH_AES_128_CBC_SHA, Connection.TLS_RSA_WITH_3DES_EDE_CBC_SHA);
   device.addConnection(hl7TLS);
   hl7App.addConnection(hl7TLS);
   return device;
 }
Пример #3
0
 @Override
 public void reloadConfiguration() throws Exception {
   device.reconfigure(dicomConfiguration.findDevice(device.getDeviceName()));
   setConfigurationStaleTimeout();
   loadRejectionNoteCodes();
   device.rebindConnections();
 }
 private Device init(Device device, Issuer issuer, Code institutionCode) throws Exception {
   String name = device.getDeviceName();
   device.setThisNodeCertificates(
       config.deviceRef(name), (X509Certificate) keystore.getCertificate(name));
   device.setIssuerOfPatientID(issuer);
   device.setIssuerOfAccessionNumber(issuer);
   if (institutionCode != null) {
     device.setInstitutionNames(institutionCode.getCodeMeaning());
     device.setInstitutionCodes(institutionCode);
   }
   return device;
 }
  private void cleanUp() throws Exception {
    config.unregisterAETitle("DCM4CHEE");
    config.unregisterAETitle("DCM4CHEE_ADMIN");
    for (String aet : OTHER_AES) config.unregisterAETitle(aet);

    try {
      config.removeDevice("dcm4chee-arc");
    } catch (ConfigurationNotFoundException e) {
    }
    try {
      config.removeDevice("hl7rcv");
    } catch (ConfigurationNotFoundException e) {
    }
    for (String name : OTHER_DEVICES)
      try {
        config.removeDevice(name);
      } catch (ConfigurationNotFoundException e) {
      }
  }
 @After
 public void tearDown() throws Exception {
   if (System.getProperty("keep") == null) cleanUp();
   config.close();
 }
Пример #7
0
 public Archive(
     HL7Configuration dicomConfiguration,
     String deviceName,
     CodeService codeService,
     PatientService patientService,
     StgCmtService stgCmtService,
     MPPSService mppsService,
     RetrieveService retrieveService,
     JMSService jmsService,
     Queue mppsSCUQueue,
     Queue ianSCUQueue,
     Queue stgcmtSCPQueue)
     throws ConfigurationException, Exception {
   this.dicomConfiguration = dicomConfiguration;
   this.codeService = codeService;
   this.aeCache = new ApplicationEntityCache(dicomConfiguration);
   this.hl7AppCache = new HL7ApplicationCache(dicomConfiguration);
   this.pixConsumer = new PIXConsumer(hl7AppCache);
   this.jmsService = jmsService;
   this.mppsSCU = new MPPSSCU(aeCache, jmsService, mppsSCUQueue);
   this.ianSCU = new IANSCU(aeCache, jmsService, ianSCUQueue);
   this.storeSCP = new CStoreSCP(aeCache, ianSCU);
   this.stgCmtSCP = new StgCmtSCP(aeCache, stgCmtService, jmsService, stgcmtSCPQueue);
   this.mppsSCP = new MPPSSCP(aeCache, mppsSCU, ianSCU, mppsService);
   this.patientRootFindSCP =
       new CFindSCP(
           UID.PatientRootQueryRetrieveInformationModelFIND,
           aeCache,
           pixConsumer,
           PATIENT,
           STUDY,
           SERIES,
           IMAGE);
   this.studyRootFindSCP =
       new CFindSCP(
           UID.StudyRootQueryRetrieveInformationModelFIND,
           aeCache,
           pixConsumer,
           STUDY,
           SERIES,
           IMAGE);
   this.patientStudyOnlyFindSCP =
       new CFindSCP(
           UID.PatientStudyOnlyQueryRetrieveInformationModelFINDRetired,
           aeCache,
           pixConsumer,
           PATIENT,
           STUDY);
   this.patientRootMoveSCP =
       new CMoveSCP(
           UID.PatientRootQueryRetrieveInformationModelMOVE,
           aeCache,
           pixConsumer,
           retrieveService,
           PATIENT,
           STUDY,
           SERIES,
           IMAGE);
   this.studyRootMoveSCP =
       new CMoveSCP(
           UID.StudyRootQueryRetrieveInformationModelMOVE,
           aeCache,
           pixConsumer,
           retrieveService,
           STUDY,
           SERIES,
           IMAGE);
   this.patientStudyOnlyMoveSCP =
       new CMoveSCP(
           UID.PatientStudyOnlyQueryRetrieveInformationModelMOVERetired,
           aeCache,
           pixConsumer,
           retrieveService,
           PATIENT,
           STUDY);
   this.patientRootGetSCP =
       new CGetSCP(
           UID.PatientRootQueryRetrieveInformationModelGET,
           aeCache,
           pixConsumer,
           retrieveService,
           PATIENT,
           STUDY,
           SERIES,
           IMAGE);
   this.studyRootGetSCP =
       new CGetSCP(
           UID.StudyRootQueryRetrieveInformationModelGET,
           aeCache,
           pixConsumer,
           retrieveService,
           STUDY,
           SERIES,
           IMAGE);
   this.patientStudyOnlyGetSCP =
       new CGetSCP(
           UID.PatientStudyOnlyQueryRetrieveInformationModelGETRetired,
           aeCache,
           pixConsumer,
           retrieveService,
           PATIENT,
           STUDY);
   this.withoutBulkDataGetSCP =
       new CGetSCP(
               UID.CompositeInstanceRetrieveWithoutBulkDataGET,
               aeCache,
               pixConsumer,
               retrieveService,
               IMAGE)
           .withoutBulkData(true);
   this.mwlFindSCP =
       new MWLCFindSCP(UID.ModalityWorklistInformationModelFIND, aeCache, pixConsumer);
   init((ArchiveDevice) dicomConfiguration.findDevice(deviceName));
   device.setHL7MessageListener(hl7ServiceRegistry(patientService));
   setConfigurationStaleTimeout();
   loadRejectionNoteCodes();
 }