Add modality to display names table and group
An established database might have a large number of rows in the display name table.
It would be really useful to group them by modality to help see which unit is which.
I'm not sure if this is possible without changing the model.
Thoughts, @dplatten
Comments (24)
-
-
OK. If you replace the
display_names_view
method inviews.py
with the following then it returns a list of the modality types, as well as the list of name information. Not great, but may be useful:def display_names_view(request): from remapp.models import UniqueEquipmentNames, GeneralEquipmentModuleAttr, GeneralStudyModuleAttr import pkg_resources # part of setuptools f = UniqueEquipmentNames.objects.order_by('display_name') modality_of_each_name = [] for item in f: g = GeneralEquipmentModuleAttr.objects.filter(unique_equipment_name = item.pk) h = g.values("general_study_module_attributes") if len(h) > 0: modality_of_each_name.append(GeneralStudyModuleAttr.objects.filter(id = h[0].values()[0]).values("modality_type")[0].values()[0]) else: modality_of_each_name.append(False) try: vers = pkg_resources.require("openrem")[0].version except: vers = '' admin = {'openremversion' : vers} for group in request.user.groups.all(): admin[group.name] = True return_structure = {'name_list': f, 'modality_of_each_name': modality_of_each_name, 'admin':admin} return render_to_response( 'remapp/displaynameview.html', return_structure, context_instance=RequestContext(request) )
-
Added display of modality type when looking at the unique display names on the
viewdosplaynames
page. They're not grouped into modality yet. References issue#312→ <<cset 5aa8db516003>>
-
They're now grouped into modality. References issue
#312→ <<cset 8cca51c16a26>>
-
@edmcdonagh, this is pretty much sorted now. The modality type is currently displayed in the far right-hand column.
-
reporter Alternative option for ref
#312- what do you think @dplatten?→ <<cset 163ea4904bc5>>
-
reporter Fixed fluoro rf vs fl and added cr or dx filter. Refs
#312→ <<cset 65cad9f5f8a9>>
-
Added line to show how many entries in each table. Moved line showing total systems to below the
All systems
title. References issue#312.→ <<cset e44fc971ee06>>
-
reporter I was thinking of just having the modality specific tables. What do you think? I haven't tried it on a large database though - I'm in the process of installing a copy of my production database on the laptop so I can test. I think it will be ok!
-
Hi @edmcdonagh. I agree, it would be neater to have the modality-specific tables. I'm testing this on a copy of my live database with 78000 studies and 28 different imaging systems. Seems to work fine. The only problem with my data is that three of the 28 systems don't have a proper modality name: one is "None", and the other two are simply blank. The modality-specific tables don't display these anomolies at the moment. Perhaps there could be another category of "Everything else", that shows all the rest. This would also cover us if things like RTIMAGE data were added in the future.
-
reporter In my test database I have some of those where a study has been through the database and then been deleted, so there is an entry in the display names tables but no study to establish the modality from!
Can we do a chained exclude to find anything that's not CT, MG, DX, CR, RF?
-
Yep. I'm about to commit it.
-
Added a table called
Other
and removed the table showing all systems. References issue#312.→ <<cset 2bd20f169118>>
-
Removed ugly code that was being used to obtain modality type. Not needed anymore. References issue
#312.→ <<cset 519b91a06a2a>>
-
reporter Added display of modality type when looking at the unique display names on the
viewdosplaynames
page. They're not grouped into modality yet. References issue#312→ <<cset 5aa8db516003>>
-
reporter They're now grouped into modality. References issue
#312→ <<cset 8cca51c16a26>>
-
reporter Alternative option for ref
#312- what do you think @dplatten?→ <<cset 163ea4904bc5>>
-
reporter Fixed fluoro rf vs fl and added cr or dx filter. Refs
#312→ <<cset 65cad9f5f8a9>>
-
reporter Added line to show how many entries in each table. Moved line showing total systems to below the
All systems
title. References issue#312.→ <<cset e44fc971ee06>>
-
reporter Added a table called
Other
and removed the table showing all systems. References issue#312.→ <<cset 2bd20f169118>>
-
reporter Removed ugly code that was being used to obtain modality type. Not needed anymore. References issue
#312.→ <<cset 519b91a06a2a>>
-
reporter - changed status to resolved
-
reporter Updating changes ref
#312→ <<cset 0402cf1ca192>>
-
reporter - changed milestone to 0.7.0
- Log in to comment
I would think it is possible to obtain the modality of each display name using a database query of some sort, as the records are related:
Each entry in GeneralEquipmentModuleAttr contains a link to a single record in UniqueEquipmentNames
Each entry in GeneralEquipmentModuleAttr also contains a link to a single record in GeneralStudyModuleAttr. That GeneraStudyModuleAttr record contains the modality type.
I'm not able to look at this in more detail now, but will take a look at it at some point.