Radiology Information System Data Specifications

Radiology Information System Data Specifications

Shared Entity References

This module references the following shared entities defined in their owning modules. RIS does not redefine these tables — it uses foreign-key references only.

Shared Entity Owning Module Table(s) FK Used in RIS
Patients ehr-patient-mgmt patients, patient_demographics, patient_identifiers patients.patient_id
Providers ehr-patient-mgmt providers, provider_credentials providers.provider_id
Encounters scheduling encounters, encounter_details encounters.encounter_id
Users & Auth ehr-patient-mgmt users, roles, permissions users.user_id
Facilities ehr-patient-mgmt facilities, departments, locations facilities.facility_id, departments.department_id
Payers policy-contract-mgmt payers, insurance_plans, contracts payers.payer_id

Entity Relationship Diagram

erDiagram patients ||--o{ radiology_orders : "has" encounters ||--o{ radiology_orders : "context for" providers ||--o{ radiology_orders : "orders" facilities ||--o{ radiology_orders : "performed at" departments ||--o{ radiology_orders : "performed in" radiology_orders ||--o{ radiology_exams : "fulfilled by" modality_resources ||--o{ radiology_exams : "performed on" users ||--o{ radiology_exams : "tech user" providers ||--o{ radiology_exams : "tech provider (optional)" radiology_exams ||--o{ radiology_reports : "reported as" users ||--o{ radiology_reports : "radiologist user" providers ||--o{ radiology_reports : "radiologist provider (optional)" radiology_templates ||--o{ radiology_reports : "uses" radiology_reports ||--o{ radiology_report_addenda : "amended by" users ||--o{ radiology_report_addenda : "radiologist user" radiology_exams ||--o{ radiology_worklist : "queued in" users ||--o{ radiology_worklist : "assigned radiologist" radiology_protocols ||--o{ radiology_orders : "suggests" radiology_protocols ||--o{ radiology_exams : "applied to" facilities ||--o{ modality_resources : "hosts" departments ||--o{ modality_resources : "within" radiology_templates ||--o{ radiology_reports : "applied as" radiology_reports ||--o{ critical_result_notifications : "triggers" providers ||--o{ critical_result_notifications : "target provider" users ||--o{ critical_result_notifications : "acknowledged by" radiology_exams ||--o{ radiation_dose_records : "dose for" patients ||--o{ radiation_dose_records : "cumulative dose for" users ||--o{ radiology_quality_metrics : "metric for" radiology_orders { bigint order_id PK bigint patient_id FK bigint encounter_id FK bigint ordering_provider_id FK bigint facility_id FK bigint department_id FK } radiology_exams { bigint exam_id PK bigint order_id FK bigint patient_id FK bigint encounter_id FK bigint technologist_user_id FK bigint modality_resource_id FK } radiology_reports { bigint report_id PK bigint exam_id FK bigint order_id FK bigint patient_id FK bigint encounter_id FK bigint radiologist_user_id FK bigint report_template_id FK } radiology_report_addenda { bigint addendum_id PK bigint report_id FK bigint radiologist_user_id FK } radiology_worklist { bigint worklist_id PK bigint exam_id FK bigint assigned_radiologist_user_id FK } radiology_protocols { bigint protocol_id PK } modality_resources { bigint resource_id PK bigint facility_id FK bigint department_id FK } radiology_templates { bigint template_id PK bigint created_by_user_id FK } critical_result_notifications { bigint notification_id PK bigint report_id FK bigint notifying_radiologist_user_id FK bigint target_provider_id FK bigint acknowledged_by_user_id FK } radiation_dose_records { bigint dose_id PK bigint exam_id FK bigint patient_id FK } radiology_quality_metrics { bigint metric_id PK bigint user_id FK }

Table Definitions

Conventions:
- SQL dialect: PostgreSQL 14+
- Timestamps are in UTC; application layer handles UAE time zone display.
- All tables include created_at, created_by, updated_at, updated_by for UAE PDPL accountability.


radiology_orders

Purpose
Stores all imaging orders received from CPOE and external systems. Drives scheduling, protocolling, modality worklists, and billing. Forms the basis for NABIDH/Malaffi order messages.

Field Specification

Field Type Nullable Default Constraint Description
order_id BIGINT NO IDENTITY PK Internal order identifier
external_order_id VARCHAR(64) YES NULL Unique per source ID from CPOE/EHR if provided
patient_id BIGINT NO FK → patients.patient_id Patient to be imaged
encounter_id BIGINT NO FK → encounters.encounter_id Clinical encounter context
ordering_provider_id BIGINT NO FK → providers.provider_id Ordering physician
ordering_user_id BIGINT YES NULL FK → users.user_id User who entered order in system
facility_id BIGINT NO FK → facilities.facility_id Performing facility (Dubai/Abu Dhabi, etc.)
department_id BIGINT NO FK → departments.department_id Radiology department/cost center
payer_id BIGINT YES NULL FK → payers.payer_id Primary payer at time of order
exam_code_cpt VARCHAR(10) NO CPT format Radiology CPT code (70000–79999)
exam_description VARCHAR(255) NO Human-readable exam name
body_part_code VARCHAR(32) YES NULL SNOMED/RadLex Coded body part
body_part_display VARCHAR(128) YES NULL Display text for body part
laterality VARCHAR(10) YES NULL IN (L,R,B,NA) Laterality code (HL7/DICOM)
modality_type VARCHAR(10) NO From modality master DICOM modality (CT, MR, US, XR, etc.)
clinical_indication TEXT NO Reason for exam (free text)
icd10am_code VARCHAR(10) YES NULL ICD-10-AM pattern Primary diagnosis code
priority VARCHAR(16) NO 'Routine' IN (Routine, Urgent, STAT, Wet) Order priority
order_status VARCHAR(20) NO 'new' Enumerated new, protocolling, scheduled, in_progress, completed, cancelled, no_show
order_datetime TIMESTAMP NO CURRENT_TIMESTAMP When order was received
scheduled_datetime TIMESTAMP YES NULL order_datetime Scheduled start time
protocol_id BIGINT YES NULL FK → radiology_protocols.protocol_id Selected imaging protocol
requires_prior_auth BOOLEAN NO FALSE Flag from payer rules
prior_auth_status VARCHAR(20) YES NULL pending/approved/denied/expired Prior auth status
prior_auth_number VARCHAR(64) YES NULL Authorization reference from payer
prior_auth_checked_at TIMESTAMP YES NULL Last time auth status checked
contraindications_json JSONB YES NULL Structured contraindications (pregnancy, allergy, implants)
notes TEXT YES NULL Additional scheduling/protocol notes
hie_submission_status VARCHAR(20) NO 'not_required' not_required/pending/sent/accepted/rejected NABIDH/Malaffi order status
hie_last_submission_at TIMESTAMP YES NULL Last HIE submission timestamp
created_at TIMESTAMP NO CURRENT_TIMESTAMP Record creation time
created_by BIGINT YES NULL FK → users.user_id User who created record
updated_at TIMESTAMP NO CURRENT_TIMESTAMP ON UPDATE Last update time
updated_by BIGINT YES NULL FK → users.user_id User who last updated

SQL DDL

SQL
CREATE TABLE radiology_orders (
    order_id                  BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    external_order_id         VARCHAR(64),
    patient_id                BIGINT NOT NULL,
    encounter_id              BIGINT NOT NULL,
    ordering_provider_id      BIGINT NOT NULL,
    ordering_user_id          BIGINT,
    facility_id               BIGINT NOT NULL,
    department_id             BIGINT NOT NULL,
    payer_id                  BIGINT,
    exam_code_cpt             VARCHAR(10) NOT NULL,
    exam_description          VARCHAR(255) NOT NULL,
    body_part_code            VARCHAR(32),
    body_part_display         VARCHAR(128),
    laterality                VARCHAR(10),
    modality_type             VARCHAR(10) NOT NULL,
    clinical_indication       TEXT NOT NULL,
    icd10am_code              VARCHAR(10),
    priority                  VARCHAR(16) NOT NULL DEFAULT 'Routine',
    order_status              VARCHAR(20) NOT NULL DEFAULT 'new',
    order_datetime            TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    scheduled_datetime        TIMESTAMP,
    protocol_id               BIGINT,
    requires_prior_auth       BOOLEAN NOT NULL DEFAULT FALSE,
    prior_auth_status         VARCHAR(20),
    prior_auth_number         VARCHAR(64),
    prior_auth_checked_at     TIMESTAMP,
    contraindications_json    JSONB,
    notes                     TEXT,
    hie_submission_status     VARCHAR(20) NOT NULL DEFAULT 'not_required',
    hie_last_submission_at    TIMESTAMP,
    created_at                TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    created_by                BIGINT,
    updated_at                TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_by                BIGINT,
    CONSTRAINT uq_radiology_orders_external UNIQUE (external_order_id),
    CONSTRAINT fk_rord_patient
        FOREIGN KEY (patient_id) REFERENCES patients(patient_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_rord_encounter
        FOREIGN KEY (encounter_id) REFERENCES encounters(encounter_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_rord_ordering_provider
        FOREIGN KEY (ordering_provider_id) REFERENCES providers(provider_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_rord_ordering_user
        FOREIGN KEY (ordering_user_id) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_rord_facility
        FOREIGN KEY (facility_id) REFERENCES facilities(facility_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_rord_department
        FOREIGN KEY (department_id) REFERENCES departments(department_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_rord_payer
        FOREIGN KEY (payer_id) REFERENCES payers(payer_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_rord_protocol
        FOREIGN KEY (protocol_id) REFERENCES radiology_protocols(protocol_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_rord_created_by
        FOREIGN KEY (created_by) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_rord_updated_by
        FOREIGN KEY (updated_by) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT chk_rord_priority
        CHECK (priority IN ('Routine','Urgent','STAT','Wet')),
    CONSTRAINT chk_rord_laterality
        CHECK (laterality IS NULL OR laterality IN ('L','R','B','NA')),
    CONSTRAINT chk_rord_status
        CHECK (order_status IN ('new','protocolling','scheduled','in_progress','completed','cancelled','no_show')),
    CONSTRAINT chk_rord_hie_status
        CHECK (hie_submission_status IN ('not_required','pending','sent','accepted','rejected')),
    CONSTRAINT chk_rord_sched_after_order
        CHECK (scheduled_datetime IS NULL OR scheduled_datetime >= order_datetime)
);

CREATE INDEX idx_rord_patient ON radiology_orders(patient_id);
CREATE INDEX idx_rord_encounter ON radiology_orders(encounter_id);
CREATE INDEX idx_rord_ordering_provider ON radiology_orders(ordering_provider_id);
CREATE INDEX idx_rord_status_priority ON radiology_orders(order_status, priority);
CREATE INDEX idx_rord_modality_sched ON radiology_orders(modality_type, scheduled_datetime);
CREATE INDEX idx_rord_hie_status ON radiology_orders(hie_submission_status)
    WHERE hie_submission_status IN ('pending','rejected');
CREATE INDEX idx_rord_prior_auth_status ON radiology_orders(prior_auth_status)
    WHERE requires_prior_auth = TRUE;

Terminology Bindings

Field Terminology Example Value
exam_code_cpt CPT (Radiology 70000–79999) 71260 (CT thorax with contrast)
body_part_code SNOMED CT / RadLex 51185008 (Lung structure)
laterality HL7 / DICOM L, R, B, NA
modality_type DICOM Modality Codes CT, MR, US, CR, DX, MG, NM, PT
icd10am_code ICD-10-AM R07.1
priority Local Radiology Priority Codes STAT
prior_auth_status Local ValueSet approved
hie_submission_status Local HIE Status accepted

FHIR Resource Mapping

Table Field FHIR Resource FHIR Path
order_id ServiceRequest ServiceRequest.id
external_order_id ServiceRequest ServiceRequest.identifier.value
patient_id ServiceRequest ServiceRequest.subject.reference (Patient/{id})
encounter_id ServiceRequest ServiceRequest.encounter.reference
ordering_provider_id ServiceRequest ServiceRequest.requester.reference (Practitioner/{id})
facility_id ServiceRequest ServiceRequest.locationReference
exam_code_cpt ServiceRequest ServiceRequest.code.coding (system = CPT)
exam_description ServiceRequest ServiceRequest.code.text
body_part_code ServiceRequest ServiceRequest.bodySite.coding (SNOMED/RadLex)
laterality ServiceRequest ServiceRequest.bodySite.extension[laterality]
modality_type ServiceRequest ServiceRequest.category (or extension for modality)
clinical_indication ServiceRequest ServiceRequest.reasonCode.text
icd10am_code ServiceRequest ServiceRequest.reasonCode.coding (ICD-10-AM)
priority ServiceRequest ServiceRequest.priority
order_status ServiceRequest ServiceRequest.status
order_datetime ServiceRequest ServiceRequest.authoredOn
scheduled_datetime ServiceRequest ServiceRequest.occurrenceDateTime
requires_prior_auth ServiceRequest Extension: priorAuthRequired
prior_auth_status ServiceRequest Extension: priorAuthStatus
prior_auth_number ServiceRequest ServiceRequest.supportingInfo (Coverage/ClaimResponse reference)

radiology_exams

Purpose
Tracks the execution of each imaging exam from check-in through completion, including modality, technologist, contrast usage, and linkage to DICOM identifiers. Drives modality worklists, PACS association, and billing.

Field Specification

Field Type Nullable Default Constraint Description
exam_id BIGINT NO IDENTITY PK Internal exam identifier
order_id BIGINT NO FK → radiology_orders.order_id Parent order
patient_id BIGINT NO FK → patients.patient_id Patient
encounter_id BIGINT NO FK → encounters.encounter_id Encounter context
technologist_user_id BIGINT YES NULL FK → users.user_id Performing technologist (user)
technologist_provider_id BIGINT YES NULL FK → providers.provider_id If technologist is also provider record
modality_resource_id BIGINT NO FK → modality_resources.resource_id Scanner used
exam_status VARCHAR(20) NO 'scheduled' Enumerated scheduled, arrived, in_progress, images_acquired, completed, cancelled, no_show
check_in_time TIMESTAMP YES NULL Patient arrived at modality
exam_start_time TIMESTAMP YES NULL check_in_time First exposure
exam_end_time TIMESTAMP YES NULL exam_start_time Last exposure
contrast_used BOOLEAN NO FALSE Whether contrast administered
contrast_type_code VARCHAR(32) YES NULL From Contrast master Coded contrast agent
contrast_volume_ml NUMERIC(6,2) YES NULL ≥ 0 Volume in mL
contrast_route VARCHAR(20) YES NULL e.g., IV, oral Route of contrast
accession_number VARCHAR(32) NO Unique per facility DICOM Accession Number
study_instance_uid VARCHAR(64) YES NULL DICOM UID Study Instance UID
series_instance_uids JSONB YES NULL List of series UIDs
image_count INT YES NULL ≥ 0 Number of images acquired
tech_notes TEXT YES NULL Technologist comments
qa_status VARCHAR(20) YES NULL pass/fail/needs_review Image quality assessment
repeat_flag BOOLEAN NO FALSE Any repeated acquisition due to quality
repeat_reason TEXT YES NULL Reason for repeat
billing_exported BOOLEAN NO FALSE Sent to billing/DFT
billing_exported_at TIMESTAMP YES NULL Time sent to billing
created_at TIMESTAMP NO CURRENT_TIMESTAMP Creation time
created_by BIGINT YES NULL FK → users.user_id Creator
updated_at TIMESTAMP NO CURRENT_TIMESTAMP ON UPDATE Last update
updated_by BIGINT YES NULL FK → users.user_id Last updater

SQL DDL

SQL
CREATE TABLE radiology_exams (
    exam_id                   BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    order_id                  BIGINT NOT NULL,
    patient_id                BIGINT NOT NULL,
    encounter_id              BIGINT NOT NULL,
    technologist_user_id      BIGINT,
    technologist_provider_id  BIGINT,
    modality_resource_id      BIGINT NOT NULL,
    exam_status               VARCHAR(20) NOT NULL DEFAULT 'scheduled',
    check_in_time             TIMESTAMP,
    exam_start_time           TIMESTAMP,
    exam_end_time             TIMESTAMP,
    contrast_used             BOOLEAN NOT NULL DEFAULT FALSE,
    contrast_type_code        VARCHAR(32),
    contrast_volume_ml        NUMERIC(6,2),
    contrast_route            VARCHAR(20),
    accession_number          VARCHAR(32) NOT NULL,
    study_instance_uid        VARCHAR(64),
    series_instance_uids      JSONB,
    image_count               INT,
    tech_notes                TEXT,
    qa_status                 VARCHAR(20),
    repeat_flag               BOOLEAN NOT NULL DEFAULT FALSE,
    repeat_reason             TEXT,
    billing_exported          BOOLEAN NOT NULL DEFAULT FALSE,
    billing_exported_at       TIMESTAMP,
    created_at                TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    created_by                BIGINT,
    updated_at                TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_by                BIGINT,
    CONSTRAINT uq_rexam_accession UNIQUE (accession_number),
    CONSTRAINT fk_rexam_order
        FOREIGN KEY (order_id) REFERENCES radiology_orders(order_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_rexam_patient
        FOREIGN KEY (patient_id) REFERENCES patients(patient_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_rexam_encounter
        FOREIGN KEY (encounter_id) REFERENCES encounters(encounter_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_rexam_tech_user
        FOREIGN KEY (technologist_user_id) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_rexam_tech_provider
        FOREIGN KEY (technologist_provider_id) REFERENCES providers(provider_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_rexam_modality_resource
        FOREIGN KEY (modality_resource_id) REFERENCES modality_resources(resource_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_rexam_created_by
        FOREIGN KEY (created_by) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_rexam_updated_by
        FOREIGN KEY (updated_by) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT chk_rexam_status
        CHECK (exam_status IN ('scheduled','arrived','in_progress','images_acquired','completed','cancelled','no_show')),
    CONSTRAINT chk_rexam_times
        CHECK (
            (exam_start_time IS NULL OR check_in_time IS NULL OR exam_start_time >= check_in_time) AND
            (exam_end_time IS NULL OR exam_start_time IS NULL OR exam_end_time >= exam_start_time)
        ),
    CONSTRAINT chk_rexam_contrast_volume
        CHECK (contrast_volume_ml IS NULL OR contrast_volume_ml >= 0),
    CONSTRAINT chk_rexam_qa_status
        CHECK (qa_status IS NULL OR qa_status IN ('pass','fail','needs_review')),
    CONSTRAINT chk_rexam_repeat_reason
        CHECK (repeat_flag = FALSE OR repeat_reason IS NOT NULL)
);

CREATE INDEX idx_rexam_order ON radiology_exams(order_id);
CREATE INDEX idx_rexam_patient ON radiology_exams(patient_id);
CREATE INDEX idx_rexam_status ON radiology_exams(exam_status);
CREATE INDEX idx_rexam_modality_status ON radiology_exams(modality_resource_id, exam_status);
CREATE INDEX idx_rexam_accession ON radiology_exams(accession_number);
CREATE INDEX idx_rexam_billing_exported ON radiology_exams(billing_exported)
    WHERE billing_exported = FALSE;

Terminology Bindings

Field Terminology Example Value
contrast_type_code Local Contrast Master / RxNorm GADOBUTROL
contrast_route SNOMED CT / HL7 Route Codes IV
qa_status Local QA Status needs_review

FHIR Resource Mapping

Table Field FHIR Resource FHIR Path
exam_id ImagingStudy ImagingStudy.id
order_id ImagingStudy ImagingStudy.basedOn.reference (ServiceRequest/{id})
patient_id ImagingStudy ImagingStudy.subject.reference
encounter_id ImagingStudy ImagingStudy.encounter.reference
modality_resource_id ImagingStudy ImagingStudy.series.modality (via Device/Endpoint)
exam_status ImagingStudy ImagingStudy.status
accession_number ImagingStudy ImagingStudy.identifier (type = accession)
study_instance_uid ImagingStudy ImagingStudy.identifier (system = DICOM UID)
series_instance_uids ImagingStudy ImagingStudy.series.uid
image_count ImagingStudy ImagingStudy.numberOfInstances
contrast_used Procedure Procedure.usedReference (Medication/Device)
contrast_type_code Procedure Procedure.usedReference → Medication.code
exam_start_time ImagingStudy ImagingStudy.started
exam_end_time Procedure Procedure.performedPeriod.end

radiology_reports

Purpose
Stores radiologist interpretations, including narrative findings, impression, structured data, and signature timestamps. Drives result distribution to EHR, NABIDH, Malaffi, and patient portals.

Field Specification

Field Type Nullable Default Constraint Description
report_id BIGINT NO IDENTITY PK Report identifier
exam_id BIGINT NO FK → radiology_exams.exam_id Exam being reported
order_id BIGINT NO FK → radiology_orders.order_id Parent order
patient_id BIGINT NO FK → patients.patient_id Patient
encounter_id BIGINT NO FK → encounters.encounter_id Encounter
radiologist_user_id BIGINT NO FK → users.user_id Signing radiologist (user)
radiologist_provider_id BIGINT YES NULL FK → providers.provider_id Radiologist provider record
report_status VARCHAR(20) NO 'draft' HL7 Table 0085 subset draft, preliminary, final, corrected, cancelled
findings_text TEXT YES NULL Narrative findings
impression_text TEXT YES NULL Impression/conclusion
structured_findings_json JSONB YES NULL RadLex/SNOMED coded findings
report_template_id BIGINT YES NULL FK → radiology_templates.template_id Template used
dictation_start TIMESTAMP YES NULL Dictation start time
dictation_end TIMESTAMP YES NULL dictation_start Dictation end time
preliminary_sign_datetime TIMESTAMP YES NULL When prelim signed
final_sign_datetime TIMESTAMP YES NULL When final signed
is_critical BOOLEAN NO FALSE Contains critical finding
critical_finding_text TEXT YES NULL Description of critical finding
hie_submission_status VARCHAR(20) NO 'pending' pending/sent/accepted/rejected NABIDH/Malaffi report status
hie_last_submission_at TIMESTAMP YES NULL Last HIE submission time
version_number INT NO 1 ≥ 1 Incremented on corrections
supersedes_report_id BIGINT YES NULL FK → radiology_reports.report_id Previous version if corrected
language_code VARCHAR(10) NO 'en' ISO 639-1 Report language (en, ar)
created_at TIMESTAMP NO CURRENT_TIMESTAMP Creation time
created_by BIGINT YES NULL FK → users.user_id Creator
updated_at TIMESTAMP NO CURRENT_TIMESTAMP ON UPDATE Last update
updated_by BIGINT YES NULL FK → users.user_id Last updater

SQL DDL

SQL
CREATE TABLE radiology_reports (
    report_id                 BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    exam_id                   BIGINT NOT NULL,
    order_id                  BIGINT NOT NULL,
    patient_id                BIGINT NOT NULL,
    encounter_id              BIGINT NOT NULL,
    radiologist_user_id       BIGINT NOT NULL,
    radiologist_provider_id   BIGINT,
    report_status             VARCHAR(20) NOT NULL DEFAULT 'draft',
    findings_text             TEXT,
    impression_text           TEXT,
    structured_findings_json  JSONB,
    report_template_id        BIGINT,
    dictation_start           TIMESTAMP,
    dictation_end             TIMESTAMP,
    preliminary_sign_datetime TIMESTAMP,
    final_sign_datetime       TIMESTAMP,
    is_critical               BOOLEAN NOT NULL DEFAULT FALSE,
    critical_finding_text     TEXT,
    hie_submission_status     VARCHAR(20) NOT NULL DEFAULT 'pending',
    hie_last_submission_at    TIMESTAMP,
    version_number            INT NOT NULL DEFAULT 1,
    supersedes_report_id      BIGINT,
    language_code             VARCHAR(10) NOT NULL DEFAULT 'en',
    created_at                TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    created_by                BIGINT,
    updated_at                TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_by                BIGINT,
    CONSTRAINT fk_rrep_exam
        FOREIGN KEY (exam_id) REFERENCES radiology_exams(exam_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_rrep_order
        FOREIGN KEY (order_id) REFERENCES radiology_orders(order_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_rrep_patient
        FOREIGN KEY (patient_id) REFERENCES patients(patient_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_rrep_encounter
        FOREIGN KEY (encounter_id) REFERENCES encounters(encounter_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_rrep_radiologist_user
        FOREIGN KEY (radiologist_user_id) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_rrep_radiologist_provider
        FOREIGN KEY (radiologist_provider_id) REFERENCES providers(provider_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_rrep_template
        FOREIGN KEY (report_template_id) REFERENCES radiology_templates(template_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_rrep_supersedes
        FOREIGN KEY (supersedes_report_id) REFERENCES radiology_reports(report_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_rrep_created_by
        FOREIGN KEY (created_by) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_rrep_updated_by
        FOREIGN KEY (updated_by) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT chk_rrep_status
        CHECK (report_status IN ('draft','preliminary','final','corrected','cancelled')),
    CONSTRAINT chk_rrep_hie_status
        CHECK (hie_submission_status IN ('pending','sent','accepted','rejected')),
    CONSTRAINT chk_rrep_dictation_times
        CHECK (dictation_end IS NULL OR dictation_start IS NULL OR dictation_end >= dictation_start),
    CONSTRAINT chk_rrep_language
        CHECK (language_code IN ('en','ar')),
    CONSTRAINT chk_rrep_critical_text
        CHECK (is_critical = FALSE OR critical_finding_text IS NOT NULL)
);

CREATE INDEX idx_rrep_exam ON radiology_reports(exam_id);
CREATE INDEX idx_rrep_patient ON radiology_reports(patient_id);
CREATE INDEX idx_rrep_status ON radiology_reports(report_status);
CREATE INDEX idx_rrep_final_signed ON radiology_reports(final_sign_datetime)
    WHERE report_status IN ('final','corrected');
CREATE INDEX idx_rrep_hie_status ON radiology_reports(hie_submission_status)
    WHERE hie_submission_status IN ('pending','rejected');
CREATE INDEX idx_rrep_radiologist ON radiology_reports(radiologist_user_id, final_sign_datetime);

Terminology Bindings

Field Terminology Example Value
structured_findings_json RadLex / SNOMED CT RadLex RID10321 (Pulmonary nodule)
report_status HL7 v2 Table 0085 F (final) mapped to final
language_code ISO 639-1 en, ar

FHIR Resource Mapping

Table Field FHIR Resource FHIR Path
report_id DiagnosticReport DiagnosticReport.id
exam_id DiagnosticReport DiagnosticReport.basedOn / ImagingStudy link
patient_id DiagnosticReport DiagnosticReport.subject.reference
encounter_id DiagnosticReport DiagnosticReport.encounter.reference
radiologist_provider_id DiagnosticReport DiagnosticReport.resultsInterpreter.reference
report_status DiagnosticReport DiagnosticReport.status
findings_text DiagnosticReport DiagnosticReport.conclusion or presentedForm
impression_text DiagnosticReport DiagnosticReport.conclusion
structured_findings_json Observation Linked Observation resources (category = imaging)
report_template_id DiagnosticReport Extension: template reference
preliminary_sign_datetime DiagnosticReport DiagnosticReport.issued (for preliminary)
final_sign_datetime DiagnosticReport DiagnosticReport.issued (for final)
is_critical DiagnosticReport Extension: criticality
critical_finding_text DiagnosticReport DiagnosticReport.conclusion + flag
language_code DiagnosticReport DiagnosticReport.language

radiology_report_addenda

Purpose
Captures addenda and amendments to signed reports while preserving the original report content for medico-legal and UAE PDPL audit requirements.

Field Specification

Field Type Nullable Default Constraint Description
addendum_id BIGINT NO IDENTITY PK Addendum identifier
report_id BIGINT NO FK → radiology_reports.report_id Parent report
radiologist_user_id BIGINT NO FK → users.user_id Authoring radiologist
radiologist_provider_id BIGINT YES NULL FK → providers.provider_id Provider record
addendum_type VARCHAR(20) NO correction/additional_info/clinical_correlation Type of addendum
addendum_text TEXT NO Addendum content
reason TEXT YES NULL Reason for addendum
signed_datetime TIMESTAMP NO CURRENT_TIMESTAMP When addendum signed
is_significant_change BOOLEAN NO FALSE Triggers notification if TRUE
created_at TIMESTAMP NO CURRENT_TIMESTAMP Creation time
created_by BIGINT YES NULL FK → users.user_id Creator
updated_at TIMESTAMP NO CURRENT_TIMESTAMP ON UPDATE Last update
updated_by BIGINT YES NULL FK → users.user_id Last updater

SQL DDL

SQL
CREATE TABLE radiology_report_addenda (
    addendum_id              BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    report_id                BIGINT NOT NULL,
    radiologist_user_id      BIGINT NOT NULL,
    radiologist_provider_id  BIGINT,
    addendum_type            VARCHAR(20) NOT NULL,
    addendum_text            TEXT NOT NULL,
    reason                   TEXT,
    signed_datetime          TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    is_significant_change    BOOLEAN NOT NULL DEFAULT FALSE,
    created_at               TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    created_by               BIGINT,
    updated_at               TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_by               BIGINT,
    CONSTRAINT fk_radd_report
        FOREIGN KEY (report_id) REFERENCES radiology_reports(report_id)
        ON UPDATE CASCADE ON DELETE CASCADE,
    CONSTRAINT fk_radd_radiologist_user
        FOREIGN KEY (radiologist_user_id) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_radd_radiologist_provider
        FOREIGN KEY (radiologist_provider_id) REFERENCES providers(provider_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_radd_created_by
        FOREIGN KEY (created_by) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_radd_updated_by
        FOREIGN KEY (updated_by) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT chk_radd_type
        CHECK (addendum_type IN ('correction','additional_info','clinical_correlation'))
);

CREATE INDEX idx_radd_report ON radiology_report_addenda(report_id);
CREATE INDEX idx_radd_radiologist ON radiology_report_addenda(radiologist_user_id);

Terminology Bindings

Field Terminology Example Value
addendum_type Local Addendum Types correction

FHIR Resource Mapping

Table Field FHIR Resource FHIR Path
addendum_id DiagnosticReport New DiagnosticReport with basedOn original
report_id DiagnosticReport DiagnosticReport.basedOn / DiagnosticReport.replaces
addendum_text DiagnosticReport DiagnosticReport.conclusion / presentedForm
signed_datetime DiagnosticReport DiagnosticReport.issued
addendum_type DiagnosticReport Extension: addendumType
is_significant_change DiagnosticReport Extension: significantChange

radiology_worklist

Purpose
Manages the reading worklist for radiologists, including assignment, prioritization, and tracking of reading start/completion times. Supports KPI calculations such as TAT and productivity.

Field Specification

Field Type Nullable Default Constraint Description
worklist_id BIGINT NO IDENTITY PK Worklist entry
exam_id BIGINT NO FK → radiology_exams.exam_id Exam to be read
assigned_radiologist_user_id BIGINT YES NULL FK → users.user_id Assigned radiologist
priority_score INT NO 0 ≥ 0 Numeric priority (higher = more urgent)
worklist_status VARCHAR(20) NO 'queued' queued/in_progress/completed/removed Status in reading queue
added_datetime TIMESTAMP NO CURRENT_TIMESTAMP When added to worklist
started_datetime TIMESTAMP YES NULL added_datetime When reading started
completed_datetime TIMESTAMP YES NULL started_datetime When reading completed
queue_name VARCHAR(64) YES NULL Named list (e.g., CT-Day, ER-STAT)
auto_assigned BOOLEAN NO TRUE System vs manual assignment
lock_user_id BIGINT YES NULL FK → users.user_id User currently viewing/locked
lock_acquired_at TIMESTAMP YES NULL Lock timestamp
created_at TIMESTAMP NO CURRENT_TIMESTAMP Creation time
created_by BIGINT YES NULL FK → users.user_id Creator
updated_at TIMESTAMP NO CURRENT_TIMESTAMP ON UPDATE Last update
updated_by BIGINT YES NULL FK → users.user_id Last updater

SQL DDL

SQL
CREATE TABLE radiology_worklist (
    worklist_id                BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    exam_id                    BIGINT NOT NULL,
    assigned_radiologist_user_id BIGINT,
    priority_score             INT NOT NULL DEFAULT 0,
    worklist_status            VARCHAR(20) NOT NULL DEFAULT 'queued',
    added_datetime             TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    started_datetime           TIMESTAMP,
    completed_datetime         TIMESTAMP,
    queue_name                 VARCHAR(64),
    auto_assigned              BOOLEAN NOT NULL DEFAULT TRUE,
    lock_user_id               BIGINT,
    lock_acquired_at           TIMESTAMP,
    created_at                 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    created_by                 BIGINT,
    updated_at                 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_by                 BIGINT,
    CONSTRAINT fk_rwl_exam
        FOREIGN KEY (exam_id) REFERENCES radiology_exams(exam_id)
        ON UPDATE CASCADE ON DELETE CASCADE,
    CONSTRAINT fk_rwl_assigned_radiologist
        FOREIGN KEY (assigned_radiologist_user_id) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_rwl_lock_user
        FOREIGN KEY (lock_user_id) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_rwl_created_by
        FOREIGN KEY (created_by) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_rwl_updated_by
        FOREIGN KEY (updated_by) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT chk_rwl_status
        CHECK (worklist_status IN ('queued','in_progress','completed','removed')),
    CONSTRAINT chk_rwl_times
        CHECK (
            (started_datetime IS NULL OR started_datetime >= added_datetime) AND
            (completed_datetime IS NULL OR completed_datetime >= started_datetime)
        )
);

CREATE INDEX idx_rwl_exam ON radiology_worklist(exam_id);
CREATE INDEX idx_rwl_status_priority ON radiology_worklist(worklist_status, priority_score DESC);
CREATE INDEX idx_rwl_assigned ON radiology_worklist(assigned_radiologist_user_id, worklist_status);
CREATE INDEX idx_rwl_queue ON radiology_worklist(queue_name, worklist_status);

Terminology Bindings

Field Terminology Example Value
worklist_status Local Worklist Status queued

FHIR Resource Mapping

Worklist is an internal construct; no direct FHIR resource. Indirect mapping:

Table Field FHIR Resource FHIR Path
exam_id Task Task.focusImagingStudy
assigned_radiologist_user_id Task Task.owner
worklist_status Task Task.status
priority_score Task Task.priority

radiology_protocols

Purpose
Defines imaging protocols per exam type and modality, including parameters, contrast requirements, and preparation instructions. Used during protocolling and exam execution.

Field Specification

Field Type Nullable Default Constraint Description
protocol_id BIGINT NO IDENTITY PK Protocol identifier
exam_code_cpt VARCHAR(10) NO CPT Exam code this protocol applies to
modality_type VARCHAR(10) NO DICOM modality CT, MR, etc.
protocol_name VARCHAR(128) NO Human-readable name
protocol_parameters_json JSONB NO '{}' kVp, mAs, sequences, etc.
contrast_required BOOLEAN NO FALSE Whether contrast is required
contrast_type_code VARCHAR(32) YES NULL From contrast master Default contrast
default_prep_instructions TEXT YES NULL Fasting, hydration, etc.
estimated_duration_minutes INT YES NULL > 0 Typical duration
age_min_years INT YES NULL ≥ 0 Minimum age
age_max_years INT YES NULL age_min_years Maximum age
is_active BOOLEAN NO TRUE Active flag
effective_from DATE NO CURRENT_DATE Start date
effective_to DATE YES NULL effective_from End date
created_at TIMESTAMP NO CURRENT_TIMESTAMP Creation time
created_by BIGINT YES NULL FK → users.user_id Creator
updated_at TIMESTAMP NO CURRENT_TIMESTAMP ON UPDATE Last update
updated_by BIGINT YES NULL FK → users.user_id Last updater

SQL DDL

SQL
CREATE TABLE radiology_protocols (
    protocol_id               BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    exam_code_cpt             VARCHAR(10) NOT NULL,
    modality_type             VARCHAR(10) NOT NULL,
    protocol_name             VARCHAR(128) NOT NULL,
    protocol_parameters_json  JSONB NOT NULL DEFAULT '{}'::JSONB,
    contrast_required         BOOLEAN NOT NULL DEFAULT FALSE,
    contrast_type_code        VARCHAR(32),
    default_prep_instructions TEXT,
    estimated_duration_minutes INT,
    age_min_years             INT,
    age_max_years             INT,
    is_active                 BOOLEAN NOT NULL DEFAULT TRUE,
    effective_from            DATE NOT NULL DEFAULT CURRENT_DATE,
    effective_to              DATE,
    created_at                TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    created_by                BIGINT,
    updated_at                TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_by                BIGINT,
    CONSTRAINT fk_rprot_created_by
        FOREIGN KEY (created_by) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_rprot_updated_by
        FOREIGN KEY (updated_by) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT chk_rprot_age_range
        CHECK (age_min_years IS NULL OR age_min_years >= 0),
    CONSTRAINT chk_rprot_age_max
        CHECK (age_max_years IS NULL OR age_min_years IS NULL OR age_max_years >= age_min_years),
    CONSTRAINT chk_rprot_effective_dates
        CHECK (effective_to IS NULL OR effective_to >= effective_from)
);

CREATE INDEX idx_rprot_exam_modality ON radiology_protocols(exam_code_cpt, modality_type)
    WHERE is_active = TRUE;
CREATE INDEX idx_rprot_effective ON radiology_protocols(effective_from, effective_to);

Terminology Bindings

Field Terminology Example Value
exam_code_cpt CPT 74177
modality_type DICOM Modality CT
contrast_type_code Local Contrast / RxNorm IODIXANOL

FHIR Resource Mapping

Protocols are configuration; no direct FHIR mapping. Indirect:

Table Field FHIR Resource FHIR Path
protocol_name PlanDefinition PlanDefinition.title
protocol_parameters_json PlanDefinition PlanDefinition.action details
exam_code_cpt PlanDefinition PlanDefinition.action.code

modality_resources

Purpose
Registry of imaging equipment and modality endpoints, including DICOM AE Titles and capacity. Supports DICOM MWL/MPPS configuration and scheduling.

Field Specification

Field Type Nullable Default Constraint Description
resource_id BIGINT NO IDENTITY PK Modality resource
facility_id BIGINT NO FK → facilities.facility_id Facility
department_id BIGINT NO FK → departments.department_id Department
modality_type VARCHAR(10) NO DICOM modality CT, MR, etc.
equipment_name VARCHAR(128) NO Display name
manufacturer VARCHAR(128) YES NULL Vendor
model VARCHAR(128) YES NULL Model name
serial_number VARCHAR(64) YES NULL Device serial
ae_title VARCHAR(32) NO Unique per network DICOM AE Title
ip_address VARCHAR(45) YES NULL IPv4/IPv6 Modality IP
port INT YES 104 1–65535 DICOM port
is_active BOOLEAN NO TRUE Active flag
max_daily_slots INT YES NULL ≥ 0 Capacity for scheduling
maintenance_status VARCHAR(20) NO 'operational' operational/maintenance/down Current status
maintenance_notes TEXT YES NULL Notes
vendor_service_contact VARCHAR(128) YES NULL Vendor contact
last_qc_date DATE YES NULL Last QA/QC date
created_at TIMESTAMP NO CURRENT_TIMESTAMP Creation time
created_by BIGINT YES NULL FK → users.user_id Creator
updated_at TIMESTAMP NO CURRENT_TIMESTAMP ON UPDATE Last update
updated_by BIGINT YES NULL FK → users.user_id Last updater

SQL DDL

SQL
CREATE TABLE modality_resources (
    resource_id           BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    facility_id           BIGINT NOT NULL,
    department_id         BIGINT NOT NULL,
    modality_type         VARCHAR(10) NOT NULL,
    equipment_name        VARCHAR(128) NOT NULL,
    manufacturer          VARCHAR(128),
    model                 VARCHAR(128),
    serial_number         VARCHAR(64),
    ae_title              VARCHAR(32) NOT NULL,
    ip_address            VARCHAR(45),
    port                  INT DEFAULT 104,
    is_active             BOOLEAN NOT NULL DEFAULT TRUE,
    max_daily_slots       INT,
    maintenance_status    VARCHAR(20) NOT NULL DEFAULT 'operational',
    maintenance_notes     TEXT,
    vendor_service_contact VARCHAR(128),
    last_qc_date          DATE,
    created_at            TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    created_by            BIGINT,
    updated_at            TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_by            BIGINT,
    CONSTRAINT uq_mres_ae_title UNIQUE (ae_title),
    CONSTRAINT fk_mres_facility
        FOREIGN KEY (facility_id) REFERENCES facilities(facility_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_mres_department
        FOREIGN KEY (department_id) REFERENCES departments(department_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_mres_created_by
        FOREIGN KEY (created_by) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_mres_updated_by
        FOREIGN KEY (updated_by) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT chk_mres_port
        CHECK (port IS NULL OR (port >= 1 AND port <= 65535)),
    CONSTRAINT chk_mres_status
        CHECK (maintenance_status IN ('operational','maintenance','down'))
);

CREATE INDEX idx_mres_facility_modality ON modality_resources(facility_id, modality_type)
    WHERE is_active = TRUE;
CREATE INDEX idx_mres_status ON modality_resources(maintenance_status);

Terminology Bindings

Field Terminology Example Value
modality_type DICOM Modality MR
maintenance_status Local maintenance

FHIR Resource Mapping

Table Field FHIR Resource FHIR Path
resource_id Device Device.id
equipment_name Device Device.deviceName.name
manufacturer Device Device.manufacturer
model Device Device.modelNumber
serial_number Device Device.serialNumber
modality_type Device Device.type (DICOM code)
facility_id Location Device.location

radiology_templates

Purpose
Stores report templates and structured reporting definitions per modality and body part. Used in the report editor and for structured findings capture.

Field Specification

Field Type Nullable Default Constraint Description
template_id BIGINT NO IDENTITY PK Template identifier
template_name VARCHAR(128) NO Name
modality_type VARCHAR(10) YES NULL DICOM modality CT, MR, etc.
body_part_code VARCHAR(32) YES NULL SNOMED/RadLex Body part
body_part_display VARCHAR(128) YES NULL Display text
template_content TEXT NO Narrative template (with placeholders)
structured_fields_json JSONB YES NULL Definition of structured fields
language_code VARCHAR(10) NO 'en' ISO 639-1 Template language
created_by_user_id BIGINT NO FK → users.user_id Author
is_active BOOLEAN NO TRUE Active flag
created_at TIMESTAMP NO CURRENT_TIMESTAMP Creation time
updated_at TIMESTAMP NO CURRENT_TIMESTAMP ON UPDATE Last update
updated_by BIGINT YES NULL FK → users.user_id Last updater

SQL DDL

SQL
CREATE TABLE radiology_templates (
    template_id            BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    template_name          VARCHAR(128) NOT NULL,
    modality_type          VARCHAR(10),
    body_part_code         VARCHAR(32),
    body_part_display      VARCHAR(128),
    template_content       TEXT NOT NULL,
    structured_fields_json JSONB,
    language_code          VARCHAR(10) NOT NULL DEFAULT 'en',
    created_by_user_id     BIGINT NOT NULL,
    is_active              BOOLEAN NOT NULL DEFAULT TRUE,
    created_at             TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at             TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_by             BIGINT,
    CONSTRAINT fk_rtpl_created_by
        FOREIGN KEY (created_by_user_id) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_rtpl_updated_by
        FOREIGN KEY (updated_by) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT chk_rtpl_language
        CHECK (language_code IN ('en','ar'))
);

CREATE INDEX idx_rtpl_modality_bodypart ON radiology_templates(modality_type, body_part_code)
    WHERE is_active = TRUE;
CREATE INDEX idx_rtpl_name ON radiology_templates(template_name);

Terminology Bindings

Field Terminology Example Value
body_part_code SNOMED CT / RadLex 113345001 (Brain structure)
language_code ISO 639-1 ar

FHIR Resource Mapping

Templates are configuration; no direct FHIR mapping. Could map to StructureDefinition or Questionnaire for structured reporting.


critical_result_notifications

Purpose
Tracks critical result communication workflow, including notification attempts, acknowledgements, read-back confirmation, and escalation, to support UAE regulatory and facility policies.

Field Specification

Field Type Nullable Default Constraint Description
notification_id BIGINT NO IDENTITY PK Notification identifier
report_id BIGINT NO FK → radiology_reports.report_id Source report
critical_finding TEXT NO Summary of critical finding
notifying_radiologist_user_id BIGINT NO FK → users.user_id Radiologist initiating notification
target_provider_id BIGINT NO FK → providers.provider_id Intended recipient
notification_method VARCHAR(20) NO in_app/phone/sms/email/pager Method used
sent_datetime TIMESTAMP NO CURRENT_TIMESTAMP When notification sent
acknowledged_datetime TIMESTAMP YES NULL sent_datetime When acknowledged
acknowledged_by_user_id BIGINT YES NULL FK → users.user_id User who acknowledged
escalation_level INT NO 0 ≥ 0 0 = initial, 1 = first escalation, etc.
read_back_confirmed BOOLEAN NO FALSE Read-back done
read_back_datetime TIMESTAMP YES NULL When read-back confirmed
status VARCHAR(20) NO 'pending' pending/acknowledged/failed Overall status
failure_reason TEXT YES NULL If failed
created_at TIMESTAMP NO CURRENT_TIMESTAMP Creation time
created_by BIGINT YES NULL FK → users.user_id Creator
updated_at TIMESTAMP NO CURRENT_TIMESTAMP ON UPDATE Last update
updated_by BIGINT YES NULL FK → users.user_id Last updater

SQL DDL

SQL
CREATE TABLE critical_result_notifications (
    notification_id              BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    report_id                    BIGINT NOT NULL,
    critical_finding             TEXT NOT NULL,
    notifying_radiologist_user_id BIGINT NOT NULL,
    target_provider_id           BIGINT NOT NULL,
    notification_method          VARCHAR(20) NOT NULL,
    sent_datetime                TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    acknowledged_datetime        TIMESTAMP,
    acknowledged_by_user_id      BIGINT,
    escalation_level             INT NOT NULL DEFAULT 0,
    read_back_confirmed          BOOLEAN NOT NULL DEFAULT FALSE,
    read_back_datetime           TIMESTAMP,
    status                       VARCHAR(20) NOT NULL DEFAULT 'pending',
    failure_reason               TEXT,
    created_at                   TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    created_by                   BIGINT,
    updated_at                   TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_by                   BIGINT,
    CONSTRAINT fk_crn_report
        FOREIGN KEY (report_id) REFERENCES radiology_reports(report_id)
        ON UPDATE CASCADE ON DELETE CASCADE,
    CONSTRAINT fk_crn_notifying_radiologist
        FOREIGN KEY (notifying_radiologist_user_id) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_crn_target_provider
        FOREIGN KEY (target_provider_id) REFERENCES providers(provider_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_crn_ack_by
        FOREIGN KEY (acknowledged_by_user_id) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_crn_created_by
        FOREIGN KEY (created_by) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_crn_updated_by
        FOREIGN KEY (updated_by) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT chk_crn_method
        CHECK (notification_method IN ('in_app','phone','sms','email','pager')),
    CONSTRAINT chk_crn_status
        CHECK (status IN ('pending','acknowledged','failed')),
    CONSTRAINT chk_crn_ack_time
        CHECK (acknowledged_datetime IS NULL OR acknowledged_datetime >= sent_datetime),
    CONSTRAINT chk_crn_readback
        CHECK (read_back_confirmed = FALSE OR read_back_datetime IS NOT NULL)
);

CREATE INDEX idx_crn_report ON critical_result_notifications(report_id);
CREATE INDEX idx_crn_status ON critical_result_notifications(status);
CREATE INDEX idx_crn_target_provider ON critical_result_notifications(target_provider_id, status);
CREATE INDEX idx_crn_sent_datetime ON critical_result_notifications(sent_datetime);

Terminology Bindings

Field Terminology Example Value
notification_method Local in_app
status Local acknowledged

FHIR Resource Mapping

Table Field FHIR Resource FHIR Path
notification_id Communication Communication.id
report_id Communication Communication.basedOnDiagnosticReport
critical_finding Communication Communication.payload.contentString
notifying_radiologist_user_id Communication Communication.sender
target_provider_id Communication Communication.recipient
sent_datetime Communication Communication.sent
acknowledged_datetime Communication Communication.received
status Communication Communication.status

radiation_dose_records

Purpose
Stores per-exam radiation dose metrics for ALARA compliance, DRL benchmarking, and UAE MOH radiation safety reporting. Populated automatically from DICOM RDSR where available.

Field Specification

Field Type Nullable Default Constraint Description
dose_id BIGINT NO IDENTITY PK Dose record
exam_id BIGINT NO FK → radiology_exams.exam_id Exam
patient_id BIGINT NO FK → patients.patient_id Patient
modality_type VARCHAR(10) NO DICOM modality CT, XA, etc.
dose_type VARCHAR(20) NO ctdi_vol/dlp/dap/fluoro_time Type of dose metric
dose_value NUMERIC(12,4) NO ≥ 0 Numeric value
dose_unit VARCHAR(16) NO UCUM mGy, mGy.cm, Gy.cm²
body_region_code VARCHAR(32) YES NULL SNOMED/RadLex Region
body_region_display VARCHAR(128) YES NULL Display text
ctdi_vol NUMERIC(12,4) YES NULL ≥ 0 CTDIvol (mGy)
dlp NUMERIC(12,4) YES NULL ≥ 0 DLP (mGy.cm)
dap NUMERIC(12,4) YES NULL ≥ 0 Dose Area Product (Gy.cm²)
effective_dose_msv NUMERIC(12,4) YES NULL ≥ 0 Effective dose (mSv)
drl_exceeded BOOLEAN NO FALSE Above DRL threshold
drl_reference_id BIGINT YES NULL Link to DRL master (if modeled elsewhere)
captured_from_rdsr BOOLEAN NO FALSE True if from DICOM RDSR
rdsr_instance_uid VARCHAR(64) YES NULL DICOM SR UID
created_at TIMESTAMP NO CURRENT_TIMESTAMP Creation time
created_by BIGINT YES NULL FK → users.user_id Creator (if manual)
updated_at TIMESTAMP NO CURRENT_TIMESTAMP ON UPDATE Last update
updated_by BIGINT YES NULL FK → users.user_id Last updater

SQL DDL

SQL
CREATE TABLE radiation_dose_records (
    dose_id               BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    exam_id               BIGINT NOT NULL,
    patient_id            BIGINT NOT NULL,
    modality_type         VARCHAR(10) NOT NULL,
    dose_type             VARCHAR(20) NOT NULL,
    dose_value            NUMERIC(12,4) NOT NULL,
    dose_unit             VARCHAR(16) NOT NULL,
    body_region_code      VARCHAR(32),
    body_region_display   VARCHAR(128),
    ctdi_vol              NUMERIC(12,4),
    dlp                   NUMERIC(12,4),
    dap                   NUMERIC(12,4),
    effective_dose_msv    NUMERIC(12,4),
    drl_exceeded          BOOLEAN NOT NULL DEFAULT FALSE,
    drl_reference_id      BIGINT,
    captured_from_rdsr    BOOLEAN NOT NULL DEFAULT FALSE,
    rdsr_instance_uid     VARCHAR(64),
    created_at            TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    created_by            BIGINT,
    updated_at            TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_by            BIGINT,
    CONSTRAINT fk_rdose_exam
        FOREIGN KEY (exam_id) REFERENCES radiology_exams(exam_id)
        ON UPDATE CASCADE ON DELETE CASCADE,
    CONSTRAINT fk_rdose_patient
        FOREIGN KEY (patient_id) REFERENCES patients(patient_id)
        ON UPDATE CASCADE ON DELETE RESTRICT,
    CONSTRAINT fk_rdose_created_by
        FOREIGN KEY (created_by) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT fk_rdose_updated_by
        FOREIGN KEY (updated_by) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT chk_rdose_value
        CHECK (dose_value >= 0),
    CONSTRAINT chk_rdose_ctdi
        CHECK (ctdi_vol IS NULL OR ctdi_vol >= 0),
    CONSTRAINT chk_rdose_dlp
        CHECK (dlp IS NULL OR dlp >= 0),
    CONSTRAINT chk_rdose_dap
        CHECK (dap IS NULL OR dap >= 0),
    CONSTRAINT chk_rdose_eff
        CHECK (effective_dose_msv IS NULL OR effective_dose_msv >= 0),
    CONSTRAINT chk_rdose_type
        CHECK (dose_type IN ('ctdi_vol','dlp','dap','fluoro_time','other'))
);

CREATE INDEX idx_rdose_patient ON radiation_dose_records(patient_id);
CREATE INDEX idx_rdose_exam ON radiation_dose_records(exam_id);
CREATE INDEX idx_rdose_modality ON radiation_dose_records(modality_type);
CREATE INDEX idx_rdose_drl_exceeded ON radiation_dose_records(drl_exceeded)
    WHERE drl_exceeded = TRUE;

Terminology Bindings

Field Terminology Example Value
modality_type DICOM Modality CT
dose_type Local Dose Type ctdi_vol
dose_unit UCUM mGy, mGy.cm, Gy.cm2
body_region_code SNOMED CT / RadLex 818981001 (Abdomen and pelvis)

FHIR Resource Mapping

Table Field FHIR Resource FHIR Path
dose_id Observation Observation.id
exam_id Observation Observation.partOfImagingStudy
patient_id Observation Observation.subject.reference
modality_type Observation Observation.method
dose_type Observation Observation.code (LOINC for CTDIvol, DLP, etc.)
dose_value + dose_unit Observation Observation.valueQuantity
effective_dose_msv Observation Observation.component (effective dose)
drl_exceeded Observation Extension: drlExceeded

radiology_quality_metrics

Purpose
Stores aggregated QA and productivity metrics per user and period (radiologists and technologists). Supports dashboards and regulatory/management reporting.

Field Specification

Field Type Nullable Default Constraint Description
metric_id BIGINT NO IDENTITY PK Metric record
period_start TIMESTAMP NO Start of measurement period
period_end TIMESTAMP NO period_start End of period
user_id BIGINT NO FK → users.user_id User measured
user_role VARCHAR(32) NO radiologist/technologist Role at time
metric_type VARCHAR(64) NO e.g., tat_routine, tat_stat, critical_compliance Metric identifier
metric_value NUMERIC(18,4) NO Numeric value
benchmark_value NUMERIC(18,4) YES NULL Target benchmark
unit VARCHAR(32) YES NULL Unit (hours, %, RVU)
details_json JSONB YES NULL Optional breakdown
created_at TIMESTAMP NO CURRENT_TIMESTAMP Creation time
created_by BIGINT YES NULL FK → users.user_id Creator

SQL DDL

SQL
CREATE TABLE radiology_quality_metrics (
    metric_id        BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    period_start     TIMESTAMP NOT NULL,
    period_end       TIMESTAMP NOT NULL,
    user_id          BIGINT NOT NULL,
    user_role        VARCHAR(32) NOT NULL,
    metric_type      VARCHAR(64) NOT NULL,
    metric_value     NUMERIC(18,4) NOT NULL,
    benchmark_value  NUMERIC(18,4),
    unit             VARCHAR(32),
    details_json     JSONB,
    created_at       TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    created_by       BIGINT,
    CONSTRAINT fk_rqm_user
        FOREIGN KEY (user_id) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE CASCADE,
    CONSTRAINT fk_rqm_created_by
        FOREIGN KEY (created_by) REFERENCES users(user_id)
        ON UPDATE CASCADE ON DELETE SET NULL,
    CONSTRAINT chk_rqm_period
        CHECK (period_end >= period_start)
);

CREATE INDEX idx_rqm_user_period ON radiology_quality_metrics(user_id, period_start, period_end);
CREATE INDEX idx_rqm_type ON radiology_quality_metrics(metric_type);

Terminology Bindings

Field Terminology Example Value
metric_type Local Metric Codes tat_routine, critical_compliance
unit UCUM / Local h, %, RVU

FHIR Resource Mapping

Aggregated metrics; no standard FHIR mapping. Could be represented via MeasureReport for quality reporting.


Data Volume Estimates

Estimates for a medium-to-large UAE hospital (300–500 beds, high imaging volume).

Table Estimated Rows (Year 1) Annual Growth Notes
radiology_orders 80,000–120,000 +10–15% Includes cancelled/no-show orders
radiology_exams 75,000–110,000 +10–15% Typically ~1 exam per order; some multi-exam orders
radiology_reports 75,000–110,000 +10–15% One per exam; addenda stored separately
radiology_report_addenda 3,000–5,000 Proportional to reports Target addendum rate ≤ 5%
radiology_worklist 100,000–150,000 +10–15% Includes historical queue entries
radiology_protocols 300–800 Low Changes infrequent; versioning over years
modality_resources 20–60 Very low Number of scanners
radiology_templates 150–300 Low Grows slowly with new templates
critical_result_notifications 2,000–4,000 +10–15% Depends on case mix; critical rate 2–4%
radiation_dose_records 75,000–110,000 +10–15% At least one per exam; more for multi-series
radiology_quality_metrics 10,000–20,000 +10–15% Depends on aggregation granularity (e.g., monthly per user per metric)

Storage impact is dominated by radiology_reports (TEXT) and radiology_exams (JSONB UIDs) plus PACS (outside this schema).


Data Retention Policy (UAE Context)

Retention must comply with UAE MOH, DOH, DHA regulations and UAE PDPL. Exact durations may vary by emirate and facility policy; below are recommended minimums for configuration.

Table Recommended Retention Rationale / Notes
radiology_orders ≥ 25 years from last activity Part of medical record; supports medico-legal traceability and audit of ordering patterns.
radiology_exams ≥ 25 years Execution details, contrast use, and linkage to images; important for long-term safety and quality review.
radiology_reports ≥ 25 years (never hard-deleted; only logically retired) Core part of the legal medical record; required for lifelong care continuity and medico-legal defense.
radiology_report_addenda ≥ 25 years Demonstrates correction history and PDPL accountability.
radiology_worklist 10–15 years Operational data; useful for KPI history and incident investigations; can be archived after 10 years.
radiology_protocols 10 years after deactivation For historical context of how exams were performed at a given time.
modality_resources 10 years after device decommission Supports dose and quality investigations referencing old devices.
radiology_templates 10 years after deactivation For understanding historical report structure in legacy reports.
critical_result_notifications ≥ 25 years Critical for medico-legal proof of timely communication of life-threatening findings.
radiation_dose_records ≥ 25 years or lifetime of patient (whichever longer) Supports cumulative dose tracking and MOH radiation safety audits.
radiology_quality_metrics 10 years For long-term quality improvement and regulatory reporting; can be aggregated/archived.

Implementation Notes

  • Use logical deletion flags or archival schemas rather than physical deletion for clinical tables (radiology_orders, radiology_exams, radiology_reports, critical_result_notifications, radiation_dose_records) to comply with medico-legal expectations.
  • Any archival or anonymisation must respect UAE PDPL: de-identification for analytics is preferred over deletion when retention periods expire, subject to facility policy and regulator guidance.
  • Imaging objects (DICOM) retention is governed by PACS policy but must remain linkable via accession_number and study_instance_uid for at least as long as radiology_reports are retained.
content/clinical/ris/03-data-specifications.md Generated 2026-02-20 22:54