@atomic-ehr/codegen
Code Generation Toolkit for FHIR SDKs in TypeScript, Python, and C#
GitHub ·
npm ·
Articles
@atomic-ehr/codegen is an extensible code generation toolkit for FHIR (Fast Healthcare Interoperability Resources). It transforms FHIR specifications into strongly typed code for several programming languages.
How it works
The generator is a three-stage pipeline:
- Input – FHIR packages from the FHIR registry, remote archives, or local StructureDefinitions. Tested with FHIR R4 Core, US Core, C-CDA, SQL on FHIR, and others.
- Intermediate representation – TypeSchema, a universal description of FHIR types. Tree shaking keeps only the resources and fields you need.
- Generation – built-in generators for TypeScript, Python (Pydantic), and C#, plus Mustache templates for any other language. A new language needs only this last stage.
Features
- Types. Resources and complex types with proper inheritance.
- Value sets. Strongly typed value set bindings.
- Profiles. Typed accessors for extensions and slices, and runtime validation.
- Configuration. A TypeScript script or a JSON file.
Technical details
Written in TypeScript. Published on npm as @atomic-ehr/codegen.
Articles
At the Health Samurai blog:
Updated 12 November 2026