def perform_find
      # Open a DICOM link:
      establish_association
      if association_established?
        if request_approved?
          # Continue with our query, since the request was accepted.
          # Set the query command elements array:
          set_command_fragment_find
          @link.build_command_fragment(PDU_DATA, presentation_context_id, COMMAND_LAST_FRAGMENT, @command_elements)
          @link.transmit
          @link.build_data_fragment(@data_elements, presentation_context_id)
          @link.transmit
          # A query response will typically be sent in multiple, separate packets.
          # Listen for incoming responses and interpret them individually, until we have received the last command fragment.
          segments = @link.receive_multiple_transmissions
          process_returned_data(segments)
        end
        # Close the DICOM link:
        establish_release
      end
    end
def perform_find
      # Open a DICOM link:
      establish_association
      if association_established?
        if request_approved?
          # Continue with our query, since the request was accepted.
          # Set the query command elements array:
          set_command_fragment_find
          @link.build_command_fragment(PDU_DATA, presentation_context_id, COMMAND_LAST_FRAGMENT, @command_elements)
          @link.transmit
          @link.build_data_fragment(@data_elements, presentation_context_id)
          @link.transmit
          # A query response will typically be sent in multiple, separate packets.
          # Listen for incoming responses and interpret them individually, until we have received the last command fragment.
          segments = @link.receive_multiple_transmissions
          process_returned_data(segments)
        end
        # Close the DICOM link:
        establish_release
      end
    end
Handles the communication involved in a DICOM query (C-FIND).
 Build the necessary strings and send the command and data element that makes up the query.
 Listens for and interpretes the incoming query responses.