Developers can write raw SQL queries with string interpolation — but they don’t like it. They prefer using ORMs because they get type safety, IDE support, less boilerplate, database agnosticism, easier schema maintenance, etc. The same logic applies to FHIR.
In this talk, I’ll describe the motivation and challenges of building such an “ORM,” introduce TypeSchema — our approach to generating SDKs from FHIR Implementation Guides — and share our roadmap for making it production-ready.
Aleksandr Penskoi, Health Samurai Engineer.
FHIR IGs <------------------------------------> Programming Data Entities
- FHIR packages - namespaces & modules
- resource, complex, primitive, logical types - types & structures & objects
- choice types, bindings, constraints - marshaling
- extensions - validation
- profiles - clients
- slices - FHIR related/non related code
- CRUD & operations
- A lot of non-directly mapped concepts1:
- Hierarchical data structures, Backbone elements
- Choice types
- Bindings
- Extensions
- Customized data shape: profiles and slices
- Opinionated decisions (language, framework, company, team, person).
- Complexity of input data:
- Multiple packages
- Multiple FHIR core package versions
- Canonical URL and name collisions
- Static resolution and consistency
- Complicated specification formats
- Absurd amount of output source code for simple cases
FHIR IGs ---> TypeSchemas ------------------------> Codegen Framework
- Simplify data entity | Customizable
- Prepare for opinionated decisions |<---- Generator
- Expanded binding | Code
- Package aware resolution v
- Tree shaking SDK - TypeScript
- Python
- C#
- Proof-of-concept for FHIR core package:
- Migration to common stack (TS): atomic-ehr/codegen
- TypeScript
- [*] C#
- Python
- [*] Package aware canonical resolution
- [*] Profiles and slices
- Extensions
- Client examples
- Dogfooding in codegen itself
- Work with non-core packages, including profiles and slices:
- [*]
hl7.cda.uv.core -
hl7.fhir.us.core
- [*]
Footnotes
-
Depends on target programming language. ↩