Skip to content

MOD ADM 004 ENC

Domain specifications / D01-ADM / 5. Detailed Functional Requirements / 5.4 Module Specification: Encounter and Visit Management

5.4 Module Specification: Encounter and Visit Management

5.4.1 Module Overview

Module ID: MOD-ADM-004

Purpose: Create and identify encounters, govern their lifecycle and provide encounter-context validation to every domain that attaches activity to an encounter.

Business Capabilities: - CAP-ADM-004 Encounter management

Primary Actors: - Registration / admission clerk (ACT-ADM-001) - Registration supervisor (ACT-ADM-010) - Consuming domain services (ACT-ADM-012)

Dependencies: - MOD-ADM-001, MOD-ADM-003, MOD-ADM-005, MOD-ADM-006. - Domain 10: facility, service, practitioner and location registries; authorization; audit. - Domains 3, 5 and 6 report closure-relevant status.

5.4.2 Functional Areas

Functional Area ID: FA-ADM-009 Encounter creation and identification

Description: Creation of encounters and assignment of the Case Identification Number.

Scope: - Included: encounter classes (inpatient, outpatient, emergency, day care and others configured), CIN, links to person, facility, service, practitioner and location. - Excluded: episodes of care spanning several encounters as a clinical construct (Domain 3).

Functional Area ID: FA-ADM-010 Encounter lifecycle and context validation

Description: The encounter state machine, correction and cancellation, and validation of encounter status for downstream activity.

Scope: - Included: state transitions, state history, correction, cancellation, closure criteria evaluation, validation API. - Excluded: enforcement inside ordering and charge capture (Domains 3 and 5 call the validation and enforce the result).

5.4.3 Detailed Requirements

Requirement FR-ADM-ENC-001: Encounter creation and Case Identification Number

Attribute Description
Requirement ID FR-ADM-ENC-001
Requirement Name Encounter creation and Case Identification Number
Requirement Type Functional
Module Encounter and visit management
Functional Area FA-ADM-009 Encounter creation and identification
Priority Must
Criticality Critical
Requirement Status Draft
Source PAT-003, ADM-002; PRS section 7.3 (Encounter / Case)
Related Business Rule BR-ADM-009
Related Workflow WF-ADM-001, WF-ADM-003

1. Requirement Statement

The system shall assign to each distinct encounter a unique Case Identification Number (CIN) linked to the enterprise person identifier, and shall retain the assigning authority and facility context, so that every order, result, document and charge can be linked to the correct encounter and traced to the patient and facility.

2. Business Rationale

The encounter is the context for clinical accountability, location, payer coverage and billing. Without a stable encounter identifier, downstream records cannot be reliably grouped or reconciled.

3. Actors and Permissions

Actor Permission Conditions
Registration / admission clerk Create, Read Permitted facilities
Triage nurse / emergency clinician Create (emergency encounter) Emergency context
Scheduler / clinic clerk Create (through check-in) —
Consuming domain service Read Scoped service identity

4. Preconditions - A resolved or provisional person exists. - Facility and encounter class are valid in the registries.

5. Trigger - Registration, check-in, emergency arrival or pre-admission.

6. Functional Behaviour

  1. The system creates the encounter with patient reference, encounter class and type, facility, service, start time, initial location where known, attending practitioner or team where known, status and payer context reference (PRS 7.3).
  2. The system generates a CIN that is unique within its assigning authority, in the configured format, and stores assigning authority and facility with it.
  3. The CIN is immutable for the life of the encounter and is never reused.
  4. A patient may have more than one open encounter where policy permits (for example an outpatient visit during an inpatient stay); the system warns on creation of a second open encounter of the same class at the same facility and applies the configured rule (warn or block). The rule does not fire for "Admit from emergency", which opens the inpatient encounter as the emergency encounter is closed (FR-ADM-ADT-001).
  5. The system exposes the encounter by CIN and by patient to consuming domains and publishes an EncounterOpened event.
  6. An encounter created from an appointment retains the appointment reference.
  7. An encounter opened by an admission from emergency or by a transfer between facilities is a linked new encounter: it records the encounter it continues, and the linked encounters form one care episode, used by Domain 5 for one claim where the payer requires it and separate bills where it does not. A move between wards of the same facility stays one encounter (DEC-ADM-008).

7. Input Requirements

Input Field Data Type Mandatory Validation Description
Patient Enterprise person identifier Yes Active or provisional identity; not a retired (merged) identity Subject
Encounter class / type Code Yes Governed value set Inpatient, outpatient, emergency, day care, other
Facility Reference Yes In registry; user permitted Facility context
Service / department Reference Configurable In registry Responsible service
Start time Date-time Yes (defaults to now) Not in the future beyond tolerance, except Pre-admitted Event time
Attending practitioner / team Reference Configurable Active in registry Responsibility
Appointment reference Reference No Existing appointment for the same patient Source appointment
Continues from CIN Conditional Set by "Admit from emergency" and transfer between facilities; encounter of the same patient Earlier encounter of the care episode

8. Processing Rules

Rule ID Processing Rule Expected Result
PR-ENC-001-1 Patient reference is a merged (retired) identity Encounter is created against the surviving identity
PR-ENC-001-2 Repeated submission of the same creation request (same idempotency key) One encounter only; the original is returned (SAFE-004)
PR-ENC-001-3 Second open encounter of the same class and facility Configured rule applied (warn or block); not applied for "Admit from emergency"
PR-ENC-001-4 Encounter opened as a continuation of an earlier encounter Linked to the earlier encounter and placed in its care episode

9. Output Requirements

Output Format Recipient Description
Encounter with CIN Stored record; API (FHIR Encounter where applicable) Users, consumers Encounter context
EncounterOpened event Domain event; HL7 v2 ADT message per profile Subscribed domains, external systems Patient, CIN, facility, class, start

10. Validation and Error Handling

Scenario Validation System Response User Message / Action
Facility or service inactive Registry check Reject "Selected facility or service is not active."
Duplicate open encounter and rule is block PR-ENC-001-3 Reject "An open encounter of this type already exists." with link
Event publication delayed Outbox Encounter is committed; event is delivered when the backbone recovers None; operational monitoring

11. State and Lifecycle Behaviour

Creates the encounter in Pre-admitted or Registered (section 4.3).

12. Audit Requirements

Encounter creation is audited with actor, time, patient, facility and source (appointment, emergency, manual).

13. Security and Privacy Requirements

Encounter data is Confidential. Access is governed by facility, role and care relationship (SEC-003). Encounters at sensitive service lines may carry privacy labels under Domain 10 policy.

14. Acceptance Criteria

  • AC-01: Given a registered patient, when an encounter is created, then a unique CIN is assigned and the encounter is retrievable with patient and facility.
  • AC-02: Given any order, result, document or charge reference carrying a CIN, when the CIN is resolved, then the encounter, patient and facility are returned.
  • AC-03: Given the same creation request submitted twice with the same idempotency key, when processed, then exactly one encounter exists.
  • AC-04: Given a CIN of a cancelled encounter, when new encounters are created, then that CIN value is not reissued.

15. Dependencies and Integration

16. Open Questions / Assumptions

  • The identity policy sets the encounter number at up to 14 characters and one medical record number per facility (DEC-ADM-002, resolved 2026-11-17).
  • Rules for concurrent encounters are not specified in the PRS; REF-004 states that multiple concurrent encounters are permitted subject to policy (CFG-ADM-010). The rule does not fire for "Admit from emergency" (DEC-ADM-008, resolved 2026-11-17).
  • Admission from emergency and transfer between facilities open a linked new encounter in one care episode; a ward move in the same facility stays one encounter (DEC-ADM-008, resolved 2026-11-17).

Requirement FR-ADM-ENC-002: Governed encounter state machine, correction and cancellation

Attribute Description
Requirement ID FR-ADM-ENC-002
Requirement Name Governed encounter state machine, correction and cancellation
Requirement Type Functional
Module Encounter and visit management
Functional Area FA-ADM-010 Encounter lifecycle and context validation
Priority Must
Criticality Critical
Requirement Status Draft
Source ADM-009, FLOW-005 (encounter correction); SAFE-004 (contributes)
Related Business Rule BR-ADM-010, BR-ADM-012
Related Workflow WF-ADM-004, WF-ADM-006

1. Requirement Statement

The system shall implement a governed encounter state machine covering pre-admission, registered, admitted, transferred, discharged, cancelled and corrected states as applicable, shall reject invalid transitions with a reason, shall audit all valid transitions, and shall represent corrections and cancellations as explicit transitions that preserve the original history.

2. Business Rationale

Explicit states prevent contradictory situations, such as a discharged patient occupying a bed in the system, and give downstream domains a dependable basis for deciding whether activity is permitted.

3. Actors and Permissions

Actor Permission Conditions
Registration / admission clerk, ward nurse Update (standard transitions) Per transition and encounter class
Registration supervisor Approve / execute (correction, cancellation after admission, reversal of discharge) Reason mandatory
System Update (closure) When criteria are met

4. Preconditions - The encounter exists; the state model for its class is configured.

5. Trigger - An ADT transaction, a correction or cancellation request, or a closure evaluation.

6. Functional Behaviour

  1. The system holds the current state of each encounter and an append-only state history; each entry records prior state, new state, transition type (including "Transferred" and "Corrected"), effective time, recorded time, actor and reason where required.
  2. The system permits only the transitions defined in section 4.3 for the encounter class and rejects any other with a reason code.
  3. Each transition is applied with a version check so that two concurrent transitions on the same encounter cannot both succeed.
  4. Cancellation requires a reason. Cancellation of an encounter that already has downstream activity is permitted only to a supervisor and results in notification to the owning domains through the cancellation event; Domain 1 does not delete or alter downstream records.
  5. Correction of an attribute (for example encounter class, start time, attending practitioner) or reversal of a transition entered in error is recorded as a "Corrected" history entry holding before and after values, and is published as a compensating event.
  6. Backdated effective times are accepted within a configured tolerance and must not produce an effective-time sequence that contradicts existing history (for example discharge before admission).

7. Input Requirements

Input Field Data Type Mandatory Validation Description
Encounter CIN Yes Exists Target
Requested transition Code Yes Permitted from current state Transition
Effective time Date-time Yes Temporal consistency with history; tolerance When the change took effect
Reason Code / text Conditional Mandatory for cancellation and correction Justification
Expected version Integer Yes (API) Equals current version Concurrency control

8. Processing Rules

Rule ID Processing Rule Expected Result
PR-ENC-002-1 Transition not in the model Rejected with reason code; no state change
PR-ENC-002-2 Stale version Rejected; caller re-reads
PR-ENC-002-3 Correction applied Original entry retained; compensating event published
PR-ENC-002-4 State change commits State, history entry and outgoing event are committed together

9. Output Requirements

Output Format Recipient Description
Current state and history API / screen Users, consumers Lifecycle view
Encounter state events Domain events (EVT-ADM-008 to EVT-ADM-015, EVT-ADM-026) Subscribed domains One event per transition, with per-encounter sequence

10. Validation and Error Handling

Scenario Validation System Response User Message / Action
Invalid transition (for example discharge of a Cancelled encounter) State model Reject with reason "Encounter is Cancelled; discharge is not permitted."
Effective time contradicts history Temporal consistency Reject "Effective time is earlier than the admission time."
Cancellation with downstream activity by a non-supervisor Authorization Reject "Supervisor authority required: encounter has linked activity."

11. State and Lifecycle Behaviour

This requirement defines the encounter lifecycle of section 4.3.

12. Audit Requirements

Every valid transition and every rejected transition attempt is audited. Corrections store before and after values and the reason.

13. Security and Privacy Requirements

Correction, cancellation after admission and reversal of discharge are distinct privileges limited to supervisors.

14. Acceptance Criteria

  • AC-01: Given an encounter in each state, when each transition not listed in the state model is attempted, then it is rejected with a reason and audited.
  • AC-02: Given a valid transition, when applied, then the history entry records actor, effective time and recorded time.
  • AC-03: Given an admission entered in error, when the supervisor corrects it, then the original admission entry remains in history, the encounter returns to the prior state and a compensating event is published.
  • AC-04: Given two simultaneous transitions on one encounter, when both are submitted, then exactly one succeeds.

15. Dependencies and Integration

16. Open Questions / Assumptions

  • Treatment of "transferred" and "corrected" as history entry types and the addition of On leave and Closed states are a working position (DEC-ADM-004). REF-004 describes a different encounter state set (Planned, Registered, Arrived, In progress, Completed, Closed); the PRS list is followed because the PRS is controlling.
  • The backdating tolerance is not given in the sources; the default is 24 hours, with the whole declared downtime window allowed for downtime back-entry (CFG-ADM-011).

Requirement FR-ADM-ENC-003: Encounter status and context validation for downstream activity

Attribute Description
Requirement ID FR-ADM-ENC-003
Requirement Name Encounter status and context validation for downstream activity
Requirement Type Functional
Module Encounter and visit management
Functional Area FA-ADM-010 Encounter lifecycle and context validation
Priority Must
Criticality Critical
Requirement Status Draft
Source ADM-010, ADM-002
Related Business Rule BR-ADM-011
Related Workflow WF-ADM-001, WF-ADM-006

1. Requirement Statement

The system shall provide an encounter validation service through which clinical ordering and charge capture validate encounter status and context, such that cancelled or unconfirmed encounters do not silently accept routine downstream activity, while approved emergency exceptions remain supported.

2. Business Rationale

Orders and charges attached to an invalid encounter create unsafe and unbillable records. The owning domains need one authoritative answer on whether an encounter may accept activity.

3. Actors and Permissions

Actor Permission Conditions
Consuming domain service (Domains 3, 4, 5, 9) Read (validate) Scoped service identity
HIM / registration governance and clinical governance Approve (validation policy, emergency exceptions) Governed configuration

4. Preconditions - The validation policy is configured: which states accept which activity categories, and which emergency exceptions apply.

5. Trigger - A downstream domain is about to commit activity linked to an encounter; or a downstream domain receives an encounter state event affecting activity in flight.

6. Functional Behaviour

  1. The service accepts patient reference, CIN, activity category (for example routine order, charge, documentation, late entry) and activity time, and returns a decision: valid, valid under emergency exception, or not valid, with a reason code.
  2. The service confirms that the CIN exists, belongs to the stated patient (following merge links), belongs to the stated facility where supplied, and that the encounter state accepts the activity category at the activity time.
  3. Cancelled encounters and encounters not yet confirmed (Pre-admitted, where policy treats them as unconfirmed) are not valid for routine orders and charges.
  4. Discharged and Closed encounters accept only the activity categories that policy allows after discharge (for example late charges or late documentation within a configured window).
  5. Approved emergency exceptions return "valid under emergency exception" with the exception identifier so that the calling domain can record it.
  6. The service returns the current location, responsible unit and attending team with the decision, so that consumers use the same effective context.
  7. When an encounter is cancelled or corrected, the event identifies the change so that owning domains can find and handle affected in-flight activity; Domain 1 reports encounters cancelled with linked activity on a worklist (UI-ADM-010).

7. Input Requirements

Input Field Data Type Mandatory Validation Description
CIN Identifier with authority Yes Exists Encounter
Patient Enterprise person identifier Yes Matches encounter (after merge resolution) Guards against wrong-patient linkage
Activity category Code Yes Governed list Type of downstream activity
Activity time Date-time Yes — Evaluated against state history
Emergency context Code No Approved exception list Requests an exception

8. Processing Rules

Rule ID Processing Rule Expected Result
PR-ENC-003-1 Patient does not match the encounter "Not valid: patient and encounter mismatch"
PR-ENC-003-2 Encounter Cancelled Not valid for all routine categories
PR-ENC-003-3 Emergency exception requested and approved for the category Valid under emergency exception, with exception identifier
PR-ENC-003-4 Validation service unavailable The calling domain applies its own documented safe behaviour; Domain 1 never returns a default "valid"

9. Output Requirements

Output Format Recipient Description
Validation decision API response Calling domain Decision, reason code, exception identifier, current context, policy version
Cancelled-with-linked-activity worklist Screen (UI-ADM-010) / report Registration supervisor, HIM Encounters cancelled or corrected while downstream activity was linked to them

10. Validation and Error Handling

Scenario Validation System Response User Message / Action
Unknown CIN Existence Not valid, reason "unknown encounter" Calling domain presents its own message
Patient and encounter mismatch PR-ENC-003-1 Not valid Calling domain blocks and alerts the user
Timeout — Error response, not a decision Calling domain applies safe behaviour and retries

11. State and Lifecycle Behaviour

Read-only. Decisions are evaluated against the state history at the activity time.

12. Audit Requirements

Not-valid decisions and emergency-exception decisions are audited with caller, encounter, category, reason and policy version. Routine valid decisions are logged for observability rather than as individual audit events (proposed, to be validated with Domain 10).

13. Security and Privacy Requirements

Service-to-service calls are authenticated, authorized and encrypted with correlation identifiers (PRS 8.2). The response contains the minimum context needed.

14. Acceptance Criteria

  • AC-01: Given a Cancelled encounter, when a routine order validation is requested, then the decision is "not valid" with a reason.
  • AC-02: Given a Cancelled or unconfirmed encounter, when a charge validation is requested, then the decision is "not valid".
  • AC-03: Given an approved emergency exception, when validation is requested with that context, then the decision is "valid under emergency exception" and is audited.
  • AC-04: Given a CIN and a different patient's identifier, when validation is requested, then the decision is "not valid: mismatch".
  • AC-05: Given an Admitted encounter, when validation succeeds, then the response includes the current location and responsible unit that match the ward board.

15. Dependencies and Integration

16. Open Questions / Assumptions

  • ADM-010 places the obligation on clinical ordering and charge capture. This specification assigns the validation service to Domain 1 and the enforcement to Domains 3 and 5 (XD-ADM-004, XD-ADM-006).
  • The validation policy is set by DEC-ADM-007, resolved 2026-11-17. By encounter state: planned, scheduling, pre-registration and future-dated orders only; in progress, all activity; on leave, documentation and leave medication only; discharged and not closed, late documentation, results of orders placed during the encounter, coding and charge correction, with no new orders; closed, addenda only, with reopening by authority; cancelled, none. Emergency exception: care never waits for registration and no activity is recorded without an encounter; a quick registration creates the encounter, and downtime entries are back-entered with their real time and a flag. The default post-discharge windows are held in CFG-ADM-023; results for orders placed during the encounter are always accepted. The late-charge window is confirmed with revenue cycle.

← 5.3 Module Specification: Patient and Facility Identifiers / Cross-Reference | Contents | Identifier index | 5.5 Module Specification: Admission, Discharge and Transfer (ADT) →