Patient Service¶
Overview¶
The Patient Service is responsible for managing patient information within the VitalBridge platform.
The service acts as the authoritative source for patient profiles and demographic information.
Responsibilities¶
The Patient Service is responsible for:
- Patient onboarding
- Patient profile management
- Patient lifecycle management
- Tenant ownership
- Identity integration
The service does not manage:
- Appointments
- Schedules
- Video consultations
Service Architecture¶
flowchart TB
PATIENT["Patient"]
SERVICE["Patient Service"]
DB[("Patient DB")]
PATIENT --> SERVICE
SERVICE --> DB
Hold "Alt" / "Option" to enable pan & zoom
Patient Aggregate¶
flowchart TB
PATIENT["Patient"]
PROFILE["Profile"]
CONTACT["Contact Information"]
IDENTITY["Identity Reference"]
PATIENT --> PROFILE
PATIENT --> CONTACT
PATIENT --> IDENTITY
Hold "Alt" / "Option" to enable pan & zoom
Tenant Ownership¶
flowchart LR
TENANT["Tenant"]
PATIENT["Patient"]
TENANT --> PATIENT
Hold "Alt" / "Option" to enable pan & zoom
Every patient belongs to exactly one tenant.
Identity Provisioning¶
sequenceDiagram
participant PatientService
participant IdentityService
participant Keycloak
PatientService->>IdentityService: Create Patient Identity
IdentityService->>Keycloak: Provision User
Keycloak-->>IdentityService: User Created
IdentityService-->>PatientService: Identity Provisioned
Hold "Alt" / "Option" to enable pan & zoom
Lifecycle¶
stateDiagram-v2
[*] --> Pending
Pending --> Active
Active --> Inactive
Inactive --> Active
Active --> Archived
Hold "Alt" / "Option" to enable pan & zoom
Domain Events¶
Published Events:
- patient.created
- patient.updated
- patient.activated
- patient.deactivated
Consumed Events:
- tenant.created