Expand description
Care Coordination Repository (CCR) Management.
This module manages care coordination records, focusing on asynchronous clinical communication and task management between clinicians, patients, and other authorised participants.
§Architecture
Like the clinical repository, the coordination repository uses:
- Type-state pattern for compile-time safety (Uninitialised/Initialised)
- UUID-based sharded storage for scalability
- Git-based versioning for all operations
- Immutable append-only records for audit and legal compliance
§Storage Layout
Coordination records are stored in a sharded structure:
coordination/
<s1>/
<s2>/
<id>/
COORDINATION_STATUS.yaml # Links to clinical record
communications/ # Messaging threads
<communication_id>/
ledger.yaml # Thread metadata and participants
thread.md # Thread messages in markdown
.git/ # Git repository for versioningwhere s1 and s2 are the first four hex characters of the coordination UUID.
Conceptually:
- a communication is a thread and a ledger file
- a thread is a list of messages stored in
thread.md - the ledger contains metadata such as participants, status, policies, and visibility settings.
§Pure Data Operations
This module contains only data operations—no API concerns such as
authentication, HTTP/gRPC servers, or service interfaces. API-level logic
belongs in api-grpc, api-rest, or api-shared.
Structs§
- Communication
- Complete thread data (messages + ledger).
- Coordination
Service - Service for managing coordination repository operations.
- Coordination
Status Update - Update to apply to coordination status.
- Initialised
- Marker type: coordination record exists.
- Ledger
Update - Update to apply to a thread ledger.
- Message
Content - Content of a message to be added to a thread.
- Uninitialised
- Marker type: coordination record does not yet exist.