ouhft / COPE

Project Repository for Work Package 4 of the COPE Transplant Trial
https://cope.nds.ox.ac.uk
1 stars 0 forks source link

Modify the S/AE start process so that Date of Death is loaded once an organ is selected #270

Closed marshalc closed 7 years ago

marshalc commented 7 years ago

Date of Death doesn't load until the Trial ID is saved in the S/AE form, so on a new form with filling in happening immediately, it doesn't appear to exist.

marshalc commented 7 years ago

Look to move Trial ID selection to the point of starting a new event? Or reload the form once Trial ID has been selected?

marshalc commented 7 years ago

Going with option B - but this is currently being overridden by AjaxFormMixin which inserts the AdminEventForm for admin users, and there's no equivalent AdminStartEventForm

marshalc commented 7 years ago

Can do a restricted-to-essentials form for starting (Organ, Onset, Contact), but then when it saves, it goes to the detail, not update, view. Need to override get_success_url for first time results... but how to determine it is the first time?

marshalc commented 7 years ago

get_success_url now refers new events to the full edit form.

Date of death is now loaded so that when you select "Yes" to did this lead to death, DoD is completed

marshalc commented 7 years ago

There is still a potential problem about trying to add a DoD to an organ that does not have an actual recipient assigned?

marshalc commented 7 years ago

No, there will be no error, but the Date of Death will not be saved (just discarded) because there is no Recipient patient to record it against - this perhaps should really generate an error on save, or at least a message?

marshalc commented 7 years ago

Minor issue in that DoD can be set in the future and this is not being trapped by the Patient model clean() function!

marshalc commented 7 years ago

Will file that under a future problem.. this issue appears to be resolved for practical purposes. And so is #271.