Help us shape the future of Go! Take the 2026 Go Developer Survey

models

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2026 License: MIT

README

FHIR Types for Go

Go structs for FHIR R4, R4B, and R5 resources.

Installation

# For FHIR R4
go get github.com/gofhir/fhir/r4

# For FHIR R4B
go get github.com/gofhir/fhir/r4b

# For FHIR R5
go get github.com/gofhir/fhir/r5

Usage

package main

import (
    "encoding/json"
    "fmt"

    "github.com/gofhir/fhir/r4"
)

func main() {
    patient := r4.Patient{
        ResourceType: "Patient",
        Id:           r4.String("123"),
        Active:       r4.Boolean(true),
        Name: []r4.HumanName{
            {
                Family: r4.String("Smith"),
                Given:  []r4.String{r4.String("John")},
            },
        },
    }

    data, _ := json.MarshalIndent(patient, "", "  ")
    fmt.Println(string(data))
}

License

MIT License - see LICENSE for details.

Directories

Path Synopsis
internal
codegen
Package codegen provides code generation from FHIR StructureDefinitions.
Package codegen provides code generation from FHIR StructureDefinitions.
codegen/analyzer
Package analyzer analyzes FHIR StructureDefinitions and determines Go types.
Package analyzer analyzes FHIR StructureDefinitions and determines Go types.
codegen/generator
Package generator implements FHIR to Go code generation.
Package generator implements FHIR to Go code generation.
codegen/parser
Package parser provides parsing of FHIR StructureDefinition JSON files.
Package parser provides parsing of FHIR StructureDefinition JSON files.
r4 module
r4b module
r5 module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL