Make modality more flexible
Would be nice to make it possible for the user to set modality and/or user definable category (e.g. angio suits / mobile fluoroscopy / mobile DR / ...). This could be made definable for the user with the setting of the display name.
Comments (24)
-
reporter -
reporter I made some small code changes to include the first two bullets and it seems to work fine (for the Siemens Mobilet Miramax). If imported without user_defined_modality_type it imports as RF, if set to DX, it imports as DX.
-
Seems good. Will have to also think about whether the display name page will need some work for the kit to jump between tables when reconfigured.
I look forward to seeing what you have put together.
-
Refs
#445Make modality more flexibleSo far only implements changes needed in the extractor. Additional changes should be made to 1. make it possible for the user to set "user_defined_modality" 2. update already imported records 3. update "display name page" to get system in correct modality category
Would also be a workaround for the "unsolvable" issue
#444→ <<cset d111f1004ab0>>
-
Refs
#445Make modality more flexibleImplements basic possibility to set a user defined modality type. Only changes from DX to RF and vice versa are allowed. Menu item caption might need to be updated.
Would also be a workaround for the "unsolvable" issue
#444→ <<cset ae951ff4dd76>>
-
Closed off table tag and slightly altered the wording. References issue
#445→ <<cset 18f91d4d2f08>>
-
Made the options a little friendlier to non-DICOM people. Refs
#445→ <<cset 9a1eaefacb16>>
-
Switched
user_defined_modality
tonull=True
fromblank=True
. Updatedviews.py
code to reflect this change. References issue#445→ <<cset 3770c6894a1c>>
-
Adding the
blank
back in to the field definition. This works fine with the current modifiedviews.py
code in my previous commit (#3770c68). References issue#445→ <<cset 40ad465bc22c>>
-
reporter It seems from the documentation that it is advised to only use blank=true https://docs.djangoproject.com/en/dev/ref/models/fields/#null):
Field.null If True, Django will store empty values as NULL in the database. Default is False. Avoid using null on string-based fields such as CharField and TextField. If a string-based field has null=True, that means it has two possible values for “no data”: NULL, and the empty string. In most cases, it’s redundant to have two possible values for “no data” the Django convention is to use the empty string, not NULL. One exception is when a CharField has both unique=True and blank=True set. In this situation, null=True is required to avoid unique constraint violations when saving multiple objects with blank values. For both string-based and non-string-based fields, you will also need to set blank=True if you wish to permit empty values in forms, as the null parameter only affects database storage (see blank).
-
@LuukO, thanks for that - I'll change it back to what you had written in the first place. @edmcdonagh, Luuk's original code didn't cause me any problems when I migrated the database. What was your concern with the database migration?
-
-
@edmcdonagh, I can't imagine the table in question will ever be very large, so perhaps it won't be a real problem. Conversely, does it matter if we define the field as null to start with. I don't know the right answer to this one.
-
reporter I don't know what the right answer is. It seems more people are struggling with it: http://stackoverflow.com/questions/36617145/django-arrayfield-null-true-migration-with-postgresql
So it seems that it is about rewriting the table during migration versus handling the null-value in the code.
-
Reverting the test for manually set modality type test when processing mammo RDSR as agreed by @dplatten. Refs
#445→ <<cset 0411c987835f>>
-
reporter -
reporter -
reporter Refs
#445Make modality more flexibleUpdated menu item captions, documentation and 2 screenshots.
→ <<cset a6eaad448b07>>
-
Hi @LuukO , @dplatten. I've updated branch issue445MakeModalityFlexible with develop, then pushed it to http://testing.openrem.org/ by creating a new branch from it called issue445MakeModalitisFlexible-stage and pushing that in.
Can you please take a look, push it around a bit and let me know if it is good for merging into develop?
Thanks.
@LuukO - I'll send you a login by email in a bit.
-
This looks good to me. I've swapped a DX room to RF, and also an RF room to DX. This works fine: the resulting detail pages appear as I would expect, and no errors are encountered. I then swapped the two rooms back to their correct modality type. I also tried to change the modality of a mammography system and received an appropriate warning: the modality was left unchanged.
-
Added ref
#445to changes and release notes.→ <<cset d4372ef1af6b>>
-
-
- changed status to resolved
Merged in issue445MakeModalityFlexible (pull request #84)
Issue445MakeModalityFlexible
Approved-by: Ed McDonagh ed@mcdonagh.org.uk
Thanks to @LuukO and @dplatten
→ <<cset 528a93ded3f5>>
-
reporter It seems a bit late, but my testing results are the same as David's. Thanks @edmcdonagh and @dplatten for making this change possible.
- Log in to comment
I would suggest to:
What do you think @edmcdonagh?