Simple Dashing widget (and associated files) to display DICOM server checks.
##Dependencies
Add it to dashing's gemfile:
gem 'dicom'
and run bundle install
.
##Usage
To use this widget, copy dicom.html
, dicom.coffee
, and dicom.scss
into a /widgets/dicom
directory. Put the dicom_check.rb
file in your /jobs
folder and the dicom_server.rb
file in your /lib
folder.
Since this widget iterates through the servers you define in dicom_server.rb
, You must also make the dicom_servers array available in the views, as a sinatra helper. To do this, add this in your config.ru
:
require './lib/dicom_server'
and then add a helper:
def dicom_servers
dicom_servers = DicomServer.all
end
To include the widget in a dashboard, add the following snippet to the dashboard layout file:
<% dicom_servers.each do |server| %>
<li data-row = "1" data-col = "1" data-sizex = "1" data-sizey = "1">
<div data-view = "Dicom" data-id = '<%= server.id %>' data-title = '<%= server.name %>' data-ip = '<%= server.ip %>' data-weburl = '<%= server.web_url %>' data-configurl = '<%= server.config_url %>'></div>
</li>
<% end %>
##Settings
The servers to check must be configured in the lib/dicom_server.rb
file as an array of hashes, configured like this:
############## CONFIGURATION ############
PING_COUNT = 10 # Number of ping checks to perform
DICOM.logger.level = Logger::ERROR # Log level for dicom communications
CALLING_AE = "CURIOSITY" # The AET that will be used to identify the widget against DICOM hosts
# Dicom servers to check
# id: unique name to pass data to the widget through the data-id attribute
# name: Name of the server to be displayed
# ip: IP of the DICOM server to check
# port: DICOM port of the server to check
# aet: AE Title of the server to check
# check_ping: flag if ping checks should be performed
# check_echo: flags if DICOM checks should be performed
# alert: flag to signal additional code to alert if checks failed (pending)
# web_url: web url of the DICOM server's web interface, for easy access with the link icon on the widget
# config_url: web url of the DICOM server's web interface, for easy access with the link icon on the widget
DICOM_SERVERS = [
{id: "demo", name: "Demo", ip: "10.10.0.1", port: 11112, aet: "EDX-PACS", check_ping: true, check_echo: true, alert: false, web_url: "http://10.10.0.1:8080/edx-pacs", config_url: "http://10.10.0.1:8080/jmx-console"},
{id: "tdx", name: "TDX", ip: "10.13.0.1", port: 11112, aet: "EDX-PACS", check_ping: true, check_echo: true, alert: false, web_url: "http://10.13.0.1:8080/edx-pacs", config_url: "http://10.13.0.1:8080/jmx-console"}
]
############ END CONFIGURATION ###########