fhirutil

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: EUPL-1.2 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSourceURL

func BuildSourceURL(baseURL string, parts ...string) (string, error)

BuildSourceURL constructs a consistent FHIR source URL from a base URL and resource reference. This ensures all _source URL construction follows the same pattern throughout the application. Examples:

func ClientConfig

func ClientConfig() *fhirclient.Config

func FilterIdentifiersBySystem added in v0.4.0

func FilterIdentifiersBySystem(identifiers []fhir.Identifier, system string) []fhir.Identifier

func IDFromReference added in v0.8.0

func IDFromReference(ref string, resourceType string) string

func ReferencesType added in v0.8.0

func ReferencesType(ref string, resourceType string) bool

func TokenToIdentifier

func TokenToIdentifier(token string) (*fhir.Identifier, error)

TokenToIdentifier converts a FHIR search token ("system|value") to a FHIR Identifier. If the token is empty or not in the correct format, an error is returned.

func VisitBundleResources

func VisitBundleResources[ResType any](bundle *fhir.Bundle, visitor func(resource *ResType) error) error

VisitBundleResources iterates over all entries in the bundle, unmarshals the entry's resource to the specified ResType and calls the visitor function.

Types

type ResourceInfo

type ResourceInfo struct {
	ID           string
	ResourceType string
	LastUpdated  *time.Time
}

ResourceInfo contains common FHIR resource fields extracted from JSON

func ExtractResourceInfo

func ExtractResourceInfo(resourceJSON []byte) (*ResourceInfo, error)

ExtractResourceInfo extracts common FHIR resource fields from JSON bytes. This is a generic utility for parsing any FHIR resource to get basic metadata without requiring knowledge of the specific resource type.

Jump to

Keyboard shortcuts

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