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
- type Message
- func (k Message) GetPIDByName(s string) (*hl7.PID, error)
- func (k Message) GetPV1ByName(s string) (*hl7.PV1, error)
- func (k Message) GetSerialisedKeyedMessage() string
- func (k Message) SafeGetMSH() *hl7.MSH
- func (k Message) SafeGetOBR() *hl7.OBR
- func (k Message) SafeGetOBX() *hl7.OBX
- func (k Message) SafeGetORC() *hl7.ORC
- func (k Message) SafeGetPID() *hl7.PID
- func (k Message) SafeGetPV1() *hl7.PV1
- func (k Message) SafeGetZCM() *hl7.ZCM
Constants ¶
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 ¶
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 ¶
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 (Message) SafeGetMSH ¶
SafeGetMSH returns the MSH segment. Keyed Messages have a present and parsable MSH segment.
func (Message) SafeGetOBR ¶
SafeGetOBR returns the OBR segment. Keyed Messages have a present and parsable OBR segment. The returned segment might be nil.
func (Message) SafeGetOBX ¶
SafeGetOBX returns the OBX segment. Keyed Messages have a present and parsable OBX segment. The returned segment might be nil.
func (Message) SafeGetORC ¶
SafeGetORC returns the ORC segment. Keyed Messages have a present and parsable ORC segment. The returned segment might be nil.
func (Message) SafeGetPID ¶
SafeGetPID returns the PID segment. Keyed Messages have a present and parsable PID segment.
func (Message) SafeGetPV1 ¶
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 ¶
SafeGetZCM returns the ZCM segment. Keyed Messages have a present and parsable ZCM segment.