Skip to content
API Reference

API Reference

This section provides a detailed API reference for the core types and functions exported by the gofhir/models packages. The same API surface is available in each version package (r4, r4b, r5), with type definitions reflecting the corresponding FHIR specification.

Topics

API Summary

The library exports a small, focused API surface on top of the generated resource structs:

CategoryKey ExportsPurpose
InterfacesResource, DomainResourceGeneric resource handling without type assertions
RegistryNewResource, UnmarshalResource, GetResourceType, IsKnownResourceType, AllResourceTypesDynamic resource creation and deserialization
BuildersNew<Resource>Builder, Set*, Add*, BuildFluent resource construction
SerializationMarshal, MarshalIndent, MarshalResourceXML, MarshalResourceXMLIndent, UnmarshalResourceXMLFHIR-conformant JSON and XML encoding
MetadataFHIRPathModel, SummaryFieldsRuntime type information and summary field lists

All examples in this section use the r4 package. The same patterns apply to r4b and r5 with their respective type definitions.

Last updated on