Make chart category grouping case-insensitive
My charts of median DAP per requested procedure name group the requested procedure in a case-sensitive way. I have a "XR Chest" category with data from some rooms, and also a "XR CHEST" category with some other rooms. I'd like these to be grouped together in a case-insensitive way.
Comments (12)
-
reporter -
reporter - changed status to resolved
Amended chart code so that y-axis categories are case-insensitive. This now means that rooms with data for
XR CHEST
and other rooms with data forXR chest
are both shown under the same chart category ofxr chest
. This fixes issue#493for me.→ <<cset abde963d2105>>
-
reporter Updating changes files for issue
#493. References issue#493→ <<cset 14ff43543235>>
-
reporter @edmcdonagh, the code that I've added to fix this issue makes all the chart categories lower case so that, for example, doses from "XR Chest" are combined with "XR CHEST" to determine the mean, median or count. The resulting category will display as "xr chest".
It may be that some users won't want this behaviour - they may sometimes want to retain the case sensitivity of the categories. Do you think this might be the case? If it is then I can change how I've addressed this issue by adding a charting option along the lines of "Make chart categories case insensitive" that can be switched on or off. This will involve adding a new database field, and so require a database migration.
-
reporter - changed status to open
Maybe this should be implemented as a chart option that the user can switch on or off.
-
There are several changes to the database models between 0.7.4 and 0.8.0 so don't let that put you off. So far, I don't think there is anything that won't auto-migrate, so we're ok.
-
reporter - changed status to resolved
Added a user chart option to make chart categories case-insensitive. References and fixes issue
#493→ <<cset ac24ebeda45f>>
-
reporter I've just realised that my previous commit was very inelegant, and am just sorting out a much more concise way of achieving the same thing.
-
-
reporter Modified method - requires far fewer lines of code. Had to
Concat
None
on to the series names to make it work. References issue#493→ <<cset 10e4fa234766>>
-
reporter Updated chart documentation to include option to make categories case-insensitive. References issue
#493→ <<cset 1013e030b19a>>
-
- changed milestone to 0.8.0
-
assigned issue to
- Log in to comment
In the
chart_functions.py
routines it should be possible to annotate a lower-case version ofdb_series_names
near the start of each routine and then use these for the remaining querying. I think that should do the trick. Will have to try this at home.See http://docs.djangoproject.com/en/1.8/ref/models/database-functions/#lower for an example of how to annotate.