Skip to content

Drop patient programme status view#6376

Merged
mikejamesthompson merged 2 commits intonextfrom
improve-reporting-performance
Mar 19, 2026
Merged

Drop patient programme status view#6376
mikejamesthompson merged 2 commits intonextfrom
improve-reporting-performance

Conversation

@mikejamesthompson
Copy link
Copy Markdown
Contributor

The totals endpoint was running 17 separate COUNT queries against the patient programme status view. This replaces them with a single aggregate query against reporting_api_totals, drops the old view entirely, and removes response fields not consumed by the reporting app.

For monthly vaccination counts, we query VaccinationRecord directly.

Jira Issue - MAV-3406

@mikejamesthompson mikejamesthompson requested a review from a team as a code owner March 19, 2026 10:24
@mikejamesthompson mikejamesthompson added this to the v7.5.0 milestone 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.
@mikejamesthompson mikejamesthompson force-pushed the improve-reporting-performance branch from f95b190 to 04cd51c Compare March 19, 2026 13:07
@mikejamesthompson mikejamesthompson merged commit 6fca96d into next Mar 19, 2026
13 checks passed
@mikejamesthompson mikejamesthompson deleted the improve-reporting-performance branch March 19, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants