treeindex

package
v0.0.0-...-4eea697 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACTION      = "ACTION"
	EVALUATION  = "EVALUATION"
	INSTRUCTION = "INSTRUCTION"
	OBSERVATION = "OBSERVATION"
)

Variables

View Source
var DefaultEHRIndex = NewEHRIndex()

Functions

func AddComposition

func AddComposition(ehrID string, cmp *model.Composition) error

func AddEHR

func AddEHR(ehr *model.EHR) error

Types

type Attributes

type Attributes map[string]Noder

func (*Attributes) DecodeMsgpack

func (attributes *Attributes) DecodeMsgpack(dec *msgpack.Decoder) error

type BaseNode

type BaseNode struct {
	ID       string        `json:"id,omitempty" msgpack:"id,omitempty"`
	Type     base.ItemType `json:"type,omitempty" msgpack:"type,omitempty"`
	Name     string        `json:"name,omitempty" msgpack:"name,omitempty"`
	NodeType NodeType      `json:"node_type" msgpack:"node_type"`
}

func (BaseNode) GetNodeType

func (node BaseNode) GetNodeType() NodeType

func (BaseNode) TryGetChild

func (node BaseNode) TryGetChild(key string) Noder

type CompositionNode

type CompositionNode struct {
	BaseNode
	Tree
	Attributes Attributes
}

func ProcessComposition

func ProcessComposition(cmp *model.Composition) (*CompositionNode, error)

func (CompositionNode) GetID

func (cmp CompositionNode) GetID() string

func (CompositionNode) TryGetChild

func (cmp CompositionNode) TryGetChild(key string) Noder

type Container

type Container map[string][]Noder

func (*Container) DecodeMsgpack

func (c *Container) DecodeMsgpack(dec *msgpack.Decoder) error

func (Container) Len

func (c Container) Len() int

type DataValueNode

type DataValueNode struct {
	BaseNode
	Values Attributes `json:"values,omitempty"`
}

func (DataValueNode) GetID

func (node DataValueNode) GetID() string

func (DataValueNode) TryGetChild

func (node DataValueNode) TryGetChild(key string) Noder

type EHRIndex

type EHRIndex struct {
	Ehrs map[string]*EHRNode `msgpack:"ehr,omitempty"`
}

func NewEHRIndex

func NewEHRIndex() *EHRIndex

func (*EHRIndex) AddComposition

func (idx *EHRIndex) AddComposition(ehrID string, cmp *model.Composition) error

func (*EHRIndex) AddEHR

func (idx *EHRIndex) AddEHR(ehr *model.EHR) error

func (*EHRIndex) AddEHRNode

func (idx *EHRIndex) AddEHRNode(node *EHRNode) error

func (EHRIndex) GetEHRs

func (idx EHRIndex) GetEHRs(id string) ([]*EHRNode, error)

func (EHRIndex) MarshalJSON

func (idx EHRIndex) MarshalJSON() ([]byte, error)

type EHRNode

type EHRNode struct {
	BaseNode

	Attributes   Attributes `json:"-"`
	Compositions Container
}

func ProcessEHR

func ProcessEHR(ehr *model.EHR) (*EHRNode, error)

func (*EHRNode) AddCompositionNode

func (ehr *EHRNode) AddCompositionNode(cmpNode *CompositionNode) error

func (EHRNode) GetCompositions

func (ehr EHRNode) GetCompositions() Container

func (EHRNode) GetID

func (ehr EHRNode) GetID() string

func (EHRNode) MarshalJSON

func (ehr EHRNode) MarshalJSON() ([]byte, error)

func (EHRNode) TryGetChild

func (ehr EHRNode) TryGetChild(key string) Noder

type EventContextNode

type EventContextNode struct {
	BaseNode
	Attributes Attributes `json:"-"`
}

func NewEventContextNode

func NewEventContextNode(ctx model.EventContext) *EventContextNode

func (*EventContextNode) GetID

func (n *EventContextNode) GetID() string

func (*EventContextNode) TryGetChild

func (n *EventContextNode) TryGetChild(key string) Noder

type NodeType

type NodeType byte
const (
	NoneNodeType NodeType = iota
	ObjectNodeType
	SliceNodeType
	DataValueNodeType
	ValueNodeType
	EHRNodeType
	CompostionNodeType
	EventContextNodeType
)

type NodeWrapper

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

func (*NodeWrapper) UnmarshalMsgpack

func (nw *NodeWrapper) UnmarshalMsgpack(data []byte) error

type Noder

type Noder interface {
	GetNodeType() NodeType

	GetID() string

	TryGetChild(key string) Noder
	// contains filtered or unexported methods
}

type ObjectNode

type ObjectNode struct {
	BaseNode

	AttributesOrder []string
	Attributes      Attributes `json:"-"`
}

func (ObjectNode) GetID

func (node ObjectNode) GetID() string

func (ObjectNode) MarshalJSON

func (node ObjectNode) MarshalJSON() ([]byte, error)

func (ObjectNode) TryGetChild

func (node ObjectNode) TryGetChild(key string) Noder

type SliceNode

type SliceNode struct {
	BaseNode
	Data Attributes
}

func (SliceNode) GetID

func (node SliceNode) GetID() string

func (SliceNode) MarshalJSON

func (node SliceNode) MarshalJSON() ([]byte, error)

func (SliceNode) TryGetChild

func (node SliceNode) TryGetChild(key string) Noder

type Tree

type Tree struct {
	Data map[string]Container
}

func NewTree

func NewTree() *Tree

func (*Tree) AddComposition

func (t *Tree) AddComposition(com model.Composition) error

func (*Tree) GetDataSourceByName

func (t *Tree) GetDataSourceByName(name string) (Container, error)

type ValueNode

type ValueNode struct {
	BaseNode
	Data any
}

func (ValueNode) GetData

func (node ValueNode) GetData() any

func (ValueNode) GetID

func (node ValueNode) GetID() string

func (ValueNode) MarshalJSON

func (node ValueNode) MarshalJSON() ([]byte, error)

func (ValueNode) TryGetChild

func (node ValueNode) TryGetChild(key string) Noder

func (*ValueNode) UnmarshalMsgpack

func (node *ValueNode) UnmarshalMsgpack(data []byte) error

Jump to

Keyboard shortcuts

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