LEADTOOLS DICOM C DLL Help > Function References > L_DicomSendCGetResponse |
#include "ltdic.h"
L_LTDIC_API L_INT L_DicomSendCGetResponse(hNet, nPresentationID, nMessageID, pszClass, nStatus, nRemaining, nCompleted, nFailed, nWarning, hDS)
HDICOMNET hNet; |
/* a DICOM Network handle */ |
L_UCHAR nPresentationID; |
/* presentation ID */ |
L_UINT16 nMessageID; |
/* message ID */ |
L_TCHAR * pszClass; |
/* class type */ |
L_UINT16 nStatus; |
/* status of the request */ |
L_UINT16 nRemaining; |
/* number of remaining instances */ |
L_UINT16 nCompleted; |
/* number of instances completed */ |
L_UINT16 nFailed; |
/* number of instances that failed */ |
L_UINT16 nWarning; |
/* number of warnings */ |
HDICOMDS hDS; |
/* data set */ |
Sends a C-GET-RSP message to a peer member of a connection. This function is available in the PACS Imaging Toolkit.
Parameter |
Description |
hNet |
A DICOM Network handle to the peer member of the connection. |
nPresentationID |
Presentation ID. The presentation ID provides information about both the class type of the data and the transfer syntax to use when transferring the data. |
nMessageID |
Message ID. Each message sent by a member of a connection should have a unique ID. Since a member of a connection may send several messages, this ID allows that member to identify when a specific request has been completed. |
pszClass |
Class affected by the request. This will be an SOP Class or an SOP MetaClass. |
nStatus |
The status of the original request. For a list of possible values, refer to Status Constants. |
nRemaining |
Number of remaining instances to search. |
nCompleted |
Number of instances searched. |
nFailed |
Number of instances that failed the search. |
nWarning |
Number of instances in which warnings occurred. |
hDS |
Pointer to the data set that contains the information retrieved as a result of the call to L_DicomSendCGetRequest. |
Returns
DICOM_SUCCESS |
The function was successful. |
>0 |
An error occurred. Refer to Return Codes. |
Comments
L_DicomSendCGetResponse is sent by the SCP in response to an L_DicomSendCGetRequest call placed by an SCU. This generates a call to RECEIVECGETRESPONSECALLBACK on the SCU.
As an example, suppose an SCU requests an SCP to search all CT class instances for specific data. If the SCP has three CT class instances present, it must search all three instances for the required data. During the search, L_DicomSendCGetResponse may be called multiple times. The table below gives examples of possible parameter values for the calls made to L_DicomSendCGetResponse during the search:
Point within search |
nStatus |
nRemaining |
nCompleted |
nFailed |
nWarning |
Finished 1st instance |
COMMAND_STATUS_PENDING |
2 |
1 |
0 |
0 |
Finished 2nd instance |
COMMAND_STATUS_PENDING |
1 |
2 |
1 |
1 |
Finished the search |
COMMAND_STATUS_SUCCESS |
0 |
3 |
1 |
1 |
After the first instance is searched, there are 2 remaining instances to search (nRemaining), there is 1 instance that has been completed (nCompleted), no instances have failed the search (nFailed), and there are no warnings(nWarning).
After the second instance is searched, there is 1 remaining instance to search (nRemaining), there are 2 instances that have been completed (nCompleted), 1 instance has failed the search (nFailed), and there is one warning (nWarning).
After the last instance has been searched, there are 0 remaining instances to search (nRemaining), there are 3 instances that have been completed (nCompleted), 1 instance has failed the search (nFailed), and there is one warning (nWarning).
The instance that failed may have failed because one data element you were searching for was not in the instance. For example, you may have included "Patient Birth Date" in the elements to search for and one instance did not include "Patient Birth Date".
Information about the warning may be found in the data set that is returned.
Required DLLs and Libraries
For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application |
Win32, x64, Linux.
See Also
Functions: |
L_DicomSendCGetRequest, RECEIVECGETRESPONSECALLBACK, RECEIVECGETREQUESTCALLBACK |
Topics: |
Example
#include <windowsx.h> static HWND hList; /* handle to list box */ L_VOID EXT_CALLBACK OnReceiveCStoreResponse(HDICOMNET hNet, L_UCHAR nPresentationID, L_UINT16 nMessageID, L_TCHAR *pszClass, L_TCHAR *pszInstance, L_UINT16 nStatus, L_VOID *pUserData) { UNREFERENCED_PARAMETER(pUserData); L_TCHAR szMsg[800]; L_INT nRet; ListBox_AddString(hList, TEXT("Command Set - C-STORE-RESPONSE")); wsprintf(szMsg, TEXT(" Presentation ID: %d"), nPresentationID); ListBox_AddString(hList, szMsg); wsprintf(szMsg, TEXT(" Message ID: %d"), nMessageID); ListBox_AddString(hList, szMsg); wsprintf(szMsg, TEXT(" Affected SOP Class: %s"), pszClass); ListBox_AddString(hList, szMsg); wsprintf(szMsg, TEXT(" Affected SOP Instance: %s"), pszInstance); ListBox_AddString(hList, szMsg); wsprintf(szMsg, TEXT(" Status: %d"), nStatus); ListBox_AddString(hList, szMsg); /* use high-level method to send a response */ nRet = L_DicomSendCGetResponse(hNet, nPresentationID, nMessageID, pszClass, COMMAND_STATUS_SUCCESS, 0, 1, 0, 0, 0); if (nRet != DICOM_SUCCESS) MessageBox(NULL, TEXT("Error Inside Callback Function"), TEXT("OnReceiveCStoreResponse"), MB_OK); }