Regarding Mergecom toolkit using C#

csharp , dicom , mergecom India
  • 11 years ago

    Hi,

    We are trying to send GET command using mergecom tool (Trail version using C#) kit. But, we are getting an run time error “UNEXPECTED NETWORK SHUT DOWN” at this “responseMsg = assoc.read(timeout);” line of code.

    Can u ppl let us know what we are missing in the below mentioned code. we have tried using the sample files..but, somehow not able interpret. We are using “PACSONE” as server. Please let me know what point am I missing… I want to get the image present on the server and store it on my machine. Below is the code for GET command.:

    //initialising the mergecom tool kit

    System.IO.FileInfo F = new System.IO.FileInfo("D:\MergeCom\bin\MERGE.INI");

    MC.mcInitialization(F);

    MCassociation assoc = null; //SCU details MCapplication app = MCapplication.getApplication("AE221"); //SCP details
    MCremoteApplication remoteApp = MCremoteApplication.getObject("MyAEtitle");

    try { //request association assoc = Mergecom.MCassociation.requestAssociation(app, remoteApp);

    MessageBox.Show("Association succuessful"); } MCdimseMessage res, responseMsg = null; //preparing dataset for the GET command MCdataSet ds1 = new MCdataSet(MCdimseService.CGETRQ,“PATIENTROOTQRGET"); //declaring the query level for the get command ds1[MCdicom.QUERYRETRIEVELEVEL, 0] = "PATIENT"; //Providing the patient id ds1[MCdicom.PATIENTID, 0] = 2; //Declaring the query retrieval service MCqueryRetrieveService ser1 = new MCqueryRetrieveService(assoc); //sending the GET command res = ser1.sendGetRequest(ds1); responseMsg = assoc.read(timeout);

    any idea why r we encountering the issue....?

  • 11 years ago

    hi,

    As stated by you, i have checked the log file and as per my knowledge, the service "PATIENTROOTQR_GET" was getting negotiated properly. And i have not observed any negotiation rejected for this service.

    Below is the information from merge.log file:

    1.2.840.10008.5.1.4.1.2.1.3 (PATIENTROOTQRGET)
    (1220) 08-10 17:22:09.04 MC3 T3: | (5)Proposed Transfer Syntaxes:
    (1220) 08-10 17:22:09.04 MC3 T3: | 1.2.840.10008.1.2.1 (Explicit Little
    Endian)
    (1220) 08-10 17:22:09.04 MC3 T3: | 1.2.840.10008.1.2 (Implicit Little
    Endian)
    (1220) 08-10 17:22:09.04 MC3 T3: | 1.2.840.10008.1.2.2 (Explicit Big
    Endian)
    (1220) 08-10 17:22:09.04 MC3 T3: | (5)SCU Role: Not sent (requestor
    supports SCU)
    (1220) 08-10 17:22:09.04 MC3 T3: | (5)SCP Role: Not sent (requestor
    supports SCP)
    (1220) 08-10 17:22:09.04 MC3 T3: | (5)No extended application info
    (1220) 08-10 17:22:09.04 MC3 T3: | (6)Pres
    context_id: 11

    However, there were few errors in the which errors were captured in the log file as stated below:

    (1220) 08-10 17:22:10.11 MC3(ReadPDUBody) E: Called with too small buffer,
    PDU length: 32762, Buffer Size: 16390
    (1220) 08-10 17:22:10.11 MC3(ReadPdata) E: Error on ReadPDUBody call
    (1220) 08-10 17:22:10.11 MC3(Transport
    ConnClosedEvent) E: Transport
    unexpectedly closed
    (1220) 08-10 17:22:10.11 MC3 T9: PDU Type: 0x04 (PDATA-TF) Received
    (1220) 08-10 17:22:10.11 MC3 T9: Reserved Byte: 0x00
    (1220) 08-10 17:22:10.11 MC3 T9: PDU length: 0000 7ffa (32762 bytes)
    (1220) 08-10 17:22:10.11 MC3 T9: PDV
    (1220) 08-10 17:22:10.11 MC3(MCIReadNextPDV) I: DULreadpdvs error: UL
    Provider aborted the association
    (1220) 08-10 17:22:10.11 MC3 E: (0000,0000): Error during
    MC
    StreamToMessage:
    (1220) 08-10 17:22:10.11 MC3 E: | Callback cannot comply
    (1220) 08-10 17:22:10.11 MC3(MCReadMessage) E: Network connection
    unexpectedly shutdown
    (1220) 08-10 17:22:10.11 MC3(MClostConnectionException.ctor) E:
    (MCulEngine1) Network Unexpectedly Shutdown

    Can we interpret anything from the above error messages? and there is no sample.pdf available along with the tool kit, we have downloaded .NET/C# tool kit.

    some how we also found that server is sending some data packets, how to capture those packets and input that info file???

    I am seriously struck up with C-GET..can u pls suggest???

  • 11 years ago

    hi,

    As stated by you, i have checked the log file and as per my knowledge, the service "PATIENTROOTQR_GET" was getting negotiated properly. And i have not observed any negotiation rejected for this service.

    Below is the information from merge.log file:

    1.2.840.10008.5.1.4.1.2.1.3 (PATIENTROOTQRGET)
    (1220) 08-10 17:22:09.04 MC3 T3: | (5)Proposed Transfer Syntaxes:
    (1220) 08-10 17:22:09.04 MC3 T3: | 1.2.840.10008.1.2.1 (Explicit Little
    Endian)
    (1220) 08-10 17:22:09.04 MC3 T3: | 1.2.840.10008.1.2 (Implicit Little
    Endian)
    (1220) 08-10 17:22:09.04 MC3 T3: | 1.2.840.10008.1.2.2 (Explicit Big
    Endian)
    (1220) 08-10 17:22:09.04 MC3 T3: | (5)SCU Role: Not sent (requestor
    supports SCU)
    (1220) 08-10 17:22:09.04 MC3 T3: | (5)SCP Role: Not sent (requestor
    supports SCP)
    (1220) 08-10 17:22:09.04 MC3 T3: | (5)No extended application info
    (1220) 08-10 17:22:09.04 MC3 T3: | (6)Pres
    context_id: 11

    However, there were few errors in the which errors were captured in the log file as stated below:

    (1220) 08-10 17:22:10.11 MC3(ReadPDUBody) E: Called with too small buffer,
    PDU length: 32762, Buffer Size: 16390
    (1220) 08-10 17:22:10.11 MC3(ReadPdata) E: Error on ReadPDUBody call
    (1220) 08-10 17:22:10.11 MC3(Transport
    ConnClosedEvent) E: Transport
    unexpectedly closed
    (1220) 08-10 17:22:10.11 MC3 T9: PDU Type: 0x04 (PDATA-TF) Received
    (1220) 08-10 17:22:10.11 MC3 T9: Reserved Byte: 0x00
    (1220) 08-10 17:22:10.11 MC3 T9: PDU length: 0000 7ffa (32762 bytes)
    (1220) 08-10 17:22:10.11 MC3 T9: PDV
    (1220) 08-10 17:22:10.11 MC3(MCIReadNextPDV) I: DULreadpdvs error: UL
    Provider aborted the association
    (1220) 08-10 17:22:10.11 MC3 E: (0000,0000): Error during
    MC
    StreamToMessage:
    (1220) 08-10 17:22:10.11 MC3 E: | Callback cannot comply
    (1220) 08-10 17:22:10.11 MC3(MCReadMessage) E: Network connection
    unexpectedly shutdown
    (1220) 08-10 17:22:10.11 MC3(MClostConnectionException.ctor) E:
    (MCulEngine1) Network Unexpectedly Shutdown

    Can we interpret anything from the above error messages? and there is no sample.pdf available along with the tool kit, we have downloaded .NET/C# tool kit.

    some how we also found that server is sending some data packets, how to capture those packets and input that info file???

    I am seriously struck up with C-GET..can u pls suggest???

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“C++: an octopus made by nailing extra legs onto a dog.” - Steve Taylor