Electronic Health Record Service

Core EHR system managing comprehensive patient medical records, clinical documentation, and longitudinal health history

Overview

The EHR Service is the system of record for all patient clinical data. It maintains longitudinal health records, supports clinical decision-making, and ensures healthcare data is accessible when and where it’s needed.

📋 System of Record

This is the authoritative source for all patient clinical data. All downstream systems sync from the EHR via FHIR APIs or HL7 messages.

Messages

Messages for this service

Sends messages (4)

Quickly find the message you need by searching for the name, type, or summary.
NameVersionTypeSummary
Patient Record Updated
v1.0.0eventEmitted when any part of a patient's medical record is updated, triggering downstream systems and audit logging
Allergy Added
v1.0.0eventEmitted when a new allergy or adverse reaction is documented in a patient's record
Encounter Created
v1.0.0eventEmitted when a new patient encounter (visit) is created in the EHR system
Clinical Alert Triggered
v1.0.0eventEmitted when clinical decision support identifies a patient safety concern requiring provider attention

Receives messages (5)

Quickly find the message you need by searching for the name, type, or summary.
NameVersionTypeSummary
Create Encounter Command
v1.0.0commandCommand to create a new patient encounter (visit) in the EHR system
Update Patient Record Command
v1.0.0commandCommand to update patient demographic or clinical information in the EHR
Add Allergy Command
v1.0.0commandCommand to add a new allergy or adverse reaction to a patient's record
Lab Result Received
v1.0.0eventEmitted when laboratory results are received from the LIS system via HL7 v2 ORU message
Imaging Report Received
v1.0.0eventEmitted when a radiologist's interpretation and report for a diagnostic imaging study is available
💡 Integration Patterns

Use FHIR APIs for real-time queries. Subscribe to events for real-time updates. See the flows below for detailed workflows.

Key Responsibilities

Patient Record Management

  • Demographics and identifiers (MRN, SSN)
  • Insurance and coverage information
  • Emergency contacts
  • Advance directives
  • Patient preferences and consent

Clinical Documentation

  • SOAP notes (Subjective, Objective, Assessment, Plan)
  • Progress notes
  • Consultation notes
  • Discharge summaries
  • Structured data entry templates

Problem & Diagnosis Lists

  • Active problems
  • Past medical history
  • Surgical history
  • Family history
  • Social history

Medication Management

  • Current medication list
  • Historical medications
  • Medication reconciliation
  • Administration records (MAR)

Allergies & Adverse Reactions

  • Drug allergies
  • Food allergies
  • Environmental allergies
  • Severity classification
  • Reaction descriptions

FHIR API Endpoints

Patient Resources

GET /fhir/Patient/{id}
GET /fhir/Patient?identifier={mrn}
POST /fhir/Patient
PUT /fhir/Patient/{id}

Core patient demographics and identifiers.

Clinical Resources

GET /fhir/Condition?patient={id}
GET /fhir/AllergyIntolerance?patient={id}
GET /fhir/MedicationStatement?patient={id}
GET /fhir/Encounter?patient={id}

Patient clinical data including conditions, allergies, medications, and visits.

Bulk Data Export

GET /$export - System level export
GET /Patient/$export - All patient data

FHIR Bulk Data API for large-scale data export. Used for analytics and reporting.

✅ FHIR R4 Compliance

All APIs follow HL7 FHIR R4 specification. See hl7.org/fhir for details.

Technical Details

Technology Stack:

  • Runtime: Java 17
  • Framework: Spring Boot
  • Database: PostgreSQL (clinical data), MongoDB (unstructured documents)
  • FHIR Server: HAPI FHIR
  • Message Broker: Apache Kafka
  • Cache: Redis (session data)
  • Search: Elasticsearch (clinical data search)

Performance:

  • Availability: 99.99% (critical healthcare system)
  • API Response Time: < 500ms (p95)
  • FHIR Query Performance: < 2s for complex queries
  • Concurrent Users: 10,000+

Data Volume:

  • 5 million+ patient records
  • 50 million+ encounters
  • 200 million+ observations
  • 100GB+ daily data growth

Clinical Decision Support

🤖 Machine Learning

Risk stratification models are continuously improved using historical outcomes data while maintaining patient privacy.

Audit & Compliance

Complete Audit Trail

  • All PHI access logged
  • User, timestamp, action, data accessed
  • Search and export capabilities
  • Retention: 7 years minimum

Access Controls

  • Role-based access (RBAC)
  • Relationship-based (treating provider)
  • Break-the-glass for emergencies
  • Minimum necessary principle

Integration Points

  • Lab Systems: HL7 v2 ORU messages
  • Imaging: DICOM, HL7 v2
  • Pharmacy: E-prescriptions, medication lists
  • HIE: Care everywhere, patient matching
  • State Registries: Immunizations, reportable diseases

Disaster Recovery

  • RPO: 15 minutes (data loss tolerance)
  • RTO: 4 hours (recovery time)
  • Daily backups with 30-day retention
  • Geo-redundant replication
  • Annual DR drills