Skip to content

v2.2.1 hotfix#3562

Merged
thomasleese merged 9 commits intoreleasefrom
v2.2.1-hotfix
May 16, 2025
Merged

v2.2.1 hotfix#3562
thomasleese merged 9 commits intoreleasefrom
v2.2.1-hotfix

Conversation

@thomasleese
Copy link
Copy Markdown
Contributor

No description provided.

thomasleese and others added 9 commits May 15, 2025 19:19
This adds a new column on consents which records when the consent was
submitted, which in most cases is the same as when the consent was
created, but in the case of manually matching a consent form with a
patient, it'll be when the consent form was first submitted.
When creating a consent (either by automatic matching with a consent
form, manual matching with a consent form, or when recording a verbal
consent), this ensures that the `submitted_at` column is set
approriately.
This changes how we determine the most recent consent response from the
`created_at` to the `submitted_at`. In most cases these values will be
the same, but it's possible for a consent to be matched with a patient
manually which can occur some period of time after the consent was
submitted.

In particular, it's possible to manually match multiple consents in a
different order to when they were submitted, which can lead to bugs
where the patient is given the wrong consent status.
This is a more accurate representation of when the consent was submitted
rather than using the `created_at`.
Otherwise we always build from using the workflow ref, but tag using the
deploy sha.
This allows us to GET `/sha` to see which version of the code is
deployed to an env.
This gets used when checking out the terraform code in
"deploy-application", without it the workflow sha is always used.
Otherwise we always build from using the workflow ref, but tag using the
deploy sha.

This is a version of
#3549 that
we need as part of an emergency release. The original PR is already
merged in for the next release.
This changes how we determine the most recent consent response from the
`created_at` to the `submitted_at`. In most cases these values will be
the same, but it's possible for a consent to be matched with a patient
manually which can occur some period of time after the consent was
submitted.

In particular, it's possible to manually match multiple consents in a
different order to when they were submitted, which can lead to bugs
where the patient is given the wrong consent status.

This has been implemented by storing a `submitted_at` column on consent
responses, which has been done to ensure we don't hit performance issues
when filtering or ordering consents where we need to fetch the related
consent form.

[Jira Issue](https://nhsd-jira.digital.nhs.uk/browse/MAV-1196)
@sonarqubecloud
Copy link
Copy Markdown

@tvararu tvararu temporarily deployed to mavis-pr-3562 May 16, 2025 10:10 Inactive
@thomasleese thomasleese merged commit 5b9603a into release May 16, 2025
35 checks passed
@thomasleese thomasleese deleted the v2.2.1-hotfix branch May 16, 2025 12:28
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.

3 participants