Relational Queries

Relational Queries have been in the DICOM standard since the start, but are supported by only about half the PACS in the world. They are negotiated using Extended Negotiation and if requested by the SCU and accepted by the SCP then they remove several of the normal C-FIND rules, namely:

e.g. with standard queries, it would not be possible to include series and study queries in the same request, but with hierarchical queries that is allowed.

In DicomObjects, to use these as an SCU:

In DicomObjects, to use these as an SCP:

SCU use in DicomObjects

The following code is a simple example, which does a series level relational query against the Medical Connections Public DICOM Server. Note that the Patient ID and Study UID which would otherwise be required for a series level query are not specified.

DicomObjects.NET version

 DicomAssociation cn= new DicomAssociation();
 DicomContext ctx = cn.RequestedContexts.Add(SOPClasses.StudyRootQR_FIND);
 ctx.ExtendedNegotiationValues = new byte[]{1};
 cn.Open( "Dicomserver.co.uk", 104, "CallingAE", "CalledAE");
 DicomDataSet ds = new DicomDataSet();
 ds.Add(Keyword.QueryRetrieveLevel, "SERIES");
 ds.Add(Keyword.StudyDate, "");
 ds.Add(Keyword.StudyDescription, ""); 
 ds.Add(Keyword.SeriesDescription, "OBL*");// series description must begin with "OBL" 
 ds.Add(Keyword.PatientName, "");
 ds.Add(Keyword.PatientID, "");
 ds.Add(Keyword.StudyID, "");
 ds.Add(Keyword.StudyInstanceUID, "");
 ds.Add(Keyword.SeriesInstanceUID, "");
 ds.Add(Keyword.SeriesNumber, "");
 cn.Find( QueryRoot.Study, ds);
 // res holds all response datasets
 DicomDataSetCollection res = cn.ReturnedIdentifiers;
 cn.Close();

DicomObjects.COM version

 Dim g As New DicomGlobal
 g.EnableExtendedNegotiation = True

 Dim cn As New DicomConnection
 Dim cxt As DicomContext
 Set cxt = cn.Contexts.Add(DicomObjects.Constants.doSOP_StudyRootQR_FIND)
 cxt.ExtendedNegotiationValues = 1

 cn.SetDestination "Dicomserver.co.uk", 104, "CallingAE", "CalledAE"

 Dim ds As New DicomDataSet
 ds.Attributes.Add &H8, &H52, "SERIES"       ' all attributes must still be at or above the level used
 ds.Attributes.Add &H8, &H20, ""             ' Give me the study date.
 ds.Attributes.Add &H8, &H1030, ""           ' give me the Study name / description.
 ds.Attributes.Add &H8, &H103E, "OBL*"       ' series description must begin with....
 ds.Attributes.Add &H10, &H10, ""            ' Give me the patient name.
 ds.Attributes.Add &H10, &H20, "*"           ' Give me the patient id.
 ds.Attributes.Add &H20, &H10, ""            ' for this study ID.
 ds.Attributes.Add &H20, &HD, ""             ' give me the study instance UID.
 ds.Attributes.Add &H20, &HE, ""             ' give me the series instance UID.
 ds.Attributes.Add &H20, &H11, ""            ' give me the series number.

 cn.Find "STUDY", ds
 Set res = cn.ReturnedDataSets

 cn.Close


We use cookies to give you the best possible experience on our website. By continuing to use this website, you agree with our use of cookies. for more information please click HERE