model

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: Apache-2.0, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const Unbound = -1

Variables

This section is empty.

Functions

This section is empty.

Types

type Builtin

type Builtin struct {
	// Name is the name of the builtin type.
	Name string

	// Regex is a regular expression that the value must match.
	Regex *regexp.Regexp
}

Builtin is a helper type that is used to represent language-level builtin types.

func (*Builtin) FromType

func (b *Builtin) FromType(ty *fhir.ElementDefinitionType) error

func (*Builtin) ValidateString

func (b *Builtin) ValidateString(s string) bool

type Cardinality

type Cardinality struct {
	Min int
	Max int
}

Cardinality represents the cardinality of an element.

func (*Cardinality) FromBaseElementDefinition

func (c *Cardinality) FromBaseElementDefinition(ed *fhir.ElementDefinition) (err error)

func (*Cardinality) FromElementDefinition

func (c *Cardinality) FromElementDefinition(ed *fhir.ElementDefinition) (err error)

func (*Cardinality) IsDisabled

func (c *Cardinality) IsDisabled() bool

func (*Cardinality) IsList

func (c *Cardinality) IsList() bool

func (*Cardinality) IsOptional

func (c *Cardinality) IsOptional() bool

func (*Cardinality) IsRequired

func (c *Cardinality) IsRequired() bool

func (*Cardinality) IsScalar

func (c *Cardinality) IsScalar() bool

func (*Cardinality) IsUnboundedList

func (c *Cardinality) IsUnboundedList() bool

func (*Cardinality) String

func (c *Cardinality) String() string

type Code

type Code struct {
	// Value is the actual string code value.
	Value string

	// Display is the human readable display value.
	Display string

	// Definition is the definition of the code.
	Definition string
}

Code represents a code that is defined in a code system.

type CodeSystem

type CodeSystem struct {
	// Package is the name of the package that the code system is defined in.
	Package string

	// Version is the version of the package that the code system is defined in.
	Version string

	// Description is the full description of the code system.
	Description string

	// URL is the URL of the code system.
	URL string

	// Name is the name of the code system.
	Name string

	// Title is the title of the code system.
	Title string

	// Status is the publication status of the code system.
	Status string

	// Codes is a list of all the codes that are defined in the code system.
	Codes []Code
}

CodeSystem represents a FHIR code system.

type Field

type Field struct {
	Name string
	Path string

	Short      string
	Comment    string
	Definition string

	Type         *Type
	Alternatives []*Type
	Builtin      *Builtin

	Cardinality     Cardinality
	BaseCardinality Cardinality
}

func (*Field) IsDisabled

func (f *Field) IsDisabled() bool

func (*Field) IsList

func (f *Field) IsList() bool

func (*Field) IsNarrowed

func (f *Field) IsNarrowed() bool

func (*Field) IsOptional

func (f *Field) IsOptional() bool

func (*Field) IsRequired

func (f *Field) IsRequired() bool

func (*Field) IsScalar

func (f *Field) IsScalar() bool

func (*Field) IsUnboundedList

func (f *Field) IsUnboundedList() bool

type Model

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

func NewModel

func NewModel(module *conformance.Module) *Model

func (*Model) CodeSystems

func (m *Model) CodeSystems() []*CodeSystem

func (*Model) DefineAllTypes

func (m *Model) DefineAllTypes() error

func (*Model) DefineType

func (m *Model) DefineType(url string) error

func (*Model) Type

func (m *Model) Type(url string) (*Type, error)

func (*Model) Types

func (m *Model) Types() *TypeSet

type Type

type Type struct {
	Source *TypeSource

	Short       string
	Comment     string
	Description string

	URL  string
	Name string
	Kind TypeKind

	Base    *Type
	Derived []*Type

	IsAbstract bool

	Fields   []*Field
	SubTypes []*Type
}

func CommonBase

func CommonBase(types []*Type) *Type

func (*Type) HasDerived

func (t *Type) HasDerived() bool

func (*Type) InPackage

func (t *Type) InPackage(pkg string) bool

func (*Type) IsComplex

func (t *Type) IsComplex() bool

func (*Type) IsConstraint

func (t *Type) IsConstraint() bool

func (*Type) IsExtension

func (t *Type) IsExtension() bool

func (*Type) IsPrimitive

func (t *Type) IsPrimitive() bool

func (*Type) IsResource

func (t *Type) IsResource() bool

func (*Type) IsSpecialization

func (t *Type) IsSpecialization() bool

func (*Type) Package

func (t *Type) Package() string

func (*Type) Version

func (t *Type) Version() string

type TypeKind

type TypeKind string
const (
	TypeKindResource    TypeKind = "resource"
	TypeKindPrimitive   TypeKind = "primitive-type"
	TypeKindComplexType TypeKind = "complex-type"
	TypeKindBackbone    TypeKind = "backbone"
)

type TypeSet

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

func DefaultTypeSet

func DefaultTypeSet() *TypeSet

func NewTypeSet

func NewTypeSet(base string, entries ...*Type) *TypeSet

func (*TypeSet) Add

func (ts *TypeSet) Add(t *Type)

func (*TypeSet) All

func (ts *TypeSet) All() []*Type

func (*TypeSet) Base

func (ts *TypeSet) Base() string

Base returns the base URL of the structure definition IG in the typeset.

func (*TypeSet) ComplexTypes

func (ts *TypeSet) ComplexTypes() *TypeSet

func (*TypeSet) DefinedInPackage

func (ts *TypeSet) DefinedInPackage(pkg registry.PackageRef) *TypeSet

func (*TypeSet) Get

func (ts *TypeSet) Get(url string) *Type

func (*TypeSet) InBase

func (ts *TypeSet) InBase() *TypeSet

func (*TypeSet) Lookup

func (ts *TypeSet) Lookup(url string) (*Type, bool)

func (*TypeSet) PrimitiveTypes

func (ts *TypeSet) PrimitiveTypes() *TypeSet

func (*TypeSet) Resources

func (ts *TypeSet) Resources() *TypeSet

func (*TypeSet) TypesMatching

func (ts *TypeSet) TypesMatching(condition func(*Type) bool) *TypeSet

type TypeSource

type TypeSource struct {
	Package             registry.PackageRef
	File                string
	StructureDefinition *definition.StructureDefinition
}

Directories

Path Synopsis
Package conformance provides the FHIR Conformance Module definition.
Package conformance provides the FHIR Conformance Module definition.
definition
Package definition provides the raw definitions for FHIR data types.
Package definition provides the raw definitions for FHIR data types.

Jump to

Keyboard shortcuts

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