Method: DICOM::DClient#test

Defined in:
lib/dicom/d_client.rb

#testObject

Tests the connection to the server in a very simple way by negotiating an association and then releasing it.



366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
# File 'lib/dicom/d_client.rb', line 366

def test
  logger.info("TESTING CONNECTION...")
  success = false
  # Verification SOP Class:

  set_default_presentation_context(VERIFICATION_SOP)
  # Open a DICOM link:

  establish_association
  if association_established?
    if request_approved?
      success = true
    end
    # Close the DICOM link:

    establish_release
  end
  if success
    logger.info("TEST SUCCSESFUL!")
  else
    logger.warn("TEST FAILED!")
  end
  return success
end