Method: DICOM::DClient#find_studies

Defined in:
lib/dicom/d_client.rb

#find_studies(query_params = {}) ⇒ Object

Note:

Caution: Calling this method without parameters will instruct your PACS to return info on ALL studies in the database!

Queries a service class provider for studies that match the specified criteria.

Instance level attributes for this query:

  • ‘0008,0020’ (Study Date)

  • ‘0008,0030’ (Study Time)

  • ‘0008,0050’ (Accession Number)

  • ‘0010,0010’ (Patient’s Name)

  • ‘0010,0020’ (Patient ID)

  • ‘0020,000D’ (Study Instance UID)

  • ‘0020,0010’ (Study ID)

In addition to the above listed attributes, a number of “optional” attributes may be specified. For a general list of optional object instance level attributes, please refer to the DICOM standard, PS3.4 C.6.2.1.2, Table C.6-5.

Examples:

Find all studies matching the given study date and patient’s id

node.find_studies('0008,0020' => '20090604-', '0010,0020' => '123456789')

Parameters:

  • query_params (Hash) (defaults to: {})

    the query parameters to use

Options Hash (query_params):

  • 'GGGG,EEEE' (String)

    a tag and value pair to be used in the query



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/dicom/d_client.rb', line 222

def find_studies(query_params={})
  # Study Root Query/Retrieve Information Model - FIND:

  set_default_presentation_context("1.2.840.10008.5.1.4.1.2.2.1")
  # Every query attribute with a value != nil (required) will be sent in the dicom query.

  # The query parameters with nil-value (optional) are left out unless specified.

  default_query_params = {
    "0008,0020" => "",  # Study Date

    "0008,0030" => "",  # Study Time

    "0008,0050" => "",  # Accession Number

    "0008,0052" => "STUDY", # Query/Retrieve Level:  "STUDY"

    "0010,0010" => "",  # Patient's Name

    "0010,0020" => "",  # Patient ID

    "0020,000D" => "",  # Study Instance UID

    "0020,0010" => ""  # Study ID

  }
  # Raising an error if a non-tag query attribute is used:

  query_params.keys.each do |tag|
    raise ArgumentError, "The supplied tag (#{tag}) is not valid. It must be a string of the form 'GGGG,EEEE'." unless tag.is_a?(String) && tag.tag?
  end
  # Set up the query parameters and carry out the C-FIND:

  set_data_elements(default_query_params.merge(query_params))
  perform_find
  return @data_results
end