Documentation
¶
Overview ¶
Package reflection provides types and utility functions to enable FHIRPath type reflection.
Index ¶
Constants ¶
const ( FHIR = "FHIR" System = "System" )
Valid namespace constants.
Variables ¶
This section is empty.
Functions ¶
func IsValidFHIRPathElement ¶
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 ¶
func (ts TypeSpecifier) Is(input TypeSpecifier) system.Boolean
Is returns a boolean representing whether or not the receiver type is equivalent to the input type, or if it's a valid subtype.