示例#1
0
  protected void setCurrentRemoteQueryInformationModel(String remoteAEForQuery) throws Exception {
    currentRemoteQueryInformationModel = null;
    String stringForTitle = "";
    if (remoteAEForQuery != null
        && remoteAEForQuery.length() > 0
        && networkApplicationProperties != null
        && networkApplicationInformation != null) {
      try {
        String queryCallingAETitle = networkApplicationProperties.getCallingAETitle();
        // If requesting data (ie dicom files) and not just info, send directly to dcm4che, not to
        // epad server

        String queryCalledAETitle =
            networkApplicationInformation.getApplicationEntityTitleFromLocalName(remoteAEForQuery);
        PresentationAddress presentationAddress =
            networkApplicationInformation
                .getApplicationEntityMap()
                .getPresentationAddress(queryCalledAETitle);

        if (presentationAddress == null) {
          throw new Exception(
              "For remote query AE <"
                  + remoteAEForQuery
                  + ">, presentationAddress cannot be determined");
        }

        String queryHost = presentationAddress.getHostname();
        int queryPort = presentationAddress.getPort();
        log.info("queryHost:" + queryHost + " queryPort:" + queryPort);
        String queryModel =
            networkApplicationInformation
                .getApplicationEntityMap()
                .getQueryModel(queryCalledAETitle);
        int queryDebugLevel = 0; // networkApplicationProperties.getQueryDebugLevel();

        if (NetworkApplicationProperties.isStudyRootQueryModel(queryModel) || queryModel == null) {
          currentRemoteQueryInformationModel =
              new StudyRootQueryInformationModel(
                  queryHost, queryPort, queryCalledAETitle, queryCallingAETitle, queryDebugLevel);
          stringForTitle = ":" + remoteAEForQuery;
        } else {
          throw new Exception(
              "For remote query AE <"
                  + remoteAEForQuery
                  + ">, query model "
                  + queryModel
                  + " not supported");
        }
        // log.info("Remote AE set to:" + remoteAEForQuery);
      } catch (Exception e) { // if an AE's property has no value, or model not supported
        e.printStackTrace(System.err);
        throw e;
      }
    }
  }
示例#2
0
  protected void removeRemotePAC(String localname) throws IOException, DicomNetworkException {

    networkApplicationInformation = networkApplicationProperties.getNetworkApplicationInformation();
    networkApplicationInformation.remove(localname);
    applicationProperties = networkApplicationProperties.getProperties(getProperties());
    log.debug(
        "4 localNameToApplicationEntityTitleMap:"
            + networkApplicationInformation.getListOfLocalNamesOfApplicationEntities());
    log.debug(
        "4 applicationEntityTitleToLocalNameMap:"
            + networkApplicationInformation
                .getListOfApplicationEntityTitlesOfApplicationEntities());
    this.storeProperties(localname + " deleted by EPAD " + new Date());
  }
示例#3
0
 protected void addRemotePAC(
     String localname,
     String aeTitle,
     String hostname,
     int port,
     String queryModel,
     String primaryDeviceType)
     throws IOException, DicomNetworkException {
   networkApplicationInformation = networkApplicationProperties.getNetworkApplicationInformation();
   networkApplicationInformation.add(
       localname, aeTitle, hostname, port, queryModel, primaryDeviceType);
   log.debug(
       "2 localNameToApplicationEntityTitleMap:"
           + networkApplicationInformation.getListOfLocalNamesOfApplicationEntities());
   applicationProperties = networkApplicationProperties.getProperties(getProperties());
   this.storeProperties(localname + " added by EPAD " + new Date());
 }