Expand specialty RBAC with dedicated specialist roles and support access.
Deploy Ladill Care / deploy (push) Successful in 41s
Deploy Ladill Care / deploy (push) Successful in 41s
Add cardiologist/ENT/derm/ophthalmology/ortho/podiatry/fertility roles and manage/refer/view matrices so GPs, nurses, lab, pharmacy, and reception get realistic module access beyond single-app specialists. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,10 +4,10 @@
|
||||
* Specialty practice modules (Settings → Modules).
|
||||
* Pro-gated via plans.*.features specialty_modules.
|
||||
*
|
||||
* Primary specialty visibility is driven by CarePermissions::primaryAppsFor()
|
||||
* (role → module keys). Config roles / support_roles / view_roles / refer_roles
|
||||
* remain for legacy doctor desk-specialist keyword matching and GP refer/view
|
||||
* outside the primary-app matrix.
|
||||
* Primary specialty visibility is driven by CarePermissions::primaryAppsFor() /
|
||||
* referAppsFor() / viewAppsFor() (role → module keys). Config roles /
|
||||
* support_roles / view_roles / refer_roles remain for legacy doctor desk-specialist
|
||||
* keyword matching and as a secondary allowlist aligned with the matrix.
|
||||
*
|
||||
* @return array<string, array<string, mixed>>
|
||||
*/
|
||||
@@ -23,7 +23,17 @@ return [
|
||||
'icon' => 'bolt',
|
||||
'queue_keywords' => ['emerg', 'casualty', 'trauma', 'er', 'a&e'],
|
||||
'access' => 'general',
|
||||
'roles' => ['doctor', 'nurse', 'lab_technician', 'pharmacist', 'receptionist'],
|
||||
'roles' => [
|
||||
'emergency_physician', 'ed_nurse', 'general_physician', 'doctor',
|
||||
'ambulance_staff',
|
||||
],
|
||||
'view_roles' => [
|
||||
'emergency_physician', 'ed_nurse', 'general_physician', 'doctor',
|
||||
'ambulance_staff', 'nurse', 'pharmacist', 'receptionist',
|
||||
],
|
||||
'refer_roles' => [
|
||||
'general_physician', 'doctor', 'nurse', 'pharmacist', 'receptionist',
|
||||
],
|
||||
'default_on_paid_plans' => true,
|
||||
],
|
||||
'blood_bank' => [
|
||||
@@ -37,7 +47,18 @@ return [
|
||||
'icon' => 'droplet',
|
||||
'queue_keywords' => ['blood', 'transfusion', 'crossmatch', 'donor'],
|
||||
'access' => 'general',
|
||||
'roles' => ['blood_bank_manager', 'lab_technician', 'nurse', 'doctor', 'receptionist'],
|
||||
'roles' => [
|
||||
'blood_bank_officer', 'blood_bank_manager', 'lab_technician', 'lab_manager',
|
||||
'emergency_physician', 'ed_nurse', 'surgeon', 'theatre_nurse',
|
||||
],
|
||||
'view_roles' => [
|
||||
'blood_bank_officer', 'blood_bank_manager', 'lab_technician', 'lab_manager',
|
||||
'pathologist', 'emergency_physician', 'ed_nurse', 'surgeon', 'theatre_nurse',
|
||||
'general_physician', 'doctor', 'nurse',
|
||||
],
|
||||
'refer_roles' => [
|
||||
'general_physician', 'doctor', 'nurse',
|
||||
],
|
||||
'default_on_paid_plans' => true,
|
||||
],
|
||||
'dentistry' => [
|
||||
@@ -51,7 +72,9 @@ return [
|
||||
'icon' => 'face-smile',
|
||||
'queue_keywords' => ['dent', 'dental', 'oral'],
|
||||
'access' => 'limited',
|
||||
'roles' => ['doctor', 'nurse', 'receptionist'],
|
||||
'roles' => ['dentist'],
|
||||
'view_roles' => ['dentist', 'general_physician', 'doctor', 'receptionist'],
|
||||
'refer_roles' => ['general_physician', 'doctor', 'receptionist'],
|
||||
'specialist_keywords' => ['dent', 'dental', 'oral', 'odont'],
|
||||
],
|
||||
'ophthalmology' => [
|
||||
@@ -65,7 +88,11 @@ return [
|
||||
'icon' => 'eye',
|
||||
'queue_keywords' => ['eye', 'ophthal', 'optom'],
|
||||
'access' => 'limited',
|
||||
'roles' => ['doctor', 'nurse', 'receptionist'],
|
||||
'roles' => ['ophthalmologist', 'general_physician', 'doctor'],
|
||||
'view_roles' => [
|
||||
'ophthalmologist', 'general_physician', 'doctor', 'receptionist',
|
||||
],
|
||||
'refer_roles' => ['general_physician', 'doctor', 'receptionist'],
|
||||
'specialist_keywords' => ['eye', 'ophthal', 'optom'],
|
||||
],
|
||||
'physiotherapy' => [
|
||||
@@ -79,7 +106,11 @@ return [
|
||||
'icon' => 'arrow-path',
|
||||
'queue_keywords' => ['physio', 'rehab', 'therapy'],
|
||||
'access' => 'limited',
|
||||
'roles' => ['doctor', 'nurse', 'receptionist'],
|
||||
'roles' => ['physiotherapist'],
|
||||
'view_roles' => [
|
||||
'physiotherapist', 'general_physician', 'doctor', 'receptionist',
|
||||
],
|
||||
'refer_roles' => ['general_physician', 'doctor', 'receptionist'],
|
||||
'specialist_keywords' => ['physio', 'rehab', 'therapy'],
|
||||
],
|
||||
'maternity' => [
|
||||
@@ -90,10 +121,16 @@ return [
|
||||
'queue_name' => 'Maternity',
|
||||
'queue_prefix' => 'MAT',
|
||||
'nav_label' => 'Maternity',
|
||||
'icon' => 'heart',
|
||||
'icon' => 'home',
|
||||
'queue_keywords' => ['matern', 'antenatal', 'obstetric'],
|
||||
'access' => 'limited',
|
||||
'roles' => ['doctor', 'nurse', 'pharmacist', 'receptionist'],
|
||||
'roles' => ['midwife', 'nurse'],
|
||||
'view_roles' => [
|
||||
'midwife', 'nurse', 'general_physician', 'doctor', 'pharmacist', 'receptionist',
|
||||
],
|
||||
'refer_roles' => [
|
||||
'general_physician', 'doctor', 'pharmacist', 'receptionist',
|
||||
],
|
||||
'specialist_keywords' => ['matern', 'antenatal', 'obstetric', 'midwif'],
|
||||
],
|
||||
'radiology' => [
|
||||
@@ -107,7 +144,16 @@ return [
|
||||
'icon' => 'camera',
|
||||
'queue_keywords' => ['radio', 'imaging', 'x-ray', 'xray', 'ultrasound', 'ct', 'mri'],
|
||||
'access' => 'general',
|
||||
'roles' => ['doctor', 'nurse', 'lab_technician', 'receptionist'],
|
||||
'roles' => [
|
||||
'radiologist', 'radiographer', 'emergency_physician', 'ed_nurse', 'surgeon',
|
||||
],
|
||||
'view_roles' => [
|
||||
'radiologist', 'radiographer', 'emergency_physician', 'ed_nurse', 'surgeon',
|
||||
'lab_technician', 'lab_manager', 'general_physician', 'doctor',
|
||||
],
|
||||
'refer_roles' => [
|
||||
'general_physician', 'doctor',
|
||||
],
|
||||
'specialist_keywords' => ['radio', 'radiolog', 'imaging'],
|
||||
],
|
||||
'cardiology' => [
|
||||
@@ -121,10 +167,13 @@ return [
|
||||
'icon' => 'heart',
|
||||
'queue_keywords' => ['cardio', 'heart', 'ecg', 'echo'],
|
||||
'access' => 'restricted',
|
||||
'roles' => ['doctor'],
|
||||
'support_roles' => ['nurse'],
|
||||
'view_roles' => ['doctor', 'general_physician', 'nurse', 'lab_technician'],
|
||||
'refer_roles' => ['doctor', 'general_physician', 'nurse'],
|
||||
'roles' => ['cardiologist', 'emergency_physician', 'general_physician', 'doctor'],
|
||||
'support_roles' => ['ed_nurse'],
|
||||
'view_roles' => [
|
||||
'cardiologist', 'emergency_physician', 'general_physician', 'doctor',
|
||||
'ed_nurse',
|
||||
],
|
||||
'refer_roles' => ['general_physician', 'doctor'],
|
||||
'specialist_keywords' => ['cardio', 'cardiology', 'heart', 'ecg'],
|
||||
],
|
||||
'psychiatry' => [
|
||||
@@ -138,10 +187,12 @@ return [
|
||||
'icon' => 'chat-bubble-left-right',
|
||||
'queue_keywords' => ['psych', 'mental', 'behaviour'],
|
||||
'access' => 'restricted',
|
||||
'roles' => ['doctor'],
|
||||
'support_roles' => ['nurse'],
|
||||
'view_roles' => ['doctor', 'general_physician', 'nurse'],
|
||||
'refer_roles' => ['doctor', 'general_physician', 'nurse'],
|
||||
'roles' => ['psychiatrist'],
|
||||
'support_roles' => [],
|
||||
'view_roles' => [
|
||||
'psychiatrist', 'general_physician', 'doctor',
|
||||
],
|
||||
'refer_roles' => ['general_physician', 'doctor'],
|
||||
'specialist_keywords' => ['psych', 'psychiatry', 'mental', 'behaviour'],
|
||||
],
|
||||
'pediatrics' => [
|
||||
@@ -155,7 +206,13 @@ return [
|
||||
'icon' => 'user-group',
|
||||
'queue_keywords' => ['pedia', 'paedia', 'child', 'infant'],
|
||||
'access' => 'general',
|
||||
'roles' => ['doctor', 'nurse', 'receptionist'],
|
||||
'roles' => ['pediatrician', 'general_physician', 'doctor'],
|
||||
'view_roles' => [
|
||||
'pediatrician', 'general_physician', 'doctor', 'nurse', 'receptionist',
|
||||
],
|
||||
'refer_roles' => [
|
||||
'general_physician', 'doctor', 'nurse', 'receptionist',
|
||||
],
|
||||
// Avoid bare "child" — collides with Child Welfare Clinic specialty labels.
|
||||
'specialist_keywords' => ['pedia', 'paedia', 'pediatric', 'paediatric', 'infant'],
|
||||
],
|
||||
@@ -170,10 +227,12 @@ return [
|
||||
'icon' => 'cube',
|
||||
'queue_keywords' => ['ortho', 'fracture', 'bone', 'joint'],
|
||||
'access' => 'restricted',
|
||||
'roles' => ['doctor'],
|
||||
'support_roles' => ['nurse'],
|
||||
'view_roles' => ['doctor', 'general_physician', 'nurse'],
|
||||
'refer_roles' => ['doctor', 'general_physician', 'nurse'],
|
||||
'roles' => ['orthopedist'],
|
||||
'support_roles' => [],
|
||||
'view_roles' => [
|
||||
'orthopedist', 'general_physician', 'doctor',
|
||||
],
|
||||
'refer_roles' => ['general_physician', 'doctor'],
|
||||
'specialist_keywords' => ['ortho', 'orthopedic', 'orthopaedic', 'fracture'],
|
||||
],
|
||||
'ent' => [
|
||||
@@ -187,10 +246,12 @@ return [
|
||||
'icon' => 'speaker-wave',
|
||||
'queue_keywords' => ['ent', 'ear', 'nose', 'throat', 'otolaryng'],
|
||||
'access' => 'restricted',
|
||||
'roles' => ['doctor'],
|
||||
'support_roles' => ['nurse'],
|
||||
'view_roles' => ['doctor', 'general_physician', 'nurse'],
|
||||
'refer_roles' => ['doctor', 'general_physician', 'nurse'],
|
||||
'roles' => ['ent_specialist', 'general_physician', 'doctor'],
|
||||
'support_roles' => [],
|
||||
'view_roles' => [
|
||||
'ent_specialist', 'general_physician', 'doctor',
|
||||
],
|
||||
'refer_roles' => ['general_physician', 'doctor'],
|
||||
'specialist_keywords' => ['ent', 'otolaryng', 'ear', 'nose', 'throat'],
|
||||
],
|
||||
'oncology' => [
|
||||
@@ -204,10 +265,14 @@ return [
|
||||
'icon' => 'shield-exclamation',
|
||||
'queue_keywords' => ['oncol', 'cancer', 'chemo'],
|
||||
'access' => 'restricted',
|
||||
'roles' => ['doctor'],
|
||||
'roles' => ['oncologist'],
|
||||
'support_roles' => ['nurse'],
|
||||
'view_roles' => ['doctor', 'general_physician', 'nurse', 'pharmacist'],
|
||||
'refer_roles' => ['doctor', 'general_physician', 'nurse'],
|
||||
'view_roles' => [
|
||||
'oncologist', 'general_physician', 'doctor', 'pharmacist',
|
||||
],
|
||||
'refer_roles' => [
|
||||
'general_physician', 'doctor', 'pharmacist',
|
||||
],
|
||||
'specialist_keywords' => ['oncol', 'cancer', 'chemo'],
|
||||
],
|
||||
'renal' => [
|
||||
@@ -221,10 +286,12 @@ return [
|
||||
'icon' => 'circle-stack',
|
||||
'queue_keywords' => ['renal', 'dialysis', 'nephro', 'kidney'],
|
||||
'access' => 'restricted',
|
||||
'roles' => ['doctor'],
|
||||
'support_roles' => ['nurse'],
|
||||
'view_roles' => ['doctor', 'general_physician', 'nurse'],
|
||||
'refer_roles' => ['doctor', 'general_physician', 'nurse'],
|
||||
'roles' => ['dialysis_nurse'],
|
||||
'support_roles' => [],
|
||||
'view_roles' => [
|
||||
'dialysis_nurse', 'general_physician', 'doctor',
|
||||
],
|
||||
'refer_roles' => ['general_physician', 'doctor'],
|
||||
'specialist_keywords' => ['renal', 'nephro', 'dialysis', 'kidney'],
|
||||
],
|
||||
'surgery' => [
|
||||
@@ -238,10 +305,12 @@ return [
|
||||
'icon' => 'wrench-screwdriver',
|
||||
'queue_keywords' => ['surg', 'theatre', 'operat', 'pre-op'],
|
||||
'access' => 'restricted',
|
||||
'roles' => ['doctor'],
|
||||
'support_roles' => ['nurse'],
|
||||
'view_roles' => ['doctor', 'general_physician', 'nurse'],
|
||||
'refer_roles' => ['doctor', 'general_physician', 'nurse'],
|
||||
'roles' => ['surgeon', 'theatre_nurse'],
|
||||
'support_roles' => [],
|
||||
'view_roles' => [
|
||||
'surgeon', 'theatre_nurse', 'general_physician', 'doctor',
|
||||
],
|
||||
'refer_roles' => ['general_physician', 'doctor'],
|
||||
'specialist_keywords' => ['surg', 'theatre', 'operat'],
|
||||
],
|
||||
'vaccination' => [
|
||||
@@ -255,7 +324,11 @@ return [
|
||||
'icon' => 'shield-check',
|
||||
'queue_keywords' => ['vaccin', 'immun', 'epi', 'injection'],
|
||||
'access' => 'general',
|
||||
'roles' => ['doctor', 'nurse', 'receptionist'],
|
||||
'roles' => ['general_physician', 'doctor', 'nurse'],
|
||||
'view_roles' => [
|
||||
'general_physician', 'doctor', 'nurse', 'receptionist',
|
||||
],
|
||||
'refer_roles' => ['general_physician', 'doctor', 'receptionist'],
|
||||
'specialist_keywords' => ['vaccin', 'immun', 'epi'],
|
||||
],
|
||||
'pathology' => [
|
||||
@@ -269,7 +342,18 @@ return [
|
||||
'icon' => 'document-magnifying-glass',
|
||||
'queue_keywords' => ['pathol', 'histo', 'cytol', 'biopsy'],
|
||||
'access' => 'general',
|
||||
'roles' => ['lab_technician', 'doctor', 'nurse', 'receptionist'],
|
||||
'roles' => [
|
||||
'lab_technician', 'lab_manager', 'pathologist',
|
||||
'emergency_physician', 'ed_nurse', 'surgeon',
|
||||
],
|
||||
'view_roles' => [
|
||||
'lab_technician', 'lab_manager', 'pathologist',
|
||||
'emergency_physician', 'ed_nurse', 'surgeon',
|
||||
'general_physician', 'doctor',
|
||||
],
|
||||
'refer_roles' => [
|
||||
'general_physician', 'doctor',
|
||||
],
|
||||
'specialist_keywords' => ['pathol', 'histo', 'cytol'],
|
||||
],
|
||||
'infusion' => [
|
||||
@@ -283,7 +367,13 @@ return [
|
||||
'icon' => 'beaker',
|
||||
'queue_keywords' => ['infusion', 'iv', 'drip', 'day care'],
|
||||
'access' => 'general',
|
||||
'roles' => ['doctor', 'nurse', 'pharmacist', 'receptionist'],
|
||||
'roles' => ['oncologist', 'nurse'],
|
||||
'view_roles' => [
|
||||
'oncologist', 'nurse', 'general_physician', 'doctor', 'pharmacist',
|
||||
],
|
||||
'refer_roles' => [
|
||||
'general_physician', 'doctor', 'pharmacist',
|
||||
],
|
||||
'specialist_keywords' => ['infusion', 'iv therapy', 'day care'],
|
||||
],
|
||||
'dermatology' => [
|
||||
@@ -297,10 +387,12 @@ return [
|
||||
'icon' => 'swatch',
|
||||
'queue_keywords' => ['derma', 'skin', 'rash'],
|
||||
'access' => 'restricted',
|
||||
'roles' => ['doctor'],
|
||||
'roles' => ['dermatologist', 'general_physician', 'doctor'],
|
||||
'support_roles' => [],
|
||||
'view_roles' => ['doctor', 'general_physician', 'nurse'],
|
||||
'refer_roles' => ['doctor', 'general_physician', 'nurse'],
|
||||
'view_roles' => [
|
||||
'dermatologist', 'general_physician', 'doctor',
|
||||
],
|
||||
'refer_roles' => ['general_physician', 'doctor'],
|
||||
'specialist_keywords' => ['derma', 'skin'],
|
||||
],
|
||||
'podiatry' => [
|
||||
@@ -314,10 +406,12 @@ return [
|
||||
'icon' => 'finger-print',
|
||||
'queue_keywords' => ['podiat', 'foot', 'diabetic foot'],
|
||||
'access' => 'restricted',
|
||||
'roles' => ['doctor'],
|
||||
'roles' => ['podiatrist'],
|
||||
'support_roles' => [],
|
||||
'view_roles' => ['doctor', 'general_physician', 'nurse'],
|
||||
'refer_roles' => ['doctor', 'general_physician', 'nurse'],
|
||||
'view_roles' => [
|
||||
'podiatrist', 'general_physician', 'doctor',
|
||||
],
|
||||
'refer_roles' => ['general_physician', 'doctor'],
|
||||
'specialist_keywords' => ['podiat', 'foot'],
|
||||
],
|
||||
'fertility' => [
|
||||
@@ -331,10 +425,12 @@ return [
|
||||
'icon' => 'sparkles',
|
||||
'queue_keywords' => ['fertil', 'ivf', 'reproduct'],
|
||||
'access' => 'restricted',
|
||||
'roles' => ['doctor'],
|
||||
'roles' => ['fertility_specialist'],
|
||||
'support_roles' => [],
|
||||
'view_roles' => ['doctor', 'general_physician', 'nurse'],
|
||||
'refer_roles' => ['doctor', 'general_physician', 'nurse'],
|
||||
'view_roles' => [
|
||||
'fertility_specialist', 'general_physician', 'doctor',
|
||||
],
|
||||
'refer_roles' => ['general_physician', 'doctor'],
|
||||
'specialist_keywords' => ['fertil', 'ivf', 'reproduct'],
|
||||
],
|
||||
'child_welfare' => [
|
||||
@@ -348,7 +444,11 @@ return [
|
||||
'icon' => 'gift',
|
||||
'queue_keywords' => ['cwc', 'child welfare', 'well baby', 'well-child', 'welfare clinic'],
|
||||
'access' => 'general',
|
||||
'roles' => ['doctor', 'nurse', 'receptionist'],
|
||||
'roles' => ['general_physician', 'doctor', 'nurse'],
|
||||
'view_roles' => [
|
||||
'general_physician', 'doctor', 'nurse', 'receptionist',
|
||||
],
|
||||
'refer_roles' => ['general_physician', 'doctor', 'receptionist'],
|
||||
// Prefer multi-word / CWC stems — do not use bare "child" (steals pediatrics).
|
||||
'specialist_keywords' => ['child welfare', 'cwc', 'welfare clinic', 'well baby', 'well-child'],
|
||||
],
|
||||
@@ -364,7 +464,13 @@ return [
|
||||
// Avoid ED stems (emergency, casualty, trauma, er, a&e) — those belong to emergency.
|
||||
'queue_keywords' => ['ambulance', 'ems', 'paramedic', 'prehospital', 'ambulance service'],
|
||||
'access' => 'general',
|
||||
'roles' => ['doctor', 'nurse', 'receptionist'],
|
||||
'roles' => ['ambulance_staff'],
|
||||
'view_roles' => [
|
||||
'ambulance_staff', 'general_physician', 'doctor', 'receptionist',
|
||||
],
|
||||
'refer_roles' => [
|
||||
'general_physician', 'doctor', 'receptionist',
|
||||
],
|
||||
'specialist_keywords' => ['ambulance', 'ems', 'paramedic', 'prehospital'],
|
||||
],
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user