Improve fluoroscopy study export

Issue #122 resolved
Ed McDonagh created an issue

Current fluoro export is very high level summary to single sheet csv file.

Need to come up with an export that is useful to allow analysis, taking into account the number of exposures can be in the hundreds.

Comments (24)

  1. Ed McDonagh reporter

    Added in the code for getting the min, mean and max DAP, kVp, mA and time. Need to pre-filter by protocol and field size and loop this all so that it can iterate through the original queryset. Refs #122.

    → <<cset 1f49224b68aa>>

  2. Ed McDonagh reporter

    Previous version of similarexposures was multiplying each time an additional filter condition was added. Now the study_UID of the exam is obtained and the exam is opened at the Irradiation_event_xray_data table, which makes the rest of the code easier to read and now the filtering works. Refs #122.

    → <<cset b6cb4a00e9ad>>

  3. Ed McDonagh reporter

    Created while loop that continues until inst is empty. Added writing strings of the summary of the similar exposures to the examdata array. Refs #122

    → <<cset 715a096a95e5>>

  4. Ed McDonagh reporter

    Replaced an instance of tabs with spaces and added task to the tasks.py file. Currently can't launch Celery as complaining of syntax error I can't find. Refs #122.

    → <<cset 2b75b5d3f86d>>

  5. Ed McDonagh reporter

    Found the errant missing bracket. Added import of aggregate functions. Replaced two references to DX. Replaced numrows with e.count() as the original declaration has now moved down the routine. Added the field size to the headers. Export now basically works for the all data sheet, series sheets are empty as expected and summary sheet doesn't work with respect to the series either. Refs #122.

    → <<cset 0742df180dae>>

  6. Ed McDonagh reporter

    Made all filters check if present except the first one. Switched the exclude to exlude the similarexposures rather than trying to filter again. Currently failing due to filter_material not always existing - need to add try. Refs #122.

    → <<cset 26abc349a5ed>>

  7. Ed McDonagh reporter

    Values for filtering with are now obtained using get_db_value which doens't crash if the value isn't there as it uses the getattr with a try statement. Calls are nested with .get() as appropriate as getattr can't follow foreignkey lookups. Refs #122

    → <<cset 92c6d8570049>>

  8. Ed McDonagh reporter

    Moved the creation of tabs till after the all-data sheet has been populated. Created new code to start populating the individual dose sheets. Currently has some print statements in; it is working for the first protocol but doesn't get to the second one. Refs #122

    → <<cset 7006c1b270da>>

  9. Ed McDonagh reporter

    Was working for more than one protocol, but example only had one! Removed comments. Not likely to work currently with missing protocol names. Needs real fields to be written now. Refs #122.

    → <<cset 447071f9c9d8>>

  10. Ed McDonagh reporter

    Moved populating the common elements of examdata to a new function, used by all data sheet and by protocol sheets. Added in Physician name. Need to repeat for common headings. Refs #122.

    → <<cset 38bce9f6550f>>

  11. Ed McDonagh reporter

    Now have a working export again. Variable commonheaders removed as can call _rf_common_headers each time. Now events are filtered from scratch at the irradiation_event_xray_data level, both for the protocol in question and for the list of studies in the original export filter. Needs the list of exported variables to be expanded. Refs #122.

    → <<cset 6e4f4f59a250>>

  12. Ed McDonagh reporter

    Fluoroscopy exams now have a useful-enough export. Needs real-world testing to see what should be changed. Then csv version can be changed in a similar way if suitable, and the old version removed. Fixes #122.

    → <<cset e117978d209f>>

  13. Log in to comment