DicomObjects.NET10 Documentation
DicomObjects.DicomWeb Namespace / WorkItemWebClient Class / RequestCancelAsync Method
The WorkItem UID to request cancellation
Payload, if present, may describe the reason for requesting the cancellation of the WorkItem.
The encoding to use (native/json/xml)
The transfer syntax used to encode and send the WorkItem. See part 4 Table CC.2.2-1. Request UPS Cancel 0 Action Information for more details
A token that may be used to cancel the operation
Example



In This Topic
    RequestCancelAsync Method (WorkItemWebClient)
    In This Topic
    Asynchronous transaction that allows a user agent that does not own a Workitem to request that it be canceled. It corresponds to the UPS DIMSE N-ACTION operation "Request UPS Cancel". To cancel a Workitem that the user agent owns, i.e., that is in the IN PROGRESS state, the user agent uses the transaction
    Syntax
    'Declaration
     
    
    <AsyncStateMachineAttribute(DicomObjects.DicomWeb.WorkItemWebClient/d__34)> 
    Public Function RequestCancelAsync( _ 
       ByVal WorkItemUID As String, _ 
       Optional ByVal ReasonForCancellation As DicomDataSet, _ 
       Optional ByVal Encoding As DicomDataEncoding, _ 
       Optional ByVal TransferSyntax As String, _ 
       Optional ByVal cancellationToken As CancellationToken _ 
    ) As Task(Of HttpResponseMessage)
    'Usage
     
    
    Dim instance As WorkItemWebClient
    Dim WorkItemUID As String
    Dim ReasonForCancellation As DicomDataSet
    Dim Encoding As DicomDataEncoding
    Dim TransferSyntax As String
    Dim cancellationToken As CancellationToken
    Dim value As Task(Of HttpResponseMessage)
     
    value = instance.RequestCancelAsync(WorkItemUID, ReasonForCancellation, Encoding, TransferSyntax, cancellationToken)

    Parameters

    WorkItemUID
    The WorkItem UID to request cancellation
    ReasonForCancellation
    Payload, if present, may describe the reason for requesting the cancellation of the WorkItem.
    Encoding
    The encoding to use (native/json/xml)
    TransferSyntax
    The transfer syntax used to encode and send the WorkItem. See part 4 Table CC.2.2-1. Request UPS Cancel 0 Action Information for more details
    cancellationToken
    A token that may be used to cancel the operation

    Return Value

    HttpResponseMessage
    Remarks
    The async operation will return as soon as the response is available and headers are read (content is not read yet)
    Example
    WorkItemWebClient wwc = new WorkItemWebClient(BaseUri);
    DicomDataSet reason = new DicomDataSet
       {
           { Keyword.ReasonForCancellation, "patient not fit for procedure" },
           { Keyword.ContactURI, "medicalconnections.co.uk" },
           { Keyword.ContactDisplayName, "MC" },
          { Keyword.ProcedureStepDiscontinuationReasonCodeSequence, null }
       };
    var rsp = wwc.RequestCancel("1.2.3.4.5.6.7.8.9", reason);
    Log($"RequestCancellation resposne: {rsp.StatusCode}");
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also