Find<TQuery,TResult>(DicomScp,TQuery,DicomMatchDelegate<TResult>,DicomDataSet) Method

Summary

Sends a C-FIND-REQ message to a peer member of a connection defined by Scp. The C-FIND-REQ is defined by the Query parameter.

Syntax
C#
VB
C++
public void Find<TQuery, TResult>( 
   DicomScp Scp, 
   TQuery Query, 
   DicomMatchDelegate<TResult> OnMatch, 
   DicomDataSet Template 
) 
  
Public Overloads Sub Find 
    (Of TQuery,_TResult_)( _ 
   ByVal Scp As DicomScp, _ 
   ByVal Query As TQuery, _ 
   ByVal OnMatch As DicomMatchDelegate(Of TResult), _ 
   ByVal Template As DicomDataSet _ 
)  
public: 
void Findgeneric<typename TQuery> 
generic<typename TResult> 
(  
   DicomScp^ Scp, 
   _TQuery^_ Query, 
   DicomMatchDelegate<TResult^>^ OnMatch, 
   DicomDataSet^ Template 
)  

Parameters

Scp
The peer connection to send the C-FIND-REQ to.

Query
The query information that describes the DICOM datasets to be found.

OnMatch
The delegate to be called for each dataset that matches the query parameters.

Template
The template dataset to use for the C-FIND-REQ.

Type Parameters

TQuery
The type of the query.

TResult
The type of the result.

Remarks

The Query argument and the Template argument together specify command and data elements of the C-FIND-RQ.

The Query argument is a class that is optionally decorated with attributes. The sample class MyModalityWorklistQuery below shows examples of the attributes.

C#
 [Instance(DicomClassType.ModalityWorklist,DicomUidType.ModalityWorklistFind)] 
    public class MyModalityWorklistQuery 
    { 
        private PersonName _PatientName = new PersonName(); 
 
        [Element(DicomTag.PatientName)] 
        [TypeConverter(typeof(PersonNameConverter))] 
        public PersonName PatientName 
        { 
            get { return _PatientName; } 
            set { _PatientName = value; } 
        } 
 
        private string _PatientId = string.Empty; 
 
        [Element(DicomTag.PatientID)] 
        public string PatientId 
        { 
            get { return _PatientId; } 
            set { _PatientId = value; } 
        } 
        ... 
    } 
VB
 <Instance(DicomClassType.ModalityWorklist,DicomUidType.ModalityWorklistFind)> _ 
 Public Class MyModalityWorklistQuery 
		Private _PatientName As New PersonName() 
 
		<Element(DicomTag.PatientName), TypeConverter(GetType(PersonNameConverter))> _ 
		Public Property PatientName() As PersonName 
			Get 
				Return _PatientName 
			End Get 
			Set(ByVal value As PersonName) 
				_PatientName = value 
			End Set 
		End Property 
 
		Private _PatientId As String = String.Empty 
 
		<Element(DicomTag.PatientID)> _ 
		Public Property PatientId() As String 
			Get 
				Return _PatientId 
			End Get 
			Set(ByVal value As String) 
				_PatientId = value 
			End Set 
		End Property 
	   Private ... 
 End Class 

The class level Instance attribute should be included to specify a DicomUidType (the SOP Class of the DICOM find) and an associated DicomClassType (the class of the default template generated if Template is null). For example, passing an instance of the MyModalityWorklistQuery class below would result in a C-FIND-RQ command set specifying:

(0000,0002) Affected SOP Class UID 1.2.840.10008.5.1.4.31 (Modality Worklist Information Model - FIND)

If the class level Instance attribute is not specified, then the Find SOP Class defaults to DicomUidType.StudyRootQueryFind

Example values for the Instance attribute pairs are shown below:

DicomUidType UID DicomClassType
DicomUidType.PatientRootQueryFind 1.2.840.10008.5.1.4.1.2.1.1 DicomClassType.PatientRootQueryPatient
DicomClassType.PatientRootQueryStudy
DicomClassType.PatientRootQuerySeries
DicomClassType.PatientRootQueryImage
DicomUidType.StudyRootQueryFind 1.2.840.10008.5.1.4.1.2.2.1 DicomClassType.StudyRootQueryStudy
DicomClassType.StudyRootQuerySeries
DicomClassType.StudyRootQueryImage
DicomUidType.ModalityWorklistFind 1.2.840.10008.5.1.4.31 DicomClassType.ModalityWorklist
DicomUidType.GeneralPurposeWorklistFind 1.2.840.10008.5.1.4.32.1 DicomClassType.GeneralPurposeWorklist
DicomUidType.HangingProtocolInformationModelFind 1.2.840.10008.5.1.4.38.2 DicomClassType.HangingProtocolInformationModelFind

An Element attribute can be included to map a class member to a DICOM element. Note that in the MyModalityWorklistQuery class, the PatientId member is decorated with an Element attribute that associates it with the DicomTag.PatientID. For example, if the PatientId member of the MyModalityWorklistQuery object contains "123", then the dataset component of the C-FIND-RQ will contain

(0010,0020) Patient ID 123

If the PatientId member of the MyModalityWorklistQuery object is empty, then no corresponding DICOM element will be added to the dataset component of the C-FIND-RQ.

The Template argument is a DicomDataSet that specifies the data set component of the C-FIND-RQ. The elements contained in the Template correspond to the data you wish to find.

For example, instead of specifying a PatientID in the PatientId member of MyModalityWorklistQuery, a PatientID could be specified in the Template DICOM dataset. If both the Query argument and the Template argument specify the same DICOM Element, the Query argument takes precedence.

If the Template argument is null, a default template is generated. In this case, the Query argument class must contain an Instance attribute specifying a DicomUidType (the SOP Class of the DICOM find) and an associated DicomClassType (the class of the default template generated). The Find method will throw an exception if the Template argument is null and the Query arguement class does not contain an Instance attribute.

Requirements

Target Platforms

Help Version 20.0.2020.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Dicom.Scu Assembly