If one study contains rdsr data from different modalities, export will fail

Issue #782 resolved
Luuk created an issue

Situation:

A study has multiple imaging modalities e.g. a DX and RF modality.

These modalities both sent a rdsr to openrem.

Both rdsrs are nicely imported in their specific modality tables and can be viewed in the different tabs.

But exports will fail, this is due to the fact that in the export the events are matched on studyInstanceUID and in the function that creates the sheets the events are matched on the “general-study-module-attributes”-id. So in this case the first one has more different “protocols” (from the events) than the first (and the worksheet is not created, but is tried to be filled).

Solution:

In rf_export.py in the rfxlsx(….):

            studyiuid = exams.study_instance_uid
            # TODO: Check if generation of inst could be more efficient, ie start with exams?
            inst = IrradEventXRayData.objects.filter(
                projection_xray_radiation_dose__general_study_module_attributes__study_instance_uid__exact=studyiuid)

Should be replaced with:

            # remove this line: studyiuid = exams.study_instance_uid
            # TODO: Check if generation of inst could be more efficient, ie start with exams?
            inst = IrradEventXRayData.objects.filter(
                projection_xray_radiation_dose__general_study_module_attributes__id__exact=exams.id)

This is probably also the case for the other export modules, but didn’t check yet.

Comments (2)

  1. Luuk reporter

    Refs #782 Fixes RF export issue with studies containing multiple modalities

    Fixed by changing the filtering on Study Instance UID to filtering on the database-id.

    → <<cset eb1053c4f490>>

  2. Log in to comment