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).
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.