Skip to content

MOD ESS 009 DOC

Domain specifications / D10-ESS / 5. Detailed Functional Requirements / 5.9 Module Specification: Document Service and Secure Document References

5.9 Module Specification: Document Service and Secure Document References

5.9.1 Module Overview

Module ID: MOD-ESS-009 (module code DOC)

Purpose: Provide a shared way to register documents and issue access-controlled references to them: document metadata, content reference, content hash, version and access policy (Architecture 5.1). Under the working boundary position, Domain 6 owns legal-record stewardship, lifecycle, retention, legal hold and release of information; Domain 2 provides the object storage.

Business Capabilities: - CAP-ESS-010 Document reference services

Primary Actors: - Calling domain service (ACT-ESS-013); HIM staff through Domain 6 functions

Dependencies: - MOD-ESS-002, MOD-ESS-003, MOD-ESS-006, MOD-ESS-004 (document type codes). - Domain 2 (encrypted object storage); Domain 6 (classification rules, retention class, legal hold).

5.9.2 Functional Area: Document Registration and Secure Reference

Functional Area ID: FA-ESS-025

Description: Registration of documents with metadata and hash, version chains, and resolution of references subject to authorization.

Scope: - Included: metadata catalogue, content reference, hash verification, version chain, secure reference resolution, cross-domain index. - Excluded: document content authoring and signature (authoring domain); classification rules, retention schedules, disposition, legal hold decisions and release packages (Domain 6); DICOM image storage (Domain 4 and Domain 2).

5.9.3 Detailed Requirements

Requirement FR-ESS-DOC-001: Document Registration, Versioning and Secure Reference Resolution

Attribute Description
Requirement ID FR-ESS-DOC-001
Requirement Name Document registration, versioning and secure reference resolution
Requirement Type Functional
Module Document Service and Secure Document References
Functional Area FA-ESS-025 Document registration and secure reference
Priority Must
Criticality High
Requirement Status Draft
Source PRS section 5 (Enterprise services: document, registry); PRS section 8.1; Architecture 5.1 (Document/registry) and 6.1 (Document/object store); contributes to EHR-007 (primary Domain 3) and HIM-002 (primary Domain 6)
Related Business Rule BR-ESS-033, BR-ESS-031
Related Workflow WF-ESS-003

1. Requirement Statement

The system shall register each document with metadata, classification, a content reference and a content hash, shall keep an immutable version chain, shall resolve a document reference to content only after an authorization decision for the requesting subject and purpose, and shall honour the retention class and legal hold flags set by Domain 6.

2. Business Rationale

EHR-007 requires attachments with metadata, classification, access control, versioning and retention rules, locatable by patient, encounter, type, author and date. A common reference service prevents uncontrolled copies and gives one access-control point.

3. Actors and Permissions

Actor Permission Conditions
Authoring domain service Create document and new versions; read Registered document types; cannot overwrite a version
Any calling domain service Resolve reference; search index Subject to authorization decision per request
Domain 6 service Update classification, retention class and legal hold flag Under Domain 6's own rules
No actor Delete content directly Disposal only on instruction from Domain 6's approved disposition process

4. Preconditions - The document type is registered with its owning domain and default privacy labels.

5. Trigger - A domain stores a document; a user or service opens a reference; Domain 6 sets or clears a flag.

6. Functional Behaviour

  1. The system accepts content and metadata, stores the content through Domain 2 object storage, computes and stores a content hash, and returns a stable document identifier and version identifier.
  2. The system stores metadata: patient and encounter references where applicable, document type, title, author, authoring organization, creation time, source system, format, language, privacy labels, classification, retention class, legal hold flag, status and signature status reference.
  3. The system stores a new version as a new immutable object linked to its predecessor; signed versions are never overwritten.
  4. The system indexes documents so that they can be located by patient, encounter, type, author and date.
  5. The system resolves a reference by requesting an authorization decision for the subject, action and purpose, applying label and consent obligations, and then returning content or a short-lived retrieval reference bound to the requester.
  6. The system verifies the content hash on retrieval and reports a mismatch as an integrity failure.
  7. The system refuses disposal of a document that is under legal hold or within its retention class, and performs disposal only on an instruction from Domain 6's disposition process, leaving a metadata tombstone.
  8. The system emits a document-registered event (EVT-ESS-013) so that Domain 6 can apply classification, completeness and lifecycle rules.
  9. The system stores a reference without content for documents whose content remains in an external or ancillary repository, recording the location and retrieval method. DICOM objects are always held this way: their content stays in the imaging archive of Domain 4.
  10. The system checks each upload against the permitted formats and size limits of its document type (CFG-ESS-024): PDF/A, JPEG, PNG, TIFF, MP4, FHIR document bundle and HL7 CDA; 25 MB per document or image, 5 MB per structured document, 500 MB per video. It checks the real file type from the content, not only the file name.

7. Input Requirements

Input Field Data Type Mandatory Validation Description
Content or external location Binary / reference Yes Format permitted for type; size within limit; malware scan result from Domain 2 The document
Document type Code Yes Registered; valid code Classification input
Patient / encounter reference Identifiers Conditional Required for patient documents Context
Author and organization References Yes Resolvable Provenance
Creation time Timestamp Yes — When authored
Privacy labels Code list No In taxonomy; defaults from type Sensitivity
Predecessor version Reference For new versions Exists; same document Version chain

8. Processing Rules

Rule ID Processing Rule Expected Result
PR-DOC-001-1 Same content hash registered again for the same patient, type and author Existing document returned; no duplicate stored
PR-DOC-001-2 Reference resolution without a Permit decision Content not returned
PR-DOC-001-3 Hash mismatch on retrieval Content withheld; integrity alert
PR-DOC-001-4 Disposal instruction for a held or in-retention document Refused
PR-DOC-001-5 Retrieval reference used by a different subject or after expiry Refused

9. Output Requirements

Output Format Recipient Description
Document identifier and version API response Authoring service Stable reference
Document metadata API resource; FHIR DocumentReference where selected Authorized services Catalogue entry
Content or short-lived retrieval reference Binary / signed reference Authorized requester The document
Document-registered event Event (EVT-ESS-013) Domain 6, Domain 8 New document or version

10. Validation and Error Handling

Scenario Validation System Response User Message / Action
Unsupported format or oversize Type rule Reject "This file type or size is not accepted for the document type."
Patient reference missing for patient document Mandatory by type Reject "Patient is required."
Storage unavailable Storage error Reject registration; caller retries; no partial registration "Document could not be saved. Try again."
Patient merge or unmerge Domain 1 event Index updated to surviving or restored identity; original identifiers kept None.

11. State and Lifecycle Behaviour

A document reference is Current, Superseded (earlier versions), Entered in Error (flagged by the authoring domain, content retained) or Disposed (tombstone). Lifecycle decisions are made by the authoring domain and Domain 6; this service records and enforces the flags.

12. Audit Requirements

  • Audited events: registration, new version, every resolution (view, print, export), denied resolution, flag change, disposal, integrity failure.

13. Security and Privacy Requirements

  • Content is encrypted at rest and in transit by Domain 2 controls (SEC-005).
  • A reference is not a capability: holding an identifier grants nothing without a Permit decision (BR-ESS-033).
  • Retrieval references are short-lived and bound to the requester.

14. Acceptance Criteria

  • AC-01: Given a registered document, when searched by patient, encounter, type, author or date, then it is found (EHR-007 acceptance).
  • AC-02: Given a user without authorization for the patient, when a document reference is resolved, then content is not returned and the denial is audited.
  • AC-03: Given a signed version, when a new version is registered, then both the original and the new version are retrievable.
  • AC-04: Given a document under legal hold, when disposal is instructed, then it is refused.
  • AC-05: Given stored content altered out of band in a test environment, when retrieved, then the hash mismatch is detected and content is withheld.

15. Dependencies and Integration

  • Upstream dependencies: Domain 2 object storage; authoring domains (3, 4, 5, 6, 7).
  • Downstream dependencies: Domain 6 (lifecycle, release of information), Domain 7 (approved document release), Domain 8 (metadata).
  • Required events or APIs: IF-ESS-011; EVT-ESS-013.

16. Open Questions / Assumptions

  • Separation between document technical service and legal-record stewardship is an open decision in REF-002; the working position is stated above (DEC-ESS-003).
  • Update 17 Nov 2026 (GAP-ESS-010, closed): permitted formats and size limits are set in CFG-ESS-024 (part 6.10); each Domain 6 document type may narrow them.

← 5.8 Module Specification: Workflow Orchestration and Task Coordination | Contents | Identifier index | 5.10 Module Specification: Registry and Cross-Reference Services →