Replace broad doctor/nurse specialty access with granular roles and primary
apps, permission inheritance for lab/BB managers, and cannot-rules for
discharge, lab approve, and cashier vs billing officer.
Co-authored-by: Cursor <cursoragent@cursor.com>
The suite landed without the catalog entry after a parallel Child Welfare merge; restore it so activation, demo flags, and departments work.
Co-authored-by: Cursor <cursoragent@cursor.com>
EMS clinic workflow (dispatch → scene → transport → handover) plus completed CWC suite, with shell stages, clinical records, reports/print, demo seed, and suite tests.
Co-authored-by: Cursor <cursoragent@cursor.com>
Bring thin catalog modules to the same depth as Cardiology with stages, clinical tabs, reports/print, demo seed, and suite tests.
Co-authored-by: Cursor <cursoragent@cursor.com>
Match Pediatrics/ENT depth with stages, workspace tabs, clinical records, reports/print, demo seed, and suite tests.
Co-authored-by: Cursor <cursoragent@cursor.com>
Mirror the Ophthalmology/Maternity shell pattern with stages, stage_tabs,
workspace clinical records, reports/print, demo seeds, and suite tests.
Co-authored-by: Cursor <cursoragent@cursor.com>
Reuse the GP consultation prescribe modal, gate with prescriptions.manage, and return to the specialty workspace after create.
Co-authored-by: Cursor <cursoragent@cursor.com>
The sidebar and dashboard linked to the lab work queue (lab.manage) while
gating on lab.view, so physio/GP doctors hit 403 on open.
Co-authored-by: Cursor <cursoragent@cursor.com>
Stage Move CTAs and pills previously always redirected to overview; map each stage to its tab via shell config so examination lands on exam, etc.
Co-authored-by: Cursor <cursoragent@cursor.com>
Lift Eye Care stage pills into a reusable action-bar component so every
module visit workspace shows config-driven stages with RBAC-gated Move CTAs.
Co-authored-by: Cursor <cursoragent@cursor.com>
Sidebar was re-querying practitioners for every specialty module and also
calling ensureDefaultModulesProvisioned on each page render, which showed
up as multi-second PHP-FPM slow logs on Care.
Co-authored-by: Cursor <cursoragent@cursor.com>
Give lab_manager catalog/ops admin access and blood_bank_manager a branch-level stock register plus specialty admin surface, while keeping technicians on clinical queues.
Co-authored-by: Cursor <cursoragent@cursor.com>
Open on waiting/called cards no longer requires consultations.manage so
view roles can re-enter Emergency and other specialty workspaces.
Co-authored-by: Cursor <cursoragent@cursor.com>
Cashiers collect via Billing only; strip POS from demo staff grants and StaffUx/launcher so the suite hub no longer offers POS for that role.
Co-authored-by: Cursor <cursoragent@cursor.com>
Cashiers and other bills.view roles get today's collections breakdown and a recent paid-invoice list under the existing metric cards.
Co-authored-by: Cursor <cursoragent@cursor.com>
Cashiers saw pesewa integers (e.g. 4000) while history showed GHS 40.00; accept and prefill major amounts and convert to minor on record/checkout.
Co-authored-by: Cursor <cursoragent@cursor.com>
Demo seeding used i%3 for both branch and paid status, so Ridge Clinic only got paid invoices. Cashiers now default to outstanding balances and Call next is secondary to the walk-up unpaid list.
Co-authored-by: Cursor <cursoragent@cursor.com>
Clarify booth Call next vs unpaid invoice list, and expose Pay/View row actions so cashiers can open bills when the booth queue is empty.
Co-authored-by: Cursor <cursoragent@cursor.com>
Doctor-only Queue left non-doctors landing on Appointments, which cashiers
(and pharmacists/lab techs) cannot open — restore role-natural list routes.
Co-authored-by: Cursor <cursoragent@cursor.com>
Hide the patient-flow Queue board from nurses, reception, and other
non-doctors; specialty home routes now render the queue board list
instead of auto-opening the first open visit.
Co-authored-by: Cursor <cursoragent@cursor.com>
Single-desk specialists already reach their workspace via dashboard cards; the Specialty → Dentistry nav group was redundant. GPs and multi-module roles keep the section.
Co-authored-by: Cursor <cursoragent@cursor.com>
Specialty seeder looked up members by email user_ref only, so remapped
demo logins never got practitioner.member_id and saw every module.
Also stop short keywords like "ent" matching "dentistry".
Co-authored-by: Cursor <cursoragent@cursor.com>
GPs keep broad general/limited manage and restricted view/refer; dentists and other desk specialists only see modules that match their specialty.
Co-authored-by: Cursor <cursoragent@cursor.com>
care_departments has no organization_id; match the Blood Bank seeder pattern so demo:seed no longer fails on dental specialty data.
Co-authored-by: Cursor <cursoragent@cursor.com>
Pro/enterprise DemoTenantSeeder now upserts visit-scoped facility stock so the Inventory tab and reports show unit counts and a low-stock alert without manual entry.
Co-authored-by: Cursor <cursoragent@cursor.com>
Doctors scoped to the visit branch were getting app 404s on nested
assessment routes because authorizePatient compared the patient's home
branch, unlike consultation/prescription auth which uses the visit.
Co-authored-by: Cursor <cursoragent@cursor.com>
Index alone still left /consultations/{uuid}/assessments/create and
/consultations/{uuid}/assessments/{uuid} unmatched (404). Wire those
paths, redirect store into the nested show, and cover the doctor form
open flow with feature tests.
Co-authored-by: Cursor <cursoragent@cursor.com>
Only POST existed on that path, so navigating to the natural collection URL 404'd. Serve the patient assessments index with consultation return context, and cover it with a doctor feature test.
Co-authored-by: Cursor <cursoragent@cursor.com>
Assigned doctors could see board waiters while Call next returned empty because ensure() early-returned without provisioning a newly linked desk. Re-provision on point miss, recover stale tickets, and align empty messaging with visible waiters.
Co-authored-by: Cursor <cursoragent@cursor.com>
Call next now picks the next board appointment, issues or reclaims its ticket onto the calling desk, and still fires display/voice announcements — so patients are not left stuck when tickets sit on the wrong point after sync-on-GET was removed.
Co-authored-by: Cursor <cursoragent@cursor.com>
hospital_admin no longer opens /queue, and nurses get Specialty home instead of Back to queue after the patient-flow board gate.
Co-authored-by: Cursor <cursoragent@cursor.com>
Stop issuing missing tickets and refreshing financial gates on every GET;
eager-load advances, cap board rows, and cache specialty department maps.
Co-authored-by: Cursor <cursoragent@cursor.com>
Shared queue-board is now a Waiting/Called/In care/Done stage board with prominent tickets and Call next; nurses lose queue.manage and canAccessPatientQueue so /queue and queue nav are gated while specialty workspaces stay available.
Co-authored-by: Cursor <cursoragent@cursor.com>
Pay-before-service holds now create a billing queue ticket (via an open bill) so cashiers can Call next / Serve; clearance completes the ticket and releases the clinical line as before.
Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve staff memberships by invite/demo email as well as public_id so nurses stay on their employer org; block staff from owner onboarding; keep Documents viewable with module access while upload stays manage-gated.
Co-authored-by: Cursor <cursoragent@cursor.com>
8a5330d already keyed Start/stage/vitals on CarePermissions for every
role; add receptionist, lab, pharmacist, and GP-without-module-manage
tests so we never regress to nurse-only branching.
Co-authored-by: Cursor <cursoragent@cursor.com>
Nurses can manage limited specialties but lack consultations.manage, so
hide Start/stage/chart edits that 403 while keeping queue/vitals/billing
aligned with what those routes actually authorize.
Co-authored-by: Cursor <cursoragent@cursor.com>
View/refer users keep read surfaces and refer actions; zero-access
modules stay out of nav via existing enabledModulesForMember filtering.
Co-authored-by: Cursor <cursoragent@cursor.com>
Icon names live on the specialty catalog; SVG paths resolve through a shared map and render in sidebar, dashboard, settings, and the specialty shell.
Co-authored-by: Cursor <cursoragent@cursor.com>
The dropdown was fetching care.wallet (account redirect HTML) instead of a
billing balance API, so Alpine always fell back to "View wallet".
Co-authored-by: Cursor <cursoragent@cursor.com>
Give nurses, lab techs, pharmacists, and GPs broad access to day-to-day modules, keep restricted specialties for specialists (with support nurses), and let GPs view results or refer without full clinical edit.
Co-authored-by: Cursor <cursoragent@cursor.com>
Replace free-text specialty on practitioner and team-invite forms with a shared selectable list so clinicians pick a known specialty.
Co-authored-by: Cursor <cursoragent@cursor.com>
Make appointment/practitioner department (and practitioner) options show branch names so duplicates are distinguishable, and replace the patient select with a searchable dropdown.
Co-authored-by: Cursor <cursoragent@cursor.com>
Admin dashboard module cards open per-module settings with editable service prices; GP consultation and clinic fees live under Settings → GP pricing (inventory drugs unchanged).
Co-authored-by: Cursor <cursoragent@cursor.com>
Branch-scoped staff could 404 on charts when the patient's home branch differed from the visit site; Orders also linked doctors to a lab index they could not access.
Co-authored-by: Cursor <cursoragent@cursor.com>
Shorten composite index names under the 64-character limit and recover partial deploys where treatment plans already exist.
Co-authored-by: Cursor <cursoragent@cursor.com>
Move timeline into a workspace tab, surface Complete consultation and Call again in Actions, and make Call next end the current encounter then open the next called patient.
Co-authored-by: Cursor <cursoragent@cursor.com>
Remove Dentistry and other specialty modules from the sidebar; Queue now uses each doctor's specialty desk context for Call next, waiting lists, and Start into specialty clinical workspaces.
Co-authored-by: Cursor <cursoragent@cursor.com>
Specialty homes now use the shared Waiting/In care board with Call next, Start routes specialty tickets into specialty workspaces, and redundant Dentistry/Specialty module chrome is removed.
Co-authored-by: Cursor <cursoragent@cursor.com>
Reuse the shared prescription form in x-modal so desktop gets a popup and mobile gets the existing bottomsheet behavior, then return to the consultation after create.
Co-authored-by: Cursor <cursoragent@cursor.com>
Desktop uses a right sticky Actions column; mobile uses a FAB above the nav that opens a bottomsheet. Request investigations moves into a modal/sheet, and Call next is available on the consultation panel.
Co-authored-by: Cursor <cursoragent@cursor.com>
Demo GP appointments now use core desk departments, and the doctor waiting list excludes specialty queue contexts so MAT/PHY tickets stay on specialty modules.
Co-authored-by: Cursor <cursoragent@cursor.com>
Demo cover desks on non-home branches now use specialty doctor names so Practitioners lists people, not departments.
Co-authored-by: Cursor <cursoragent@cursor.com>
Show the current invoice book by status so Paid/Partial are not hidden when create dates fall outside MTD.
Co-authored-by: Cursor <cursoragent@cursor.com>
Facility admins see analytics overviews instead of operational directories; floor roles keep list UIs, with optional ?view=list for admins who need records.
Co-authored-by: Cursor <cursoragent@cursor.com>
Hospital admins no longer see specialty/queue floor nav; Call next is a full-width button; specialty encounters open module-specific clinical forms instead of the general consultation page.
Co-authored-by: Cursor <cursoragent@cursor.com>
Admins without a desk now scan all specialty service points, KPIs use the same branch as queue ops, and empty Call next flashes explain tickets vs other branches.
Co-authored-by: Cursor <cursoragent@cursor.com>
Visit-scoped structured forms for Emergency triage, Blood Bank requests,
and Dentistry odontogram with derived alerts, document upload, and KPI counts.
Co-authored-by: Cursor <cursoragent@cursor.com>
Overview/Visits/History/Billing/Workspace layout with stage maps, KPIs,
patient header/timeline, and service catalogs seeded into Billing on activate.
Emergency, Blood Bank, and Dentistry ship first-class shell configs.
Co-authored-by: Cursor <cursoragent@cursor.com>
Issue, call-next, serve, and complete tickets locally so Care Pro no longer
needs QUEUE_API_* when CARE_QUEUE_DRIVER=native (default). Remote Ladill Queue
remains available for cutover; PHPUnit keeps the remote driver for existing fakes.
Co-authored-by: Cursor <cursoragent@cursor.com>
Capture the unified workflow, UI, queue, and billing blueprint, and add a Cursor rule so specialty work follows the shared shell instead of one-off apps.
Co-authored-by: Cursor <cursoragent@cursor.com>
Add Cardiology through Child Welfare to the specialty catalog, keep Emergency and Blood Bank always enabled on Pro/Enterprise sidebars, and generate matching demo specialty doctors.
Co-authored-by: Cursor <cursoragent@cursor.com>
Seed investigation types early (before clinical data), expand the default catalog, scope Lab → Catalog by organization, and harden practitioner-branch sync so a mid-reseed failure cannot wipe the catalog.
Co-authored-by: Cursor <cursoragent@cursor.com>
Replace optional “All branches” with required branch checkboxes; doctors may switch only among assigned sites, never org-wide by default.
Co-authored-by: Cursor <cursoragent@cursor.com>
Doctors were treated as multi-branch when Identity cleared branch_id; now they stay on their assigned/desk site, specialty desks are home-branch only, and the queue shows site name as text only.
Co-authored-by: Cursor <cursoragent@cursor.com>
Nav and pages require a linked practitioner desk in the module department; demo seeds specialty doctors and stops overwriting their assigned waiters.
Co-authored-by: Cursor <cursoragent@cursor.com>
Doctors no longer see branch/practitioner pickers; queue, appointments, patients, and dashboard only include visits on their linked desk.
Co-authored-by: Cursor <cursoragent@cursor.com>
Demo doctors were querying their own public_id, so branches/patients/queues looked empty even though the Pro tenant had data.
Co-authored-by: Cursor <cursoragent@cursor.com>
Stops cramming ticket status, destination, and patient name onto one line across Patient, Pharmacy, Lab, and specialty queues.
Co-authored-by: Cursor <cursoragent@cursor.com>
Patient queue syncs consultation and specialty waiters; specialty contexts now provision desks so check-in/onboarding no longer leaves half the list on local positions only.
Co-authored-by: Cursor <cursoragent@cursor.com>
Specialty demo seed reused slot+1 per module; repair duplicates on queue load and renumber after demo seed so waiting lists show 1..n.
Co-authored-by: Cursor <cursoragent@cursor.com>
Admins pick a working branch once; session keeps Pharmacy Call Next and lists scoped to that site so ticket numbers no longer collide across branches.
Co-authored-by: Cursor <cursoragent@cursor.com>
Link DemoWorld doctor staff to practitioners, clear unresolved routing, distribute staff across branches, and restore scoped consultation/pharmacy ticket sync so demos are not left Unassigned.
Co-authored-by: Cursor <cursoragent@cursor.com>
Provision one branch/context at a time instead of the whole org, fall back to a desk when doctor counters are catching up, sync pharmacy tickets in Care list order on page load, and seed waiting_at/queue_position for demos.
Co-authored-by: Cursor <cursoragent@cursor.com>
Defer Queue provision and ticket backfill after the settings response, harden messaging credential creation against lock races, and stop wrapping demo seed in a long-held transaction.
Co-authored-by: Cursor <cursoragent@cursor.com>
Enterprise reseeds were blocked for minutes on queue.ladill.com calls; local specialty data still seeds, and Queue tickets can backfill on first visit.
Co-authored-by: Cursor <cursoragent@cursor.com>
Enterprise reseeds were hanging on per-module Queue HTTP; activate specialties locally first, then provision once, and limit ticket sync to core contexts.
Co-authored-by: Cursor <cursoragent@cursor.com>
Free and real onboarding stay opt-in; Pro/Enterprise demos activate every catalog specialty and seed waiting appointments so module pages are populated.
Co-authored-by: Cursor <cursoragent@cursor.com>
Demo Pro was left as an empty workflow shell after lock-timeout races; clear leftover rollout flags on seed, sync-reseed empty tenants on login, and repair missing facility workflow indexes.
Co-authored-by: Cursor <cursoragent@cursor.com>
Production already had care_facility_workflows from a prior attempt, so recreate checks let migrate finish and record the batch.
Co-authored-by: Cursor <cursoragent@cursor.com>
Introduces a facility workflow engine as Care's primary configuration
object: onboarding now leads with a facility category (which modules to
enable) and a workflow template (how patients move + where money is
collected), including standard herbal hospital/clinic templates.
Templates materialize into care_facility_workflows/care_workflow_stages.
The engine tracks a visit's position via care_visit_stage_advances and,
with FinancialGateService, gates a stage's queue behind a cleared
FinancialObligation (paid/authorized/waived/deferred) for "before"
payment timing while leaving "after" (pay-at-exit) flows unblocked.
Gated behavior is opt-in behind the workflow_engine/financial_gates
rollout flags; legacy orgs keep current behavior.
Co-authored-by: Cursor <cursoragent@cursor.com>
Async reseed alone still left the first Care request without an onboarded org; ensure the shell synchronously, then refresh demo data afterResponse().
Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid the onboarding flash when reset-on-login deletes the tenant before the afterResponse() reseed finishes.
Co-authored-by: Cursor <cursoragent@cursor.com>