DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomAssociation Class / Find Method / Find(QueryRoot,DicomDataSet) Method

The query root

The DataSet parameter defines the C-FIND searching criteria.

Example

In This Topic
    Find(QueryRoot,DicomDataSet) Method
    In This Topic
    Sends a C-FIND request
    Syntax
    'Declaration
     
    
    Public Overloads Sub Find( _
       ByVal Root As QueryRoot, _
       ByVal DataSet As DicomDataSet _
    ) 
    public void Find( 
       QueryRoot Root,
       DicomDataSet DataSet
    )

    Parameters

    Root

    The query root

    DataSet

    The DataSet parameter defines the C-FIND searching criteria.

    Remarks

    The query to be performed is defined by the DataSet parameter, and this method is functionally equivalent to the Find method of the DicomQuery object.

    Note that the QueryLevel value (0008,0052), must be included in the data set, but the dataset parameter MUST NOT contain any group 0x0000 elements (the group 0x0000 contains elements describing operation and some of the fields like MessageID, etc.)

    Once the operation has completed, the result may be found in the ReturnedIdentifiers Collection.

    Example
    using DicomObjects;
    using DicomObjects.DicomUIDs;
    using DicomObjects.Enums;
                	    
       using (var cn = new DicomAssociation())
       {
           // define your own list of DICOM transfer syntaxes to use in C-FIND request
           var tsList = new string[] {TransferSyntaxes.ImplicitVRLittleEndian,
                                       TransferSyntaxes.ExplicitVRLittleEndian };
       
           cn.RequestedContexts.Add(SOPClasses.StudyRootQR_FIND, tsList);
           cn.Open("localhost", 104, "callingAET", "calledAET");        
           
           // setting up the Query, this one is return all the studies
           var queryDS = new DicomDataSet();
           queryDS.Add(Keyword.PatientName, "");
           queryDS.Add(Keyword.PatientID, "");
           queryDS.Add(Keyword.PatientSex, "");
           queryDS.Add(Keyword.PatientBirthDate, "");
           queryDS.Add(Keyword.QueryRetrieveLevel, "STUDY");
           
           cn.Find(QueryRoot.Study, queryDS);
                
           // this holds the returned C-FIND results
           DicomDataSetCollection results = cn.ReturnedIdentifiers;
           
           // this holds the final C-FIND response, including the final status
           DicomDataSet finalC_Find_Status = cn.LastCommand;
           
           // the final C-FIND status, 0 means Success
           int status = cn.LastStatus;
           cn.Close();
       }
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also