brand: remove all poona references and standardize on XYZ Hospital
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Poona Hospital AMS — Acceptance Checklist & UAT Sign-Off Matrix (Proposal §10)
|
||||
# XYZ Hospital AMS — Acceptance Checklist & UAT Sign-Off Matrix (Proposal §10)
|
||||
|
||||
This matrix maps the requirements defined in Section 10 ("Acceptance Criteria") of the Poona Hospital Asset Management System Proposal (Draft 1.0) to automated regression test suites, manual verification steps, and formal User Acceptance Testing (UAT) sign-off fields.
|
||||
This matrix maps the requirements defined in Section 10 ("Acceptance Criteria") of the XYZ Hospital Asset Management System Proposal (Draft 1.0) to automated regression test suites, manual verification steps, and formal User Acceptance Testing (UAT) sign-off fields.
|
||||
|
||||
---
|
||||
|
||||
@@ -8,29 +8,29 @@ This matrix maps the requirements defined in Section 10 ("Acceptance Criteria")
|
||||
|
||||
| # | Acceptance Criterion | Automated Test Coverage | Manual Verification Steps | UAT Status | Verified Date | Sign-Off / Approver |
|
||||
|:---:|---|---|---|:---:|:---:|---|
|
||||
| **1** | **Auth, 5-Role RBAC, Masters & Settings** (`system_admin`, `biomedical`, `department_user`, `management`, `coordinator`, JWT auth, login rate limiting, configurable settings, audit logs) | `backend/tests/test_auth_and_permissions.py`<br>`backend/tests/test_phase8_polish.py`<br>`frontend/src/test/login.test.tsx`<br>`frontend/src/test/permissions.test.ts`<br>`frontend/src/test/smoke.test.tsx` | Log in with all 5 demo accounts (`Demo@123`), confirm role-filtered sidebar items, test `/masters` & `/settings` CRUD as `admin@poona.demo`, confirm `/audit-logs` returns `403` for non-admins, and trigger >15 rapid failed logins to observe `429`. | `[Pass]` | 13-Nov-2026 | Biomedical Head / IT Lead |
|
||||
| **2** | **Asset Register, Global Quick Search & Secure Attachments** (unique `asset_code`, department scoping, coordinator edit restrictions, `AssetPicker`, `/api/search`, JPG/PNG/PDF magic-byte + 10 MB checks, bulk import) | `backend/tests/test_assets_and_attachments.py`<br>`backend/tests/test_asset_bulk_import.py`<br>`backend/tests/test_phase8_polish.py`<br>`frontend/src/test/asset-picker.test.tsx`<br>`frontend/src/test/bulk-import.test.tsx` | Create/edit an asset on `/assets`, confirm duplicate code returns `409`, verify `dept@poona.demo` sees ICU assets only, search in TopBar to jump to asset/complaint detail, bulk import sample `.xlsx`, and upload attachments. | `[Pass]` | 13-Nov-2026 | Biomedical Engineer |
|
||||
| **3** | **Breakdown & Complaint Workflow + Downtime Calculation** (sequential `complaint_no`, response time, `clip_downtime_to_month`, assign/attend/restore/close/reopen syncing `Asset.status`, role-gated technical fields, required closure remarks) | `backend/tests/test_complaints.py`<br>`backend/tests/test_time_utils.py`<br>`frontend/src/test/complaint-detail.test.tsx` | Raise a complaint via `AssetPicker`, verify `dept@poona.demo` sees Technical read-only lock, complete repair workflow as `bio@poona.demo`, verify `Asset.status` returns to `in_service`, and verify close without restore halts downtime. | `[Pass]` | 13-Nov-2026 | Clinical Coordinator |
|
||||
| **4** | **Preventive Maintenance & Calibration Schedules** (in-house & outsourced PM, dynamic `upcoming`/`due`/`overdue` vs `effective_today()`, clamped `add_months`, calibration approval gate, certificate upload, PM service reports) | `backend/tests/test_pm_and_calibration.py`<br>`frontend/src/test/pm-page.test.tsx`<br>`frontend/src/test/calibration-page.test.tsx` | Toggle Table and Calendar views on `/pm`, complete & reschedule cycles, verify `bio@poona.demo` receives `403` on calibration approval while `mgmt@poona.demo` can approve, and upload calibration & PM reports. | `[Pass]` | 13-Nov-2026 | Biomedical Head |
|
||||
| **1** | **Auth, 5-Role RBAC, Masters & Settings** (`system_admin`, `biomedical`, `department_user`, `management`, `coordinator`, JWT auth, login rate limiting, configurable settings, audit logs) | `backend/tests/test_auth_and_permissions.py`<br>`backend/tests/test_phase8_polish.py`<br>`frontend/src/test/login.test.tsx`<br>`frontend/src/test/permissions.test.ts`<br>`frontend/src/test/smoke.test.tsx` | Log in with all 5 demo accounts (`Demo@123`), confirm role-filtered sidebar items, test `/masters` & `/settings` CRUD as `admin@xyz.demo`, confirm `/audit-logs` returns `403` for non-admins, and trigger >15 rapid failed logins to observe `429`. | `[Pass]` | 13-Nov-2026 | Biomedical Head / IT Lead |
|
||||
| **2** | **Asset Register, Global Quick Search & Secure Attachments** (unique `asset_code`, department scoping, coordinator edit restrictions, `AssetPicker`, `/api/search`, JPG/PNG/PDF magic-byte + 10 MB checks, bulk import) | `backend/tests/test_assets_and_attachments.py`<br>`backend/tests/test_asset_bulk_import.py`<br>`backend/tests/test_phase8_polish.py`<br>`frontend/src/test/asset-picker.test.tsx`<br>`frontend/src/test/bulk-import.test.tsx` | Create/edit an asset on `/assets`, confirm duplicate code returns `409`, verify `dept@xyz.demo` sees ICU assets only, search in TopBar to jump to asset/complaint detail, bulk import sample `.xlsx`, and upload attachments. | `[Pass]` | 13-Nov-2026 | Biomedical Engineer |
|
||||
| **3** | **Breakdown & Complaint Workflow + Downtime Calculation** (sequential `complaint_no`, response time, `clip_downtime_to_month`, assign/attend/restore/close/reopen syncing `Asset.status`, role-gated technical fields, required closure remarks) | `backend/tests/test_complaints.py`<br>`backend/tests/test_time_utils.py`<br>`frontend/src/test/complaint-detail.test.tsx` | Raise a complaint via `AssetPicker`, verify `dept@xyz.demo` sees Technical read-only lock, complete repair workflow as `bio@xyz.demo`, verify `Asset.status` returns to `in_service`, and verify close without restore halts downtime. | `[Pass]` | 13-Nov-2026 | Clinical Coordinator |
|
||||
| **4** | **Preventive Maintenance & Calibration Schedules** (in-house & outsourced PM, dynamic `upcoming`/`due`/`overdue` vs `effective_today()`, clamped `add_months`, calibration approval gate, certificate upload, PM service reports) | `backend/tests/test_pm_and_calibration.py`<br>`frontend/src/test/pm-page.test.tsx`<br>`frontend/src/test/calibration-page.test.tsx` | Toggle Table and Calendar views on `/pm`, complete & reschedule cycles, verify `bio@xyz.demo` receives `403` on calibration approval while `mgmt@xyz.demo` can approve, and upload calibration & PM reports. | `[Pass]` | 13-Nov-2026 | Biomedical Head |
|
||||
| **5** | **Contracts, Warranties, Insurance, Demo Equipment & Department Visits** (contract renewal superseding & history, warranty/insurance expiry chips, `InsuranceDrawer`, demo return tracking with serial number, visit rounds) | `backend/tests/test_phase5_modules.py`<br>`frontend/src/test/phase5-modules.test.tsx` | Renew a contract on `/contracts` and check history chain, open `InsuranceDrawer` from `AssetDetailPage`, mark demo equipment returned on `/demo-equipment`, and log a multi-asset visit with observations on `/visits`. | `[Pass]` | 13-Nov-2026 | Hospital Administrator |
|
||||
| **6** | **Automated Alert Engine & Notifications** (8 alert types, dedupe keys, per-user read state, TopBar bell polling, `CalibrationReminderModal`, Demo Clock `demo_as_of_date`, SLA breach alert) | `backend/tests/test_notifications_and_dashboard.py`<br>`frontend/src/test/phase6-modules.test.tsx` | Advance TopBar Demo Clock (+20 days) as `admin@poona.demo`, run alert check in `/settings`, confirm new notifications appear without duplicates on second run, mark read per user, and check login reminder pop-up. | `[Pass]` | 13-Nov-2026 | IT Lead |
|
||||
| **7** | **Hospital Operations Dashboard** (role-aware department scope banner, 7 clickable KPI cards, 4 Recharts charts, Needs Attention & Recent Complaints) | `backend/tests/test_notifications_and_dashboard.py`<br>`frontend/src/test/phase6-modules.test.tsx` | Compare `/` as `mgmt@poona.demo` (hospital-wide) vs `dept@poona.demo` (ICU-scoped) and verify KPI navigation, responsive chart tooltips, and click-through filters. | `[Pass]` | 13-Nov-2026 | Medical Superintendent |
|
||||
| **8** | **8 Operational Reports, Excel Exports & A4 Print** (8 report keys, 3-complaint downtime reconciliation, `daily-visit` RBAC `403`, openpyxl `.xlsx` & SheetJS export, `@media print`) | `backend/tests/test_reports.py`<br>`frontend/src/test/reports.test.tsx` | Open `/reports`, verify `daily-visit` is hidden/`403` for `dept@poona.demo`, inspect Monthly Maintenance `"How this is calculated"` formula popover, download `.xlsx` spreadsheets, and open Print Preview. | `[Pass]` | 13-Nov-2026 | Finance / Operations Head |
|
||||
| **6** | **Automated Alert Engine & Notifications** (8 alert types, dedupe keys, per-user read state, TopBar bell polling, `CalibrationReminderModal`, Demo Clock `demo_as_of_date`, SLA breach alert) | `backend/tests/test_notifications_and_dashboard.py`<br>`frontend/src/test/phase6-modules.test.tsx` | Advance TopBar Demo Clock (+20 days) as `admin@xyz.demo`, run alert check in `/settings`, confirm new notifications appear without duplicates on second run, mark read per user, and check login reminder pop-up. | `[Pass]` | 13-Nov-2026 | IT Lead |
|
||||
| **7** | **Hospital Operations Dashboard** (role-aware department scope banner, 7 clickable KPI cards, 4 Recharts charts, Needs Attention & Recent Complaints) | `backend/tests/test_notifications_and_dashboard.py`<br>`frontend/src/test/phase6-modules.test.tsx` | Compare `/` as `mgmt@xyz.demo` (hospital-wide) vs `dept@xyz.demo` (ICU-scoped) and verify KPI navigation, responsive chart tooltips, and click-through filters. | `[Pass]` | 13-Nov-2026 | Medical Superintendent |
|
||||
| **8** | **8 Operational Reports, Excel Exports & A4 Print** (8 report keys, 3-complaint downtime reconciliation, `daily-visit` RBAC `403`, openpyxl `.xlsx` & SheetJS export, `@media print`) | `backend/tests/test_reports.py`<br>`frontend/src/test/reports.test.tsx` | Open `/reports`, verify `daily-visit` is hidden/`403` for `dept@xyz.demo`, inspect Monthly Maintenance `"How this is calculated"` formula popover, download `.xlsx` spreadsheets, and open Print Preview. | `[Pass]` | 13-Nov-2026 | Finance / Operations Head |
|
||||
| **9** | **Duplicate Record & Import Conflict Prevention (Task 1)** (exact duplicate contracts rejected with `409`, duplicate insurance policies rejected with `409`, duplicate calibration plans per asset rejected, in-file duplicate row errors) | `backend/tests/test_task1_duplicates.py` | Import same contract/insurance/calibration file twice; verify row-level duplicate errors and HTTP `409` conflict responses on direct creations. | `[Pass]` | 17-Nov-2026 | IT Lead / QA |
|
||||
| **10** | **Import Template Multi-Sheet Structure (Task 2)** (empty headers-only Sheet 1, sample data moved to Sheet 2 with warning banner, all 4 importers reading strictly Sheet 1) | `backend/tests/test_task2_templates.py` | Download fresh templates from UI, dry-run upload unchanged templates; confirm `total_rows == 0` and zero sample records imported. | `[Pass]` | 17-Nov-2026 | Biomedical Engineer |
|
||||
| **11** | **Backup Path Resolution & Packaging (Task 3)** (robust SQLite URI parsing across 3-slash and 4-slash formats, dual `.tar.gz` and `.zip` archive support with `ams.db` and `db.sqlite3` aliases) | `backend/tests/test_backup_paths.py` | Run `python scripts/backup.py` with custom relative and absolute `DATABASE_URL` values; inspect output archive integrity. | `[Pass]` | 17-Nov-2026 | IT Lead |
|
||||
| **12** | **Universal Password Policy (Task 4)** (8-128 chars, at least one letter and digit, no leading/trailing space `422`, blocklist common passwords, username containment check) | `backend/tests/test_task4_passwords.py` | Attempt setting short, all-number, spaced, or username-containing passwords across user create, edit, change-password, and reset. | `[Pass]` | 17-Nov-2026 | IT Security |
|
||||
| **13** | **Admin Reset-Password Screen (Task 5)** (`system_admin` reset password modal in `/masters`, show/hide toggles, mismatch validation, 422 display, zero admin session disruption) | `frontend/src/test/admin-reset-password.test.tsx` | Log in as `admin@poona.demo`, open Masters > Users, click "Reset password", verify mismatch error, submit valid password, check toast. | `[Pass]` | 17-Nov-2026 | System Administrator |
|
||||
| **13** | **Admin Reset-Password Screen (Task 5)** (`system_admin` reset password modal in `/masters`, show/hide toggles, mismatch validation, 422 display, zero admin session disruption) | `frontend/src/test/admin-reset-password.test.tsx` | Log in as `admin@xyz.demo`, open Masters > Users, click "Reset password", verify mismatch error, submit valid password, check toast. | `[Pass]` | 17-Nov-2026 | System Administrator |
|
||||
| **14** | **Department User Scoping & Empty Scope Resolution (Task 6)** (unassigned `department_user` gets all-zero dashboard, empty search, 0 report rows; assigned user cannot widen scope via query params) | `backend/tests/test_task6_scoping.py` | Create department user with `department_id=None`; verify `/api/dashboard/summary`, `/api/search`, and reports return zero items. | `[Pass]` | 17-Nov-2026 | QA Lead |
|
||||
| **15** | **Token Versioning & Session Invalidation (Task 7)** (`token_version` column on users, `"tv"` JWT claim, invalidation on password change and admin reset, automatic session retention on change) | `backend/tests/test_task7_token_version.py` | Log in as user, change password, confirm old token gets `401`; reset user password as admin, confirm user token gets `401`. | `[Pass]` | 17-Nov-2026 | IT Security |
|
||||
| **16** | **Delivery Cleanliness & Packaging Target (Task 8)** (`.gitattributes` enforcing LF line endings, `.gitignore` ignoring databases/backups/dist/tsbuildinfo, `make package` generating clean delivery zip) | `backend/tests/test_task8_delivery.py` | Run `make package`; inspect `../poona-ams-delivery.zip` to confirm zero `.db`, `dist/`, or `__pycache__` files present. | `[Pass]` | 17-Nov-2026 | Release Engineer |
|
||||
| **17** | **Cost Inputs, Migrations, Role Stripping & Seed Data (AI Task 1)** (new nullable cost columns on assets/categories/contracts/PM/complaints, SQLite auto-migration, 9 AI/cost settings, role-stripped cost fields for `department_user`, bulk import templates) | `backend/tests/test_ai1_cost_inputs.py` | Verify cost fields save on Asset/Contract/PM/Complaint forms, confirm `dept@poona.demo` receives no cost keys in API JSON, and verify `coord@poona.demo` can edit `contract_value` only. | `[Pass]` | 18-Nov-2026 | Biomedical Head / IT Lead |
|
||||
| **16** | **Delivery Cleanliness & Packaging Target (Task 8)** (`.gitattributes` enforcing LF line endings, `.gitignore` ignoring databases/backups/dist/tsbuildinfo, `make package` generating clean delivery zip) | `backend/tests/test_task8_delivery.py` | Run `make package`; inspect `../xyz-ams-delivery.zip` to confirm zero `.db`, `dist/`, or `__pycache__` files present. | `[Pass]` | 17-Nov-2026 | Release Engineer |
|
||||
| **17** | **Cost Inputs, Migrations, Role Stripping & Seed Data (AI Task 1)** (new nullable cost columns on assets/categories/contracts/PM/complaints, SQLite auto-migration, 9 AI/cost settings, role-stripped cost fields for `department_user`, bulk import templates) | `backend/tests/test_ai1_cost_inputs.py` | Verify cost fields save on Asset/Contract/PM/Complaint forms, confirm `dept@xyz.demo` receives no cost keys in API JSON, and verify `coord@xyz.demo` can edit `contract_value` only. | `[Pass]` | 18-Nov-2026 | Biomedical Head / IT Lead |
|
||||
| **18** | **AMC/CMC Auto-Tagging & Outsourced PM Auto-Fill (AI Task 2)** (precedence warranty > CMC > AMC > OTHER > out_of_contract, complaint registration snapshot + timeline event, outsourced PM auto-fill, `CoverageBadge` + vendor call tooltip) | `backend/tests/test_ai2_coverage_tagging.py` | Open `/assets`, `/complaints`, and `/pm` to confirm color-coded `CoverageBadge` and `"Call: <vendor>, <contact>"` tooltip; raise a complaint and verify `coverage_at_registration` snapshot; filter complaints by `coverage_tag`. | `[Pass]` | 18-Nov-2026 | Biomedical Engineer |
|
||||
| **19** | **Pure-Python AI Metrics Engine (AI Task 3)** (SLM & WDV depreciation, lifetime cost analysis, 3-scenario in-house/outsourced/rent comparison with CMC spare exclusion, breakdown frequency, weighted efficiency score, stable evidence IDs) | `backend/tests/test_ai3_metrics.py` | Validate worked examples (₹10L 10-yr SLM/WDV, 5-yr comparison ₹7.75L/₹9.75L/₹9.0L), missing inputs returning `"Insufficient data: <input>"`, rented assets, and Demo Clock responsiveness. | `[Pass]` | 18-Nov-2026 | Finance / Operations Head |
|
||||
| **20** | **Rule-Based Suggestions Engine S1–S8 (AI Task 4)** (deterministic S1–S8 rules, red/yellow/info severity ranking, verified evidence IDs, neutral advisory wording ending with `"Needs a human decision."`) | `backend/tests/test_ai4_suggestions.py` | Inspect top Suggestions panel on `/reports/ai` against seeded DB; confirm ≥3 S1 repeat-failure and ≥2 S4 replacement-review suggestions sorted red → yellow → info. | `[Pass]` | 18-Nov-2026 | Medical Superintendent |
|
||||
| **21** | **Local AI Provider Layer, Grounding Validator, Privacy & Cache (AI Task 5)** (`NoneProvider`, `OllamaProvider`, `OpenAICompatibleProvider`, 0.5% numeric grounding & banned-word validator with 1 retry + fallback, zero PII/free text in prompts, `ai_summaries` cache + audit log) | `backend/tests/test_ai5_narrative.py` | Verify default `AI_PROVIDER=none` produces rule-based summaries; test fake provider invented numbers, unknown metric IDs, broken JSON, timeouts, cache hit/invalidation, and prompt PII absence. | `[Pass]` | 18-Nov-2026 | IT Security / IT Lead |
|
||||
| **22** | **AI Reporting API & 3-Sheet Excel/CSV Exports (AI Task 6)** (`/api/ai/status`, `summary`, `comparison`, `depreciation`, `efficiency`, `breakdown-frequency`, `suggestions`, admin-only `narrative/regenerate`, styled 3-sheet `.xlsx` + `.csv` exports) | `backend/tests/test_ai6_api.py` | Verify `dept@poona.demo` receives `403` on all `/api/ai/*` routes, non-admins get `403` on regenerate, and downloaded `.xlsx` workbooks contain Main + `Evidence` + `How calculated` sheets. | `[Pass]` | 18-Nov-2026 | QA Lead |
|
||||
| **23** | **AI Report UI, Reports Toggle & Settings Group (AI Task 7)** (`ReportsPage` `"Simple reports | AI report"` toggle hidden for `department_user`, `AIReportPage` 4 numbered sections + charts + Evidence + How calculated + admin Regenerate, `SettingsPage` `"AI and cost analysis"` group) | `frontend/src/test/ai-report.test.tsx` | Toggle between Simple and AI reports as `mgmt@poona.demo` and `admin@poona.demo`; confirm `dept@poona.demo` sees no toggle; verify charts, grey `"Insufficient data"` cells, and Settings AI status panel. | `[Pass]` | 18-Nov-2026 | Hospital Administrator |
|
||||
| **22** | **AI Reporting API & 3-Sheet Excel/CSV Exports (AI Task 6)** (`/api/ai/status`, `summary`, `comparison`, `depreciation`, `efficiency`, `breakdown-frequency`, `suggestions`, admin-only `narrative/regenerate`, styled 3-sheet `.xlsx` + `.csv` exports) | `backend/tests/test_ai6_api.py` | Verify `dept@xyz.demo` receives `403` on all `/api/ai/*` routes, non-admins get `403` on regenerate, and downloaded `.xlsx` workbooks contain Main + `Evidence` + `How calculated` sheets. | `[Pass]` | 18-Nov-2026 | QA Lead |
|
||||
| **23** | **AI Report UI, Reports Toggle & Settings Group (AI Task 7)** (`ReportsPage` `"Simple reports | AI report"` toggle hidden for `department_user`, `AIReportPage` 4 numbered sections + charts + Evidence + How calculated + admin Regenerate, `SettingsPage` `"AI and cost analysis"` group) | `frontend/src/test/ai-report.test.tsx` | Toggle between Simple and AI reports as `mgmt@xyz.demo` and `admin@xyz.demo`; confirm `dept@xyz.demo` sees no toggle; verify charts, grey `"Insufficient data"` cells, and Settings AI status panel. | `[Pass]` | 18-Nov-2026 | Hospital Administrator |
|
||||
| **24** | **Demo Data Verification, Docs & Full Regression Clean Run (AI Task 8)** (fresh seeded DB validation across all roles, all 8 operational + 5 AI exports HTTP 200 in xlsx & csv, updated docs/README) | Full backend `pytest` + frontend `tsc`, `eslint`, `vitest`, `build` + export script | Run fresh seed, verify all endpoints as all 5 roles with `AI_PROVIDER=none`, verify all 13 reports export HTTP 200 in `.xlsx` and `.csv`, review updated docs. | `[Pass]` | 18-Nov-2026 | Release Engineer |
|
||||
|
||||
---
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
# Assumptions Log — Poona Hospital AMS
|
||||
# Assumptions Log — XYZ Hospital AMS
|
||||
|
||||
Items marked "to be confirmed" or left flexible in the proposal are recorded here along with the configurable defaults implemented in Phase 1.
|
||||
|
||||
@@ -52,7 +52,7 @@ Items marked "to be confirmed" or left flexible in the proposal are recorded her
|
||||
28. **Admin Reset Password Interface (Task 5)**: `frontend/src/api/users.ts` and `frontend/src/pages/MastersPage.tsx` expose an administrator password reset modal for users with role `system_admin`. The dialog features password masking toggles, client-side mismatch validation (`Passwords do not match`), universal password policy helper instructions, and displays backend 422 validation errors inline. Successful resets trigger a notification toast and close the modal without affecting the active administrator session.
|
||||
29. **Department User Scoping & Empty Scope Resolution (Task 6)**: `backend/app/services/scoping.py` implements `resolve_department_scope(user, requested_dept_id)`. Non-department roles are unconstrained and may optionally filter by `requested_dept_id`. Assigned `department_user` accounts are strictly bound to `user.department_id`, ignoring any client-requested department parameter. Unassigned `department_user` accounts (`department_id=None`) resolve to `is_empty=True`, immediately returning 0 counters on Dashboard summary, empty results on global search, and empty row lists across all accessible report endpoints without running hospital-wide queries. Report key aliases are registered to support both canonical paths and audit identifiers (e.g., `equipment-inventory`, `condemned-equipment`, `pm-schedule`).
|
||||
30. **Token Versioning & Session Invalidation (Task 7)**: A `token_version` integer column (default 0, not null) is added to `users` and reconciled automatically via `run_sqlite_migrations`. Access tokens encode the user's `token_version` in claim `"tv"`. `get_current_user` rejects tokens with mismatched `"tv"` with HTTP 401 (`Token has been invalidated. Please log in again.`). Password changes and administrator password resets increment `user.token_version`, invalidating previous tokens. `POST /api/auth/change-password` returns a renewed access token, and `ChangePasswordModal.tsx` stores the new token in the active auth store to keep the user's session active without re-login.
|
||||
31. **Delivery Cleanliness, Line Endings & Packaging (Task 8)**: `.gitattributes` enforces standard LF line endings across the repository (`* text=auto eol=lf`). `.gitignore` excludes all SQLite databases (`*.db`), backups, volatile uploads, frontend dist artifacts, and build info files. The `make package` target generates `../poona-ams-delivery.zip` using `git archive` to ensure zero uncommitted, ignored, or temporary files leak into handoff archives.
|
||||
31. **Delivery Cleanliness, Line Endings & Packaging (Task 8)**: `.gitattributes` enforces standard LF line endings across the repository (`* text=auto eol=lf`). `.gitignore` excludes all SQLite databases (`*.db`), backups, volatile uploads, frontend dist artifacts, and build info files. The `make package` target generates `../xyz-ams-delivery.zip` using `git archive` to ensure zero uncommitted, ignored, or temporary files leak into handoff archives.
|
||||
32. **Cost Fields & Role-Based Stripping (AI Task 1)**: The fields `purchase_value`, `monthly_rent`, `contract_value`, `cost_per_visit`, `repair_cost`, and `spare_cost_estimate` are classified as cost fields. For `department_user`, these keys are completely stripped from JSON responses across `/api/assets`, `/api/contracts`, `/api/pm/schedules`, and `/api/complaints` via `maybe_strip_costs_response`. For contract bulk imports, both the canonical `contract_value` header and legacy `cost` alias are accepted for backward compatibility. `settings_service` supports a typed `float` setting type for `default_salvage_pct` (0–50) and `replacement_review_ratio` (0.05–2.0).
|
||||
33. **AMC/CMC Auto-Tagging & Outsourced PM Auto-Fill (AI Task 2)**: Coverage precedence is strictly `active warranty > active CMC > active AMC > active OTHER contract > out_of_contract` where active means `start_date <= on_date <= end_date` and `is_superseded == False`. When registering a complaint, coverage is snapshotted as of `effective_today(db)` into `coverage_tag`, `coverage_contract_id`, and `coverage_provider_id` so historical registration coverage remains immutable even after contracts expire, while `coverage_now` always reflects live coverage. Creating an outsourced PM schedule without `provider_id`/`contract_id` auto-fills them from the asset's highest-priority active AMC/CMC contract (CMC over AMC); if none exists, the schedule is still created with empty provider/contract and `"no_active_contract": true` warning (replacing the legacy 422 rejection).
|
||||
34. **Metrics Engine Formulas & Edge Cases (AI Task 3)**:
|
||||
|
||||
@@ -93,7 +93,8 @@ The color system maintains dual alignment: foundational authority anchored to AI
|
||||
|
||||
## 6. Hospital Deployment: XYZ Hospital
|
||||
|
||||
- **Tenant Name**: `XYZ Hospital` (formerly Poona Hospital & Research Centre).
|
||||
- **Tenant Name**: `XYZ Hospital` (formerly XYZ Hospital).
|
||||
- **System Header**: `XYZ Hospital AMS — MediAsset AI`.
|
||||
- **Demo Scenarios**: Configured under `XYZ Hospital` administrative umbrella, supporting multisite departmental hierarchies (ICU, Radiology, OT, OPD, Biomedical Workshop).
|
||||
- **Asset Code Standards**: `XYZ-<DEPT>-<0001>` (e.g. `XYZ-ICU-0001`).
|
||||
|
||||
|
||||
+16
-16
@@ -1,19 +1,19 @@
|
||||
# Poona Hospital AMS — 10-Minute End-to-End Demo Script
|
||||
# XYZ Hospital AMS — 10-Minute End-to-End Demo Script
|
||||
|
||||
**Prerequisites**:
|
||||
1. Run `python -m app.seed.seed` inside `backend/` to load realistic hospital demo data (60 assets, 30 complaints, 45 PM schedules, 20 calibration plans, 35 contracts, 20 warranties, 25 insurance policies, 3 demo items, 12 department visits, and 26 alerts).
|
||||
2. Start backend (`uvicorn app.main:app --port 8000`) and frontend (`npm run dev` on `http://localhost:5173`), or run `docker compose up --build`.
|
||||
3. All demo accounts use password **`Demo@123`**:
|
||||
- **System Admin**: `admin@poona.demo`
|
||||
- **Biomedical Engineer**: `bio@poona.demo`
|
||||
- **Department User (ICU)**: `dept@poona.demo`
|
||||
- **Management**: `mgmt@poona.demo`
|
||||
- **Coordinator**: `coord@poona.demo`
|
||||
- **System Admin**: `admin@xyz.demo`
|
||||
- **Biomedical Engineer**: `bio@xyz.demo`
|
||||
- **Department User (ICU)**: `dept@xyz.demo`
|
||||
- **Management**: `mgmt@xyz.demo`
|
||||
- **Coordinator**: `coord@xyz.demo`
|
||||
|
||||
---
|
||||
|
||||
## Step 1 — Login, Role Overview & Calibration Pop-up (1 min)
|
||||
1. Open `http://localhost:5173/login`. Use Quick Demo Login or sign in as **Biomedical** (`bio@poona.demo` / `Demo@123`).
|
||||
1. Open `http://localhost:5173/login`. Use Quick Demo Login or sign in as **Biomedical** (`bio@xyz.demo` / `Demo@123`).
|
||||
2. Observe the **Calibration Reminder Pop-up** (`CalibrationReminderModal`) surfacing upcoming/due/overdue calibrations once per login. Click **Go to Calibration** or dismiss it.
|
||||
3. Point out the role-filtered sidebar (no Masters/Settings/Audit Log for Biomedical).
|
||||
|
||||
@@ -27,27 +27,27 @@
|
||||
3. Click **View Insurance** to slide open `InsuranceDrawer` showing policy coverage in INR and attached policy PDF.
|
||||
|
||||
## Step 4 — Breakdown Complaint Lifecycle & Department Scoping (1.5 min)
|
||||
1. Sign out and log in as **Department User (ICU)** (`dept@poona.demo` / `Demo@123`).
|
||||
1. Sign out and log in as **Department User (ICU)** (`dept@xyz.demo` / `Demo@123`).
|
||||
- Notice the ICU-scoped dashboard banner and asset/complaint lists limited to ICU.
|
||||
- Click **Raise Complaint** (`/complaints`), select an ICU asset using `AssetPicker` (note warranty/coverage badge), enter a breakdown description, attach an image/PDF, and submit.
|
||||
- Open a complaint detail (`/complaints/:id`) and point out the **read-only lock banner** on the Technical / CE / Spares section (`FORBIDDEN_TECHNICAL_FIELDS` for non-biomedical/admin roles).
|
||||
2. Switch to **Biomedical** (`bio@poona.demo`), open the newly raised complaint, assign/attend/restore it, enter technical action & spares, and close it with closure remarks—confirm `Asset.status` syncs back to `in_service` and downtime is calculated in IST.
|
||||
2. Switch to **Biomedical** (`bio@xyz.demo`), open the newly raised complaint, assign/attend/restore it, enter technical action & spares, and close it with closure remarks—confirm `Asset.status` syncs back to `in_service` and downtime is calculated in IST.
|
||||
|
||||
## Step 5 — Preventive Maintenance Table & Calendar Views (1 min)
|
||||
1. Open `/pm` (`PMPage`). Review the KPI strip and toggle between **Table View** and the **7-column Mon–Sun Month Calendar View**.
|
||||
2. Complete a due PM item (auto-advances next cycle using clamped `add_months`) or reschedule an upcoming PM item.
|
||||
|
||||
## Step 6 — Calibration Plan Approval Gate (1 min)
|
||||
1. Open `/calibration` (`CalibrationPage`) as **Biomedical** (`bio@poona.demo`). Note that creating/completing calibrations (with certificate PDF upload) is enabled, whereas frequency approval controls are gated (`FORBIDDEN_CALIBRATION_APPROVAL`).
|
||||
2. Switch to **Management** (`mgmt@poona.demo`) or **Coordinator** (`coord@poona.demo`) to approve a calibration plan's frequency.
|
||||
1. Open `/calibration` (`CalibrationPage`) as **Biomedical** (`bio@xyz.demo`). Note that creating/completing calibrations (with certificate PDF upload) is enabled, whereas frequency approval controls are gated (`FORBIDDEN_CALIBRATION_APPROVAL`).
|
||||
2. Switch to **Management** (`mgmt@xyz.demo`) or **Coordinator** (`coord@xyz.demo`) to approve a calibration plan's frequency.
|
||||
|
||||
## Step 7 — Contracts Renewal Chain, Warranties, Demo Equipment & Visits (1 min)
|
||||
1. Open `/contracts` (`/contracts`) and renew an expiring AMC/CMC contract—observe the superseded badge on the prior contract and the intact renewal history chain.
|
||||
2. Open `/demo-equipment` to view active vs overdue trial equipment and log a return.
|
||||
3. Open `/visits` as **Biomedical** (`bio@poona.demo`) to review/log a department round linked to multiple assets and complaints; verify `dept@poona.demo` / `coord@poona.demo` cannot access `/visits`.
|
||||
3. Open `/visits` as **Biomedical** (`bio@xyz.demo`) to review/log a department round linked to multiple assets and complaints; verify `dept@xyz.demo` / `coord@xyz.demo` cannot access `/visits`.
|
||||
|
||||
## Step 8 — Demo Clock ("As of Date") & Live Alert Engine (1 min)
|
||||
1. Log in as **System Admin** (`admin@poona.demo`).
|
||||
1. Log in as **System Admin** (`admin@xyz.demo`).
|
||||
2. Use the TopBar **"As of Date"** Demo Clock to advance the date by +20 days.
|
||||
3. Click **Run alert check now** in `/settings` (or `/notifications`), watch new deduplicated notifications appear in the TopBar bell counter and `/notifications` inbox, then reset Demo Date back to real time.
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
2. Inspect the **"How this is calculated"** formula popover (`scheduled_hours_per_day`, `downtime_end_milestone`, `clip_downtime_to_month`), Recharts BarChart/PieChart, export `.xlsx` and `.csv`, and trigger **Print (A4)** preview.
|
||||
|
||||
## Step 10 — Audit Log Viewer & Rate-Limit Protection (0.5 min)
|
||||
1. As **System Admin** (`admin@poona.demo`), open `/audit-logs` (`AuditLogsPage`) to filter historical entity mutations by Entity Type, User, Action, Date Range, and search query, and inspect the JSON diff modal.
|
||||
1. As **System Admin** (`admin@xyz.demo`), open `/audit-logs` (`AuditLogsPage`) to filter historical entity mutations by Entity Type, User, Action, Date Range, and search query, and inspect the JSON diff modal.
|
||||
2. Confirm `/audit-logs` is restricted to `system_admin` only (`403` for other roles) and `POST /api/auth/login` enforces sliding-window rate limiting (`429 RATE_LIMITED`).
|
||||
|
||||
---
|
||||
@@ -66,7 +66,7 @@
|
||||
- Open `/complaints`, click **Raise Complaint**, and pick an ICU asset in `AssetPicker` (e.g. `PHRC-ICU-0001`).
|
||||
- Point out the live **Coverage Badge** (`Under Warranty`, `Under CMC`, `Under AMC`, or `Out of Contract`) and hover to show `"Call: <vendor>, <contact>"`. Submit the complaint and show that the coverage tag is snapshotted on the complaint detail page and timeline.
|
||||
2. **Switch to AI Report (15 sec)**:
|
||||
- Open `/reports` as **Management** (`mgmt@poona.demo`) or **System Admin** (`admin@poona.demo`) and click the **"AI report"** side of the `"Simple reports | AI report"` segmented toggle (note that `dept@poona.demo` does not see this toggle).
|
||||
- Open `/reports` as **Management** (`mgmt@xyz.demo`) or **System Admin** (`admin@xyz.demo`) and click the **"AI report"** side of the `"Simple reports | AI report"` segmented toggle (note that `dept@xyz.demo` does not see this toggle).
|
||||
- Point out the top status chip (`Rule-based summary` by default, or `AI: local model <name>` when Ollama is active).
|
||||
3. **Repeat-Failure & Replacement Suggestions (25 sec)**:
|
||||
- Scroll to the top **Suggestions** panel. Highlight a red **S1 Repeat Failure** card and an **S4 Replacement Review** card, expand **Supporting evidence** to show the exact metric IDs and values, click an asset code link, and note that every suggestion ends with `"Needs a human decision."`.
|
||||
@@ -74,4 +74,4 @@
|
||||
- Scroll to **1. Comparison: in-house vs outsourced vs rent**. Show the 10 latest equipment rows comparing 5-year In-House vs Outsourced (AMC/CMC) vs Rent costs in INR, the highlighted lowest-cost option, difference vs next option, and any grey `"Insufficient data: <input>"` cells.
|
||||
5. **Depreciation Example & Rule-Based vs AI Summary (30 sec)**:
|
||||
- Scroll to **2. Depreciated price and cost analysis**. Click an asset row to display its Book Value curve over useful life and point out red maintenance-ratio flags (≥ 40%).
|
||||
- Open **Evidence** and **How this is calculated** on any section, and demonstrate the **Rule-based summary** badge (plus **Regenerate summary** as `admin@poona.demo`, and if Ollama is enabled in `/settings`, show an `AI summary` badge or automatic fallback). Export Excel (`.xlsx`) to show the 3 sheets: main report, `Evidence`, and `How calculated`.
|
||||
- Open **Evidence** and **How this is calculated** on any section, and demonstrate the **Rule-based summary** badge (plus **Regenerate summary** as `admin@xyz.demo`, and if Ollama is enabled in `/settings`, show an `AI summary` badge or automatic fallback). Export Excel (`.xlsx`) to show the 3 sheets: main report, `Evidence`, and `How calculated`.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Poona Hospital AMS — Implementation Plan Summary
|
||||
# XYZ Hospital AMS — Implementation Plan Summary
|
||||
|
||||
**Status:** Phases 0–8 complete, plus Excel exports / bulk import / responsive layout as of commit `22fad38`.
|
||||
|
||||
|
||||
+7
-7
@@ -1,12 +1,12 @@
|
||||
# Poona Hospital AMS — Role-Based User Guide
|
||||
# XYZ Hospital AMS — Role-Based User Guide
|
||||
|
||||
Welcome to the Poona Hospital Asset Management & Maintenance System. This quick-start guide details the day-to-day operations, permissions, and typical workflows for each user role.
|
||||
Welcome to the XYZ Hospital Asset Management & Maintenance System. This quick-start guide details the day-to-day operations, permissions, and typical workflows for each user role.
|
||||
|
||||
All demo accounts share the password: `Demo@123`
|
||||
|
||||
---
|
||||
|
||||
## 1. System Administrator (`admin@poona.demo`)
|
||||
## 1. System Administrator (`admin@xyz.demo`)
|
||||
|
||||
The System Administrator oversees system security, reference masters, user access, and global configuration.
|
||||
|
||||
@@ -28,7 +28,7 @@ The System Administrator oversees system security, reference masters, user acces
|
||||
|
||||
---
|
||||
|
||||
## 2. Biomedical Engineer (`bio@poona.demo`)
|
||||
## 2. Biomedical Engineer (`bio@xyz.demo`)
|
||||
|
||||
Biomedical Engineers handle physical medical assets, breakdown repairs, preventative maintenance schedules, and rounds.
|
||||
|
||||
@@ -49,7 +49,7 @@ Biomedical Engineers handle physical medical assets, breakdown repairs, preventa
|
||||
|
||||
---
|
||||
|
||||
## 3. Department User (`dept@poona.demo` — ICU)
|
||||
## 3. Department User (`dept@xyz.demo` — ICU)
|
||||
|
||||
Department Users (Nurses, In-charges, Technicians) raise and monitor breakdown calls for their own department.
|
||||
|
||||
@@ -66,7 +66,7 @@ Department Users (Nurses, In-charges, Technicians) raise and monitor breakdown c
|
||||
|
||||
---
|
||||
|
||||
## 4. Management (`mgmt@poona.demo`)
|
||||
## 4. Management (`mgmt@xyz.demo`)
|
||||
|
||||
Hospital Management (Medical Superintendent, Directors, Quality Heads) review operational performance, KPIs, and reports.
|
||||
|
||||
@@ -84,7 +84,7 @@ Hospital Management (Medical Superintendent, Directors, Quality Heads) review op
|
||||
|
||||
---
|
||||
|
||||
## 5. Clinical Coordinator (`coord@poona.demo`)
|
||||
## 5. Clinical Coordinator (`coord@xyz.demo`)
|
||||
|
||||
Coordinators manage legal contracts, equipment warranties, insurance coverage, and loaner/demo devices.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user