DX export has no filtration details, and filtration has too many decimal places in detail view

Issue #367 resolved
Ed McDonagh created an issue

No description provided.

Comments (20)

  1. David Platten

    @edmcdonagh, I don't seem to be able to debug the export routine in PyCharm. It that because the export task is being executed by celery? Any tips on how I can do this in PyCharm?

  2. Ed McDonagh reporter

    Probably. I've never really tried. Can you remove the .delay from the export call to bypass celery?

  3. David Platten

    Corrected what I assume is a typo that was using a CT export instead of a DX one. The export now fails, but at least it is trying to use the correct routine... References issue #367

    → <<cset ba5a6d2e8833>>

  4. David Platten

    I can't work out why the csv export of radiographic studies fails. The export to xls works fine. The error message in my celery window says:

    [2016-02-28 13:27:18,559: ERROR/MainProcess] Received unregistered task of type u'remapp.exports.dx_export.exportDX2excel'.
    The message has been ignored and discarded.
    
    Did you remember to import the module containing this task?
    Or maybe you are using relative imports?
    Please see http://bit.ly/gLye1c for more information.
    
    The full contents of the message body was:
    {u'timelimit': [None, None], u'utc': True, u'chord': None, u'args': [{u'requested_procedure': u'', u'display_name': u'', u'patient_age_min': u'', u'study_dap_max': u'', u'submit': u'Submit', u'csrfmiddlewaretoken': u'jngC3el1pNmGJ2Scq0sHPx5l1aTzhhT4', u'manufacturer': u'', u'patient_age_max': u'', u'study_description': u'', u'date_before': u'', u'plotMeanMedianOrBoth': u'median', u'acquisition_protocol': u'', u'station_name': u'', u'date_after': u'2015-10-05', u'plotDXStudyPerDayAndHour': u'on', u'plotDXAcquisitionMeanDAPOverTimePeriod': u'months', u'institution_name': u'', u'accession_number': u'', u'o': u'-study_date', u'test_data': u'', u'study_dap_min': u'', u'model_name': u''}, False, 0, 0, 1], u'retries': 0, u'expires': None, u'task': u'remapp.exports.dx_export.exportDX2excel', u'callbacks': None, u'errbacks': None, u'taskset': None, u'kwargs': {}, u'eta': None, u'id': u'934508aa-eade-45aa-ac70-d52f8e913ca5'} (869b)
    Traceback (most recent call last):
      File "c:\users\david\documents\code\python\openrem\testbed\openrem\lib\site-packages\celery\worker\consumer.py", line 455, in on_task_received
        strategies[name](message, body,
    KeyError: u'remapp.exports.dx_export.exportDX2excel'
    
  5. Ed McDonagh reporter

    I've probably fixed the xlsx one but not the csv one. It's to do with importing from openrem.remapp vs remapp, which gets very complicated.

    Fix is to do with naming the task rather than just making it a task. Have a look at the xlsx export and I think it will be named in the @ bit above the function.

    If that doesn't make sense I'll take a look.

  6. David Platten

    @edmcdonagh, thanks for the help. Adding a line to tasks.py to include exportDX2excel has sorted out the problem that I had. I can now take a look at adding the filters to the export.

  7. David Platten

    Added filter type and thickness headings to radiographic csv output file. The headings are included n times, where n is the maximum number of filters present in any single exposure that is being exported. No filter data is written out yet. References issue #367

    → <<cset c238b177202f>>

  8. David Platten

    Added code to include the filter materials and maximum thicknesses of filters used for each exposure. It's written a little as pseudo-code at the moment as I can't debug it at work. Once it's working then the other filter materials will need to be added to the if statement. The code can then be re-used for the xls part of the export. References issue #367

    → <<cset 1702c8424e97>>

  9. David Platten

    @edmcdonagh, I think this is fixed now. The database doesn't contain material codes like C-120F9, it just has things like Aluminum or Aluminum compound.

    I don't have any kit that has more than one filter, but I think this code will work no matter how many filters are present.

  10. Ed McDonagh reporter

    It does @dplatten - they are in the ContextID table. If you use .xray_filter_material.code_meaning you get the Copper or Copper compound style response, and if you use .xray_filter_material.code_value you get the C-127F9 style response.

  11. David Platten

    Altered the if statements that check for the presence of materials in the exposures. The new code reads in a more natural way. I would prefer to keep using the element names, rather than revert to using the material reference values, as I think it makes the code easier to read. References issue #367

    → <<cset 01df6999ad3f>>

  12. Log in to comment