funcs

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package funcs provides the implementations for all base FHIRPath functions. Provides a wrapper, and function table for compilation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FHIRPathFunc

type FHIRPathFunc func(ctx *expr.Context, input system.Collection, args ...expr.Expression) (system.Collection, error)

FHIRPathFunc is the common abstraction for all function types supported by FHIRPath.

type Function

type Function struct {
	Func           FHIRPathFunc
	MinArity       int
	MaxArity       int
	IsTypeFunction bool
}

Function contains the FHIRPathFunction, along with metadata

func ToFunction

func ToFunction(fn any) (Function, error)

ToFunction takes in a function with any arguments and attempts to convert it to a functions.Function type. If the conversion is successful, the new function will assert the argument expressions resolve to the original argument types.

type FunctionTable

type FunctionTable map[string]Function

FunctionTable is the data structure used to store valid FHIRPath functions, and maps their case-sensitive names.

func AddExperimentalFuncs added in v1.2.1

func AddExperimentalFuncs(table FunctionTable) FunctionTable

AddExperimentalFuncs adds experimental functions to the given function table and returns it. If a function already exists in the table, it is not overridden.

func Clone

func Clone() FunctionTable

Clone returns a deep copy of the base function table.

func (FunctionTable) Register

func (t FunctionTable) Register(name string, fn any) error

Register attempts to add a given function to the FunctionTable t.

Directories

Path Synopsis
Package impl provides implementations of FHIRPath functions.
Package impl provides implementations of FHIRPath functions.

Jump to

Keyboard shortcuts

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