element

package
v0.0.0-...-5b88717 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package element defines subpackages focused on FHIR R4 elements. Each subpackage is named after the FHIR data type (e.g. identifier) and provides capabilities related to that type.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFhirPathNotImplemented error = errors.New("FHIRPath labeling not yet implemented")
)

Functions

func ExtractAll

func ExtractAll[elementT proto.Message](resource fhir.Resource) ([]elementT, error)

ExtractAll returns all the elements of type elementT within the resource. The returned elements are not copies: mutations of the returned elements will mutate the resource. The order of the returned list is unspecified.

func SortSliceOfElementWithPath

func SortSliceOfElementWithPath[elementT proto.Message](s []ElementWithPath[elementT])

SortSliceOfElementWithPath sorts the given slice in-place according to the lexical ordering of the FHIR path of each element.

Types

type ElementWithPath

type ElementWithPath[elementT proto.Message] struct {
	Element  elementT
	FHIRPath string
}

A ElementWithPath holds a FHIR element as a proto message and its corresponding FHIRPath. All FHIR elements (including scalar-ish elements like string and URI) are proto messages. See http://hl7.org/fhir/R4/fhirpath.html.

func ExtractAllWithPath

func ExtractAllWithPath[elementT proto.Message](resource fhir.Resource) ([]ElementWithPath[elementT], error)

ExtractAllWithPath returns all the elements of typeT within the resource, along with the FHIR path of each such element. The returned elements are not copies: mutations of the returned elements will mutate the resource. The returned list is sorted by the lexical order of the FHIR path of each element.

Directories

Path Synopsis
Package identifier provides utilities for constructing and working with FHIR R4 Identifier elements.
Package identifier provides utilities for constructing and working with FHIR R4 Identifier elements.

Jump to

Keyboard shortcuts

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