import type { Coding } from 'fhir/r4'; export type ClinicalTier = 'provider' | 'support'; /** * Roles whose day is rooming/prep/assisting a provider's visit (the "rooms & preps" tier). Every OTHER * catalog role - and any custom role - is 'provider' (runs-visits). Note the split WITHIN the nursing * discipline: RN/LPN/LVN/CNA are support; NP/CNM/CRNA/PA run visits (not listed here). Approved 2026-07-20. */ export const ROOMS_AND_PREPS_ROLE_CODES = new Set([ 'registered-nurse', 'licensed-practical-nurse', 'licensed-vocational-nurse', 'certified-nursing-assistant', 'medical-assistant', 'dental-hygienist', 'dental-assistant', 'ophthalmic-technician', 'optician', 'chiropractic-assistant', 'physical-therapy-assistant', 'occupational-therapy-assistant', 'behavioral-health-technician', 'pharmacy-technician', 'phlebotomist', 'surgical-technician', 'radiology-professional', 'laboratory-professional', 'medical-scribe', ]); /** The overview tier for a user's PRIMARY role coding. Unknown/custom/undefined 'provider'. */ export const roleTier = (coding?: Coding): ClinicalTier => coding?.code && ROOMS_AND_PREPS_ROLE_CODES.has(coding.code) ? 'support' : 'provider';