The system stores every file your clinic uses: consents, scans, medical photos, staff visas, vendor contracts, lab result PDFs, audit certificates. Two storage systems run side by side. The clinic file manager is the Drive-style folder browser you see in the documents view. The typed documents system is what powers the Documents tab inside each entity drawer (patient, employee, invoice). Both attach files where they belong so nothing gets orphaned, but they have different rules.

Two storage systems, one product#

The file manager and the typed-documents API solve different problems and you reach them from different places.

  • File manager (Drive-style). Folder tree, hierarchical share inheritance (a file dropped into a shared folder picks up the folder's shares), branch and team audiences, soft delete with filename suffixing, single-folder zip export. This is what the standalone Documents view shows. There is no category field; organisation is by folder naming.
  • Typed documents (entity attachments). Every record (patient, employee, invoice, booking, vendor) carries a Documents tab driven by the typed API. Each document sits in a scope (patient, employee, accounting, booking, inventory, sales, general) and inside a category that defines the allowed MIME types, a per-category file-size cap, and whether expiry is required. Versioning is first-class. The 500 MB presigned-upload path lives here.

If you are browsing files the way you would browse Google Drive, you are in the file manager. If you opened a patient or an employee and clicked the Documents tab, you are in the typed-documents system.

For staff, uploading and finding files#

Attach a file#

Open the record (patient, invoice, employee, vendor), Documents tab, click + Upload. Drag the file or pick it. Choose the category. Save.

Supported: PDF, JPG, PNG, MP4, DOCX, XLSX. Files up to 50 MB go straight through the API. Files between 50 MB and 500 MB use a presigned-S3 path: the file uploads directly from your browser to storage, then the system confirms it. If the browser tab closes mid-upload, the placeholder is left in draft status and is cleared on the next sweep. The upload paths have platform limits, and a document category can impose a smaller file-size cap. Check the selected category before preparing a large upload.

Find a file#

From the record's Documents tab, filter by category, date, or filename. From the global search bar, type the filename.

Coming soon. The behaviour described below is on the roadmap. Today: search inside file contents is not implemented. OCR and PDF full-text indexing are roadmap items, not live. Filename search works; "any text inside the PDF" does not.

Preview#

Click any file to preview inline. PDFs and images render directly; other types prompt download.

Share inside the clinic#

Folders and files in the file manager can be shared with another user, a branch, or a messaging team. Sharing with a branch or team automatically notifies every member through the in-app notification channel. Sharing with a single user is silent (no notification). Shares cascade: a new file dropped into a shared folder inherits the folder's shares automatically. Move a file out of a shared folder and it loses those shares.

Coming soon. The behaviour described below is on the roadmap. Today: there is no "Send to patient" action. Patient-facing share (WhatsApp link, email attachment, portal hand-off, authenticated time-limited link) is roadmap. Shares fan out to branches and teams only.

Categories and scopes#

Every typed document carries a category, and every category sits inside a scope (the entity family the document belongs to). Scopes are fixed; categories inside a scope are tenant-tunable.

  • patient: ID cards, insurance cards, lab results, consents, treatment plans, before and after photos.
  • employee: Emirates ID, passport, visa, professional licence, contract.
  • accounting: bank statements, receipts.
  • booking: booking-related attachments (uncommon today).
  • inventory: supplier certificates, MSDS sheets.
  • sales: quotations, signed proposals.
  • general: anything that does not fit a specific scope.

Inside a scope, categories carry a code (used by the system), a name and Arabic name, optional icon and colour, a requires_expiry flag, a per-category MIME allow-list, and a per-category file-size cap. Seeded categories cannot be renamed or deleted; they can only be deactivated. Tenant-authored categories alongside them are fully editable.

Large file uploads (presigned path)#

The direct upload endpoint caps at 50 MB. Anything larger uses a three-step presigned flow.

  1. The browser asks the server for a presigned PUT URL. The server creates a draft document row, stores the target S3 key, and returns the URL (valid for 1 hour).
  2. The browser uploads the file straight to S3 with that URL. The clinic's server never sees the bytes, so a 400 MB MRI does not block other traffic.
  3. The browser tells the server "upload done". The server flips the document from draft to active.

If the browser tab closes after step 1 but before step 3, the draft row stays in place until it is cancelled or swept. A staff member can also cancel an in-progress upload from the UI to release the S3 key immediately.

Expiry warnings (live today)#

Categories that require an expiry date (Emirates ID, visa, professional licence, insurance card) drive a daily background job. The job finds documents whose expiry falls within 30 days and emits an expiry-warning event so other modules can react. A second daily job flips documents whose expiry has passed from active to expired. The 30-day warning window is configurable per category, and the critical threshold sits at 7 days.

The warning is fired once per document. A document already marked as "warning sent" does not re-warn every day. The expired flip is capped per run so a one-time backlog cannot pile up notifications.

Per-category retention (roadmap)#

Coming soon. The behaviour described below is on the roadmap. Today: a per-category retention engine (auto-archive at N years, hard-delete after legal hold) is not shipped. Files stay until someone soft-deletes them. The expiry warning above is not the same thing as retention; it is "this document is about to be invalid", not "this document should be purged".

Attachment registry, why you cannot attach to just any model#

The typed-documents API will only attach to entities that are explicitly registered. Each backend app declares "documents can hang off these models, in this scope, with this label" at startup. A category that points at an unregistered model is rejected at save time. This is what stops a tenant accidentally turning, say, a payment row into a free-for-all attachment surface.

If a developer needs to open a new entity to the typed-documents API, they register it in that app's startup hook; there is no admin UI for this.

Employee documents, where the expiry lives#

Employee documents have a stricter type system than other scopes. The recognised types are emirates_id, passport, visa, and professional_license. When you upload one of these with an expiry date, the system copies the expiry onto the matching field on the employee profile (for example, an Emirates ID expiry lands on emirates_id_expiry on the profile). The HR dashboards then read from the profile, not from each document, which is why the renewal reminders work even before the typed-documents tab is the daily surface.

If the document is later versioned with a new expiry, the sync runs again and the profile field updates.

Sharing through folders#

The file manager treats shares as something that hangs off a folder, not off each file. When you create a folder under a shared parent, the new folder inherits the parent's shares. When a file is uploaded into that folder, it inherits the same shares. Move the file out and it loses those shares. This is what lets a clinic share an entire "X-Ray archive" folder with a team once, and every file dropped in later picks up the same audience automatically.

For admins, retention and policy#

Storage and security#

  • Files live in S3 (or the configured S3-compatible store). Server-side encryption depends on the bucket policy of the deployment; the application code does not pin SSE or KMS headers today.
  • Access through the API is role-gated. There is no per-category access matrix today; anyone who can open the parent record can see the Documents tab on it.
  • Every upload, version, archive, and delete logs a structured event. Download access logging is on the roadmap.
Coming soon. The behaviour described below is on the roadmap. Today: watermarking on download is not implemented. No setting, no toggle, no service exists in the codebase.

Custom categories#

Tenants can create their own document categories alongside the seeded ones. On the backend this is fully supported; anything not marked as a system default is editable.

Coming soon. The behaviour described below is on the roadmap. Today: the Documents API supports staff-managed custom categories and protects system-default categories. A dedicated category editor in Settings is not established by this guide; ask support if your current document screen does not expose category management.

Migration import#

Bulk file import at go-live is ad-hoc today. There is no management command that takes a ZIP plus a mapping CSV; the platform team scripts each migration to the tenant's source shape. If you need a bulk import, raise it with onboarding before kick-off.

Compliance report (today: API only)#

A compliance-report task counts active, expired, and expiring-soon documents per scope and returns the totals. It runs on demand; there is no schedule, no PDF or XLSX export, and no recipient list today. The numbers feed an admin view, not a regulator bundle. A scheduled run with a delivered file is on the roadmap.

Folder zip export#

The one bulk export shipped today is per-folder zip in the file manager. Select a folder, request a zip, the server bundles its contents into a single archive. There is no date-range or category bundle, no manifest of what was included, and no regulator-grade export endpoint. For a regulator inspection, the platform team scripts an export against the tenant schema.

How documents connect to the rest of the system#

  • Patients, consent records and clinical documents attach to the patient drawer.
  • EMR / Clinical tests, result PDFs and scan images attach to the chart.
  • Invoices, invoice PDFs and proof of payment attach to the invoice.
  • Vendors and purchases, contracts and bills attach to the vendor record.
  • Employees, visas, licences, contracts. Expiry dates sync to the employee profile and drive renewal reminders.
  • Notifications, "expires in N days" alerts for time-bound documents.
  • Security and audit, every upload, version, archive, and delete event is captured.
  • Patient portal, shared documents appear in the patient's portal (roadmap; today shares fan out to internal audiences only).

Common situations#

  • "File will not upload, size limit hit." The 50 MB direct-upload cap is a backend constant. Files between 50 MB and 500 MB go through the presigned path automatically. Anything beyond 500 MB has to be split.
  • "Want to delete a patient's consent." Soft-delete is the default; the file is renamed with a suffix and hidden, but the row stays for audit. Hard delete requires owner approval and the legal hold to be clear.
  • "Staff licence expires next month." The system warns at 30 days and again at 7 days, then flips the document to expired on the day. Renew, upload the new version, archive the old.
  • "External auditor wants all clinic files for last year." The only bulk export shipped today is per-folder zip in the file manager. There is no date-range or category bundle and no manifest. For a regulator inspection, the platform team scripts an export against the tenant schema.
  • "Stuck draft after a failed large upload." Cancel the upload from the UI to release the S3 key, or wait for the next sweep to clear the draft.