Open
Conversation
This is as simple as possible for now, so we have an MVP we can test in the pilot. In a future iteration we will probably want to split out the JSON into a relational model, or add some kind of JSON schema. We should also store the annotated image itself, so that we can display exactly what the user who annotated the image saw.
|
MatMoore
commented
Feb 12, 2026
| "Appointment", on_delete=models.PROTECT, related_name="breast_features" | ||
| ) | ||
| annotations_json = models.JSONField(null=False, default=list) | ||
| diagram_version = models.IntegerField(null=False, default=1) |
Contributor
Author
There was a problem hiding this comment.
I stuck in a version number here just to future-proof a little. Any time we change the SVG, or the format of the annotations_json, we'll need to ensure that we don't interpret past data incorrectly.
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
This is some preparatory work creating a way to store breast feature data. The goal is to have some form of the breast feature annotation widget in the pilot version. I'll have separate PRs for integrating @colinrotherham's work on the frontend, and then wiring up the views and templates.
We're starting out with a simple json field so that we can quickly implement the feature and test it in the pilot. This means that we're storing whatever the frontend will generate, and the backend only validates that it is valid JSON.
In a future iteration we will probably want to split out the JSON into a relational model, or add some kind of JSON schema. I also think that to minimise the chance of display bugs, we should create and store a static image with the annotations embedded, but this is something we can revisit later.
Jira link
https://nhsd-jira.digital.nhs.uk/browse/DTOSS-11635
Review notes
Review checklist