Drop patient programme status view#6376
Merged
mikejamesthompson merged 2 commits intonextfrom Mar 19, 2026
Merged
Conversation
thomasleese
approved these changes
Mar 19, 2026
Replace 17 individual COUNT queries with a single with_aggregate_metrics call. Query VaccinationRecord directly for vaccinations_given/monthly. Remove dependency on PatientProgrammeStatus materialized view. Drop API response fields not consumed by any reporting app template: vaccinated_by_sais, vaccinated_elsewhere_*, vaccinated_previously, parent_refused_consent, child_refused_vaccination, refusal_reasons, consent_routes, and flu-specific detail fields.
Drop the reporting_api_patient_programme_statuses view, model, SQL files, and update the refresh job. All reporting data now comes from reporting_api_totals + direct VaccinationRecord queries.
f95b190 to
04cd51c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The totals endpoint was running 17 separate
COUNTqueries against the patient programme status view. This replaces them with a single aggregate query againstreporting_api_totals, drops the old view entirely, and removes response fields not consumed by the reporting app.For monthly vaccination counts, we query
VaccinationRecorddirectly.Jira Issue - MAV-3406