Glossary
DHS — Dubai Health Authority. In this codebase it refers to Dentolize's integration with DHS's insurance clearinghouse: eligibility checks, coverage lookups, and pre-approval submissions for UAE clinics. Parallel to, but separate from, the NPHIES integration used by Saudi clinics.
NPHIES — Saudi Arabia's National Platform for Health Information Exchange Services, the Saudi counterpart to DHS. Referenced here only for contrast — this PR does not touch NPHIES code.
clinic-web-canary — A separately built and published package (@dentolize/clinic-web-canary, built with vite build --lib) that clinic-web consumes as a dependency. It hosts newer/faster-moving features — DHS integration, ZATCA e-invoicing, custom forms, and others — so they can ship somewhat independently of the main clinic-web release cycle, while still rendering inside the main app.
Prop injection — The pattern this PR applies throughout: instead of a component reaching into another package's source code to get something it needs (a direct import), the parent component passes that thing in as a normal React prop. Makes dependencies explicit, type-checkable, and buildable independently of the source it used to reach into.
DHSUser — A TypeScript type (packages/clinic-web-canary/src/features/DHS/shared/DHSUser.ts) describing the minimal shape of the logged-in user that DHS canary components need: id, name, isDoctor, medicalNumber, a permissions map, and optionally the user's company country. Introduced in this PR as the typed replacement for what used to be a live import of clinic-web's user context.
nphiesCode — The field name (on a Branch or InsuranceCompany record) used to store a clearinghouse branch/company code — despite the name, this same field is reused for DHS branch mappings, not just NPHIES ones. A DHS-facing screen checks branchData?.branchDetails?.nphiesCode to decide whether a branch has completed DHS setup.
Feature flag FEATURE_DHS_INTEGRATION — Controls whether any DHS UI renders for a given tenant at all, independent of user permissions or branch configuration. Unchanged by this PR.
canSubmitOperation — A pure function deciding whether a chart procedure is eligible to be (re)submitted to DHS for approval: true if it has no approval yet, or its prior approval errored without ever receiving an approval number. Exists in three manually-synced copies across the server, clinic-mobile, and clinic-web-canary packages — see For Quality.
Rollup / Vite --lib build — The production bundler used to package clinic-web-canary for distribution. Distinct from the TypeScript compiler (tsc): tsc type-checks source against declared types (including any-typed declare module shims), while Rollup actually resolves and transforms the real files behind an import. A file that satisfies tsc can still fail to bundle if Rollup can't process it — which is exactly what happened here before this PR.