Skip to content

Paginate already in mavis on import results#6292

Merged
stevehook merged 5 commits intonextfrom
paginate-already-in-mavis-on-import-results
Mar 30, 2026
Merged

Paginate already in mavis on import results#6292
stevehook merged 5 commits intonextfrom
paginate-already-in-mavis-on-import-results

Conversation

@stevehook
Copy link
Copy Markdown
Contributor

@stevehook stevehook commented Mar 13, 2026

This PR is a follow-up to #6257 and adds pagination to the Records already in Mavis, Import issues and School moves lists.

It also includes a fix for a potential 1+N query caused by lazy loading SchoolMove#school_teams.

Jira-Issue: https://nhsd-jira.digital.nhs.uk/browse/MAV-4109

Screenshots

image image

Pre-release tasks

  • ...

Post-release tasks

  • ...

@stevehook stevehook force-pushed the paginate-import-results branch 3 times, most recently from 85303b7 to 8757469 Compare March 13, 2026 14:51
@stevehook stevehook force-pushed the paginate-already-in-mavis-on-import-results branch 2 times, most recently from f7447e5 to f8f6b88 Compare March 13, 2026 16:56
Comment thread app/controllers/cohort_imports_controller.rb
@stevehook stevehook marked this pull request as ready for review March 16, 2026 10:48
@stevehook stevehook requested a review from a team as a code owner March 16, 2026 10:48
@stevehook stevehook marked this pull request as draft March 16, 2026 19:00
@stevehook stevehook marked this pull request as ready for review March 17, 2026 16:55
@stevehook stevehook requested a review from misaka March 17, 2026 16:56
Comment thread app/models/patient.rb Outdated
@stevehook stevehook force-pushed the paginate-already-in-mavis-on-import-results branch from 8817f2b to 7f90700 Compare March 20, 2026 12:20
@stevehook stevehook force-pushed the paginate-import-results branch from 8757469 to be6b62c Compare March 20, 2026 13:06
Instead of manipulating query results as arrays to exclude patients that
have moved school I'm using a `NOT IN (<list of ids>)` condition.

I'm making an assumption here that the number of inter-school moves is
not huge (and this is borne out by an examination of historical imports
on prod).

Jira-Issue: MAV-4109
@stevehook stevehook force-pushed the paginate-already-in-mavis-on-import-results branch from 7f90700 to 72ba042 Compare March 20, 2026 13:33
@stevehook stevehook requested a review from misaka March 20, 2026 16:42
This makes adds the anchor that we scroll to when the page is refreshed
following a paging action. It also makes the detail component that
contains that list open on page refresh so that the page stays in more
or less the same state.

Jira-Issue: MAV-4109
We have seen a 1+N query being flagged by `strict_loading` in
`SchoolMove#from_another_team?` when displaying large datasets on the
review import pages. Eager loading the `Patient#school_moves:
:school_teams` associations fixes this and may help improve overall
performance.

Jira-Issue: MAV-4109
@stevehook stevehook force-pushed the paginate-already-in-mavis-on-import-results branch from 72ba042 to d52ac28 Compare March 23, 2026 15:25
Copy link
Copy Markdown
Collaborator

@misaka misaka left a comment

Choose a reason for hiding this comment

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

:shipit:

@thomasleese thomasleese added the feature New functionality label Mar 25, 2026
@thomasleese thomasleese added this to the v7.7.0 milestone Mar 25, 2026
Base automatically changed from paginate-import-results to next March 30, 2026 07:57
@stevehook stevehook merged commit 08f2fbd into next Mar 30, 2026
13 checks passed
@stevehook stevehook deleted the paginate-already-in-mavis-on-import-results branch March 30, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants