0
votes

i am trying to send a dicom file (dicomized pdf report file) to several PACS systems. In some cases i can do it while in some other the dicom is not being sent without any errors in my log.

Here is my java code:

public void sendDicomPdfToPacs(String dcmFilePath) throws Exception, IOException {

    Path tmpPdfDcm = Paths.get(dcmFilePath+".dcm");

    GlobalConfig cfg = new GlobalConfig();
    String localPacsAet = "";
    String localPacsIp="";
    int localPacsPort=0;
    localPacsAet = cfg.getLocalPacsAet1();
    localPacsPort = cfg.getLocalPacsPort1();
    localPacsIp = cfg.getLocalPacsIp();

    DcmEcho dcmEcho = new DcmEcho("device");
    dcmEcho.setRemoteHost(localPacsIp);
    dcmEcho.setRemotePort(localPacsPort);
    dcmEcho.setCalledAET(localPacsAet, true);
    dcmEcho.setCalling("DCMROUTER");

    Boolean dcmPacsStatus=false;

    try {
        dcmEcho.open();
        dcmPacsStatus=true;
        log.info("PACS is up and running");
        dcmEcho.close();
    } catch (IOException ex) {
        ...
    }


    if(dcmPacsStatus) {
        DcmSnd dcmsnd = new DcmSnd("device");

        //Set parameters AET
        dcmsnd.setCalledAET(localPacsAet);
        dcmsnd.setRemoteHost(localPacsIp);
        dcmsnd.setRemotePort(localPacsPort);
        dcmsnd.setCalling("DCMROUTER");

        //Set other default parameters
        dcmsnd.setOfferDefaultTransferSyntaxInSeparatePresentationContext(false);
        dcmsnd.setSendFileRef(false);
        dcmsnd.setStorageCommitment(false);
        dcmsnd.setPackPDV(true);
        dcmsnd.setTcpNoDelay(true);
        //Add DICOM file
        dcmsnd.addFile(tmpPdfDcm.toFile());
        // Configure transfer capability
        dcmsnd.configureTransferCapability();
        try {
            dcmsnd.start();
            log.info("Dicom Send initiated...");
        } catch (Exception e) {
            ...
        }

        try {
            long t1 = System.currentTimeMillis();
            dcmsnd.open();
            long t2 = System.currentTimeMillis();
            Logger.getLogger("Connected to " + localPacsAet + " in " + ((t2-t1)/1000F)+ "s");
            dcmsnd.send();
            dcmsnd.close();
            log.info("Released connection to " + localPacsAet);
        } catch (IOException e) {
           ...
        }  finally {
            dcmsnd.stop();

            /* delete dicom file! */
           ...

        }
    } else {
        log.info("Local PACS is down... Can not perform DICOM send request.");
    }
}

If i try to send to an Osirix PACS then the dicom file is being send succesfully ...

If i try to send to other PACS systems (e.g. Agfa) then i am getting the following message to my log:

Encapsulated Document:  (0042,0011) OB #795856 [25\50\44\46\2D\31\2E\33\0A\25\E2\E3\CF\D3\0A\31\20\30\20\6F\62\...]
MIME Type of Encapsulated Document:     (0042,0012) LO #16 [application/pdf]
2015-04-24 15:57:02 INFO  ProcessPdfReportFiles:487 - Going to perfom DICOM send request for file: C:\XXXXXXXX\5912.pdf.dcm to local pacs: [email protected]:104
38920 [DefaultQuartzScheduler_Worker-2] INFO org.dcm4che2.net.Association - Association(1) initiated Socket[addr=/10.37.5.50,port=104,localport=53580]
38920 [DefaultQuartzScheduler_Worker-2] INFO org.dcm4che2.net.PDUEncoder - PACS(1): A-ASSOCIATE-RQ PACS << DCMROUTER
39040 [device-2] INFO org.dcm4che2.net.Association - PACS(1): A-ASSOCIATE-AC DCMROUTER >> PACS
2015-04-24 15:57:02 INFO  ProcessPdfReportFiles:500 - PACS is up and running
39041 [DefaultQuartzScheduler_Worker-2] INFO org.dcm4che2.net.PDUEncoder - PACS(1) << A-RELEASE-RQ
39045 [device-2] INFO org.dcm4che2.net.Association - PACS(1) >> A-RELEASE-RP
39045 [device-2] INFO org.dcm4che2.net.Association - PACS(1): close Socket[addr=/10.37.5.50,port=104,localport=53580]
.2015-04-24 15:57:02 INFO  ProcessPdfReportFiles:535 - Dicom Send initiated...
39058 [DefaultQuartzScheduler_Worker-2] INFO org.dcm4che2.net.Association - Association(2) initiated Socket[addr=/10.37.5.50,port=104,localport=53581]
39059 [DefaultQuartzScheduler_Worker-2] INFO org.dcm4che2.net.PDUEncoder - PACS(2): A-ASSOCIATE-RQ PACS << DCMROUTER
39191 [device-3] INFO org.dcm4che2.net.Association - PACS(2) >> org.dcm4che2.net.pdu.AAssociateRJ: A-ASSOCIATE-RJ[result=1, source=1, reason=2]: 
permanent application-context-name-not-supported
39192 [device-3] INFO org.dcm4che2.net.Association - PACS(2): close Socket[addr=/10.37.5.50,port=104,localport=53581]

So i guess that this particular PACS is denying my send request because of:

A-ASSOCIATE-RJ[result=1, source=1, reason=2]: permanent application-context-name-not-supported

So what does it mean? What am i missing here?

2
I have also tried to send the file by using the dcmsnd tool from command line: dcmsnd [email protected]:104 5912.pdf.dcm and i am getting the same: ERROR: Failed to establish association:A-ASSOCIATE-RJ[result=1, source=1, reason=2]: permanent application-context-name-not-supported Do i have to set anything in order to succesfully send the file? An association parameter for example?thanili

2 Answers

1
votes

You are correct. The PACS likely doesn't support the Encapsulated PDF SOP class. You can get more information by putting the logs on DEBUG - the A-ASSOCIATE-RJ message that you receive will indicate what presentation context (SOP Class + transfer syntax) is not supported if DEBUG logging is enabled.

http://medical.nema.org/dicom/2013/output/chtml/part08/sect_9.3.html is the relevant section in the standard.

Simply storing the data is likely configurable in the Agfa PACS system. Contact the site's PACS admin with your proposed presentation context and they may be able to add it.

0
votes

Associate reject reason provided by the server is "Application context name not supported". That means SCU is proposing an UID for Application context name that is not supported by the SCP. Try using default Application context name UID for DICOM 3.0 -"1.2.840.10008.3.1.1.1"