Chuyển đến nội dung chính

Lesson 25: The Future of FHIR — R6, AI/ML, Genomics and New Trends

FHIR R6 roadmap, FHIR and AI/ML (CDS Hooks, inference), Genomics (MolecularSequence, DiagnosticReport Genetics), FHIR Bulk Data, SMART Health Cards, FHIR for IoT/Wearables, PHR, digital health future.

🏗️ Architecture — Lesson 25 Lesson 25: The future of FHIR — R6, AI/ML, Genomics and New Trends

HL7 FHIR - Basic to Advanced Healthcare Data Standard

Part 7: Production, Scale and Future

xdev.asia

1. FHIR R6 Roadmap

FHIR R5 (2023) is the current standard version. R6 is being developed with many improvements.

VersionYearStatus
DSTU 12014Legacy
DSTU 22015Legacy
STU 32017Legacy
R42019Normative (most widely used)
R4B2022Normative
R52023Normative (current)
R6~2026Developing

It is expected that R6 will be available

  • Improved Subscriptions — Topic-based subscriptions are more complete
  • Enhanced search — Composite search parameters, GraphQL improvements
  • AI/ML integration — Standardized resources for model inference
  • Device/IoT — Improve resources for medical devices and wearables
  • Cross-version compatibility — Tooling is better for version migration
  • Performance — Binary resource streaming, pagination improvements

2. FHIR and AI/ML

CDS Hooks + AI — Clinical Decision Support

┌──────────┐    CDS Hook     ┌──────────────┐     ┌──────────┐
│   EHR    │───────────────▶│   CDS Server  │────▶│  AI/ML   │
│ (trigger │    prefetch     │  (mediator)   │     │  Model   │
│  event)  │◀───────────────│               │◀────│(TF/PyTorch)│
└──────────┘    CDS Card     └──────────────┘     └──────────┘
// CDS Hook request: patient-view → AI risk prediction
{
  "hook": "patient-view",
  "hookInstance": "abc-123",
  "context": {
    "userId": "Practitioner/practitioner-001",
    "patientId": "patient-001"
  },
  "prefetch": {
    "patient": {
      "resourceType": "Patient",
      "id": "patient-001",
      "gender": "male",
      "birthDate": "1960-05-15"
    },
    "conditions": {
      "resourceType": "Bundle",
      "entry": [
        {
          "resource": {
            "resourceType": "Condition",
            "code": {"coding": [{"system": "http://snomed.info/sct", "code": "44054006", "display": "Diabetes mellitus type 2"}]}
          }
        }
      ]
    },
    "observations": {
      "resourceType": "Bundle",
      "entry": [
        {
          "resource": {
            "resourceType": "Observation",
            "code": {"coding": [{"system": "http://loinc.org", "code": "4548-4", "display": "HbA1c"}]},
            "valueQuantity": {"value": 8.5, "unit": "%"}
          }
        }
      ]
    }
  }
}
// CDS Response: AI prediction card
{
  "cards": [
    {
      "summary": "Nguy cơ biến chứng tim mạch cao",
      "detail": "AI model dự đoán nguy cơ biến chứng tim mạch trong 5 năm: **42%** (dựa trên HbA1c 8.5%, ĐTĐ type 2, nam, 64 tuổi). Khuyến nghị tăng cường kiểm soát HbA1c < 7%.",
      "indicator": "warning",
      "source": {
        "label": "Cardiovascular Risk AI Model v2.1",
        "url": "https://ai.hospital.vn/models/cv-risk"
      },
      "suggestions": [
        {
          "label": "Tạo y lệnh xét nghiệm Lipid Panel",
          "actions": [
            {
              "type": "create",
              "resource": {
                "resourceType": "ServiceRequest",
                "status": "draft",
                "intent": "proposal",
                "code": {"coding": [{"system": "http://loinc.org", "code": "24331-1", "display": "Lipid Panel"}]},
                "subject": {"reference": "Patient/patient-001"}
              }
            }
          ]
        }
      ]
    }
  ]
}

FHIR → ML Pipeline

# Extract FHIR data → Train ML model
import requests
import pandas as pd
from sklearn.ensemble import GradientBoostingClassifier

FHIR_BASE = "http://localhost:8080/fhir"

def extract_training_data():
    """Trích xuất dữ liệu từ FHIR Server cho ML training"""
    
    # Bulk export
    patients_bundle = requests.get(
        f"{FHIR_BASE}/Patient?_count=1000"
    ).json()
    
    records = []
    for entry in patients_bundle.get("entry", []):
        patient = entry["resource"]
        pid = patient["id"]
        
        # Lấy Observations
        obs_bundle = requests.get(
            f"{FHIR_BASE}/Observation?subject=Patient/{pid}&code=4548-4"
        ).json()
        
        # Lấy Conditions
        cond_bundle = requests.get(
            f"{FHIR_BASE}/Condition?subject=Patient/{pid}"
        ).json()
        
        record = {
            "patient_id": pid,
            "age": calculate_age(patient.get("birthDate")),
            "gender": 1 if patient.get("gender") == "male" else 0,
            "hba1c": extract_latest_value(obs_bundle),
            "diabetes": has_condition(cond_bundle, "44054006"),
            "hypertension": has_condition(cond_bundle, "38341003"),
        }
        records.append(record)
    
    return pd.DataFrame(records)

# Train model
df = extract_training_data()
X = df[["age", "gender", "hba1c", "diabetes", "hypertension"]]
y = df["cv_event_5yr"]  # label từ follow-up data

model = GradientBoostingClassifier()
model.fit(X, y)

3. FHIR Genomics

FHIR supports genomics data through specialized resources:

ResourcePurpose
MolecularSequenceDNA/RNA/Protein Sequence
Observation (Genetics)Genetic test results
DiagnosticReport (Genetics)Genetic test report
RiskAssessmentAssess genetic risk
{
  "resourceType": "Observation",
  "meta": {
    "profile": ["http://hl7.org/fhir/StructureDefinition/observation-genetics"]
  },
  "status": "final",
  "category": [
    {
      "coding": [
        {"system": "http://terminology.hl7.org/CodeSystem/observation-category", "code": "laboratory"}
      ]
    }
  ],
  "code": {
    "coding": [
      {
        "system": "http://loinc.org",
        "code": "69548-6",
        "display": "Genetic variant assessment"
      }
    ]
  },
  "subject": {"reference": "Patient/patient-001"},
  "valueCodeableConcept": {
    "coding": [
      {
        "system": "http://loinc.org",
        "code": "LA6703-8",
        "display": "Heterozygous"
      }
    ]
  },
  "component": [
    {
      "code": {
        "coding": [{"system": "http://loinc.org", "code": "48018-6", "display": "Gene studied"}]
      },
      "valueCodeableConcept": {
        "coding": [
          {"system": "http://www.genenames.org", "code": "HGNC:1100", "display": "BRCA1"}
        ]
      }
    },
    {
      "code": {
        "coding": [{"system": "http://loinc.org", "code": "81252-9", "display": "Discrete genetic variant"}]
      },
      "valueCodeableConcept": {
        "coding": [
          {"system": "http://www.ncbi.nlm.nih.gov/clinvar", "code": "37153", "display": "NM_007294.4(BRCA1):c.5266dupC"}
        ]
      }
    }
  ]
}

4. FHIR for IoT and Wearables

┌──────────────┐    BLE/WiFi    ┌──────────────┐    FHIR API    ┌──────────────┐
│  Wearable    │──────────────▶│  Mobile App  │──────────────▶│ FHIR Server  │
│  (Apple Watch│               │  (HealthKit) │               │              │
│   Mi Band)   │               │              │               │              │
└──────────────┘               └──────────────┘               └──────────────┘
{
  "resourceType": "Observation",
  "status": "final",
  "category": [
    {
      "coding": [
        {"system": "http://terminology.hl7.org/CodeSystem/observation-category", "code": "vital-signs"}
      ]
    }
  ],
  "code": {
    "coding": [
      {"system": "http://loinc.org", "code": "8867-4", "display": "Heart rate"}
    ]
  },
  "subject": {"reference": "Patient/patient-001"},
  "effectiveDateTime": "2025-01-15T10:30:00+07:00",
  "valueQuantity": {
    "value": 72,
    "unit": "beats/minute",
    "system": "http://unitsofmeasure.org",
    "code": "/min"
  },
  "device": {
    "reference": "Device/apple-watch-001",
    "display": "Apple Watch Series 9"
  },
  "method": {
    "coding": [
      {"system": "http://snomed.info/sct", "code": "258104002", "display": "Measured"}
    ]
  }
}

5. SMART Health Cards

SMART Health Cards (SHC) — Verifiable credentials for healthcare (vaccines, tests).

  • Using FHIR Bundle inside JWT (JWS compact)
  • QR code contains tag — offline verifiable
  • Widely used for COVID-19 vaccine records (SMART Health Cards Framework)
SHC QR Code → JWT → FHIR Bundle:
{
  "resourceType": "Bundle",
  "type": "collection",
  "entry": [
    {
      "resource": {
        "resourceType": "Patient",
        "name": [{"family": "Nguyen", "given": ["Van A"]}],
        "birthDate": "1990-05-15"
      }
    },
    {
      "resource": {
        "resourceType": "Immunization",
        "status": "completed",
        "vaccineCode": {
          "coding": [{"system": "http://hl7.org/fhir/sid/cvx", "code": "208", "display": "COVID-19 mRNA"}]
        },
        "occurrenceDateTime": "2024-03-15",
        "lotNumber": "EN6207",
        "performer": [{"actor": {"display": "TTYT Quận 1"}}]
      }
    }
  ]
}

6. Personal Health Record (PHR)

PHR allows patients self-management health records. FHIR Patient Access API is the foundation.

PHR featureFHIR API
View medical recordsPatient/$everything
Test resultsObservation?patient=X
PrescriptionMedicationRequest?patient=X
Appointment scheduleAppointment?patient=X
Share with new BSIPS Document
From wearablePOST Observation (vital signs)

7. New trend

TrendDescriptionFHIR support
AI Clinical CopilotThe LLM supports physician decision makingCDS Hooks + SMART App
Precision MedicinePersonalized treatment based on geneticsGenomics resources
TelemedicineRemote medical examinationEncounter (virtual), Communication
Federated LearningTrain AI on local, non-centralized dataBulk Data + local inference
Blockchain + FHIRImmutable audit trailAuditEvent + on-chain hash
FHIR Shorthand (FSH)Democratize IG creationSUSHI, GoFSH tools
GraphQL for FHIRFlexible queries replace REST$graphql operation

8. End of Series

Through 25 lessons, we have gone through the entire FHIR journey:

  1. Part 1 — Platform: HL7 history, FHIR R5 overview, development environment
  2. Part 2 — Core resources: Patient, Encounter, Condition, Observation, Medication...
  3. Part 3 — RESTful API: CRUD, Search, Bundle, Transaction
  4. Part 4 — Data Types, Terminologies, Profiles, Extensions, IGs
  5. Part 5 — Documents, Messaging, Subscriptions, SMART on FHIR, Security
  6. Part 6 — Hands-on: HAPI FHIR Server, Client, VN Core IG, EMR/HIS integration
  7. Part 7 — Production: Performance, VN context, Case Studies, Future

FHIR is changing the way the world exchanges medical data. With this knowledge base, you are ready to build an interoperable system for Vietnamese healthcare.

9. Summary

  • FHIR R6 — Improved Subscriptions, AI integration, IoT resources

  • AI/ML + FHIR — CDS Hooks for clinical decision support, ML pipeline from FHIR data

  • Genomics — MolecularSequence, genetic observations for precision medicine

  • IoT/Wearables — Apple Watch, Mi Band → Observations → FHIR Server

  • SMART Health Cards — Verifiable health credentials (vaccines, tests)

  • PHR — Patient Access API for self-management of health records