Open
Conversation
This is medical information collected in the context of an appointment, so it should live in the mammograms app alongside the corresponding views.
Previously we were planning to have an autocomplete field so that the user could select the specific provider on this form. We've now decided to just use a simple free text input, so alter the model accordingly. Instead of location_type=NHS_BREAST_SCREENING_UNIT, use SAME_PROVIDER (to match the provider of the current screening episode) or ANOTHER_NHS_PROVIDER. The foriegn key to provider is reundant in the case when SAME_PROVIDER is selected, because this model is now linked to provider. If ANOTHER_NHS_PROVIDER is selected, we will populate location_details.
Note: the prototype says "Approximately taken 6 months or more ago:" which we've decided to shorten to "Taken 6 months or more ago:"
When we first implemented this form, it wasn't linked to an appointment, which meant that to get the current provider we had to separately query the most recent provider for the participant. Now that the mammograms are linked to an appointment, we can directly access the provider from there, which simplifies the code.
This was referenced Mar 18, 2026
swebberuk
reviewed
Mar 18, 2026
| previous_mammograms: | ||
| - location_type: NHS_BREAST_SCREENING_UNIT | ||
| - location_type: SAME_PROVIDER | ||
| provider: |
Contributor
There was a problem hiding this comment.
As we've removed provider_id from participants_participantreportedmammogram, do we need to remove provider from previous_mammograms in these .yml files?
When I try make rebuild-db I get an error. Can workaround it by adding mammogram.pop("provider", None) to create_reported_mammograms in seed_demo_data.py.
File "dtos-manage-breast-screening/manage_breast_screening/nonprod/management/commands/seed_demo_data.py", line 285, in create_reported_mammograms
appointment_mammogram = ParticipantReportedMammogramFactory(
appointment=appointment,
**mammogram,
)
File "dtos-manage-breast-screening/.venv/lib/python3.14/site-packages/django/db/models/base.py", line 590, in __init__
raise TypeError(
...<2 lines>...
)
TypeError: ParticipantReportedMammogram() got unexpected keyword arguments: 'provider'
Contributor
Author
There was a problem hiding this comment.
Yeah we do, just pushed another commit to fix this.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Refactoring
ParticipantReportedMammogrammodel. We're not relying on it now that we pass in the appointment (which is linked to the current provider).Distinguish NHS and non-NHS providers when adding previous mammograms
Align approximate dates with the prototype
Make exact date hint text dynamic
Previously the example was hardcoded to "15 3 2025". It's now calculated to be 9 months ago.
Jira link
https://nhsd-jira.digital.nhs.uk/browse/DTOSS-12370
Review notes
Review checklist