# RADENVO FHIR Capability Statement

| | |
|---|---|
| Product | RADENVO FHIR R4 server (CapabilityStatement `lumen-pacs`, version 1.3.0) |
| Document date | 2026-11-05 |
| FHIR version | 4.0.1 (R4) |
| Base URL | `https://<host>/api/fhir/r4` |
| Machine-readable statement | `GET <base>/metadata` (no authentication) |
| SMART configuration | `GET <base>/.well-known/smart-configuration` |
| Sources | `src/lib/fhir/**` (statement generated in `server.ts`), `src/app/api/fhir/**` |

This document is a readable rendering of the CapabilityStatement the server generates from its own resource definitions, plus behavior described in the code. Every interaction and search parameter listed is implemented; anything not listed is not supported.

---

## 1. General

| Item | Value |
|---|---|
| Kind | instance (one multi-tenant endpoint; the tenant comes from the access token, never from the URL) |
| Formats | `application/fhir+json` (JSON only; XML requests get 406) |
| Patch format | `application/json-patch+json` |
| System interactions | `batch`, `transaction` (POST of a Bundle to the base URL) |
| CORS | not enabled |
| Software | RADENVO 1.2 |

### 1.1 Search

- Paging: `_count` (maximum 500) with `self`, `first`, `previous`, `next`, `last` links (`_offset`). `_summary=count` returns the total only.
- Common parameters on every resource: `_id`, `_lastUpdated`.
- `_sort` on the parameters each resource supports (an unsupported sort is an error, not ignored).
- `_include` and `_revinclude` as listed per resource (one level, no `:iterate`).
- Chained reference parameters one level deep (for example `ImagingStudy?patient.identifier=…`, `DiagnosticReport?subject:Patient.name=…`) and reference type modifiers.
- String parameters match "contains", case-insensitive; `:exact` and `:missing` are supported on string (and `:missing` on reference) parameters.
- Unknown search parameters are ignored and reported in an OperationOutcome entry (`search.mode = outcome`); unknown `_include`/`_revinclude` values are rejected with 400.
- `POST <Type>/_search` with `application/x-www-form-urlencoded`.
- `_elements` and `_total` are accepted and have no effect.

### 1.2 Versioning, conditional interactions, delete

- `meta.versionId` is a real, increasing version for every resource backed by a tracked row (every write, from FHIR or from the RADENVO application, is a new version; heartbeat counters are not); DiagnosticReport uses the report's own version. **Every resource offers `vread` and `_history`** (instance and type, with `_since`, `_count`, `_offset`): stored versions where rows are tracked; computed resources (free Slots, built-in code systems and value sets, staff Practitioners/PractitionerRoles, the tenant Organization, order diagnoses, registration allergy alerts, imaging assessment Observations, ledger-only Accounts) have a content-derived version and history returns their current version. Deletions appear in history (`request.method` DELETE) and `vread` of a deletion version answers 410.
- History follows the read rules: a signed-in user sees the stored versions of a row only when the row itself is visible to that user under the table's row-level security (`fhir_row_visible`); an API client sees only its own organization (and, for Subscription, only its own subscriptions).
- `ETag: W/"<versionId>"`, `Last-Modified` and `If-None-Match` (304) on read; `If-Match` on update and patch (412 on conflict).
- Conditional create (`If-None-Exist`), conditional update and patch (search URL, single match; conditional update creates when nothing matches and the type supports create), conditional delete (single match). Multiple matches: 412.
- Update-as-create (PUT to an unknown id) is not supported.
- **Delete** follows FHIR semantics: 204, and afterwards read answers **410 Gone** (API clients; a signed-in user gets 404) and history shows the deletion — for Patient (records without clinical or billing data only; otherwise 409), DocumentReference (marked entered-in-error, file kept), Account, Flag, Encounter (undo arrival), Slot (unblock), Device (remote AE), OrganizationAffiliation (practice), CodeSystem, ValueSet and Subscription. Where clinical or billing records must be kept the delete is a status change and the resource stays readable with that status: ServiceRequest `revoked` (orders already performed cannot be deleted), Appointment cancelled (completed visits cannot be deleted), Coverage ended, Task cancelled, FamilyMemberHistory/AllergyIntolerance/Condition/Observation `entered-in-error`, ChargeItem voided, Organization (payer), HealthcareService, Practitioner (referrer), Schedule and RADENVO receiving AEs deactivated. Deleting an already deleted resource returns 204.
- `Prefer: return=minimal` returns 201 without a body.

### 1.3 Batch and transaction

- At most 100 entries. `urn:uuid:` references between entries are resolved in transactions; duplicate `fullUrl` values are rejected.
- Transactions process DELETE, POST, PUT/PATCH, GET in that order and are all-or-nothing through compensating rollback: on any failure, created rows are removed and changed rows are restored to their previous version. Side effects already sent (notifications) are not recalled.
- Each batch or transaction entry is audited.

---

## 2. Security

### 2.1 Authentication: SMART Backend Services

| Item | Value |
|---|---|
| Token endpoint | `POST https://<host>/api/fhir/token` |
| Grant type | `client_credentials` |
| Client authentication | `client_secret_basic`, `client_secret_post`, `private_key_jwt` |
| Assertion signing algorithms | RS384, ES384, RS256, ES256 (keys from the client's registered JWKS; `exp` must be within 5 minutes; `jti` replay is refused) |
| Access token | opaque bearer token, stored as a SHA-256 hash, lifetime 300 s (`FHIR_TOKEN_TTL`) |
| Capabilities advertised | `client-confidential-symmetric`, `client-confidential-asymmetric`, `permission-v1`, `permission-v2` |

FHIR clients are registered per organization by an administrator (Admin, FHIR clients) with their allowed scopes, a client secret and/or a JWKS. A client can be deactivated at any time. Requested scopes are granted only when the client's registered scopes cover them; with no `scope` parameter the client receives all its registered scopes.

**Signed-in RADENVO users** may also call the API with their browser session (or Supabase access token) within their organization and are subject to the same row-level security as the web application. They receive `user/*.rs` (read and search only) unless the organization setting `fhir_user_writes` is true; then they receive `user/*.cruds` and every write additionally checks the user's role for that resource (`has_role`, listed in section 3.2) and, for delete, the delete permission (`has_perm`). Subscriptions remain API-client only.

### 2.2 Scopes

| Scope form | Meaning |
|---|---|
| `system/*.read`, `system/<Type>.read` | read and search (SMART v1) |
| `system/*.write`, `system/<Type>.write` | create, update, patch, delete (SMART v1) |
| `system/*.*` | everything |
| `system/<Type>.<cruds>` | SMART v2 letters: c create, r read, u update, d delete, s search (for example `system/*.rs`) |
| `system/Binary.read` | Binary read |

`write` scopes are advertised for every resource with a write interaction (every resource except Endpoint and ImagingStudy). History and vread require read permission. A request outside the token's scopes returns 403 with an OperationOutcome.

### 2.3 Audit

Every FHIR interaction is written to the organization's tamper-evident audit log (`fhir.read`, `fhir.search`, `fhir.create`, `fhir.update`, `fhir.delete`, `fhir.history`, `fhir.bundle`, per-entry `fhir.batch.entry` / `fhir.transaction.entry`) with method, path, query, HTTP status and result count. Token issuance is audited as `fhir.token`.

### 2.4 Transport

HTTPS only. Errors return an OperationOutcome; 401 includes `WWW-Authenticate: Bearer realm="lumen-fhir", error="invalid_token"`. Binary content is served with `Content-Security-Policy: sandbox`, `X-Content-Type-Options: nosniff` and `Cache-Control: no-store`.

---

## 3. Resources

### 3.1 Summary

| Resource | read | vread | search | create | update / patch | delete | history (instance, type) |
|---|---|---|---|---|---|---|---|
| Account | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| AllergyIntolerance | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Appointment | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| ChargeItem | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| CodeSystem | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Condition | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Coverage | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Device | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| DiagnosticReport | Yes | Yes | Yes | Yes | Yes | - | Yes |
| DocumentReference | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Encounter | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Endpoint | Yes | Yes | Yes | - | - | - | Yes |
| FamilyMemberHistory | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Flag | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| HealthcareService | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| ImagingStudy | Yes | Yes | Yes | - | - | - | Yes |
| Location | Yes | Yes | Yes | Yes | Yes | - | Yes |
| Observation | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Organization | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| OrganizationAffiliation | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Patient | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Practitioner | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| PractitionerRole | Yes | Yes | Yes | - | Yes | - | Yes |
| Schedule | Yes | Yes | Yes | - | Yes | Yes | Yes |
| ServiceRequest | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Slot | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Subscription | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Task | Yes | Yes | Yes | - | - | Yes | Yes |
| ValueSet | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Binary | Yes | - | - | - | - | - | - |


### 3.2 Write mappings

Writes land in RADENVO's own tables, scoped to the caller's organization; scopes, role checks (signed-in users) and audit apply to every write. "Roles" are the membership roles a signed-in user needs when the organization enables `fhir_user_writes` (delete also needs the delete permission); API clients are authorized by their `system/<Type>.write` scope.

| Resource | Stored in | Rules | Delete | Roles |
|---|---|---|---|---|
| Account | `patient_accounts` (id = patient id) | Account settings: `description` (account note), `guarantor[0].onHold` (statement hold). Balances, coverage and guarantor party are derived (read-only). One account per patient: create of an existing account returns 409. | Only without ledger activity (409 when the patient has charges); read then answers 410. | admin, staff |
| AllergyIntolerance | `patient_allergies` | Structured allergies (substance and code, category, criticality, clinical and verification status, reaction, severity). Registration alerts (id = patient id) stay read-only (422; change them through Flag). `patient` cannot be changed. | Soft: `verificationStatus` entered-in-error; stays readable. | admin, staff, technologist, radiologist |
| ChargeItem | `charges` | One charge per exam: `service` (ImagingStudy of the same patient) is required. CPT/HCPCS code, modifiers (extension `urn:lumen:fhir:cpt-modifier`), ICD-10 `reason`, units, fee (`priceOverride`), date of service, `supportingInformation` Coverage of the same patient. Status planned (draft) or billable (ready) only; submitted/paid/denied charges are read-only (409). | Soft: voided (status entered-in-error); 409 once submitted. | admin, staff |
| CodeSystem | `fhir_terminology` | Org-local code systems: `url` (not `urn:lumen:`), version, name, title, status, `concept` (unique codes, max 5000), content complete. Built-in systems (`urn:lumen:…`, the procedure catalogue) are read-only (422). | Hard (read then answers 410). | admin |
| Condition | `patient_conditions` | Problem-list conditions. Diagnoses and reasons for exam carried on orders (id = `<order id>-<n>`) stay read-only; change the ServiceRequest instead. `subject` cannot be changed. | Soft: `verificationStatus` entered-in-error. | admin, staff, technologist, radiologist |
| Device | `remote_aes` / `dicom_nodes` | Remote AEs: identifier `urn:dicom:ae`, `url` dicom://host:port, `type` (modality, workstation, pacs, vna, ai, research, ris, printer, dicomweb, other), `deviceName`, status inactive = paused. RADENVO receiving AEs (type lumen-ae): only description and active can change; they are provisioned in Admin → Gateways (create returns 422). | Remote AE removed (as in Admin → Gateways, with its routing rules; 410 afterwards); RADENVO AE deactivated. | admin |
| DiagnosticReport | `reports` | Only when the organization exposes preliminary reports (`fhir_expose_preliminary`), otherwise 422. Create: a preliminary report for an `imagingStudy` (or `basedOn` order with images) without a report; text from `conclusion` and `presentedForm` text/plain (sections TECHNIQUE, COMPARISON, FINDINGS, IMPRESSION, RECOMMENDATIONS). Update: a preliminary report's text (stays preliminary); a final report accepts only an addendum (extension `urn:lumen:fhir:addendum` or an ADDENDUM section; status becomes appended), anything else 409. **Reports are never signed through FHIR**: status final is refused (422). | Not offered (405): reports are medico-legal records. | radiologist, admin |
| DocumentReference | `documents` + private `documents` bucket | Create needs `subject` and `content[0].attachment.data` inline base64 (attachments by URL are not fetched), content type PDF, PNG, JPEG, TIFF, GIF, plain text, RTF or Word, 1 byte to 20 MB (PDF signature checked). Content is immutable: an update may change type, description and related order/study but not the attachment. | Marked entered-in-error (file kept, Binary no longer served); read then answers 410. | admin, staff, technologist, radiologist |
| Encounter | `appointments` (id = appointment id) | Create checks the patient in for a booked appointment (`appointment` required, status arrived or in-progress); update/patch move it forward arrived → in-progress → finished (going back: 409). | Undoes an arrival (appointment back to booked; 409 once in progress); read then answers 410. | admin, staff, technologist, radiologist |
| FamilyMemberHistory | `family_member_history` | One condition per resource; relationship (HL7 v3 RoleCode), sex, onset age, deceased, note. Entries also come from the intake questionnaire (source `intake`). `patient` cannot be changed. | Soft: status entered-in-error. | admin, staff, technologist, radiologist |
| Flag | `patients.alerts` (id = patient id) | One alert text per patient (`code.text`), status active. Create on a patient who already has an alert returns 409. | Clears the alert; read then answers 410. | admin, staff, technologist, radiologist |
| HealthcareService | `procedures` | Procedure catalogue: identifier `urn:lumen:org:<slug>:procedure` (or a CPT type coding), name, `specialty` DICOM modality, duration as characteristic "NN minutes", "Prior authorization required" / "Patient self-scheduling" characteristics, preparation in `extraDetails`, active. | Soft: deactivated. | admin |
| Location | `facilities` / `rooms` | A Location with `physicalType` `ro` or a `partOf` reference is a scanner room of that facility; otherwise a facility. | Not offered: referenced by appointments, studies and charges; a room is taken out of service with status inactive. | admin |
| Observation | `patient_observations` | Laboratory results (also received over HL7 OBX): `code` coding (LOINC stored as LN), value (Quantity, string or CodeableConcept), status final/preliminary/corrected/cancelled, effective time, reference range, interpretation, `basedOn` order of the same patient. Imaging assessment categories (from signed reports and mammography exams) are read-only (422). | Soft: status entered-in-error. | admin, staff, technologist, radiologist |
| Organization | `payers` | Insurance payers (type `pay`). The tenant organization itself is managed in RADENVO settings (422). | Soft: payer deactivated; the tenant cannot be deleted (422). | admin, staff |
| OrganizationAffiliation | `payers` / `referrers.practice` | Role payer (id = payer): participatingOrganization.display + identifier `urn:lumen:payer-id`; role provider (id = referrer): `practitionerRole` of a referrer + practice name (409 if the referrer already has one). | Payer: deactivated; practice: cleared (410 afterwards). | admin, staff |
| Patient | `patients` | MRN identifier required on create; name, gender, birth date, telecom, address. | Only a record without clinical or billing data (any table with a patient_id: studies, orders, appointments, documents, policies, charges, history entries…); read then answers 410. Otherwise 409: merge the record in RADENVO. | admin, staff, technologist, radiologist |
| Practitioner | `referrers` | Referring physicians (name, NPI, telecom, `active`). Staff users are managed in RADENVO user management (422). | Soft: active false (report delivery off); orders keep the reference. | admin, staff, technologist, radiologist |
| PractitionerRole | `referrers` (id = practitioner id) | Update/patch a referrer's practice (`organization.display`), phone, email, active. Staff roles are read-only (422). | Not offered (1:1 with the Practitioner; delete the Practitioner). Create not offered: the role exists with its Practitioner. | admin, staff, technologist, radiologist |
| Schedule | `rooms` (id = room id) | Update/patch `active`, `serviceType` (DICOM modality) and opening hours (extension `urn:lumen:fhir:opening-hours`, `HH:MM-HH:MM`). Create not offered: every room has exactly one Schedule. | Soft: deactivated (no new bookings). | admin |
| Slot | `schedule_blocks` | Blocked time only: status busy-unavailable, `schedule` (a room), start/end, `comment` (reason). Rejected (409) when an appointment is booked in that time or another block overlaps. Computed free slots cannot be written (422). | Unblocks (row removed); read then answers 410. | admin, staff |
| Subscription | `fhir_subscriptions` | See section 4. | Removed; read then answers 410. | API clients only |
| ValueSet | `fhir_terminology` | Org-local value sets: `url` (not `urn:lumen:`), `compose.include` of built-in or org-local code systems (all codes) or explicit concepts of any system; the expansion is computed on read. Built-in value sets are read-only (422). | Hard (410 afterwards). | admin |

Interactions that stay read-only, with the reason (also in each resource's documentation in the CapabilityStatement): ImagingStudy (derived from received DICOM: created by C-STORE/STOW-RS, corrected through DICOM/HL7 or the study editor, deleted under RADENVO retention), Endpoint (provisioned in Admin → Gateways; changed through Device), Task create/update (follow-up recommendations are created by the reading workflow), DiagnosticReport delete, Location delete, PractitionerRole create/delete, Schedule create.

### 3.3 Resource details

#### Account

One billing account per patient with charges or account settings (id = patient id); balances from the ledger. create/update store the account settings: description (account note) and guarantor.onHold (statement hold). Delete: Removes the account settings of a patient without ledger activity (read then answers 410); an account with charges cannot be deleted.

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

_include: Account:patient. _revinclude: ChargeItem:account.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| patient | reference | Patient (references Patient; chainable) |
| subject | reference | Patient (references Patient; chainable) |
| status | token | active |
| name | string | Name (contains) |
| identifier | token | Account id |
| type | token | PBILLACCT |
| owner | reference | Owner (references Organization; chainable) |

#### AllergyIntolerance

Structured allergies (create/update; source staff, HL7 or FHIR) and, read-only, allergy alerts recorded at registration (patients.alerts mentioning an allergy/reaction; id = patient id, free text, unconfirmed). Delete: Soft delete of a structured allergy: verificationStatus becomes entered-in-error and it stays readable. Registration alerts are cleared through Flag (DELETE Flag/<patient id>).

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

_include: AllergyIntolerance:patient.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| patient | reference | Patient (references Patient; chainable) |
| clinical-status | token | active \| inactive \| resolved |
| verification-status | token | unconfirmed \| confirmed \| refuted \| entered-in-error |
| type | token | allergy |
| category | token | food \| medication \| environment \| biologic |
| criticality | token | low \| high \| unable-to-assess |
| code | string | Substance text or code (contains) |
| date | date | Recorded |
| severity | token | mild \| moderate \| severe |

#### Appointment

Scheduled exams per room. create books a room (conflicts with other appointments and block time are rejected); update reschedules or cancels. Delete: Soft delete: the appointment is cancelled (frees the room). Completed visits cannot be deleted.

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

_include: Appointment:patient. _revinclude: Encounter:appointment.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| patient | reference | Patient (references Patient; chainable) |
| actor | reference | Patient or room Location |
| location | reference | Room Location (references Location; chainable) |
| date | date | Appointment start |
| status | token | booked \| arrived \| checked-in \| fulfilled \| noshow \| cancelled |
| based-on | reference | The order (references ServiceRequest; chainable) |

#### ChargeItem

Technical/professional charges per exam (one per ImagingStudy; CPT, modifiers, ICD-10, units, fee). Billing status is in extension urn:lumen:fhir:charge-status. create/update write planned (draft) or billable (ready) charges; submitted, paid and denied charges are read-only. Delete: Soft delete: a planned/billable charge is voided (status entered-in-error) and stays readable; charges already submitted or paid cannot be deleted (adjust them in billing).

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

_include: ChargeItem:patient, ChargeItem:service.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| patient | reference | Patient (references Patient; chainable) |
| subject | reference | Patient (references Patient; chainable) |
| account | reference | Account (= patient id) (references Account; chainable) |
| code | token | CPT code |
| entered-date | date | Entered |
| occurrence | date | Date of service |
| service | reference | The exam (references ImagingStudy; chainable) |
| status | token | planned \| billable \| billed \| entered-in-error |

#### CodeSystem

RADENVO's built-in local code systems (procedure catalogue, statuses, roles, RADS categories...; read-only) and org-local code systems stored through FHIR (create/update/delete; content = complete). Delete: Removes an org-local CodeSystem (read then answers 410); built-in ones are read-only.

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| url | token | Canonical URL |
| name | string | Name (contains) |
| title | string | Title (contains) |
| status | token | draft \| active \| retired |
| version | token | Version |
| code | token | A code in the set |

#### Condition

Problem-list conditions (create/update; staff or FHIR) plus, read-only, diagnoses (ICD-10-CM) and reasons for exam carried on orders (id = <order id>-<n>). Delete: Soft delete of a problem-list condition: verificationStatus becomes entered-in-error and it stays readable. Order diagnoses are changed on the ServiceRequest.

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

_include: Condition:patient.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| patient | reference | Patient (references Patient; chainable) |
| subject | reference | Patient (references Patient; chainable) |
| code | token | ICD-10-CM / SNOMED CT code |
| category | token | problem-list-item \| encounter-diagnosis |
| clinical-status | token | active \| inactive \| resolved \| ... |
| verification-status | token | confirmed \| provisional \| ... |
| recorded-date | date | Recorded |
| onset-date | date | Onset |

#### Coverage

Patient insurance policies. create adds a policy (payor display/identifier, subscriberId, class group, order 1-3). Delete: Soft delete: the policy is ended (period.end = yesterday, status cancelled); billing history keeps it.

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

_include: Coverage:beneficiary.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| patient | reference | Patient (references Patient; chainable) |
| beneficiary | reference | Patient (references Patient; chainable) |
| identifier | token | Member id |
| subscriber-id | token | Member id |
| payor | string | Payer name (contains) |

#### Device

DICOM application entities: RADENVO's own receiving AEs (type lumen-ae; update changes description and active, delete deactivates) and the registered remote modalities, workstations and archives (create/update/delete; url dicom://host:port, status inactive = paused). Delete: A remote AE is removed (with its routing rules and queued jobs, as in Admin -> Gateways); read then answers 410. A RADENVO receiving AE is deactivated and stays readable (studies keep their source).

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| identifier | token | AE title |
| device-name | string | Name (contains) |
| status | token | active \| inactive |
| type | token | lumen-ae \| modality \| workstation \| pacs \| vna \| ai \| ris \| printer \| other |
| organization | reference | Owner (references Organization; chainable) |
| location | reference | Room (references Location; chainable) |

#### DiagnosticReport

Signed radiology reports (final; appended when an addendum exists). Preliminary reports only when the org setting fhir_expose_preliminary is true; then create writes a preliminary report for a study, update replaces a preliminary report's text or adds an addendum (extension urn:lumen:fhir:addendum) to a final one. Reports are never signed through FHIR. vread returns earlier versions. Not offered: delete (radiology reports are medico-legal records: a signed report is corrected by an addendum, and an unsigned draft is discarded by its author in the reading workspace).

Interactions: read, vread, update, patch, history-instance, history-type, create, search-type. Versioning: versioned-update.

_include: DiagnosticReport:patient, DiagnosticReport:subject, DiagnosticReport:result, DiagnosticReport:based-on.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| patient | reference | Patient (references Patient; chainable) |
| subject | reference | Patient (references Patient; chainable) |
| status | token | final \| appended (amended) \| preliminary |
| date | date | Study (effective) date |
| issued | date | Signed at |
| identifier | token | Accession number |
| based-on | reference | ServiceRequest |
| results-interpreter | reference | Signing radiologist (references Practitioner; chainable) |
| category | token | RAD \| LP29684-5 |
| code | token | 18748-4 |
| conclusion | token | Text search in the impression (contains) |

#### DocumentReference

Scanned patient documents (requisitions, consents, insurance cards, prior reports...). Content is served by Binary. Delete: The document is marked entered-in-error (the stored file is kept for the legal record and Binary no longer serves it); read then answers 410 and history shows the deletion.

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

_include: DocumentReference:patient.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| patient | reference | Patient (references Patient; chainable) |
| subject | reference | Patient (references Patient; chainable) |
| type | token | requisition \| consent \| insurance_card \| id \| prior_report \| intake \| screening_form \| other |
| date | date | Created |
| related | reference | ImagingStudy or ServiceRequest |

#### Encounter

Derived from appointments once the patient has arrived (id = the appointment id). create checks the patient in (Encounter.appointment = a booked Appointment); update/patch move it forward (arrived -> in-progress -> finished). Delete: Undoes the check-in of an arrived patient (the appointment returns to booked); read then answers 410. Encounters in progress or finished cannot be deleted.

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

_include: Encounter:patient.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| patient | reference | Patient (references Patient; chainable) |
| subject | reference | Patient (references Patient; chainable) |
| date | date | Visit date |
| status | token | arrived \| in-progress \| finished |
| appointment | reference | Appointment (references Appointment; chainable) |
| location | reference | Room (references Location; chainable) |

#### Endpoint

DICOMweb (QIDO-RS/WADO-RS/STOW-RS) base URL per AE title; authenticate with that AE's bearer token (Admin -> Gateways). Not offered: create (DICOMweb endpoints are the RADENVO receiving AE titles; they are provisioned in Admin -> Gateways, where the bearer token is issued once (the Device resource changes their description and active flag)). Not offered: update (the address is derived from the AE title and the token is never exposed; change the AE through Device). Not offered: delete (deactivate the AE through Device (DELETE Device/<id>), which also turns the endpoint off).

Interactions: read, vread, history-instance, history-type, search-type. Versioning: versioned-update.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| name | string | AE title |
| status | token | active \| off |
| connection-type | token | dicom-wado-rs |

#### FamilyMemberHistory

Family history recorded by staff, the intake questionnaire (family history question type) or FHIR clients. One condition per resource. Delete marks the entry entered-in-error. Delete: soft delete: status becomes entered-in-error.

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

_include: FamilyMemberHistory:patient.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| patient | reference | Patient (references Patient; chainable) |
| status | token | partial \| completed \| entered-in-error \| health-unknown |
| relationship | token | v3 RoleCode (MTH, FTH, SIS, BRO, ...) |
| code | token | Condition code (e.g. SNOMED CT, ICD-10) |
| sex | token | male \| female \| other \| unknown |
| date | date | When recorded |

#### Flag

Patient alerts entered at registration (id = the patient id: one alert text per patient). create sets the alert of a patient without one, update replaces the text, delete clears it (read then answers 410).

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| patient | reference | Patient (references Patient; chainable) |
| subject | reference | Patient (references Patient; chainable) |

#### HealthcareService

Orderable/schedulable procedures; location = facilities with an active room of the procedure's modality. create/update maintain the procedure catalogue (code, name, modality, duration as characteristic 'NN minutes', preparation as extraDetails). Delete: Soft delete: the procedure is deactivated (active false; no longer orderable or bookable) and stays readable; orders keep their code.

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| name | string | Name (contains) |
| identifier | token | Procedure code |
| service-type | token | Procedure code |
| specialty | token | Modality (DCM) |
| active | token | true \| false |
| location | reference | Facility (references Location; chainable) |
| organization | reference | Provider (references Organization; chainable) |
| service-category | token | 35 (Radiology) |

#### ImagingStudy

Studies with series (instances on read). endpoint = RADENVO DICOMweb (QIDO/WADO-RS, per-AE bearer token). Not offered: create (ImagingStudy is derived from received DICOM: studies are created by C-STORE or STOW-RS (see Endpoint) and their metadata comes from the images). Not offered: update (study metadata is corrected through DICOM/HL7 updates (IOCM, ADT/ORM) or the RADENVO study editor so images and metadata stay consistent). Not offered: delete (deleting images is a retention decision made in RADENVO (study deletion with audit and DICOM IOCM notification), not through FHIR).

Interactions: read, vread, history-instance, history-type, search-type. Versioning: versioned-update.

_include: ImagingStudy:patient, ImagingStudy:endpoint, ImagingStudy:basedon. _revinclude: ChargeItem:service, Observation:derived-from, Task:focus.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| patient | reference | Patient (references Patient; chainable) |
| subject | reference | Patient (references Patient; chainable) |
| identifier | token | Accession number, or Study Instance UID with system urn:dicom:uid |
| started | date | Study date/time |
| modality | token | Modality (DCM code) |
| status | token | available \| registered |
| basedon | reference | ServiceRequest |
| dicom-class | token | SOP Class UID of any instance (urn:oid: prefix optional) |
| instance | token | SOP Instance UID |
| series | token | Series Instance UID |

#### Location

Facilities (mode instance) and their scanner rooms (physicalType ro, partOf the facility). Not offered: delete (facilities and rooms are referenced by appointments, studies and charges; a room is taken out of service with status inactive (update)).

Interactions: read, vread, update, patch, history-instance, history-type, create, search-type. Versioning: versioned-update.

_revinclude: Appointment:location, Device:location, Encounter:location, HealthcareService:location, Location:partof, Schedule:actor.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| name | string | Name (contains) |
| identifier | token | Facility NPI or room station AE title |
| partof | reference | Rooms of a facility (references Location; chainable) |
| type | token | Room modality (DCM) or RADDX |
| status | token | active \| inactive |
| organization | reference | Managing organization (references Organization; chainable) |
| address | string | Address text |

#### Observation

Imaging assessment categories (structured-report RADS results, mammography BI-RADS/density; read-only, derived from signed reports) and laboratory results received over HL7 (OBX) or FHIR (create/update/delete). Delete: Soft delete of a laboratory result: status becomes entered-in-error and it stays readable. Imaging assessment categories cannot be deleted (they come from signed reports).

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

_include: Observation:patient.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| patient | reference | Patient (references Patient; chainable) |
| subject | reference | Patient (references Patient; chainable) |
| code | token | bi-rads \| lung-rads \| ti-rads \| li-rads \| pi-rads \| breast-density \| HL7 OBX code |
| category | token | imaging \| laboratory |
| status | token | final \| preliminary \| corrected |
| based-on | reference | Order (HL7 results) (references ServiceRequest; chainable) |
| date | date | Exam date |
| derived-from | reference | Source study (references ImagingStudy; chainable) |

#### Organization

This tenant (type prov) and its insurance payers (type pay). Payers can be created, changed and deactivated; the tenant itself is read-only (managed in RADENVO settings). Delete: Soft delete: the payer is deactivated (active false) and stays readable; existing policies keep their payer name.

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

_revinclude: Account:owner, Device:organization, HealthcareService:organization, Location:organization, OrganizationAffiliation:primary-organization, OrganizationAffiliation:participating-organization, PractitionerRole:organization.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| name | string | Name (contains) |
| identifier | token | Org slug or payer id |
| type | token | prov \| pay |
| active | token | true \| false |

#### OrganizationAffiliation

Contracted payers (role payer; id = the payer Organization id) and referring practices (role provider; id = the referrer, practitionerRole = the referrer). create adds a payer (participatingOrganization.display + identifier urn:lumen:payer-id) or records a referrer's practice; update changes name/identifier/active or practice/telecom. Delete: A payer affiliation deactivates the payer (stays readable, active false); a practice affiliation clears the referrer's practice (read then answers 410).

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| role | token | payer \| provider |
| active | token | true \| false |
| primary-organization | reference | This organization (references Organization; chainable) |
| participating-organization | reference | Payer Organization (references Organization; chainable) |
| identifier | token | Payer id |

#### Patient

Registered patients (MRN is the master identifier; extra issuer identifiers from patient_identifiers). Delete: Only a record without clinical or billing data (no studies, orders, appointments, documents, policies, charges, history entries...) is deleted; read then answers 410. Any other record answers 409: merge it into the surviving record in RADENVO instead.

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

_revinclude: Account:patient, Account:subject, AllergyIntolerance:patient, Appointment:patient, ChargeItem:patient, ChargeItem:subject, Condition:patient, Condition:subject, Coverage:patient, Coverage:beneficiary, DiagnosticReport:patient, DiagnosticReport:subject, DocumentReference:patient, DocumentReference:subject, Encounter:patient, Encounter:subject, FamilyMemberHistory:patient, Flag:patient, Flag:subject, ImagingStudy:patient, ImagingStudy:subject, Observation:patient, Observation:subject, ServiceRequest:patient, ServiceRequest:subject, Task:patient, Task:subject.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| identifier | token | MRN (system urn:lumen:org:<slug>:mrn) or other issuer identifier |
| name | string | Any part of the name (contains) |
| family | string | Family name (contains) |
| given | string | Given name (contains) |
| birthdate | date | Date of birth |
| gender | token | male \| female \| other \| unknown |
| phone | string | Phone number |
| email | string | Email address |
| address | string | Address text |
| active | token | false = merged into another record |

#### Practitioner

Radiologists, technologists and admins of the org (users; read-only, managed in RADENVO user management) and referring physicians (with NPI; create, update, delete). Delete: Soft delete of a referring physician: active becomes false (report delivery off); orders keep the reference. Staff users cannot be deleted through FHIR.

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

_revinclude: DiagnosticReport:results-interpreter, PractitionerRole:practitioner, ServiceRequest:requester.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| name | string | Name (contains) |
| family | string | Family name (contains) |
| given | string | Given name (contains) |
| identifier | token | NPI (http://hl7.org/fhir/sid/us-npi) or user id |
| telecom | string | Phone, fax or email |
| email | string | Email |
| active | token | true \| false |

#### PractitionerRole

Each staff member's role in the org (read-only) and each referrer's practice (id = the practitioner id; update/patch change the practice name, phone, email and active). Not offered: create (a PractitionerRole is 1:1 with its Practitioner (same id): a referrer's role exists as soon as the Practitioner is created, and staff roles are assigned in RADENVO user management (admin, MFA)). Not offered: delete (the role is deleted with its Practitioner (DELETE Practitioner/<id>)).

Interactions: read, vread, update, patch, history-instance, history-type, search-type. Versioning: versioned-update.

_include: PractitionerRole:practitioner.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| practitioner | reference | The practitioner (references Practitioner; chainable) |
| role | token | radiologist \| technologist \| admin \| referrer |
| organization | reference | Organization (references Organization; chainable) |
| active | token | true \| false |

#### Schedule

One schedule per scanner room (id and actor = the room Location). update/patch change active, serviceType (DICOM modality) and opening hours (extension urn:lumen:fhir:opening-hours, valueString HH:MM-HH:MM). Free time is exposed as Slot; blocked time as busy-unavailable Slots. Delete: Soft delete: the room's schedule is deactivated (active false, no new bookings); it stays readable. Not offered: create (every room has exactly one Schedule with the room's id; create the room (POST Location with physicalType ro) and its Schedule exists).

Interactions: read, vread, update, patch, delete, history-instance, history-type, search-type. Versioning: versioned-update; conditional delete: single match.

_revinclude: Slot:schedule.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| actor | reference | Room Location (references Location; chainable) |
| active | token | true \| false |
| service-type | token | Modality (DCM code) |

#### ServiceRequest

Imaging orders. create/update from an EHR places the order on the RADENVO worklist (source fhir); status revoked cancels it. Delete: Soft delete: the order is cancelled (status revoked). Orders already performed cannot be deleted.

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

_include: ServiceRequest:patient, ServiceRequest:requester. _revinclude: Appointment:based-on, Observation:based-on.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| patient | reference | Patient (references Patient; chainable) |
| subject | reference | Patient (references Patient; chainable) |
| identifier | token | Accession or placer order number |
| status | token | active \| completed \| revoked |
| authored | date | Order date |
| occurrence | date | Scheduled date |
| code | token | Procedure code |
| requester | reference | Referring practitioner (references Practitioner; chainable) |
| priority | token | routine \| urgent \| stat |

#### Slot

Free slots computed from room hours minus appointments and block time (status free; search needs schedule or service-type; start defaults to the next 7 days, max 31), and blocked time (status busy-unavailable; id = the block id). create/update/patch/delete write blocked time: create blocks a room (rejected when an appointment is booked in that time), delete unblocks it. Delete: Blocked time (busy-unavailable) is removed, freeing the room; read then answers 410. Computed free slots cannot be deleted (block the time instead).

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| schedule | reference | Schedule/<room id> (references Schedule; chainable) |
| service-type | token | Procedure code or id |
| start | date | Slot start (ge/le) |
| status | token | free \| busy-unavailable (blocked time) |

#### Subscription

rest-hook notifications for DiagnosticReport and ImagingStudy (criteria = any supported search on those types). API clients see only their own subscriptions.

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| status | token | requested \| active \| error \| off |
| criteria | string | Criteria (contains) |
| url | string | Channel endpoint (contains) |
| type | token | rest-hook |

#### Task

Follow-up imaging recommendations tracked to completion (focus = the source study, output = the completing study). Delete: Soft delete: the follow-up is cancelled.

Interactions: read, vread, delete, history-instance, history-type, search-type. Versioning: versioned-update; conditional delete: single match.

_include: Task:patient.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| patient | reference | Patient (references Patient; chainable) |
| subject | reference | Patient (references Patient; chainable) |
| status | token | requested \| completed \| cancelled |
| focus | reference | Source study (references ImagingStudy; chainable) |
| period | date | Due date |
| authored-on | date | Created |

#### ValueSet

One ValueSet per built-in CodeSystem (all codes; read-only) and org-local value sets (create/update/delete; compose.include of built-in or org-local systems, or explicit concepts of any system). The expansion is included. Delete: Removes an org-local ValueSet (read then answers 410); built-in ones are read-only.

Interactions: read, vread, update, patch, delete, history-instance, history-type, create, search-type. Versioning: versioned-update; conditional delete: single match.

| Search parameter | Type | Description |
|---|---|---|
| _id | token | Logical id |
| _lastUpdated | date | meta.lastUpdated |
| url | token | Canonical URL |
| name | string | Name (contains) |
| title | string | Title (contains) |
| status | token | draft \| active \| retired |
| version | token | Version |
| code | token | A code in the set |
| reference | token | Included CodeSystem URL |

#### Binary

Document files (from DocumentReference) and report renditions: `Binary/reportpdf-<report id>` (application/pdf) and `Binary/report-<report id>` (text/html). Read only. The raw content is returned unless `Accept` is `application/fhir+json` (or `_format` is given), in which case a Binary resource with base64 `data` is returned. Scope `system/Binary.read`.

---

## 4. Subscriptions (R4 rest-hook)

- Resource types: **DiagnosticReport** and **ImagingStudy** only. `criteria` is any search supported on those types (for example `DiagnosticReport?status=final`).
- Events: report signed or addended; images ingested for a study. Each event is matched by running the criteria as a search restricted to the changed resource.
- Channel: `rest-hook` only. `endpoint` must be HTTPS and must not resolve to a loopback, private, link-local, CGNAT, multicast or reserved address (checked at creation and at delivery; on-premises installations can lift this with `FHIR_ALLOW_PRIVATE_HOOKS=true`). `payload` is `application/fhir+json` (the resource is POSTed) or omitted (empty POST). Custom `header` values are stored and shown masked.
- Delivery: retried up to 6 times with exponential back-off (2^n minutes).
- An API client sees, updates and deletes only its own subscriptions; signed-in users cannot create them. `status` is `active` or `off` (requested/error are not set by clients).

---

## 5. Operations

No FHIR operations (`$…`) are implemented: no `$everything`, `$export` (Bulk Data), `$expand`, `$lookup`, `$validate-code`, `$validate`, `$meta`, `$process-message` or `$document`. ValueSets carry their expansion inline instead of supporting `$expand`.

---

## 6. Not supported

| Item | Note |
|---|---|
| Write interactions on derived resources | ImagingStudy (derived from DICOM) and Endpoint (provisioned in Admin → Gateways): 405 with the reason. Within writable types, these parts are read-only (422): registration allergy alerts, order diagnoses, imaging assessment Observations, staff Practitioners and PractitionerRoles, the tenant Organization, RADENVO receiving AEs (create), built-in CodeSystems/ValueSets, computed free Slots, final DiagnosticReport text (addendum only). |
| Delete not offered | DiagnosticReport (medico-legal record), Location (referenced by appointments, studies and charges; set a room inactive), PractitionerRole (deleted with its Practitioner) |
| Task create and update; PractitionerRole and Schedule create | Tasks (follow-up recommendations) are created by the reading workflow; the API can read, search and cancel (delete) them. A PractitionerRole exists with its Practitioner and a Schedule with its room (same id). |
| DocumentReference attachments by URL, attachment replacement | content must be inline base64 on create and is immutable afterwards |
| XML | JSON only |
| Update-as-create, conditional read | not supported |
| `_include:iterate`, `_has`, `_text`, `_content`, `_filter`, `_list`, composite and quantity search parameters | not supported |
| SMART App Launch (EHR launch, standalone launch, `launch` / `openid` / `fhirUser` / `patient/` scopes, refresh tokens) | only SMART Backend Services and RADENVO's own session; user-facing app launch is not implemented |
| CORS | browser-based third-party apps cannot call the API directly |
| Subscriptions other than rest-hook, other resource types, R5 topic-based subscriptions | |
| Preliminary reports | DiagnosticReport exposes (and accepts writes) only for signed reports unless the organization enables `fhir_expose_preliminary`; reports are never signed through FHIR |
| Messaging and documents | no FHIR messaging, no Bundle type `document` |
| Imaging content through FHIR | ImagingStudy points to RADENVO DICOMweb (Endpoint resource); pixel data is retrieved with DICOMweb using the AE's own bearer token, not the FHIR token |
