reflection

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: 6 Imported by: 0

Documentation

Overview

Package reflection provides types and utility functions to enable FHIRPath type reflection.

Index

Constants

View Source
const (
	FHIR   = "FHIR"
	System = "System"
)

Valid namespace constants.

Variables

This section is empty.

Functions

func IsValidFHIRPathElement

func IsValidFHIRPathElement(name string) bool

IsValidFHIRPathElement checks if the input string represents a valid element name. This function is importantly case-sensitive, which is a distinction that is important for primitive types.

Types

type TypeSpecifier

type TypeSpecifier struct {
	// contains filtered or unexported fields
}

TypeSpecifier is a FHIRPath type that enables use of is and as operators. Provides a namespace and type name

func MustCreateTypeSpecifier

func MustCreateTypeSpecifier(namespace string, typeName string) TypeSpecifier

MustCreateTypeSpecifier creates a qualified type specifier and panics if the provided namespace or typeName is invalid. Returns the created TypeSpecifier

func NewQualifiedTypeSpecifier

func NewQualifiedTypeSpecifier(namespace string, typeName string) (TypeSpecifier, error)

NewQualifiedTypeSpecifier constructs a Qualified Type Specifier given a namespace and typeName. Returns an error if the typeName is not found within the namespace, or the namespace is invalid.

func NewTypeSpecifier

func NewTypeSpecifier(typeName string) (TypeSpecifier, error)

NewTypeSpecifier constructs a Qualified Type Specifier given a typeName. The namespace is inferred with the priority rules of FHIRPath. Returns an error if the typeName cannot be resolved.

func TypeOf

func TypeOf(input any) (TypeSpecifier, error)

TypeOf retrieves the Type Specifier of the input, given that it is a supported FHIRPath type. Otherwise, returns an error.

func (TypeSpecifier) Is

Is returns a boolean representing whether or not the receiver type is equivalent to the input type, or if it's a valid subtype.

Jump to

Keyboard shortcuts

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