model

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ADLType

type ADLType = string
const (
	ADLTypeXML  ADLType = "application/xml"
	ADLTypeJSON ADLType = "application/openehr.wt+json"
)

type ADLVer

type ADLVer = string

Version show as which service we should use for parsing template

const (
	VerADL1_4 ADLVer = "adl1.4"
	VerADL2   ADLVer = "adl2"
)

type Attribute

type Attribute = uint8
const (
	AttributeID                 Attribute = 1
	AttributeIDEncr             Attribute = 2
	AttributeKeyEncr            Attribute = 3
	AttributeDocUIDHash         Attribute = 4
	AttributeDocUIDEncr         Attribute = 5
	AttributeDealCid            Attribute = 6
	AttributeMinerAddress       Attribute = 7
	AttributeContent            Attribute = 8
	AttributeContentEncr        Attribute = 9
	AttributeDescriptionEncr    Attribute = 10
	AttributePasswordHash       Attribute = 11
	AttributeTimestamp          Attribute = 12
	AttributeNameEncr           Attribute = 13
	AttributeGroupDoctorsIDHash Attribute = 14
	AttributeGroupAllDocsIDHash Attribute = 15
	AttributeDataIndexID        Attribute = 16
)

type AttributesEhr

type AttributesEhr []ehrIndexer.AttributesAttribute

func (AttributesEhr) GetByCode

func (a AttributesEhr) GetByCode(code Attribute) []byte

type AttributesUsers

type AttributesUsers []users.AttributesAttribute

func (AttributesUsers) GetByCode

func (a AttributesUsers) GetByCode(code Attribute) []byte

type AuditDetails

type AuditDetails struct {
	Type          base.ItemType    `json:"_type"`
	SystemID      string           `json:"system_id"`
	TimeCommitted base.DvDateTime  `json:"time_committed,omitempty"`
	ChangeType    base.DvCodedText `json:"change_type,omitempty"`
	Committer     base.PartyProxy  `json:"committer,omitempty"`
	Description   base.DvText      `json:"description,omitempty"`
}

AUDIT_DETAILS The set of attributes required to document the committal of an information item to a repository. https://specifications.openehr.org/releases/RM/latest/common.html#_audit_details_class

type Composition

type Composition struct {
	Language  base.CodePhrase  `json:"language"`
	Territory base.CodePhrase  `json:"territory"`
	Category  base.DvCodedText `json:"category"`
	Context   *EventContext    `json:"context,omitempty"`
	Composer  base.PartyProxy  `json:"composer"`
	Content   []base.Root      `json:"content,omitempty"`
	base.Locatable
}

Composition Content of one version in a VERSIONED_COMPOSITION. A Composition is considered the unit of modification of the record, the unit of transmission in record Extracts, and the unit of attestation by authorising clinicians. In this latter sense, it may be considered equivalent to a signed document. https://specifications.openehr.org/releases/RM/latest/ehr.html#_composition_class

func (*Composition) UnmarshalJSON

func (c *Composition) UnmarshalJSON(data []byte) error

func (*Composition) Validate

func (c *Composition) Validate() (bool, error)

type Contribution

type Contribution struct {
	base.Root
	UID      base.UIDBasedID       `json:"uid"`
	Versions []ContributionVersion `json:"versions"`
	Audit    AuditDetails          `json:"audit"`
}

https://specifications.openehr.org/releases/RM/latest/common.html#_contribution_class

func (*Contribution) Validate

func (c *Contribution) Validate(template helper.Searcher) (bool, error)

TODO if type contribution version was modified then check that version is exist

type ContributionResponse

type ContributionResponse struct {
	UID      base.UIDBasedID               `json:"uid"`
	Versions []ContributionVersionResponse `json:"versions"`
	Audit    AuditDetails                  `json:"audit"`
}

type ContributionVersion

type ContributionVersion struct {
	Type                base.ItemType    `json:"_type"`
	Contribution        base.ObjectRef   `json:"contribution"`
	CommitAudit         AuditDetails     `json:"commit_audit"`
	UID                 base.UIDBasedID  `json:"uid"`
	PrecedingVersionUID base.UIDBasedID  `json:"preceding_version_uid"`
	LifecycleState      base.DvCodedText `json:"lifecycle_state"`
	Data                base.Root        `json:"data"`
}

func (*ContributionVersion) UnmarshalJSON

func (c *ContributionVersion) UnmarshalJSON(data []byte) error

func (*ContributionVersion) Validate

func (c *ContributionVersion) Validate(templateSearcher helper.Searcher) (bool, error)

type ContributionVersionResponse

type ContributionVersionResponse struct {
	Type         base.ItemType `json:"_type"`
	Contribution base.ObjectRef
}

type Directory

type Directory struct {
	base.Locatable
	FeederAudit base.FeederAudit   `json:"feeder_audit"`
	Folders     []*Directory       `json:"folders"`
	Items       []DirectoryItem    `json:"items,omitempty"`
	Details     base.ItemStructure `json:"details"`
}

func (*Directory) GetByPath

func (d *Directory) GetByPath(p string) (*Directory, error)

func (*Directory) Validate

func (d *Directory) Validate() error

type DirectoryItem

type DirectoryItem struct {
	ID        base.UIDBasedID `json:"id"`
	Type      base.ItemType   `json:"type"`
	Namespace string          `json:"namespace"`
}

type DocAccessDocument

type DocAccessDocument struct {
	CID         string `json:"CID"`
	Level       string `json:"level,omitempty"`
	Description string `json:"description,omitempty"`
}

type DocAccessDocumentGroup

type DocAccessDocumentGroup struct {
	GroupID       string               `json:"groupID"`
	Level         string               `json:"level"`
	Description   string               `json:"description"`
	ParentGroupID string               `json:"parentGroupID,omitempty"`
	Documents     []*DocAccessDocument `json:"documents"`
}

type DocAccessListResponse

type DocAccessListResponse struct {
	Documents      []*DocAccessDocument      `json:"documents"`
	DocumentGroups []*DocAccessDocumentGroup `json:"documentGroups"`
}

type DocAccessSetRequest

type DocAccessSetRequest struct {
	UserID      string
	CID         string
	AccessLevel string
}

type DocumentGroup

type DocumentGroup struct {
	GroupID     uuid.UUID `json:"groupID"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Members     []string  `json:"members"`

	GroupKey     *chachaPoly.Key `json:"-"`
	GroupKeyEncr []byte          `json:"-"`
	MembersEncr  [][]byte        `json:"-"`
}

type DocumentInterface

type DocumentInterface interface{}

type DocumentMeta

type DocumentMeta ehrIndexer.IDocsDocumentMeta

func (*DocumentMeta) GetAttr

func (dm *DocumentMeta) GetAttr(code Attribute) []byte

type EHR

type EHR struct {
	SystemID      base.HierObjectID `json:"system_id"`
	EhrID         base.HierObjectID `json:"ehr_id"`
	Contributions []base.ObjectRef  `json:"contributions,omitempty"`
	EhrStatus     base.ObjectRef    `json:"ehr_status"`
	EhrAccess     base.ObjectRef    `json:"ehr_access"`
	Compositions  []*Composition    `json:"compositions,omitempty"`
	Directory     *base.ObjectRef   `json:"directory,omitempty"`
	TimeCreated   base.DvDateTime   `json:"time_created"`
	Folders       []base.ObjectRef  `json:"folders,omitempty"`
}

EHR model info The EHR object is the root object and access point of an EHR for a subject of care https://specifications.openehr.org/releases/RM/latest/ehr.html#_ehr_class

type EhrCreateRequest

type EhrCreateRequest struct {
	Type            string `json:"_type"`
	ArchetypeNodeID string `json:"archetype_node_id"`
	Name            struct {
		Value string `json:"value"`
	} `json:"name"`
	Subject struct {
		ExternalRef ExternalRef `json:"external_ref"`
	} `json:"subject"`
	IsModifiable bool `json:"isModifiable"`
	IsQueryable  bool `json:"isQueryable"`
}

func (*EhrCreateRequest) Validate

func (e *EhrCreateRequest) Validate() bool

TODO

type EhrDocumentItem

type EhrDocumentItem struct {
	Name        string `json:"name"`
	UID         string `json:"uid"`
	TimeCreated string `json:"timeCreated"`
}

type EhrStatus

type EhrStatus struct {
	base.Locatable
	Subject      base.PartySelf      `json:"subject"`
	IsQueryable  bool                `json:"is_queryable"`
	IsModifable  bool                `json:"is_modifiable"`
	OtherDetails *base.ItemStructure `json:"other_details,omitempty"`
}

Single object per EHR containing various EHR-wide status flags and settings, including whether this EHR can be queried, modified etc. This object is always modifiable, in order to change the status of the EHR as a whole. https://specifications.openehr.org/releases/RM/latest/ehr.html#_ehr_status_class

type EhrStatusUpdate

type EhrStatusUpdate struct {
	Type            string `json:"_type"`
	ArchetypeNodeID string `json:"archetype_node_id"`
	Name            struct {
		Value string `json:"value"`
	} `json:"name"`
	UID struct {
		Type  string `json:"_type"`
		Value string `json:"value"`
	} `json:"uid"`
	Subject struct {
		ExternalRef ExternalRef `json:"external_ref"`
	} `json:"subject"`
	OtherDetails struct {
		Type            string `json:"_type"`
		ArchetypeNodeID string `json:"archetype_node_id"`
		Name            struct {
			Value string `json:"value"`
		} `json:"name"`
		Items []interface{} `json:"items"`
	} `json:"other_details"`
	IsModifiable bool `json:"is_modifiable"`
	IsQueryable  bool `json:"is_queryable"`
}

type EhrSummary

type EhrSummary struct {
	SystemID  base.ObjectID `json:"system_id"`
	EhrID     base.ObjectID `json:"ehr_id"`
	EhrStatus struct {
		ID        base.ObjectID `json:"id"`
		Namespace string        `json:"namespace"`
		Type      string        `json:"type"`
	} `json:"ehr_status"`
	EhrAccess struct {
		ID        base.ObjectID `json:"id"`
		Namespace string        `json:"namespace"`
		Type      string        `json:"type"`
	} `json:"ehr_access"`
	TimeCreated struct {
		Value string `json:"value"`
	} `json:"time_created"`
}

type ErrorResponse

type ErrorResponse struct {
	Message string  `json:"message"`
	Errors  []error `json:"validationErrors"`
}

func (*ErrorResponse) AddError

func (e *ErrorResponse) AddError(err error) *ErrorResponse

func (*ErrorResponse) SetMessage

func (e *ErrorResponse) SetMessage(m string) *ErrorResponse

type EventContext

type EventContext struct {
	StartTime          base.DvDateTime       `json:"start_time"`
	EndTime            *base.DvDateTime      `json:"end_time,omitempty"`
	Location           *string               `json:"location,omitempty"`
	Setting            base.DvCodedText      `json:"setting"`
	OtherContext       *base.ItemStructure   `json:"other_context,omitempty"`
	HealthCareFacility *base.PartyIdentified `json:"health_care_facility,omitempty"`
	Participations     []base.Participation  `json:"participations,omitempty"`
}

EventContext Documents the context information of a healthcare event involving the subject of care and the health system. The context information recorded here are independent of the attributes recorded in the version audit, which document the system interaction context, i.e. the context of a user interacting with the health record system. https://specifications.openehr.org/releases/RM/latest/ehr.html#_event_context_class

type ExternalRef

type ExternalRef struct {
	ID struct {
		Value  string `json:"value"`
		Type   string `json:"_type,omitempty"`
		Scheme string `json:"scheme,omitempty"`
	} `json:"id"`
	Namespace string `json:"namespace"`
	Type      string `json:"type"`
}

type GroupAccess

type GroupAccess struct {
	GroupUUID   *uuid.UUID      `json:"group_id"`
	Description string          `json:"description"`
	Key         *chachaPoly.Key `json:"-"`
	Nonce       *[12]byte       `json:"-"`
}

type GroupAccessCreateRequest

type GroupAccessCreateRequest struct {
	Description string `json:"description"`
}

func (*GroupAccessCreateRequest) Validate

func (e *GroupAccessCreateRequest) Validate() bool

TODO

type QueryColumn

type QueryColumn struct {
	Name string `json:"name"`
	Path string `json:"path"`
}

type QueryName

type QueryName = string

QueryName The (fully qualified) name of the query (when is registered as a stored query), in a format of [{namespace}::]{query-name}. The namespace prefix is optional, and when used it should be in a form of a reverse domain name. https://specifications.openehr.org/releases/ITS-REST/latest/definition.html#tag/StoredQuery_schema

type QueryRequest

type QueryRequest struct {
	Query           string                 `json:"q"`
	EhrID           string                 `json:"ehr_id"`
	Offset          int                    `json:"offset"`
	Fetch           int                    `json:"fetch"`
	QueryParameters map[string]interface{} `json:"query_parameters"`
}

https://specifications.openehr.org/releases/ITS-REST/Release-1.0.2/query.html#requirements

func (*QueryRequest) Validate

func (q *QueryRequest) Validate() error

type QueryResponse

type QueryResponse struct {
	Meta struct {
		Href          string `json:"_href"`
		Type          string `json:"_type"`
		SchemaVersion string `json:"_schema_version"`
		Created       string `json:"_created"`
		Generator     string `json:"_generator"`
		ExecutedAql   string `json:"_executed_aql"`
	} `json:"meta"`
	Name    string        `json:"name"`
	Query   string        `json:"q"`
	Columns []QueryColumn `json:"columns"`
	Rows    []interface{} `json:"rows"`
}

https://specifications.openehr.org/releases/ITS-REST/Release-1.0.2/query.html#requirements-response-structure

func (*QueryResponse) Validate

func (q *QueryResponse) Validate() bool

type QueryType

type QueryType = string

Query formalism type

const (
	QueryTypeAQL QueryType = "AQL"
)

type StoredQuery

type StoredQuery struct {
	Name        QueryName `json:"name"`
	Type        QueryType `json:"type"`
	Version     string    `json:"version"`
	TimeCreated string    `json:"saved"`
	Query       string    `json:"q"`
}

func (*StoredQuery) Validate

func (q *StoredQuery) Validate() error

type SwagComposition

type SwagComposition struct {
	Type            string `json:"_type"`
	ArchetypeNodeID string `json:"archetype_node_id"`
	Name            struct {
		Value string `json:"value"`
	} `json:"name"`
	UID struct {
		Type  string `json:"_type"`
		Value string `json:"value"`
	} `json:"uid,omitempty"`
	ArchetypeDetails struct {
		Type        string `json:"_type"`
		ArchetypeID struct {
			Value string `json:"value"`
		} `json:"archetype_id"`
		TemplateID struct {
			Value string `json:"value"`
		} `json:"template_id,omitempty"`
		RmVersion string `json:"rm_version"`
	} `json:"archetype_details,omitempty"`
	Language struct {
		TerminologyID struct {
			Value string `json:"value"`
		} `json:"terminology_id"`
		CodeString    string `json:"code_string,omitempty"`
		PreferredTerm string `json:"preferred_term,omitempty"`
	} `json:"language"`
	Territory struct {
		TerminologyID struct {
			Value string `json:"value"`
		} `json:"terminology_id"`
		CodeString    string `json:"code_string,omitempty"`
		PreferredTerm string `json:"preferred_term,omitempty"`
	} `json:"territory"`
	Category struct {
		Value        string `json:"value"`
		DefiningCode struct {
			TerminologyID struct {
				Value string `json:"value"`
			} `json:"terminology_id"`
			CodeString    string `json:"code_string,omitempty"`
			PreferredTerm string `json:"preferred_term,omitempty"`
		} `json:"defining_code"`
	} `json:"category"`
	Composer struct {
		Type        string `json:"_type"`
		Name        string `json:"name"`
		ExternalRef struct {
			ID struct {
				Type  string `json:"_type"`
				Value string `json:"value"`
			} `json:"id"`
			Namespace string `json:"namespace"`
			Type      string `json:"type"`
		} `json:"external_ref"`
	} `json:"composer"`
	Context struct {
		StartTime struct {
			Value string `json:"value"`
		} `json:"start_time"`
		Setting struct {
			Value        string `json:"value"`
			DefiningCode struct {
				TerminologyID struct {
					Value string `json:"value"`
				} `json:"terminology_id"`
				CodeString    string `json:"code_string,omitempty"`
				PreferredTerm string `json:"preferred_term,omitempty"`
			} `json:"defining_code"`
		} `json:"setting"`
	} `json:"context,omitempty"`
	Content []interface{} `json:"content,omitempty"`

} //@name Composition

type Template

type Template struct {
	TemplateID  string  `json:"template_id"`
	UID         string  `json:"-" msgpack:"-"`
	Version     string  `json:"version,omitempty" msgpack:"-"`
	VerADL      ADLVer  `json:"-" msgpack:"-"`
	MimeType    ADLType `json:"-" msgpack:"-"`
	Body        []byte  `json:"-" msgpack:"-"`
	Concept     string  `json:"concept"`
	ArchetypeID string  `json:"archetype_id,omitempty" msgpack:",omitempty"`
	CreatedAt   string  `json:"created_timestamp" msgpack:"-"`
}

type TemplateXML

type TemplateXML struct {
	XMLName    xml.Name `xml:"template"`
	TemplateID string   `xml:"template_id>value"`
	UID        string   `xml:"uid>value"`
	Concept    string   `xml:"concept"`
	Definition struct {
		ArchetypeID string `xml:"archetype_id,attr"` // TODO maybe we should generate it?
	} `xml:"definition"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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