-
Notifications
You must be signed in to change notification settings - Fork 5
Don't delete data unnecessarily when revisiting additional image details #992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e876203 to
582e81a
Compare
1779991 to
bd76c56
Compare
| "rcc_count": series_counts.get(("CC", "R"), 1), | ||
| "lcc_count": series_counts.get(("CC", "L"), 1), | ||
| "right_eklund_count": series_counts.get(("EKLAND", "R"), 1), | ||
| "left_eklund_count": series_counts.get(("EKLAND", "L"), 1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it correct that we default to 1? I wonder if this should be changed to default to 0, and for the other five image types?
| "left_eklund_count": series_counts.get(("EKLAND", "L"), 1), | |
| "left_eklund_count": series_counts.get(("EKLAND", "L"), 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh no, the EKLUND should both be 0. 🤦🏻 this line is full of typos.
| "lmlo_count": series_counts.get(("MLO", "L"), 1), | ||
| "rcc_count": series_counts.get(("CC", "R"), 1), | ||
| "lcc_count": series_counts.get(("CC", "L"), 1), | ||
| "right_eklund_count": series_counts.get(("EKLAND", "R"), 1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo on lines 198 and 199 - EKLAND should be EKLUND
| "right_eklund_count": series_counts.get(("EKLAND", "R"), 1), | |
| "right_eklund_count": series_counts.get(("EKLUND", "R"), 1), |
When revisiting take images, we don't want to lose notes added to the study. Therefore, we shouldn't delete anything if the first step is resubmitted and the answer is NO_ADD_ADDITIONAL.
3e7ef85 to
47a4959
Compare
|
@swebberuk thanks for the review. I've just corrected the handling of EKLUND views. |
| should_recall = None | ||
|
|
||
| kwargs["initial"] = { | ||
| "rmlo_count": series_counts.get(("MLO", "R"), 1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is just EKLUND image types that should default to 0, I think they all should.
If user selects 0 for RMLO then no record will be inserted into it, as StudyService.create_or_update only inserts record for series when count > 0. If user returns to page then, if we default to 1, 1 will be shown for RMLO rather than 0.
When instance is None, because there is not an existing study for the appointment, then the form will still default to 1 for CC and MLO, and 0 for EKLUND - as that is controlled by the initial argument of IntegerField.
| "rmlo_count": series_counts.get(("MLO", "R"), 1), | |
| "rmlo_count": series_counts.get(("MLO", "R"), 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you're right, I was thinking it would default to the standard set of images (as it does if there is no study instance) but if there's an instance we need to treat missing as 0.
47a4959 to
4c10b50
Compare
|
swebberuk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍



Description
Currently, if you return to "Take images" from "check information", all the study data is wiped, and the previously entered values are not pre-filled.
This branch changes that so that study data is only deleted if "No images taken" is selected. If "No, add additional information" is selected, and the user has previously filled out that information, redirect them to the next form with the information pre-filled.
When revisiting the additional image details form, we now prefill the existing values. Further work is needed to prefill the other forms within "take images", but I want to split this into multiple PRs to avoid too many conflicts.
Jira link
#989
Review notes
Review checklist