Issue665fluoroHighDoseHighlight

Merged
#237 · Created  · Last updated

Merged pull request

Merged in issue665fluoroHighDoseHighlight (pull request #237)

b0516b9·Author: ·Closed by: ·2018-11-27

Description

Creating a pull request to see what Codacy makes of this; I still need to write documentation.

  • Added feature that highlights fluoro total DAP or total dose to reference point that are above admin-defined levels. The values are highlighted in bold red on the summary fluoro view. I've included a form that an administrator can use to view and modify the results. I haven't written any docs yet. References issue #665

  • Correcting typo in url. References issue #665

  • Updated rf filter test file to prevent error when running tests due to HighDoseMetricAlertSettings not being created during the tests. References issue #665

  • Removing duplicate line in forms.py left when fixing conflicts after merge of workload branch into develop. References issue #665

  • Added code to calculate the sum of DAP and dose at RP for the patient involved in each study over a period going back 6 weeks from the current study. At the moment the code calculates these values and populates the new database fields when the user first visits the rf summary page. On revisits the value is simply read from the database. This is not how I'd like this to work in practice: my intention is to have these values calculated at study import, and re-calculated if an OpenREM administrator changes the time period over which the doses are summed. Also, in each row of the rf summary table I'd like the user to see how many studies have contributed to the summed total and also be able to navigate to these - perhaps this should be on the summary details page? At the moment I'm writing the private keys of the associated studies to a string that is displayed on the summary page. There must be a better way of storing the related studies to make it easier for them to be retrieved by a Django template so that they can be used in hyperlinks. References issue #665

  • Created new table to store pks of RF studies that fall within delta weeks of each RF study. Changed how number of studies in previous delta weeks displayed on RF filtered page. Included info on studies in delta weeks on RF detail page, including hyperlinks to take the user to them. Haven't tried a bi-plane system yet, but do now have a bi-plane RSDR (thanks to Ed). References issue #665

  • Altered code so that it works as expected for bi-plane systems as well as single-plane systems. Also moved the summed dose information to be after the dose table on the rf detail page. References issue #665

  • Added button that can be used by an admin to recalculate all the summed total DAP and total dose at RP values. No calculation is done in the rf_summary view any more. Still need to add code to calculate these values when a new study is received. References issue #665.

  • Added calculation of summed total DAP and total dose at RP when a new RF study enters the system. Simplified code that does the calculations. References issue #665

  • (Hopefully) fixed the problem where my check for existence of HighDoseMetricAlertSettings did not work (spotted thanks to the failed pipeline). References issue #665

  • (Hopefully) fixed the problem where my check for existence of HighDoseMetricAlertSettings did not work (spotted thanks to the failed pipeline). References issue #665

  • Removed creation of the HighDoseMetricAlertSettings objects in the test files now that it should take place in the rdsr extractor. References issue #665

  • Forced calculation of summed total DAP and total dose at RP when an admin changes the delta_weeks time period. References issue #665

  • Tidied up the high dose form. Added warning message and made recalc button look better. References issue #665

  • Removed unrequred Button import. References issue #665

  • Fixed problem where delta weeks was not being updated: my redirection to another page stopped it from working. The 'Recalculate summed data' button now only appears if the user has changed the delta weeks value. References issue #665

  • Removed unrequired HTML import and made default of changed_accum_dose_delta_weeks True so that users are prompted to update the data initially. References issue #665

  • Added admin setting to choose whether to display summed total DAP and total dose at RP in rf summary page. Added admin setting to choose whether to calculate this data during import of new fluoroscopy studies. Altered messages to inform user of which aspect of the settings have been changed by the form. References issue #665

  • Added code to hide or show summed dose information on rf detail page depending on the admin setting. References issue #665

  • Added a check for the existence of patient module attributes for the study before trying to access them. At least one of the studies in my database is missing this relationship which caused the previous code to fail. References issue #665

  • Added e-mail server settings. References issue #665

  • Added ability to switch e-mail notification of high doses on and off. I haven't coded the actual e-mail sending yet. I've also added a new database table to enable OpenREM users to be marked as receiving these alerts; I've not coded this into a form yet. References issue #665

  • Added a method to create or save the high dose alert notification user setting and hooked it into saving of the user profile. I think that when I create the OpenREM admin form to choose which users to notify of high doses I should ensure that code checks for the existence of the high dose alert notification setting for each user, and if it does not exist it should be created. References issue #665

  • I've added e-mail capability to OpenREM and set this up so that designated users are e-mailed when a new fluoroscopy study exceeds the dose alert levels. The code checks for the individual study exceeding these levels, and also accumulated DAP and dose at RP over a specified time period. Some things need sorting out and further testing: I don't know if bi-planar studies will break my new code; I'd like to add a 'send a test e-mail' function so that users can confirm that e-mail is working; I'd like to make the e-mails html; and finally, I'm not able to put the URL of OpenREM into the e-mails - I think this will require adding the 'Sites' app. References issue #665

  • Replaced a specific e-mail address with a dummy one. References issue #665

  • Added html e-mail content - needs smartening up. References issue #665

  • Added code to check that highdosemetricalertrecipients exists for the user before trying to change values. References issue #665

  • Moved e-mail sending code to a new tools file - incomplete at the moment. Added test line into views.py to help me test the code. References issue #665

  • Added text and html e-mail templates for high dose fluoro alert messages. Added a new setting in local_settings.py for the server URL. This could be added using the Sites app, but this would still require manual config and is really intended for when you are running multiple Django sites from one server. References issue #665

  • Removed sending test e-mail from homepage code. References issue #665

  • Recalculation of accumulated dose levels now uses Ajax. References issue #665

  • Removed unnecessary div and associated JavaScript. References issue #665

  • Added DAP and dose at RP for previous studies to the HTML e-mail template. Need to add to plain text one too. Also changed some wording and a little formatting. References issue #665

  • Added display of DAP and dose at RP for studies within delta weeks on rf detail page. Changed layout slightly. Checked that the code works for single and bi-plane systems. References issue #665

  • Commented out unnecessary import. References issue #665

  • Changed text associated with high dose alert field [skip ci]. References issue #665

0 attachments

0 comments

Loading commits...