Skip to content

Conversation

thomasleese
Copy link
Contributor

@thomasleese thomasleese commented Sep 5, 2025

This reworks the PatientLocation model to no longer have a direct association with a session and instead have a separate location_id and academic_year, which represents the equivalent information since that's all that is needed to get the sessions for the patient.

Jira Issue - MAV-1822

@thomasleese thomasleese added this to the v4.3.0 milestone Sep 5, 2025
@thomasleese thomasleese added the refactor Improving maintainability label Sep 5, 2025
@thomasleese thomasleese modified the milestones: v4.3.0, v4.4.0 Sep 5, 2025
@thomasleese thomasleese force-pushed the registration-status-patient-session-foreign-key branch from 84e8012 to 40cb5d1 Compare September 5, 2025 11:20
@thomasleese thomasleese force-pushed the patient-session-location branch from 2f7404d to 548419d Compare September 5, 2025 14:46
@thomasleese thomasleese modified the milestones: v4.4.0, v4.3.0 Sep 5, 2025
@thomasleese thomasleese force-pushed the registration-status-patient-session-foreign-key branch 2 times, most recently from b6f8b77 to d7db67d Compare September 5, 2025 16:23
@thomasleese thomasleese force-pushed the patient-session-location branch from 548419d to a156c4e Compare September 5, 2025 16:25
@thomasleese thomasleese force-pushed the registration-status-patient-session-foreign-key branch from d7db67d to b4d444e Compare September 7, 2025 18:58
@thomasleese thomasleese force-pushed the patient-session-location branch 3 times, most recently from 79f1fb6 to b1b02c5 Compare September 7, 2025 20:07
@thomasleese thomasleese force-pushed the registration-status-patient-session-foreign-key branch from b4d444e to 7a8f5b2 Compare September 8, 2025 07:58
@thomasleese thomasleese force-pushed the registration-status-patient-session-foreign-key branch 4 times, most recently from e9f4b3c to 03db68d Compare September 8, 2025 11:23
@thomasleese thomasleese modified the milestones: v4.3.0, v4.4.0 Sep 8, 2025
@thomasleese thomasleese force-pushed the registration-status-patient-session-foreign-key branch 2 times, most recently from 4222cb5 to 277f8b4 Compare September 8, 2025 16:56
@thomasleese thomasleese force-pushed the patient-session-location branch 2 times, most recently from 8c878a2 to a24bb38 Compare September 8, 2025 19:58
@thomasleese thomasleese force-pushed the registration-status-patient-session-foreign-key branch from 277f8b4 to 823515d Compare September 9, 2025 14:21
Base automatically changed from registration-status-patient-session-foreign-key to next September 9, 2025 14:37
@thomasleese thomasleese force-pushed the patient-session-location branch from a24bb38 to 33abc8f Compare September 9, 2025 18:13
@thomasleese thomasleese force-pushed the prepare-for-patient-session-replacement branch from c734b27 to dce4f97 Compare September 16, 2025 07:39
@thomasleese thomasleese force-pushed the patient-session-location branch from 4073ae3 to 5228f8f Compare September 16, 2025 07:39
thomasleese added a commit that referenced this pull request Sep 16, 2025
This builds on top of the refactoring work done in
#4526 which
unlocked the ability for clinic sessions to work in a similar way to
school sessions where there exists a session per group of programmes
(HPV, Flu, and Doubles).

This is more of a proof of concept for now, we don't know operationally
whether teams are more likely to use clinics per programme, or clinics
for all the programmes ("make every contact count").
@thomasleese thomasleese modified the milestones: v4.4.0, v4.2.1, v4.2.2 Sep 16, 2025
Base automatically changed from prepare-for-patient-session-replacement to next September 16, 2025 09:16
@thomasleese thomasleese force-pushed the patient-session-location branch from 5228f8f to ec2bfb9 Compare September 16, 2025 09:20
thomasleese added a commit that referenced this pull request Sep 16, 2025
This builds on top of the refactoring work done in
#4526 which
unlocked the ability for clinic sessions to work in a similar way to
school sessions where there exists a session per group of programmes
(HPV, Flu, and Doubles).

This is more of a proof of concept for now, we don't know operationally
whether teams are more likely to use clinics per programme, or clinics
for all the programmes ("make every contact count").
@thomasleese thomasleese force-pushed the patient-session-location branch 3 times, most recently from c440726 to bf7a210 Compare September 16, 2025 15:19
thomasleese added a commit that referenced this pull request Sep 16, 2025
This builds on top of the refactoring work done in
#4526 which
unlocked the ability for clinic sessions to work in a similar way to
school sessions where there exists a session per group of programmes
(HPV, Flu, and Doubles).

This is more of a proof of concept for now, we don't know operationally
whether teams are more likely to use clinics per programme, or clinics
for all the programmes ("make every contact count").
Copy link
Contributor

@jhenderson jhenderson left a comment

Choose a reason for hiding this comment

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

Good job. 👍

@thomasleese thomasleese force-pushed the patient-session-location branch from bf7a210 to c008fdb Compare September 17, 2025 10:50
This renames the `PatientSession` model to `PatientLocation` in
preparation for the next commit which will restructure the model to
remove the association to the session and instead link to a location and
an academic year.

Jira-Issue: MAV-1822
This reworks the `PatientLocation` model to no longer have a direct
association with a session and instead have a separate `location_id` and
`academic_year`, which represents the equivelant information since
that's all that is needed to get the sessions for the patient.

Jira-Issue: MAV-1822
This simplifies the lookups for patients and sessions by removing the
duplicate scopes between patient locations and patients, instead using
the scopes on the patient only, and making sure to filter out patients
who shouldn't belong in the session before we need to query for this.

Jira-Issue: MAV-1822
@thomasleese thomasleese force-pushed the patient-session-location branch from c008fdb to a007392 Compare September 17, 2025 11:08
@thomasleese thomasleese changed the base branch from next to v4.2.2-wip September 17, 2025 11:08
Copy link

@thomasleese thomasleese merged commit 6d5e946 into v4.2.2-wip Sep 17, 2025
13 checks passed
@thomasleese thomasleese deleted the patient-session-location branch September 17, 2025 11:27
thomasleese added a commit that referenced this pull request Sep 18, 2025
This builds on top of the refactoring work done in
#4526 which
unlocked the ability for clinic sessions to work in a similar way to
school sessions where there exists a session per group of programmes
(HPV, Flu, and Doubles).

This is more of a proof of concept for now, we don't know operationally
whether teams are more likely to use clinics per programme, or clinics
for all the programmes ("make every contact count").
thomasleese added a commit that referenced this pull request Sep 18, 2025
This builds on top of the refactoring work done in
#4526 which
unlocked the ability for clinic sessions to work in a similar way to
school sessions where there exists a session per group of programmes
(HPV, Flu, and Doubles).

This is more of a proof of concept for now, we don't know operationally
whether teams are more likely to use clinics per programme, or clinics
for all the programmes ("make every contact count").
thomasleese added a commit that referenced this pull request Sep 19, 2025
This builds on top of the refactoring work done in
#4526 which
unlocked the ability for clinic sessions to work in a similar way to
school sessions where there exists a session per group of programmes
(HPV, Flu, and Doubles).

This is more of a proof of concept for now, we don't know operationally
whether teams are more likely to use clinics per programme, or clinics
for all the programmes ("make every contact count").
thomasleese added a commit that referenced this pull request Sep 19, 2025
This builds on top of the refactoring work done in
#4526 which
unlocked the ability for clinic sessions to work in a similar way to
school sessions where there exists a session per group of programmes
(HPV, Flu, and Doubles).

This is more of a proof of concept for now, we don't know operationally
whether teams are more likely to use clinics per programme, or clinics
for all the programmes ("make every contact count").
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Improving maintainability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants