Skip to content

Conversation

thomasleese and others added 25 commits September 17, 2025 12:02
This fixes an issue where some vaccination records are currently invalid
as they have both a `location_id` and a `location_name`.

Jira-Issue: MAV-2016
Add `data_migrations:fix_vaccination_records_location`
These have all been run in our deployed environments so we can safely
remove the migrations.
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
- Prevent frequently querying database for infrequently changing results
Introduce a rails cache for web server
…less_redis

Add serverless elasticache deployment permissions
- Was only endpoint address but lacking protocol
This will be used to configure Rails caching using Redis.

Jira-Issue: MAV-2006
This enables the use of Redis as a backend for the Rails cache, allowing
for the cache to be distributed across the various web instances.

Jira-Issue: MAV-2006
This adds a service class which is responsible for displaying counts in
the headers and navigation bar. At the moment, this just refactors the
existing code to use this class, but it allows us in the future to cache
these values and improve performance.

Jira-Issue: MAV-2006
This updates `TeamCachedCounts` to cache the values in the header to
ensure a more performant page load instead of needing to query the
latest information from the database each time.

Jira-Issue: MAV-2006
- For invalidating caches

JIRA Ticket: MAV-2006
This should have an improvement on performance, avoiding the need to
compare the entire result set. Due to the size of the set, it's unlikely
to be able to use a hash and instead performs a sequential scan.

Jira-Issue: MAV-2004
This makes a number of small improvements to the queries to improve
performance and fix an issue with the session counts.
@thomasleese thomasleese requested review from a team as code owners September 17, 2025 21:34
Copy link

@thomasleese thomasleese merged commit c696c06 into next Sep 18, 2025
13 checks passed
@thomasleese thomasleese deleted the v4.2.2-wip branch September 18, 2025 07:37
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