DicomObjects.NET10 Documentation
DicomObjects.DicomWeb Namespace / WorkItemWebClient Class / CreateAsync Method
Workitem encoded in the media type specified in the Content-Type header field. The payload shall contain all data elements to be stored.
The encoding to use (native/json/xml)
The transfer syntax used to encode and send the WorkItem
A token that may be used to cancel the operation
Example



In This Topic
    CreateAsync Method (WorkItemWebClient)
    In This Topic
    Async function to create a Workitem on the target Worklist. It corresponds to the UPS DIMSE N-CREATE operation.
    Syntax
    'Declaration
     
    
    <AsyncStateMachineAttribute(DicomObjects.DicomWeb.WorkItemWebClient/d__24)> 
    Public Function CreateAsync( _ 
       ByVal WorkItem 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 WorkItem As DicomDataSet
    Dim Encoding As DicomDataEncoding
    Dim TransferSyntax As String
    Dim cancellationToken As CancellationToken
    Dim value As Task(Of HttpResponseMessage)
     
    value = instance.CreateAsync(WorkItem, Encoding, TransferSyntax, cancellationToken)

    Parameters

    WorkItem
    Workitem encoded in the media type specified in the Content-Type header field. The payload shall contain all data elements to be stored.
    Encoding
    The encoding to use (native/json/xml)
    TransferSyntax
    The transfer syntax used to encode and send the WorkItem
    cancellationToken
    A token that may be used to cancel the operation

    Return Value

    HttpResponseMessage
    Remarks
    If TransferSyntax is null, then the instances are sent using the transfer syntax in which they are currently held 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 ups = new DicomDataSet
    {
       SOPClass = SOPClasses.UnifiedProcedureStepPush,
       Name = "Test^Patient",
       PatientID = "12345",
       StudyUID = "1.2.840.10001.123.456.789",
       SeriesUID = "1.2.840.10001.123.456.789.1",
       InstanceUID = "1.2.840.10001.123.456.789.1.1"
    };
    ups.Add(Keyword.InputInformationSequence, new DicomDataSetCollection());
    var re = await wwc.CreateAsync(ups, DicomDataEncoding.Json);
    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