LDicomPrintSCU::CreatePullPrintRequest

#include "ltdic.h"

L_INT LDicomPrintSCU::CreatePullPrintRequest(InstancesInfo, uInstancesCount, pParameters)

const pSTOREDPRINTSTORAGEINSTANCEINFO InstancesInfo;

/* Referenced Stored Print */

L_UINT32 uInstancesCount;

/* Count of Stored Print Instances */

const pPULLPRINTREQUESTPARAMETERS pParameters;

/* Pull Print Request parameters */

Requests the Print SCP to create a Pull Print Request SOP Instance.

Parameter

Description

InstancesInfo

A STOREDPRINTSTORAGEINSTANCEINFO structure pointer that specifies one or more of such structure. The count of the structures is determined by the parameter uInstancesCount. Each structure specifies information about one referenced Stored Print Storage SOP Instance. The function will return an error if the parameter InstancesInfo is set to NULL.

uInstancesCount

The count of the structures specified by the parameter InstancesInfo. The function will return an error if the parameter uInstancesCount is set to 0.

pParameters

Pointer to a PULLPRINTREQUESTPARAMETERS structure that specifies the parameters of the Pull Print Request SOP Instance to be created. If this is set to NULL, the request will be sent to the Print SCP without specifying any parameters (Attributes).

Returns

0

The Pull Print Request SOP Instance was created successfully.

DICOM_ERROR_PRINTSCU_FAILURE_STATUS

The response of the Print SCP specifies a Failure status code; no Instance was created.

DICOM_ERROR_PRINTSCU_CLASS_NOT_SUPPORTED

The Pull Stored Print Management Meta SOP Class is not supported on the Association, and hence the Pull Print Request SOP Class is not supported.

> 0

An error occurred. Refer to Return Codes.

Comments

Only one Pull Print Request SOP Instance can be supported on the Association at any time.

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 CreatePullPrintRequest is 0, then the Pull Print Request SOP Instance was created successfully, with either a Success or Warning status code in the response of the Print SCP.

Having the Instance created, the function LDicomPrintSCU::GetPullPrintRequestInstanceUID can then be used to obtain its SOP Instance UID. Also, the functions LDicomPrintSCU::PrintPullPrintRequestSession and LDicomPrintSCU::DeletePullPrintRequest can be used to print the session and to delete the Instance, respectively.

At least one Stored Print Storage SOP Instance must be specified to be referenced. The information about each such Instance is specified using a STOREDPRINTSTORAGEINSTANCEINFO structure. Except for the member pszPatientID, if any string member of the structure is set to NULL or if the member specifies an empty string, the function will return an error.

The parameter pParameters points to a PULLPRINTREQUESTPARAMETERS structure that specifies the parameters to be used when creating the Pull Print Request SOP Instance. In this structure, if a string member is NULL, then the corresponding Attribute will not be included in the request to the Print SCP. Similarly, if a numeric member (that specifies an Attribute) is negative, the corresponding Attribute will not be included in the request. If pParameters is set to NULL, then the request will be sent without specifying any parameters.

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::GetPullPrintRequestInstanceUID, LDicomPrintSCU::PrintPullPrintRequestSession, LDicomPrintSCU::DeletePullPrintRequest, LDicomPrintSCU::GetDefaultPullPrintRequestParameters, LDicomPrintSCU::GetLastOperationStatus, LDicomPrintSCU::CreateFilmSession

Topics:

Print Management SCU

 

DICOM Print Management Service Class User: Functions

Example

L_VOID PerformPullStoredPM()
{
   LDicomPrintSCU PrintSCU; 
   //CPrintSCU PrintSCU; 

   L_CHAR szMsg[32]; 

   // Establish the Association
   L_INT iRet = PrintSCU.Associate ("10.0.2.20", 7104, "PrintSCP", "PrintSCU",
                            PRINTSCU_PULL_STORED_PM_META_SOP_CLASS |
                            PRINTSCU_PRINT_JOB_SOP_CLASS |
                            PRINTSCU_PRINTER_CONFIGURATION_RETRIEVAL_SOP_CLASS); 
   if (iRet == DICOM_ERROR_PRINTSCU_ASSOCIATE_RQ_REJECTED) 
   {
      L_UCHAR nSource, nReason; 
      PrintSCU.GetAssociateRejectInfo (NULL, &nSource, &nReason); 
      
      wsprintf(szMsg, "Source = %i, Reason = %i", nSource, nReason); 
      MessageBox(NULL, szMsg, "Association Request was Rejected", MB_OK); 
      return; 
   }
   else if (iRet != DICOM_SUCCESS) 
   {
      wsprintf(szMsg, "Error code: %i", iRet); 
      MessageBox(NULL, szMsg, "Failed to Establish the Association", MB_OK); 
      return; 
   }

   // Display some printer info
   //GetPrinterInfo(PrintSCU); 

   // Display some printer configuration info
   //GetPrinterConfigInfo(PrintSCU); 

   // A referenced Stored Print Storage SOP Instance
   STOREDPRINTSTORAGEINSTANCEINFO InstanceInfo; 
   InstanceInfo.uStructSize = sizeof(STOREDPRINTSTORAGEINSTANCEINFO); 
   InstanceInfo.pszRetrieveAETitle = "SomeAE";
   InstanceInfo.pszReferencedSOPInstanceUID = "1.2.840.114257.254.7638.6787";
   InstanceInfo.pszStudyInstanceUID = "1.2.840.114257.945.5676.5674";
   InstanceInfo.pszSeriesInstanceUID = "1.2.840.114257.23.2343.3489";
   InstanceInfo.pszPatientID = "SomeID";

   PULLPRINTREQUESTPARAMETERS PullPrintReqParams; 

   
   // Ask the Print SCP to create a Pull Print Request SOP Instance
   PrintSCU.GetDefaultPullPrintRequestParameters (&PullPrintReqParams, 
               sizeof(PULLPRINTREQUESTPARAMETERS)); 
   PullPrintReqParams.nNumberOfCopies = 1; 
   PrintSCU.CreatePullPrintRequest (&InstanceInfo, 1, &PullPrintReqParams); 
   MessageBox(NULL, PrintSCU.GetPullPrintRequestInstanceUID (),
              "Pull Print Request SOP Instance UID", MB_OK); 

   // Print the session
   PrintSCU.PrintPullPrintRequestSession ();

   // Display some info about the Print Job
   if (PrintSCU.IsClassSupported (PRINTSCU_PRINT_JOB_SOP_CLASS)) 
   {
      //GetPrintJobInfo(PrintSCU, PrintSCU.GetPrintJobInstanceUID ());
   }

   // Ask the Print SCP to delete the Pull Print Request SOP Instance
   PrintSCU.DeletePullPrintRequest ();

   // Release the Association and close the connection
   PrintSCU.Release ();
}