0002: Unified medical record viewers
Decision
Expose one Records library rather than separate Documents and Imaging views. Represent a DICOM study as one logical record, while retaining specialized Study → Series → Instance tables behind a typed record facade. Choose the viewer only after the user opens a record.
Use lazy-loaded Cornerstone3D adapters for DICOM images, NIfTI, and DICOM ECG waveforms supported by Cornerstone's ECG viewport. Use native browser rendering for JPEG, PNG, WebP, and PDF. Preserve unsupported files as downloadable ordinary records; do not add independent WFDB or EDF viewers.
Consequences
- Search, timeline, metadata, report links, and archive export must include both document and imaging sources.
- DICOM imports group by embedded UIDs and enforce consistent source-patient identity within a study.
- Cornerstone and codecs stay out of the application shell and ordinary record detail pages.
- Existing document foreign keys require no risky parent-table migration.
- New format families should be added as adapters behind the record facade, not as parallel top-level libraries.