refactor(reports): standardise names, flatten admin (reports+datasets), gate sensitive reports (2.50.11)#522
refactor(reports): standardise names, flatten admin (reports+datasets), gate sensitive reports (2.50.11)#522julianam-w wants to merge 7 commits into
Conversation
…ames, require root-level name (2.50.11)
Brings report structure and naming in line with the convention adopted on
2.45/2.49/2.54 and makes a root-level `name` mandatory.
Flatten admin -> standard (config + sql):
- move all 14 models/reports/{config,sql}/admin/admin-* reports into
standard/, dropping the `admin-` prefix
- drop the now-unused reports `admin` tag block from dbt_project.yml
(the datasets `admin` tag block is unaffected)
Renames (config + sql, standard + sensitive):
- (admin) audit-patient-details-edits-line-list -> audit-patient-details-edit
- (admin) audit-patient-views-line-list -> audit-patient-views
- audit-outpatient-appointments-line-list -> audit-outpatient-appointments
- user-audit-report -> user-audit-line-list
Report names:
- add missing root-level `name` (deceased-patients-line-list,
incomplete-referrals, registered-patients-by-dob-line-list,
audit-outpatient-appointments)
- normalise display names (sentence case; drop "Current"/"report";
"Registered birth" -> "Registered births"); sensitive = "Sensitive <standard>"
Schema/docs:
- report-config-schema.json: root `name` now required (minLength 1);
queryOptions.name marked deprecated
- tamanu-report-configuration-schema.md: document required root `name`,
add Recommended Field Ordering, flag nested name as legacy, fix example
- validate_report_configs.py: recurse into standard/sensitive subfolders
(rglob) so configs are actually validated
Version/deps:
- bump 2.50.10 -> 2.50.11 (dbt_project.yml, pyproject.toml)
- dbt_utils 1.3.3 -> 1.4.0
list_tamanu_reports.md regenerated; all 58 report configs validate.
Compiled assets (compiled/v2.50.11) to be regenerated via the release build.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Folder-only move of all 23 models/datasets/admin/* files into models/datasets/standard/, and drop the now-dead datasets `admin` tag block from dbt_project.yml. Model names (ds__*) are unchanged, so ref()s are unaffected; the models lose the path-based dbt `admin` tag. Internal yml metadata (meta.domain, tags) is left untouched. Rides on the pending version bump (compiled assets regenerated by the release build). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…(false) Ports PR #425 to this branch so sensitive (restricted-tagged) reports are not emitted by default. - dbt_project.yml: add `has_sensitive_facility: false` var - report_utils.py: exclude `restricted`-tagged nodes from generate_project_reports() and generate_reporting_schema_script() when the flag is false (read from dbt_project.yml via get_dbt_project_vars()) - README: document the flag Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Claude finished @julianam-w's task in 5m 25s —— View job PR Review: standardise report names, flatten admin, gate sensitive reports✅ Verdict: looks good to merge — well-structured, low-risk refactor (mostly renames + a cleanly-documented gating feature). 0 blockers in source code, 1 action-required on the build artifacts (already acknowledged in the PR body), a few minor suggestions.
Findings🟡 1. Compiled assets predate the gating commit (action required before release)You already flagged this in the PR body, but it's the most important item so I'm surfacing it. 🟢 2. Root-level
|
Overview
The largest of the set — 2.50 still had the old
admin/report folder. Flattens reports and datasets intostandard/, standardises report naming, requires a root-levelname, and disables sensitive reports by default. Bumps to 2.50.11.Changes
Flatten admin reports + standardise names + root-level
name(536bb36)models/reports/{config,sql}/admin/admin-*(14 reports) →standard/, dropping theadmin-prefix; removed the reportsadmintag block fromdbt_project.yml.audit-patient-details-edits-line-list→audit-patient-details-edit,audit-patient-views-line-list→audit-patient-views,audit-outpatient-appointments-line-list→audit-outpatient-appointments,user-audit-report→user-audit-line-list(+sensitive-counterparts).nameand normalised display names (sentence case; dropped "Current"/"report"; "Registered birth" → "Registered births"; sensitive = "Sensitive ").namenow required; legacyqueryOptions.namedeprecated. Docs updated.validate_report_configs.pyrecurses subfolders (rglob).2.50.10→2.50.11;dbt_utils1.3.3→1.4.0.Flatten admin datasets (
7b43532)models/datasets/admin/*intomodels/datasets/standard/; dropped the datasetsadmintag block. Model names unchanged.Gate sensitive reports (
540ce13)has_sensitive_facility: falsevar +report_utils.pygating + README. Sensitive (restricted) reports no longer emitted by default.Also includes compiled-asset build commits (
Update) and a.mauisubmodule bump made on the branch.Verification
validate_report_configs.py→ all 58 report configs valid.Note
The compiled
Updatecommits were built before thehas_sensitive_facilitygate (540ce13) was added, so the bundledcompiled/v2.50.11may still include sensitive reports. Re-runscripts/build_reporting_assets.pywith the flag in place to refresh.🤖 Generated with Claude Code