@babelfhir-ts/zod
v0.2.2
Published
Zod v4 schemas for FHIR R4/R4B/R5 base types and resources — runtime validation with full TypeScript inference
Maintainers
Readme
@babelfhir-ts/zod
Zod v4 schemas for all FHIR base data types — runtime validation for FHIR resources with full TypeScript inference. Supports R4, R4B, and R5.
Install
npm install @babelfhir-ts/zodPeer dependency: zod ^4.0.0
Usage
import { PatientSchema, CodingSchema, HumanNameSchema } from '@babelfhir-ts/zod/r4';
const result = CodingSchema.safeParse({
system: 'http://loinc.org',
code: '12345-6',
display: 'Test Code'
});
if (result.success) {
console.log('Valid coding:', result.data);
}R4B types
import { CodeableReferenceSchema } from '@babelfhir-ts/zod/r4b';Tree-shakeable imports
import { CodingSchema } from '@babelfhir-ts/zod/r4/CodingSchema';About
This package provides base Zod schemas used by BabelFHIR-TS-generated --schema zod output. Generated profile schemas extend these base type schemas with profile-specific constraints.
