Skip to content

Breast features - add model and form#1024

Open
MatMoore wants to merge 2 commits intomainfrom
DTOSS-11635-breast-features-model-and-form
Open

Breast features - add model and form#1024
MatMoore wants to merge 2 commits intomainfrom
DTOSS-11635-breast-features-model-and-form

Conversation

@MatMoore
Copy link
Contributor

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

  • Check database queries are correctly scoped to current_provider

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.
@sonarqubecloud
Copy link

"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)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant