keyed

package
v0.0.0-...-e69eef7 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package keyed contains functions to handle HL7 messages in realistic settings, for instance: - They are loaded from a database and have a key - They contain custom Z-Segments - They have been somewhat validated - and thus we can ignore errors in parsing.

Index

Constants

View Source
const (
	MessageTypeADT         = "adt"
	MessageTypeORU         = "oru"
	MessageTypeORR         = "orr"
	MessageTypeORM         = "orm"
	MessageTriggerEventA03 = "A03"
	MessageTriggerEventA11 = "A11"
	MessageTriggerEventA13 = "A13"
	MessageTriggerEventA17 = "A17"
	MessageTriggerEventA23 = "A23"
	MessageTriggerEventA34 = "A34"
	MessageTriggerEventA40 = "A40"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	// Sanitized hl7.Message, see MessageSanitizer.
	// Sanitized messages are parsable, so errors to retrieve segments can be ignored.
	*hl7.Message
	// The message's key from the database.
	Key []byte

	ParsedMessage interface{}

	// Trigger event for this message, A01, A02, R01 etc
	TriggerEvent string

	// True if the message is reliable.
	Reliable bool

	// The SendingFacility (MSH.SendingFacility.NamespaceID) so that it can be accessed easily.
	SendingFacility string

	// The message type for this message: adt, oru, etc.
	// This is lower case for compatibility with current metrics.
	MessageType string

	MessageDateTime time.Time

	SendingApplication string
}

Message is a wrapper of an hl7.Message that contains the Message key from the database, mostly for logging. After parsing, this is the main type of message that could be passed around.

func (Message) GetPIDByName

func (k Message) GetPIDByName(s string) (*hl7.PID, error)

GetPIDByName gets the PID segment from this message with the provided name. This function should be used when a PID segment does not have the default name of "PID".

func (Message) GetPV1ByName

func (k Message) GetPV1ByName(s string) (*hl7.PV1, error)

GetPV1ByName gets the PV1 segment from this message with the provided name. This function should be used when a PV1 segment does not have the default name of "PV1".

func (Message) GetSerialisedKeyedMessage

func (k Message) GetSerialisedKeyedMessage() string

func (Message) SafeGetMSH

func (k Message) SafeGetMSH() *hl7.MSH

SafeGetMSH returns the MSH segment. Keyed Messages have a present and parsable MSH segment.

func (Message) SafeGetOBR

func (k Message) SafeGetOBR() *hl7.OBR

SafeGetOBR returns the OBR segment. Keyed Messages have a present and parsable OBR segment. The returned segment might be nil.

func (Message) SafeGetOBX

func (k Message) SafeGetOBX() *hl7.OBX

SafeGetOBX returns the OBX segment. Keyed Messages have a present and parsable OBX segment. The returned segment might be nil.

func (Message) SafeGetORC

func (k Message) SafeGetORC() *hl7.ORC

SafeGetORC returns the ORC segment. Keyed Messages have a present and parsable ORC segment. The returned segment might be nil.

func (Message) SafeGetPID

func (k Message) SafeGetPID() *hl7.PID

SafeGetPID returns the PID segment. Keyed Messages have a present and parsable PID segment.

func (Message) SafeGetPV1

func (k Message) SafeGetPV1() *hl7.PV1

SafeGetPV1 returns the PV1 segment. Keyed Messages have a parsable PV1 segment, so errors can be ignored. The returned segment might be nil.

func (Message) SafeGetZCM

func (k Message) SafeGetZCM() *hl7.ZCM

SafeGetZCM returns the ZCM segment. Keyed Messages have a present and parsable ZCM segment.

Jump to

Keyboard shortcuts

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