fhir-dsl: a type-safe FHIR toolchain for TypeScript
fhir-dsl is a TypeScript toolchain that provides type-safe interactions with FHIR APIs by leveraging code generation from the FHIR specification. It enables compile-time safety for searches, profiles, extensions, and validations without runtime overhead. The tool supports autocomplete, correct parameter narrowing, and schema validation based on official FHIR resources and implementation guides.
- ▪fhir-dsl generates TypeScript types from the FHIR spec to ensure compile-time safety for all FHIR operations.
- ▪The tool supports autocompletion and type narrowing for search parameters, resources, and included references.
- ▪Search operators are type-narrowed based on parameter types, preventing invalid operator usage.
- ▪Generated code includes support for profiles (e.g., US Core), value sets, extensions, and FHIRPath-based validation rules.
- ▪The fhir-gen CLI tool can process any FHIR version or implementation guide to produce a fully typed client SDK.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 720579) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Abdelhadi Sabani Posted on May 2 fhir-dsl: a type-safe FHIR toolchain for TypeScript #typescript #healthcare #fhir #opensource If you've written TypeScript against a FHIR API, you know the script: The "official" client returns Bundle | unknown. Every property access is a ?. chain through fog. Search parameters are strings. name works on Patient, but does family work on Practitioner? Read the spec, hope you remember. Profile narrowing (US Core, IPS) doesn't exist at the type level.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).