FHIR — это спецификация, не реализация. Поверх неё существует экосистема инструментов: type-libraries для compile-time check, HTTP-клиенты для работы с FHIR-сервером, runtime-валидаторы, server SDKs, профайлинг-tooling. Каждый слой решает свою задачу — некоторые продукты совмещают несколько слоёв, некоторые узкоспециализированные.

Слои

                  Profiling tools (FSH, SUSHI, IG Publisher)
                                    ↓
                        Conformance resources (SDs, VSs)
                                    ↓
       ┌────────────────────────────┼────────────────────────────┐
       ↓                            ↓                            ↓
   Code generation               Runtime validators           Server SDKs
   (types, Zod, classes)         (parse + check)              (persistence + REST)
       ↓                            ↓                            ↓
   Builders / клиентский код   ←   HTTP-клиенты   →   FHIR-сервер

По функциям

Type libraries — compile-time только

ToolЯзыкЧтоMaintainer
@types/fhirTypeScriptPre-generated interfaces для R2–R5 (vanilla base, без profile-awareness)DefinitelyTyped community (GitHub DefinitelyTyped/DefinitelyTyped)
@reasonhealth/fhir-ts-codegenTypeScriptCLI codegen для собственных IGs (FSH-package → TS interfaces + Zod schemas)reason-healthcare org
fhir-codegen (бывший microsoft/fhir-codegen)TS / C# / Python / Java / Rust / SwiftMulti-language types generator. Originally от Microsoft (Gino Canessa); ныне в HL7-FHIR/fhir-codegen orgFHIR org (HL7)
Firely SDK (types-portion)C#Pre-generated POCOs для R2–R5 + любых IGsFirely

Подробнее — fhir-code-generation.

Runtime validators — parse + check

ToolЯзыкЧтоMaintainer
@reasonhealth/fhir-zodTypeScriptPre-generated Zod schemas для R4/R4B/R5 (можно расширить своими IG’ами через codegen)reason-healthcare org
HL7 FHIR Validator (CLI)Java jar, multi-platformReference официальный валидатор, проверяет ресурс vs profile URLHL7
Firely .NET SDK validatorC#Валидация в-line C# с full SD supportFirely
HAPI FHIR ValidatorJavaValidator embedded в HAPI-серверcommunity + Smile CDR (originally UHN)
InfernoRubyTest-suite-as-validator для HTI-1 / US Core complianceMITRE (для ONC Health IT Certification)

HTTP-клиенты для FHIR-сервера

ToolЯзыкЧтоMaintainer
fhir-kit-clientTypeScriptМинималистичный client (read/write/search), без typesVermonster
Medplum SDKTypeScriptClient + types + auth + React hooks + caching (full stack)Medplum (open-source SaaS)
Firely .NET SDKC#Client + types + validator + parserFirely
HAPI FHIR ClientJavaAnnotation-driven client + builders + validationUHN
fhirclient.js (SMART)TypeScriptOAuth/SMART-launch focused (для clinical apps)SMART Health IT
@medplum/coreTypeScriptСовместим с любым FHIR-сервером, не только MedplumMedplum

Server SDKs / FHIR-серверы

ToolТипЧтоMaintainer
HAPI FHIRSelf-hosted JavaПолноценный FHIR-сервер, validator, client (all-in-one). Open-source, commercial backing — Smile CDR (formerly Smile Digital Health)community + Smile CDR (originally UHN)
MedplumSelf-hosted или SaaSTypeScript-native FHIR-сервер с дашбордом, IAM, botsMedplum
Microsoft FHIR ServerSelf-hosted .NETOpen-source FHIR-сервер от Microsoft (foundation для Azure FHIR)Microsoft
Google Healthcare APIManaged cloudFHIR-as-a-service на GCP — то что используем мыGoogle
Azure Health Data Services FHIRManaged cloudFHIR-as-a-service на Azure (под капотом Microsoft FHIR Server)Microsoft
AWS HealthLakeManaged cloudFHIR-as-a-service на AWSAWS
AidboxSelf-hosted / managedFHIR-сервер от Health Samurai (distributed team, founders из СНГ; продукт международный)Health Samurai
Firely Server (ранее Vonk)Self-hosted .NETCommercial FHIR-серверFirely

Подробнее — google-healthcare-api для нашего конкретного выбора.

Profiling / IG-tooling

ToolЧтоMaintainer
SUSHIFSH compiler (FSH → JSON SDs)FHIR org (HL7, FHIR/sushi)
IG PublisherCompiles IG repo → HTML site + NPM + validation packHL7
GoFSHReverse: JSON SDs → FSH (для миграции legacy IG’ов на FSH)FHIR org (HL7)
Firely ForgeGUI editor для SDs (альтернатива FSH)Firely
Simplifier.netPublic registry IGs + хостинг + validationFirely

Подробнее — fsh и fhir-implementation-guide.

По стилю — pure-types vs full-stack

ПодходКогдаTools
Pure-types толькоКогда есть свой клиент / валидация / сервер, нужны только TS interfaces для compile-time@types/fhir, fhir-ts-codegen
Types + validatorКогда вход непредсказуемый (LLM output, external API), нужен runtime gate@reasonhealth/fhir-zod + types
Types + client (light)Standard read/write/search на готовый FHIR-серверfhir-kit-client + @types/fhir
Full-stack (SDK)Хочется типы + клиент + валидация + auth + dashboard в одной поставкеMedplum SDK (TS), Firely .NET SDK (C#)
Full FHIR-server in processХочется свой FHIR-сервер с full validation на месте, не managed cloudHAPI FHIR, Medplum (self-hosted), Aidbox

Чем дальше вниз, тем больше lock-in и тем меньше control. Pure-types — low blast-radius (можно сменить tool); full-stack — high migration cost.

Наш текущий стек

СлойЧто используем
Types@types/fhir (vanilla R4, без profile-awareness)
Validationruntime — только сервер-side в Google Healthcare API (base R4)
HTTP-клиентсвой fhir-client.ts поверх REST endpoints Google Healthcare API
Buildersруками в narrative-to-fhir/fhir-builders/*.ts + lib/fhir-*-builder.ts
ServerGoogle Healthcare API (managed, GCP)
Profilingнет (vanilla R4)

Это в-целом pure-types подход + managed server. Без runtime валидации в коде; check выполняется неявно через Google Healthcare API при write. Builder-логика — наша полностью.

Когда мог бы понадобиться другой стек

  • fhir-zod добавится — если LLM-output structure становится более сложной и runtime garbage статистически появляется. См. fhir-code-generation и formalize-fhir-profiles.
  • Medplum SDK заменит свой client — если хотим React-hooks-style работу с FHIR из B2C-приложения и принимаем lock-in.
  • HAPI FHIR / Medplum self-hosted сервер — если выйдем за пределы GCP (например, на on-prem deployment для госпиталя или для compliance с резиденцией данных). Маловероятно в ближайшие 12 месяцев.
  • Inferno — если входим в US-рынок и нужно проходить ONC HTI-1 conformance tests.

Открытые вопросы

  • Между fhir-ts-codegen (only TS) и Microsoft fhir-codegen (multi-target) — что выбрать если планируем поддерживать и TS-pipeline и .NET-pipeline?
  • Когда runtime валидатор окупится — на каком объёме / сложности custom-profiles это становится net-win?
  • Какие части Medplum SDK можно взять без adoption Medplum server — @medplum/core standalone работает?

Связано