Add option to recalculate skin dose map

Issue #509 resolved
David Platten created an issue

It would be good to be able to make the system recalculate skin dose map data in certain situations. For example, users may wish to do this after patient height and/or weight data has been imported in to the system (this is why I'd like to be able to do it).

We could make the re-calculation of skin dose map data automatic if the patient height or weight in the database differs from what is stored in the skin dose map pickle data file.

If a user updates lots of studies at once then the recalculation of the skin dose map data could take some time.

Alternatively we could add a button to the rfdetail view that would trigger the recalculation of skin dose map data for the study being viewed.

Any thoughts on this from anyone?

Comments (7)

  1. Ed McDonagh

    Not sure. If, like we do, you update the heights and weights only every so often, then that would add a lot of celery jobs all at once.

    I don't know what the best solution is. I think one thing we should do is to highlight that the height and weight used for the displayed map differs from the data in the database, and in that case certainly to offer to recalculate.

    Whether there should be an option always - why not?

  2. David Platten reporter

    At the moment when a user views a particular study in rfdetail the system checks to see if there is an existing set of skin dose map data. If there is, and the open skin version in the data file matches the system version, then it's loaded and displayed. If there is no data file present, or if it was calculated using a previous version of the open skin code, then the skin map data is calculated and a data file created.

    I propose that we add a check to the rfdetail code to ensure that if there is a skin dose data file for the study that the patient height and mass stored in the skin dose map file matches that stored in the database. If there is a match then load and display the file. If there's not, recalculate the skin dose map. This avoids having to add a "Recalculate skin dose map" button, and also avoids queuing up loads of skin dose map calculations on the back of updating lots of height and mass data.

    Thoughts?

  3. Ed McDonagh

    I'd say that would be a good way to proceed - minimal changes required so you can get on with other things! If in the future another use case arises or you feel you do need to trigger a batch recalculation, we can revisit.

  4. David Platten reporter

    Added code to recalculate skin dose map data if patient height or mass in database differ from what is stored in the pickle file. If no height or mass data are present in the database then default values are used. References and fixes issue #509

    → <<cset 4a8f26f17cf4>>

  5. David Platten reporter

    Updated skin dose map documentation to reflect the new code that recalculates skin dose map data if database height or mass differ from what is stored in the skin dose map pickle file. References issue #509

    → <<cset e6312facfec1>>

  6. Log in to comment