Files
Data_Visualisation_DMH/docs/PHASE2_3_ACCEPTANCE.md
T

2.6 KiB

Phase 2 & 3 Acceptance Verification Report

Scope: Access Control & Visualisation Engine

The One Rule That Matters Most

The browser never receives data the user is not allowed to see. All permission checks and all aggregations execute securely on the backend. The frontend sends a declarative JSON chart specification, which is validated and rewritten using whitelisted column objects and bound parameters.


Acceptance Criteria Checklist

# Acceptance Criterion Verification Method Status Verified Result
1 Super Admin queries overall aggregated dataset POST /api/v1/charts/query with kpi & bar PASSED Correctly aggregated 86,099 admissions. Top specialities: Oncology (18,536), Medicine (9,770), Ophthalmology (5,366).
2 Role-based row rule enforcement on server Query as dept_manager (AdmittingDoctorSpecialityName = 'MEDICINE') PASSED Only returns Medicine department admissions (9,770). All other departments filtered out on database query.
3 Role-based row rule enforcement for Finance Query as finance_user (PatientCategoryName = 'TPA') PASSED Only returns TPA insured admissions (32,056). Cash/GNL records excluded.
4 Sensitive column masking Attempt to query mrdNumber or AdmittingDoctorName as standard viewer PASSED Server immediately rejects query with HTTP 403 Forbidden ("Access to column is restricted").
5 Parameterized Core queries (No SQL injection) Client filters compiled via SQLAlchemy Core bound parameters PASSED No string interpolation or f-strings. All columns verified against whitelisted schema.
6 Super Admin "Preview As" capability Query with ?preview_role=department_manager or ?preview_role=finance PASSED Super Admin dynamically simulates restricted user and role views with live UI badge.
7 Core hospital charts rendered via Apache ECharts Full dashboard with 5 visualisations & 4 KPI cards PASSED Bar chart (Specialities), Donut (Buildings), Monthly Trend Area (2025), Pie (Admission Categories), Stacked Bar (Payer mix x Gender).
8 Dynamic and permission-scoped filter options GET /api/v1/charts/filter-options/{id} PASSED Filter dropdown options only include values permitted under active user rules.
9 Backend automated test suite pytest in backend PASSED 25 out of 25 unit tests passed in 7.27s.
10 Frontend production compilation npm run build in frontend PASSED TypeScript strictly compiled into production bundle in dist/ with zero errors.