Wednesday, July 25, 2012

Dcm4chee: move study to trash using command line

Using on command line:

/export/dcm4chee-2.17.2-mysql/bin/ -s -u admin -p password invoke dcm4chee.archive:service=ContentEditService moveStudyToTrash 1.2.826.0.1.3680043.8.291.20091126113000.28044

Where 1.2.826.0.... is the Study Instance UID

This can be useful for mass trashing or if you have timeout problem on large studies.

Monday, July 23, 2012


Java program useful to query two pacs server and compare results. i.e. same number of studies, same patients etc. 

Please visit

Friday, July 20, 2012

Solaris, snooping RPC and "can't authenticate (unknown cause)" message

The problem

I had a problem with QStar Remote Admin connecting to a Solaris server. As far I can understand QStar uses RPC.
Sniffing traffic using snoop, I've seen a message like this: → RPC R (#140) x10=1209249015 can't authenticate (unknown cause)

The problem was that local_only option in the network/rpc/bind service was set to true.

The solution

  svc:> select network/rpc/bind
  svc:/network/rpc/bin> setprop config/local_only=false
  svc:/network/rpc/bind> quit
svcadm refresh network/rpc/bind:default
svcprop network/rpc/bind:default | grep local_only



Java program useful to query pacs server to get scriptable list of studies in a specified time range.

Please visit

Send study with a manually generated Patient ID

Send a study with a manually generated Patient ID using dcm4che tools

/usr/java/jdk1.6.0_31-32bit/jre/bin/java -jar /opt/Mayam/dcm4che-1.4.31/bin/dcmsnd.jar --set=PatientID:552220 dicom://DESTAE@ /path/to/the/study

SQL queries for dcm4chee

How many US patients have not birth date

select count(distinct s.patient_fk)
from study as s
join patient as p
where s.patient_fk =
and s.mods_in_study = 'US'
and ( p.pat_birthdate not like '1%'
and p.pat_birthdate not like '2%'
or p.pat_birthdate is NULL )

How many US patients have not M or F sex?

select count(distinct s.patient_fk)
from study as s
join patient as p
where s.patient_fk =
and s.mods_in_study = 'US'
and (p.pat_sex is NULL
or p.pat_sex = 'O' )

How many studies for each modality?

select distinct mods_in_study , count(mods_in_study) as conto from study group by  mods_in_study

How many patients without studies?

SELECT patient.pat_name, patient.pat_id, as papk, as stpk, study.num_series, study.num_instances
FROM patient LEFT JOIN study ON ( = study.patient_fk)
ORDER BY patient.pat_name ASC, ASC, study.study_datetime ASC

Studies with a number of instances > 10000 Grouped by Year

select count(cnt) as num, year
  SELECT COUNT(*) as cnt, 
  YEAR(study_datetime) as year
  FROM instance as i
  join series as s 
  on i.series_fk =
  join study as stu
  on = s.study_fk
  GROUP BY YEAR(study_datetime),  i.series_fk
  HAVING COUNT(*) > 10000) XX 

Files patient and study iuid year and month

SELECT files.filepath, patient.pat_name, study.study_iuid 
FROM series 
join study on series.study_fk =
join patient on study.patient_fk =
join instance on instance.series_fk =
join files on = files.instance_fk
WHERE series.src_aet="DCM4STORICOMS" and YEAR(study.study_datetime) = '2011' 
and MONTH(study.study_datetime) = 7;

Nagios plugin: check_SL500

check_SL500 is a shell script to check various things on a Sun StorageTek(TM) SL500 Modular Library System (maybe it works with other models). Currently the script can check:
  • fan status
  • drives temperature
  • robot status
  • cap status
  • controller status
  • overall (toplevel) status
  • system load

Firefox SRKiosk add-on Q&A

Where is my profile folder?

Help > Troubleshooting Information
In the new tab click the Show Folder button, or Open Directory.

How to remove Close button

To remove the X close button, delete these lines from content/srkioskbrowser.xul

<toolbarpalette id="BrowserToolbarPalette">
   <toolbarbutton id="closebutton" 

      label="Close browser"
      tooltiptext="Close browser"
      class="toolbarbutton-1 chromeclass-toolbar-additional closebutton"

How to add a link in the top bar

To add a link button in the custom toolbar, edit the content/srkioskbrowser.xul file, put something like this code inside the <toolbox id="navigator-toolbox"> and <toolbar id="KioskLinks-Toolbar"> elements.

The vbox id="Kiosk-ResizeBar" is a vertical line to divide buttons

<toolbox id="navigator-toolbox"> 
   <toolbar id="KioskLinks-Toolbar" toolbarname="Kiosk Links Toolbar" 
      class="chromeclass-toolbar" context="toolbar-context-menu"
      hidden="false" persist="hidden">

      <toolbarbutton label="Button link text" 
         tooltiptext="Tooltip on mouse over"
         oncommand="objToolbar.LoadURL('')" />

         <vbox id="Kiosk-ResizeBar" />



How to change home page

Edit the content/variables.js file and set var v_homepage. This will be the home page on browser startup and it is the link associated with the home button.

var v_homepage = "";

Note. Such homepage will not be effective the first time you launch Firefox after the change: you must close the browser and reopen it.

Such variable is used in the content/srkioskbrowser.js file


How to uninstall the Firekiosk plugin

Easy: start Firefox from command line using the -safe-mode option. Then Tools->Addon->Extensions and remove.

Firefox SRKiosk add-on

A full screen locked kiosk mode for Firefox.


Download from




Many things can be changed editing the extension files, see below.
  • Forced full screen
  • All keyboard shortcuts disabled
  • Mouse right-click disabled
  • Menu bar, Add-on bar, Bookmarks toolbar, Navigation toolbar all disabled (hidden?)
  • Hidden address bar
  • Hidden search bar
  • Eventually, “about:”, “file:”, “chrome:” and “resource:” URLs are forbidden
  • You can place “link buttons” as if they are bookmars
  • Print button and Zoom button are available
You must edit files by hand.


I'm not a programmer. I don't know very well Firefox add-ons. So, you can use this extension at your own risk. :-)

To configure and customize this extension, it is supposed:
  • you know where Firefox extensions are installed on your system i.e. /home/user/.mozilla/firefox/muwypw2y.default/extensions on Linux and Solaris or C:\Document and settings\user\Application data\Mozilla\Firefox\Profiles\fj5drt33.default\extensions\ under Windows

  • you are able to edit files (using vi, gedit, wordpad, notepad or what you like)

How to disable the extension

To disable the extension, you must start Firefox in safe mode, then disable or uninstall it:

firefox -safe-mode

Questions and Answers