Skip to content

Conversation

thomasleese
Copy link
Contributor

@thomasleese thomasleese commented Sep 5, 2024

This adds the concept of draft/active to patient sessions, to support the immunisation import process. When we import patient sessions, we only want them to be active (and therefore shown in the UI) once the "Check and confirm" step has been completed. Currently this wasn't the case, which lead to patients being shown in the UI before the import had been confirmed.

I've also removed the unused state column from patient sessions, and made a number of general improvements to the factories.

This column isn't being used anywhere, and we calculate the state of
each session dynamically.
This adds a column to patient sessions for tracking which patient
sessions are active (i.e. from the import and should be shown in the UI)
and draft.
This makes a number of improvements to the patient session factory to
use the association feature rather than creating objects explicitly.

I've also removed the transiant user property and instead we can be
explicit about it being the created_by property.
When first importing immunisations we want the patient sessions to be
draft so they don't appear in any parts of the interface, until the
import is confirmed and then they are marked as active.

Without this, it's possible for a patient to appear in parts of the
system if the session already existed (and was active).
Draft patient sessions which may have been imported but not yet
confirmed shouldn't be shown anywhere yet.
@thomasleese thomasleese requested a review from a team as a code owner September 5, 2024 10:50
Copy link

sonarqubecloud bot commented Sep 5, 2024

@tvararu tvararu temporarily deployed to mavis-pr-1707 September 5, 2024 10:53 Inactive
@thomasleese thomasleese merged commit 3dc6cb3 into main Sep 5, 2024
11 checks passed
@thomasleese thomasleese deleted the draft-patient-sessions branch September 5, 2024 14:02
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.

2 participants