MOD HIM 005 DOC
Domain specifications / D06-HIM / 5. Detailed Functional Requirements / 5.5 Module Specification: Document Classification, Indexing, Lifecycle, Versioning, Metadata and Provenance
5.5 Module Specification: Document Classification, Indexing, Lifecycle, Versioning, Metadata and Provenance¶
5.5.1 Module Overview¶
Module ID: MOD-HIM-005
Purpose:
Steward the metadata and lifecycle of every document in the health record so that documents are correctly classified, indexed, versioned and traceable, while the Domain 10 document service stores content and issues secure references.
Business Capabilities: - CAP-HIM-005 Document stewardship
Primary Actors: - Document Indexing Clerk, HIM Analyst
Dependencies: - Domain 10 document service (content, reference, hash, version, access policy enforcement) and terminology (document type codes) - Domain 2 secure storage, backup and integration channels for inbound documents - Domains 3 and 4 as document producers; Domain 1 for patient and encounter resolution
5.5.2 Functional Area: Classification, Indexing, Lifecycle and Capture¶
Functional Area ID: FA-HIM-010, FA-HIM-011, FA-HIM-012
Description:
FA-HIM-010 covers document class, type and index attributes. FA-HIM-011 covers lifecycle state, version chain and provenance. FA-HIM-012 covers scanning and indexing of paper and downtime documents and correction of indexing errors.
Scope: - Included: HIM document metadata record, record class assignment, index attributes, lifecycle state, version and provenance stewardship, capture and quality check, indexing correction. - Excluded: binary storage, content hash computation, malware scanning, content retrieval and reference issuance (Domain 10 and Domain 2); image studies in PACS (Domain 4).
5.5.3 Detailed Requirements¶
Requirement FR-HIM-DOC-001: Document classification and indexing¶
| Attribute | Description |
|---|---|
| Requirement ID | FR-HIM-DOC-001 |
| Requirement Name | Document classification and indexing |
| Requirement Type | Functional |
| Module | Document Classification, Indexing, Lifecycle, Versioning, Metadata and Provenance |
| Functional Area | FA-HIM-010 Classification and indexing |
| Priority | Must |
| Criticality | High |
| Requirement Status | Draft |
| Source | EHR-007 (partial); ADM-002 (partial); PRS section 5 "HIM and compliance" (document lifecycle); PRS 13.2 (document classification as optional AI use case); PMK 24/2022 articles 13 and 18 (storage and processing of the medical record) |
| Related Business Rule | BR-HIM-009, BR-HIM-010 |
| Related Workflow | WF-HIM-006 |
1. Requirement Statement
The system shall classify every document in the health record with a document type and a record class and shall index it by patient, encounter, type, author and date, so that an authorized user can locate a document by any of those attributes.
2. Business Rationale
EHR-007 acceptance is that a document can be located by patient, encounter, type, author and date. The record class assigned here is what retention rules act on (HIM-002).
3. Actors and Permissions
| Actor | Permission | Conditions |
|---|---|---|
| Document Indexing Clerk | Create, Read, Update | Documents in the indexing queue for own facility |
| HIM Analyst | Read, Update | Reclassify and re-index with reason |
| System | Create | Classifies documents that arrive with complete metadata from Domains 3 and 4 |
| Authorized record users | Read | Search subject to access policy |
4. Preconditions - The document is registered in the Domain 10 document service and has a document reference. - Document types and record classes are configured; each document type maps to a record class.
5. Trigger - Document registration event from the document service; manual indexing; reclassification.
6. Functional Behaviour
- For a document produced by a clinical or ancillary workflow with patient, encounter, type, author and date supplied, the system creates the HIM metadata record automatically and assigns the record class from the type mapping.
- For a document without complete metadata, the system places it in the indexing queue in state Received.
- The clerk assigns document type and enters the missing index attributes; the system validates patient and encounter against Domain 1. A document whose patient or encounter cannot be resolved is held Unindexed; when the clerk completes and validates the index, it becomes Indexed.
- On successful validation the document becomes Indexed. It becomes Active when it is added to the record component list of its encounter; a scanned document becomes Active only after its quality check passes (PR-DOC-003-1 of FR-HIM-DOC-003; section 4.3).
- Reclassification or re-indexing creates a new metadata version with reason; the earlier version is retained.
- Search returns documents by patient, encounter, type, author and date range, limited to documents the user is permitted to see.
- Where an automated classification suggestion is offered, it is labelled "Suggested · confirm", visually distinct from the clerk's decisions, and requires clerk confirmation.
7. Input Requirements
| Input Field | Data Type | Mandatory | Validation | Description |
|---|---|---|---|---|
| Document reference | Reference | Yes | Issued by Domain 10 document service | Link to content |
| Patient identifier | Identifier | Yes | Resolves in Domain 1 | Subject of the document |
| Encounter identifier | Identifier | Where applicable to the type | Belongs to the patient | Encounter context |
| Document type | Code | Yes | Configured type (governed code set) | Kind of document |
| Record class | Code | Yes | Derived from type; overridable with reason | Retention class |
| Author / source | Identifier or text | Yes | Practitioner, organisation or source system | Provenance |
| Document date | Date/time | Yes | Not in the future | Date of the document content |
8. Processing Rules
| Rule ID | Processing Rule | Expected Result |
|---|---|---|
| PR-DOC-001-1 | Encounter must belong to the indexed patient | Mismatch rejected |
| PR-DOC-001-2 | A document without a resolved patient is not visible in any patient record | It remains in the unindexed queue |
| PR-DOC-001-3 | Record class is always present once a document is Indexed | Retention evaluation has no unclassified active documents |
9. Output Requirements
| Output | Format | Recipient | Description |
|---|---|---|---|
| HIM document metadata record | Structured record | HIM modules; document service (class and lifecycle state) | Classification and index attributes |
| Search result | Screen / API response | Authorized users | Documents matching criteria |
DocumentIndexed |
Event | MOD-HIM-004; Domain 8 | Document added to the record |
10. Validation and Error Handling
| Scenario | Validation | System Response | User Message / Action |
|---|---|---|---|
| Encounter belongs to another patient | Cross-check with Domain 1 | Rejected | "Encounter does not belong to this patient." |
| Unknown document type from a source system | Mapping lookup | Document queued for manual classification | Work item |
| Domain 1 unavailable | Service call | Indexing cannot be confirmed; document stays Received | "Patient lookup unavailable; try again." |
11. State and Lifecycle Behaviour
Received to Indexed on validation (or Unindexed when held, then Indexed when indexing is completed); Indexed to Active when the document is included in the encounter record, after the quality check for a scanned document.
12. Audit Requirements
Indexing, reclassification and re-indexing are audited with before and after metadata. Document searches by patient are audited as record queries (SEC-019).
13. Security and Privacy Requirements
Access policy for the document is enforced by the document service using the classification and any privacy label. Unindexed documents are visible only to indexing staff.
14. Acceptance Criteria
- AC-01: Given an indexed document, when an authorized user searches by patient, by encounter, by type, by author or by date, then the document is found in each case.
- AC-02: Given a document indexed with an encounter of a different patient, when the clerk saves, then the save is rejected.
- AC-03: Given a reclassified document, when its metadata history is viewed, then the earlier classification, the user, time and reason are shown.
- AC-04: Given a document without a resolved patient, when any patient record is viewed, then the document does not appear.
15. Dependencies and Integration
- Upstream dependencies: Domain 10 document service; Domain 1 patient and encounter lookup; Domain 10 terminology for document types.
- Downstream dependencies: MOD-HIM-004, MOD-HIM-006.
- Required events or APIs: document service registration event and metadata API; EVT-HIM-007.
16. Open Questions / Assumptions
- EHR-007 is shared between the clinical record (Domain 3), the document service (Domain 10) and this domain. This specification treats it as Partial and specifies stewardship only (DEC-HIM-001).
- Whether the HIM metadata record is a separate store or an HIM-governed section of the document service's metadata catalogue is a design decision (DEC-HIM-001).
Requirement FR-HIM-DOC-002: Document lifecycle, versioning and provenance¶
| Attribute | Description |
|---|---|
| Requirement ID | FR-HIM-DOC-002 |
| Requirement Name | Document lifecycle, versioning and provenance |
| Requirement Type | Functional |
| Module | Document Classification, Indexing, Lifecycle, Versioning, Metadata and Provenance |
| Functional Area | FA-HIM-011 Lifecycle, versioning and provenance |
| Priority | Must |
| Criticality | High |
| Requirement Status | Draft |
| Source | EHR-007 (partial); EHR-004 (partial); EHR-003 (partial); SEC-020 (partial); DAT-003 (partial); PRS section 5 (document lifecycle) |
| Related Business Rule | BR-HIM-004, BR-HIM-010, BR-HIM-013 |
| Related Workflow | WF-HIM-006, WF-HIM-004 |
1. Requirement Statement
The system shall maintain for every record document a lifecycle state, a complete version chain and a provenance record covering source, author, capture method, transformations and each lifecycle change, and shall not permit a document version in the legal record to be overwritten or removed outside the approved disposal workflow.
2. Business Rationale
The Domain 6 boundary principle is that the legal record must preserve provenance, authorship, version history and applicable retention constraints.
3. Actors and Permissions
| Actor | Permission | Conditions |
|---|---|---|
| HIM Analyst | Read, Update | Mark a document entered in error with reason. Only documents captured or held by HIM (scanned, external, imported); a clinical entry is marked in Domain 3 on UI-CLI-003 and its state is mirrored here; its reversal by the HIM Manager is sent to Domain 3 as a command (OV-118) |
| HIM Manager | Read, Update | Reverse an entered-in-error marking with reason; works "Integrity check failed" work items |
| Document Indexing Clerk | Read | View version chain and provenance |
| System | Create, Update | Maintains lifecycle and version chain from events |
| Records Retention Administrator | Update | Lifecycle transitions to Archived and Disposed through MOD-HIM-006 only |
4. Preconditions - The document is Indexed.
5. Trigger - New version registered in the document service; lifecycle action by a user; retention action; legal hold.
6. Functional Behaviour
- The system records lifecycle states Received, Unindexed, Indexed, Active, Superseded, Entered in Error, Archived and Disposed, each transition with actor, time and reason.
- When a new version of a document is registered, the system links it to its predecessor, marks the predecessor Superseded and keeps it retrievable.
- The provenance record holds: source system or capture method (authored, scanned, imported, generated), author, capturing user, original source identifier, content hash reference from the document service and, for transformed content, the transformation performed.
- Marking a document Entered in Error requires a reason and keeps content and metadata. In clinical views the document is struck through with "Entered in error by [name] · [date time] · [reason]", collapsed to one line in default views, and visible to authorized users with the reason (design rule CUX-09). HIM views (UI-HIM-006) show it in full. Users who viewed or acted on the document before it was marked, as recorded in the audit trail, are notified. Only the HIM Manager may reverse the marking, with a reason; the document returns to the state it had before, and the reversal is audited.
- The system exposes the current lifecycle state, record class and hold indicator of each document to the document service so that the service can enforce them.
- After disposal the metadata record remains as a tombstone stating what was disposed, when, under which rule and approval (FR-HIM-RET-003).
- A Superseded version follows the retention schedule of its record. It is archived and disposed with the record, under FR-HIM-RET-002 and FR-HIM-RET-003, never on a schedule of its own.
7. Input Requirements
| Input Field | Data Type | Mandatory | Validation | Description |
|---|---|---|---|---|
| Document reference and version | Reference | Yes | Issued by document service | Version being registered |
| Predecessor reference | Reference | For new versions | Exists | Version chain link |
| Capture method | Code | Yes | Authored, scanned, imported, generated | Provenance |
| Lifecycle action and reason | Code and text | For user actions | Allowed transition | Requested change |
8. Processing Rules
| Rule ID | Processing Rule | Expected Result |
|---|---|---|
| PR-DOC-002-1 | Only the transitions in section 4.3 are allowed | Invalid transitions are rejected with reason |
| PR-DOC-002-2 | A version in the legal record is never physically replaced | All versions retrievable until disposal |
| PR-DOC-002-3 | Transition to Archived or Disposed is possible only from MOD-HIM-006 with an approved batch | No ad hoc disposal |
9. Output Requirements
| Output | Format | Recipient | Description |
|---|---|---|---|
| Version chain and provenance view | Screen / API response | HIM roles, authorized record users | History of the document |
| Lifecycle state | API / event | Domain 10 document service | State to enforce |
| Entered-in-error notification | Notification | Users who viewed or acted on the document before it was marked | Document reference, the marking and its reason, without clinical content |
| "Integrity check failed" work item | Work item | HIM Manager (UI-HIM-001) | Document version whose hash differs from the recorded one |
10. Validation and Error Handling
| Scenario | Validation | System Response | User Message / Action |
|---|---|---|---|
| Delete requested by a user | BR-HIM-013 | Refused and audited | "Documents cannot be deleted. Use Entered in Error or the disposal workflow." |
| Content hash of a retrieved version differs from the recorded hash | Integrity result from document service | Document flagged; integrity incident raised; an HIM work item of type "Integrity check failed" is created for the HIM Manager (FR-HIM-WBN-001) | Security alert to HIM Manager and security; work item in UI-HIM-001, which opens UI-HIM-006 |
| Entered in Error without a reason | Mandatory field | Refused | "Enter why this document is entered in error." |
| Reversal of Entered in Error by a user other than the HIM Manager | Authorization | Refused | "Only the HIM Manager can reverse an entered-in-error marking." |
| Reversal without a reason | Mandatory field | Refused | "Enter why the entered-in-error marking is reversed." |
| New version registered for a Disposed document | State check | Rejected | Exception work item |
11. State and Lifecycle Behaviour
As listed in section 4.3 for "Document (HIM lifecycle)", including the reversal of Entered in Error by the HIM Manager.
12. Audit Requirements
Every lifecycle transition, including the marking and reversal of Entered in Error with its reason, and every view of provenance is audited. Integrity failures are security events forwarded through the audit service.
13. Security and Privacy Requirements
Superseded and Entered in Error versions remain subject to the same access policy and privacy labels as the current version.
14. Acceptance Criteria
- AC-01: Given a document with two versions, when the version chain is viewed, then both versions are retrievable and the earlier is Superseded.
- AC-02: Given a scanned document, when its provenance is viewed, then capture method, capturing user, capture time and source are shown.
- AC-03: Given any HIM user, when a delete of an Active document is attempted, then it is refused and audited.
- AC-04: Given a document marked Entered in Error, when the patient record is viewed by default in a clinical view, then the document is struck through and collapsed to one line, an authorized user can see it with the reason, and the HIM history view shows it in full.
- AC-05: Given a document that a clinician viewed before it was marked Entered in Error, when it is marked, then the clinician is notified.
- AC-06: Given a document in Entered in Error, when the HIM Manager reverses the marking with a reason, then the document is Active again and the reversal is audited; when an HIM Analyst attempts it, it is refused.
- AC-07: Given a document version whose retrieved hash differs from the recorded one, when the integrity result arrives, then the version is flagged, a security alert is raised and an "Integrity check failed" work item is in the HIM Manager's queue.
15. Dependencies and Integration
- Upstream dependencies: Domain 10 document service (versions, hash, retrieval).
- Downstream dependencies: MOD-HIM-006, MOD-HIM-007, MOD-HIM-008.
- Required events or APIs: document version events; IF-HIM-003.
16. Open Questions / Assumptions
- SEC-020 Provenance for clinical assertions is owned by the clinical and shared-service domains; this requirement covers document-level provenance in the legal record only.
Requirement FR-HIM-DOC-003: Paper and downtime document capture and indexing correction¶
| Attribute | Description |
|---|---|
| Requirement ID | FR-HIM-DOC-003 |
| Requirement Name | Paper and downtime document capture and indexing correction |
| Requirement Type | Functional |
| Module | Document Classification, Indexing, Lifecycle, Versioning, Metadata and Provenance |
| Functional Area | FA-HIM-012 Paper and downtime document capture |
| Priority | Must |
| Criticality | High |
| Requirement Status | Draft |
| Source | BCP-006 (partial); PRS 14.2 (downtime forms, chain of custody); EHR-008 (partial); EHR-007 (partial) |
| Related Business Rule | BR-HIM-009, BR-HIM-010 |
| Related Workflow | WF-HIM-006 |
1. Requirement Statement
The system shall support capture of paper documents and downtime forms into the health record with quality check, form-number tracking and provenance, and shall support correction of a document indexed to the wrong patient or encounter without loss of history.
2. Business Rationale
PRS 14.2 requires uniquely numbered downtime forms with chain of custody, and BCP-006 requires controlled reconciliation of downtime entries with duplicate prevention and provenance. A mis-indexed document is a wrong-patient and privacy hazard.
3. Actors and Permissions
| Actor | Permission | Conditions |
|---|---|---|
| Document Indexing Clerk | Create, Update | Scan, index and quality-check |
| HIM Analyst | Update, Approve | Approve indexing corrections on UI-HIM-005; never a correction they requested |
| System | Create | Duplicate detection |
4. Preconditions - Scanned content has been accepted by the Domain 10 document service (including its file safety checks).
5. Trigger - Paper documents delivered to HIM; end of a downtime period; discovery of a mis-indexed document.
6. Functional Behaviour
- The clerk registers a capture batch with source location, date and, for downtime, the downtime event reference.
- Each scanned document is indexed as in FR-HIM-DOC-001, with capture method "scanned" and, for downtime forms, the unique form number.
- The system checks the form number against already indexed forms and flags a possible duplicate.
- A quality check step records that the image is legible and complete and that indexing was verified; documents failing the check are rescanned or re-indexed.
- The system reports, per downtime event, the form numbers issued (where supplied by the downtime procedure), captured and outstanding. This domain owns the form register: the capture batch header of a downtime batch shows "Forms captured [n] of [m] · outstanding [list]"; the downtime console reads its counts and the owning domains link transcribed entries by form number, without a list of their own (OV-122).
- Transcription of downtime entries into structured records is done in the owning domains; this requirement stores the source form and links it by form number so that the reconciled entry can reference it.
- For a mis-indexed document, an authorized user starts a correction stating the correct patient and encounter and the reason; the correction shows "Awaiting approval" and creates an "Indexing correction" work item; after approval by an HIM analyst other than the requester the system creates a new metadata version, removes the document from the wrong record's component list, adds it to the correct one and retains the full history. The wrong indexing is shown only in HIM views of the correct record (UI-HIM-006). The wrong patient's record keeps no visible trace of the document; the audit log alone records it.
- The system lists disclosures and accesses of the mis-indexed document while it was wrongly indexed for privacy review.
7. Input Requirements
| Input Field | Data Type | Mandatory | Validation | Description |
|---|---|---|---|---|
| Batch source and date | Text / date | Yes | Origin of the paper | |
| Downtime event reference | Identifier | For downtime forms | Known downtime event | Link to the downtime |
| Form number | Text | For downtime forms | Unique among indexed forms | Controlled form identifier |
| Quality check result | Code | Yes | Pass / fail with reason | Legibility and indexing verification |
| Correction target and reason | Identifier / text | For corrections | Target patient and encounter resolve | Correct index values |
8. Processing Rules
| Rule ID | Processing Rule | Expected Result |
|---|---|---|
| PR-DOC-003-1 | A scanned document is not Active until the quality check passes | Unchecked scans do not enter the record |
| PR-DOC-003-2 | Indexing correction never deletes the earlier metadata version | The wrong indexing remains in history, shown only in HIM views of the correct record; the wrong patient's record keeps no visible trace beyond the audit log |
| PR-DOC-003-3 | A duplicate form number is flagged, not rejected | The clerk decides whether it is a rescan or a true duplicate |
9. Output Requirements
| Output | Format | Recipient | Description |
|---|---|---|---|
| Downtime form reconciliation report | Report | HIM Manager, downtime command | Captured and outstanding form numbers |
| Mis-indexing exposure list | Report | Privacy Officer | Access and disclosure of the document while mis-indexed |
10. Validation and Error Handling
| Scenario | Validation | System Response | User Message / Action |
|---|---|---|---|
| File rejected by the document service | Safety check result | Capture fails for that file | "File was rejected by the document service." |
| File format or size not allowed for the document type | Document type rules of CFG-HIM-014, within CFG-ESS-024 | Capture fails for that file | "This document type accepts: list of formats, up to the size limit." |
| Patient on a downtime form cannot be identified | Lookup | Document held Unindexed | Work item; identity resolution through Domain 1 |
| Correction without approval | Authorization | Not applied | Correction waits for HIM Analyst approval |
11. State and Lifecycle Behaviour
Received to Indexed to Active after quality check. Correction leaves state Active with a new metadata version.
12. Audit Requirements
Capture, quality check, duplicate decision and indexing correction are audited with before and after index values. Physical custody of paper originals is recorded in the batch record where the hospital procedure requires it.
13. Security and Privacy Requirements
A mis-indexing correction is treated as a potential privacy incident and is notified to the privacy office. Disposal of paper originals after scanning follows the paper originals row of the enterprise retention baseline: 2 years after the verified scan, then destruction with minutes, unless under legal hold or flagged "keep original".
14. Acceptance Criteria
- AC-01: Given a batch of downtime forms, when they are scanned and indexed with form numbers, then each is retrievable in the patient record with capture method scanned and the downtime event reference.
- AC-02: Given a form number already indexed, when the same number is captured again, then a possible duplicate is flagged.
- AC-03: Given a document indexed to the wrong patient, when the correction is approved, then it no longer appears in the wrong patient's record, appears in the correct one, and the history shows both index values with user, time and reason.
- AC-04: Given a scan that fails the quality check, when the record is viewed, then the scan is not part of the record.
15. Dependencies and Integration
- Upstream dependencies: Domain 10 document service; Domain 2 scanning endpoints and downtime technical enablement; Domain 1 identity resolution.
- Downstream dependencies: owning domains' downtime reconciliation; MOD-HIM-010.
- Required events or APIs: document service upload API; downtime event reference from Domain 2 operations.
16. Open Questions / Assumptions
- BCP-006 is owned by Domain 2 for the platform capability; each domain reconciles its own downtime entries. HIM's part is the paper source documents (ASM-HIM-004).
- Paper originals are kept 2 years after the scan passes the quality check, then destroyed with minutes (berita acara), unless under legal hold or flagged "keep original" by HIM (enterprise retention baseline; GAP-HIM-003, closed 17 Nov 2026).
← 5.4 Module Specification: Record Assembly and Encounter Completion | Contents | Identifier index | 5.6 Module Specification: Retention Schedules and Disposition Controls →