Problems with similar display names

Issue #459 wontfix
Tim de Wit created an issue

I'm having some trouble with a CT system that appears twice in my display-name list. After merging them the problem disappears, but this shouldn't have been necessary. The system has the following two entries in the remapp_uniqueequipmentnames table:

station_name display_name
c01-ct-01 c01-ct-01
c01-ct-01 hospitalname c01-ct-01

When clicking on "c01-ct-01" in the CT summary table i get the following error (and empty plots):

[12/Jan/2017 13:58:57] "GET /openrem/ct/?display_name=c01-ct-02&o=-study_date HTTP/1.1" 200 75126
Internal Server Error: /openrem/ct/chart/
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 132, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py", line 22, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/openrem/remapp/views.py", line 815, in ct_summary_chart_data
user_profile.plotHistogramBins, user_profile.plotHistograms)
File "/usr/local/lib/python2.7/dist-packages/openrem/remapp/views.py", line 913, in ct_plot_calculations
calculate_histograms=plot_histograms)
File "/usr/local/lib/python2.7/dist-packages/openrem/remapp/interface/chart_functions.py", line 312, in average_chart_inc_histogram_data
set([d[db_series_names] for d in return_structure['summary'][index]]))
IndexError: list index out of range

When printing the variable return_structure['system_list'] I get:
[u'hospitalname c01-ct-01', u'c01-ct-01']
so it seems that even though i'm requesting information about display_name "c01-ct-01" it also returns display names containing "c01-ct-01".

Comments (10)

  1. Ed McDonagh

    Hi @tcdewit, thanks for reporting the issue.

    The error reproduced here is presumably from the runserver output? Do you get the same in the web browser, or just the standard listing and empty charts?

    That both systems are being picked up is probably due to a 'contains' rather than 'equals'.

    I don't quite understand the situation though - is it one CT scanner that has two entries in the openrem/viewdisplaynames/ table, or two CT scanners that have display names where one name is the same as part of the other?

    Do the charts work if you use other criteria to ensure that only one scanner (if we have two) is present in the filter?

    Hopefully we can get to the bottom of this, and fix/improve OpenREM in the process :-)

    Ed

  2. Tim de Wit reporter

    hi Ed,

    Only in the runserver output indeed. It's one CT scanner that apparently over the years changed some dicom-header info (probably due to software updates, etc). However, due to the long list of systems it can be hard to find similar ones. What would help is being able to sort the summary table and displaynames-update table by clicking on a table header (e.g. sorting on eatitle or station_name).

    When using other criteria as well (in my case accessionnumber) the charts work.

  3. Ed McDonagh

    I've added issue ref #460 to propose adding sort by column header.

    I too have a lot of systems in my list, particularly for DX as our Carestream units change the Department field based on the patient's ward location in the worklist message!

    However, whilst it can be a chore to get them in order the first time, once they are in order the ones that have not been sorted will usually bunch together making them easier to spot. And then I tend to also click one of the entries with the correct display name too when editing so I can copy and paste from it. I tend to use a system of hospital abbreviation and room or system name, which also helps get them in line, like RMH Chelsea Rm 2 or RMH Chelsea Flash.

    As to the actual error message, and having a more robust system, I'm not sure exactly what the issue will be. @dplatten - is this something you have come across?

    Otherwise @tcdewit you might like to have a go at trying to determine the correct behaviour? I do want to be able to use display name 'contains', as it can be useful when sorting my units out in the filter.

  4. Tim de Wit reporter

    "contains" as a default is fine, but perhaps a checkbox in the exam filter div, named "exact match" would be handy to toggle the use of iexact/icontains in mod_filters.py?

    Still wouldn't solve this issue though...

  5. Ed McDonagh

    I'd be very happy to receive a Pull Request regarding improving study filtering! In fact, the oldest remaining open ticket for OpenREM on bitbucket is to do this: #17

    More recently, we've also had the problem that the current released version of django-filter doesn't work with OpenREM (#436), which led to me pegging OpenREM to an old version for the current OpenREM release (#437).

    This obviously isn't a situation that can be sustained, so someone will need to tackle it...

  6. David Platten

    @tcdewit, I've created a new branch of OpenREM (issue460tableSort) and added the ability to sort the display name tables by clicking on the table headings. See issue #460.

    Did you want to be able to sort some other tables on another page too?

  7. Ed McDonagh

    Assume doesn't need attention - please re-open if it does @Tim de Wit Possibly partially duplicates issue #17 which remains open.

  8. Log in to comment