Station name filtering

60 views
Skip to first unread message

Ben Earner

unread,
Aug 5, 2021, 6:23:47 AM8/5/21
to OpenREM
Hi,

I couldn't find any previous discussions on this. When attempting to filter a QR based upon station name, I'm never able to get the query to match - it's always zero results. Here are the logs:

[05/Aug/2021 11:10:17] DEBUG [remapp.netdicom.qrscu:454] Form mods are [u'MG'], inc_sr is False
[05/Aug/2021 11:10:17] DEBUG [remapp.netdicom.qrscu:455] All form modes are {'get_toshiba_images_field': False, 'stationname_include_field': u'OBSHOMG01MGB', 'get_empty_sr_field': False, 'desc_exclude_field': u'', 'date_from_field': datetime.date(2021, 8, 4), 'store_scp_
field': u'1', 'stationname_exclude_field': u'', 'duplicates_field': True, 'date_until_field': datetime.date(2021, 8, 4), 'desc_include_field': u'', 'modality_field': [u'MG'], 'inc_sr_field': False, 'remote_host_field': u'1'}
[05/Aug/2021 11:10:17] INFO [remapp.netdicom.qrscu:657] cd19ce84-bf49-4571-ad11-f0c5ba5c7b8f: Request association with {'Port': 5000, 'AET': 'ALI_QUERY_SCP', 'Address': '10.25.39.134'} (10.25.39.134 5000 from <AE(OPENREM, stopped daemon 140214364079872)>)
[05/Aug/2021 11:10:17] INFO [remapp.netdicom.qrscu:874] cd19ce84-bf49-4571-ad11-f0c5ba5c7b8f DICOM Echo ...
[05/Aug/2021 11:10:18] INFO [remapp.netdicom.qrscu:884] cd19ce84-bf49-4571-ad11-f0c5ba5c7b8f DICOM FindSCU ...
[05/Aug/2021 11:10:18] INFO [remapp.netdicom.qrscu:703] cd19ce84-bf49-4571-ad11-f0c5ba5c7b8f Currently querying for MG studies...
[05/Aug/2021 11:10:18] INFO [remapp.netdicom.qrscu:747] cd19ce84-bf49-4571-ad11-f0c5ba5c7b8f 72 study responses returned, removing duplicates.
[05/Aug/2021 11:10:18] INFO [remapp.netdicom.qrscu:756] cd19ce84-bf49-4571-ad11-f0c5ba5c7b8f Removed 0 duplicates from response, 72 remain.
[05/Aug/2021 11:10:18] INFO [remapp.netdicom.qrscu:944] cd19ce84-bf49-4571-ad11-f0c5ba5c7b8f Pruning study responses based on inc/exc options: station name includes obshomg01mgb,
[05/Aug/2021 11:10:18] INFO [remapp.netdicom.qrscu:140] cd19ce84-bf49-4571-ad11-f0c5ba5c7b8f Filter at study level on station_name that include [u'obshomg01mgb']
[05/Aug/2021 11:10:19] INFO [remapp.netdicom.qrscu:154] cd19ce84-bf49-4571-ad11-f0c5ba5c7b8f Now have 0 studies
[05/Aug/2021 11:10:19] INFO [remapp.netdicom.qrscu:951] cd19ce84-bf49-4571-ad11-f0c5ba5c7b8f Pruning studies based on inc/exc has removed 72 studies, 0 studies remain.
[05/Aug/2021 11:10:19] INFO [remapp.netdicom.qrscu:958] cd19ce84-bf49-4571-ad11-f0c5ba5c7b8f Querying at series level to get more details about studies
[05/Aug/2021 11:10:19] INFO [remapp.netdicom.qrscu:170] cd19ce84-bf49-4571-ad11-f0c5ba5c7b8f Getting series and image level information and deleting series we can't use
[05/Aug/2021 11:10:19] INFO [remapp.netdicom.qrscu:140] cd19ce84-bf49-4571-ad11-f0c5ba5c7b8f Filter at series level on station_name that include [u'obshomg01mgb']
[05/Aug/2021 11:10:19] INFO [remapp.netdicom.qrscu:154] cd19ce84-bf49-4571-ad11-f0c5ba5c7b8f Now have 0 studies
[05/Aug/2021 11:10:19] INFO [remapp.netdicom.qrscu:1019] cd19ce84-bf49-4571-ad11-f0c5ba5c7b8f
[05/Aug/2021 11:10:19] INFO [remapp.netdicom.qrscu:1025] cd19ce84-bf49-4571-ad11-f0c5ba5c7b8f Pruning series responses removed 0 studies, leaving 0 studies
[05/Aug/2021 11:10:19] INFO [remapp.netdicom.qrscu:65] cd19ce84-bf49-4571-ad11-f0c5ba5c7b8f Checking to see if any of the 0 studies are already in the OpenREM database
[05/Aug/2021 11:10:19] INFO [remapp.netdicom.qrscu:114] cd19ce84-bf49-4571-ad11-f0c5ba5c7b8f After removing studies we already have in the db, 0 studies are left
[05/Aug/2021 11:10:19] INFO [remapp.netdicom.qrscu:1037] cd19ce84-bf49-4571-ad11-f0c5ba5c7b8f Removing duplicates of previous objects removed 0, leaving 0
[05/Aug/2021 11:10:20] INFO [remapp.netdicom.qrscu:1066] cd19ce84-bf49-4571-ad11-f0c5ba5c7b8f Query complete. Query took 3.2 seconds and we are left with 0 studies to move.<br>Of the original 72 study responses, Filtering for only studies with station names that include
'obshomg01mgb' removed 72 studies, Removing duplicates of previous objects removed 0 studies.

Now I'm certain that station should be there in that date range, I have tried it for other station names too, always 0 results. I notice the name I enter and the logs have different capitialisation, does this have any effect? The station name always comes out lower case even though our systems seem to either be all capitalised or have at least one captial letter.

Thanks,

Ben

dpla...@gmail.com

unread,
Aug 5, 2021, 11:26:12 AM8/5/21
to OpenREM
Hi Ben,

Filtering by station name does not work for me either. I have never looked into why it doesn't work, but I suspect it may be related to the PACS that we have (a flavour of GE). Ed may be of more help, but is enjoying some annual leave at the moment.

Kind regards,

David

Ed McDonagh

unread,
Aug 5, 2021, 12:29:49 PM8/5/21
to OpenREM
I'm home now! But still on annual leave :)

I think this has been fixed for the next version as part of refactoring the QR code for issue #858 - specifically this commit. The issue was (I think) that unless the station name was provided at both study and series level then the study was excluded.

There is a related issue, issue #772, that discusses the situation where a Study contains series from more than one source (CT and 'Injection images') or PET and CT, and provide a station name of MIXEDCT or MIXEDCTNM at study level, and the correct station name at series level. As the station name is checked at both levels, the code would currently never allow this to work. If the station name was blank or absent at study level then (with the new code) they would filter as required.

Regarding the capitalisation - we convert to lower case in the code before any comparisons to reduce issues there.

Kind regards

Ed

--
You received this message because you are subscribed to the Google Groups "OpenREM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrem+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openrem/c5899d81-4a45-4332-92c0-0a379f6b6701n%40googlegroups.com.

Ben Earner

unread,
Aug 9, 2021, 8:46:43 AM8/9/21
to OpenREM
Thanks both, I'll give it another try in the next release.

My use case is I've been asked to gather some data I don't normally acquire and I don't want to fill the DB with uneeded exams. So the more filtering I can do the better. It would in fact be useful to be able to filter based upon institution too as the station name isn't always unique it seems but I appreciate that few will require that level of filtration. 

Related to this, is there a relatively clean way of removing modality data from a DB? For example, all MG data?

Many thanks,

Ben



Ed McDonagh

unread,
Aug 9, 2021, 12:33:00 PM8/9/21
to OpenREM
I think greater filtration on query-retrieve would be welcomed by lots of people - unfortunately the DICOM C-FIND model is very much set up for a clinical model of patients and studies for reporting etc. So fields relating to equipment or institutions are rarely made available in query responses, and we wouldn't see them until the study is retrieved and is being imported to OpenREM.

Depending on the number of different systems you wish to remove, and on your tolerance levels, you can go to the Display names and modalities page on the config menu and Review and Delete each of the systems.

Alternatively, you can delete an entire modality type (or anything, depending on how you filter the responses) by using the Django database API. I can send you some sample commands if you like.

Ben Earner

unread,
Aug 11, 2021, 8:30:21 AM8/11/21
to OpenREM
Thanks Ed, I hadn't explored that part of the application, but it looks like I will be able to remove the data easily enough without getting into the Django backend.
Reply all
Reply to author
Forward
0 new messages