LDicomPrintSCU::GetPrintJobInfo

#include "ltdic.h"

L_INT LDicomPrintSCU::GetPrintJobInfo(pszPrintJobInstanceUID, pRequiredPrintJobInfo = NULL)

L_INT LDicomPrintSCU::GetPrintJobInfo(pPrintJobInfo, uStructSize) const

const L_TCHAR * pszPrintJobInstanceUID;

/* SOP Instance UID of the Print Job */

const pPRINTJOBINFO pRequiredPrintJobInfo;

/* required Print Job information */

pPRINTJOBINFO pPrintJobInfo;

/* print Job information */

L_UINT uStructSize;

/* size of the structure */

LDicomPrintSCU::GetPrintJobInfo(pszPrintJobInstanceUID, pRequiredPrintJobInfo) queries the Print SCP for information about the specified Print Job.

LDicomPrintSCU::GetPrintJobInfo (pPrintJobInfo, uStructSize) fills the members of the specified PRINTJOBINFO structure with the Print Job information retrieved previously from the Print SCP.

Parameter

Description

pszPrintJobInstanceUID

Character string that contains the SOP Instance UID of the Print Job whose information is to be retrieved. The function will return an error if this is NULL or if an empty string is specified.

pRequiredPrintJobInfo

Pointer to a PRINTJOBINFO structure that specifies the Print Job information to be retrieved. If this is set to NULL, then it will be assumed that the Values of all the Attributes are required.

pPrintJobInfo

Pointer to a PRINTJOBINFO structure. The function will set the members of this structure to the retrieved Print Job information.

uStructSize

Size of the structure pointed to by pPrintJobInfo.

Returns

LDicomPrintSCU::GetPrintJobInfo(pszPrintJobInstanceUID, pRequiredPrintJobInfo) returns the following:

0

The required Print Job information was retrieved successfully.

DICOM_ERROR_PRINTSCU_FAILURE_STATUS

The response of the Print SCP specifies a Failure status code.

DICOM_ERROR_PRINTSCU_CLASS_NOT_SUPPORTED

The Print Job SOP Class is not supported on the Association.

> 0

An error occurred. Refer to Return Codes.

LDicomPrintSCU::GetPrintJobInfo (pPrintJobInfo, uStructSize) returns the following:

0

The function was successful.

<> 0

An error occurred. Refer to Return Codes.

Comments

For LDicomPrintSCU::GetPrintJobInfo(pszPrintJobInstanceUID, pRequiredPrintJobInfo):

The function will not return until it receives the response of the Print SCP, or an error occurs. The function LDicomPrintSCU::GetLastOperationStatus can be used to obtain the status code specified in the response of the Print SCP. When the return value of the function GetPrintJobInfo is 0, then the required Print Job information was retrieved successfully, with either a Success or Warning status code in the response of the Print SCP.

The function LDicomPrintSCU::GetPrintJobInfo can be used to obtain the Print Job information retrieved from the Print SCP.

The parameter pRequiredPrintJobInfo points to a PRINTJOBINFO structure that specifies the Print Job information to be retrieved. In this structure, all the members that specify Attributes are string buffers. To query the Print SCP for the Value of an Attribute, the corresponding structure member must contain a non-empty string. If a structure member contains an empty string, the corresponding Attribute will not be included in the request; however, if all the members contain empty strings, the Print SCP will be queried for the Values of all the Attributes.

For LDicomPrintSCU::GetPrintJobInfo(pPrintJobInfo, uStructSize):

Using the function LDicomPrintSCU::GetPrintJobInfo, the Print SCP can be queried for information about a Print Job. Once the information is retrieved successfully, the function GetPrintJobInfo can then be used to obtain the information sent by the Print SCP.

If an Attribute was not included in the response of the Print SCP, the corresponding structure member will be set to an empty string.

Required DLLs and Libraries

LTDIC

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

Class Members, LDicomPrintSCU::GetPrintJobInstanceUID, LDicomPrintSCU::OnPrintJobReport, LDicomPrintSCU::GetPrintJobInfo, LDicomPrintSCU::GetLastOperationStatus

Topics:

Print Management SCU

 

DICOM Print Management Service Class User: Functions

Example

L_INT LDicomPrintSCU_GetPrintJobInfoExample(LDicomPrintSCU& PrintSCU, L_PCTSTR pszPrintJobInstanceUID)
{
   L_INT          nRet;
   PRINTJOBINFO   PrintJobInfo; 
   // We need only the Execution Status and Execution Status Info
   memset(&PrintJobInfo, 0, sizeof(PRINTJOBINFO)); 
   PrintJobInfo.uStructSize = sizeof(PRINTJOBINFO); 
   lstrcpy(PrintJobInfo.szExecutionStatus, TEXT(" "));
   lstrcpy(PrintJobInfo.szExecutionStatusInfo, TEXT(" "));
   // Query the Print SCP for the Print Job information
   nRet = PrintSCU.GetPrintJobInfo (pszPrintJobInstanceUID, &PrintJobInfo);
   if(nRet != DICOM_SUCCESS)
      return nRet;
   else
   {
      // Display the retrieved information
      nRet = PrintSCU.GetPrintJobInfo (&PrintJobInfo, sizeof(PRINTJOBINFO)); 
      if(nRet != DICOM_SUCCESS)
         return nRet;
      L_TCHAR szPrintJobInfo[256]; 
      wsprintf(szPrintJobInfo, 
               TEXT("Execution Status: %s\nExecution Status Info: %s"),
               PrintJobInfo.szExecutionStatus, 
               PrintJobInfo.szExecutionStatusInfo); 
      MessageBox(NULL, szPrintJobInfo, TEXT("Print Job Info"), MB_OK); 
   }
   return DICOM_SUCCESS;
}