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

Bài 25: Tương lai FHIR — R6, AI/ML, Genomics và Xu hướng mới

FHIR R6 roadmap, FHIR và AI/ML (CDS Hooks, inference), Genomics (MolecularSequence, DiagnosticReport Genetics), FHIR Bulk Data, SMART Health Cards, FHIR cho IoT/Wearables, PHR, tương lai y tế số.

🏗️ Kiến trúc — Bài 25 Bài 25: Tương lai FHIR — R6, AI/ML, Genomics và Xu hướng mới

HL7 FHIR - Chuẩn Dữ liệu Y tế từ Cơ bản đến Nâng cao

Phần 7: Production, Quy mô và Tương lai

xdev.asia

Xem bản video

1. FHIR R6 Roadmap

FHIR R5 (2023) là phiên bản normative hiện tại. R6 đang được phát triển với nhiều cải tiến.

Phiên bảnNămTrạng thái
DSTU 12014Legacy
DSTU 22015Legacy
STU 32017Legacy
R42019Normative (được dùng rộng rãi nhất)
R4B2022Normative
R52023Normative (hiện tại)
R6~2026Đang phát triển

Dự kiến R6 sẽ có

  • Improved Subscriptions — Topic-based subscriptions hoàn thiện hơn
  • Enhanced search — Composite search parameters, GraphQL improvements
  • AI/ML integration — Standardized resources cho model inference
  • Device/IoT — Cải thiện resource cho medical devices, wearables
  • Cross-version compatibility — Tooling tốt hơn cho version migration
  • Performance — Binary resource streaming, pagination improvements

2. FHIR và 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 hỗ trợ dữ liệu genomics qua các resources chuyên biệt:

ResourceMục đích
MolecularSequenceTrình tự DNA/RNA/Protein
Observation (Genetics)Kết quả xét nghiệm di truyền
DiagnosticReport (Genetics)Báo cáo xét nghiệm gen
RiskAssessmentĐánh giá nguy cơ di truyền
{
  "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 cho IoT và 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 cho y tế (vaccine, xét nghiệm).

  • Sử dụng FHIR Bundle bên trong JWT (JWS compact)
  • QR code chứa thẻ — offline verifiable
  • Được dùng rộng rãi cho 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 cho phép bệnh nhân tự quản lý hồ sơ sức khỏe. FHIR Patient Access API là nền tảng.

Tính năng PHRFHIR API
Xem hồ sơ y tếPatient/$everything
Kết quả xét nghiệmObservation?patient=X
Đơn thuốcMedicationRequest?patient=X
Lịch hẹnAppointment?patient=X
Chia sẻ với BS mớiIPS Document
Từ wearablePOST Observation (vital signs)

7. Xu hướng mới

Xu hướngMô tảFHIR support
AI Clinical CopilotLLM hỗ trợ bác sĩ ra quyết địnhCDS Hooks + SMART App
Precision MedicineĐiều trị cá nhân hóa dựa trên geneticsGenomics resources
TelemedicineKhám bệnh từ xaEncounter (virtual), Communication
Federated LearningTrain AI trên data tại chỗ, không tập trungBulk Data + local inference
Blockchain + FHIRImmutable audit trailAuditEvent + on-chain hash
FHIR Shorthand (FSH)Democratize IG creationSUSHI, GoFSH tools
GraphQL for FHIRFlexible queries thay thế REST$graphql operation

8. Kết thúc Series

Qua 25 bài học, chúng ta đã đi qua toàn bộ hành trình FHIR:

  1. Phần 1 — Nền tảng: HL7 history, FHIR R5 overview, development environment
  2. Phần 2 — Resources cốt lõi: Patient, Encounter, Condition, Observation, Medication...
  3. Phần 3 — RESTful API: CRUD, Search, Bundle, Transaction
  4. Phần 4 — Data Types, Terminologies, Profiles, Extensions, IGs
  5. Phần 5 — Documents, Messaging, Subscriptions, SMART on FHIR, Security
  6. Phần 6 — Hands-on: HAPI FHIR Server, Client, VN Core IG, EMR/HIS integration
  7. Phần 7 — Production: Performance, VN context, Case Studies, Future

FHIR đang thay đổi cách thế giới trao đổi dữ liệu y tế. Với nền tảng kiến thức này, bạn đã sẵn sàng xây dựng hệ thống interoperable cho y tế Việt Nam.

9. Tổng kết

  • FHIR R6 — Cải tiến Subscriptions, AI integration, IoT resources

  • AI/ML + FHIR — CDS Hooks cho clinical decision support, ML pipeline từ FHIR data

  • Genomics — MolecularSequence, genetic observations cho precision medicine

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

  • SMART Health Cards — Verifiable health credentials (vaccine, xét nghiệm)

  • PHR — Patient Access API cho tự quản lý hồ sơ sức khỏe