Getting Started
Getting Started
This section walks you through installing the library, building your first FHIR resource in Go, and understanding how the three supported FHIR versions are organized.
Overview
gofhir/models provides type-safe Go structs for all FHIR resources, data types, and code systems. Each FHIR version (R4, R4B, R5) is published as an independent Go module, so you only import what you need.
The library is designed around three core principles:
- Type safety – Every FHIR field maps to a strongly typed Go struct field with proper pointer semantics for optional values.
- Two construction patterns – Choose between struct literals and fluent builders depending on your coding style.
- JSON serialization – JSON marshaling follows the FHIR specification for decimal precision and the
_fieldrepresentation of extensions on primitives, and round-trips the published corpus 8757/8757; the residual failures are documented in JSON Marshaling. XML round-trips 3653/3653, narrative included.
Guides
Last updated on