message

package
v0.0.0-...-d424132 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ADT represents an ADT HL7v2 message.
	ADT = "ADT"
	// ORM represents an ORM HL7v2 message.
	ORM = "ORM"
	// ORR represents an ORR HL7v2 message.
	ORR = "ORR"
	// ORU represents an ORU HL7v2 message.
	ORU = "ORU"
	// MDM represents an MDM HL7v2 message.
	MDM = "MDM"
)

The fields in this block are HL7 message types Simulated Hospital supports. https://corepointhealth.com/resource-center/hl7-resources/hl7-messages/

View Source
const (
	MSH             = "MSH"
	MSA             = "MSA"
	EVN             = "EVN"
	PID             = "PID"
	ORC             = "ORC"
	OBR             = "OBR"
	OBRClinicalNote = "OBRClinicalNote"
	OBX             = "OBX"
	OBXClinicalNote = "OBXClinicalNote"
	OBXForMDM       = "OBXForMDM"
	PV1             = "PV1"
	PV2             = "PV2"
	NK1             = "NK1"
	AL1             = "AL1"
	NTE             = "NTE"
	MRG             = "MRG"
	DG1             = "DG1"
	PD1             = "PD1"
	PR1             = "PR1"
	TXA             = "TXA"
)

Constants for segments and templates.

View Source
const DiagnosticServIDMDOC = "MDOC"

DiagnosticServIDMDOC is the value of the Diagnostic Serv ID field (OBR_24) for clinical documents.

View Source
const SegmentTerminator = constants.SegmentTerminatorStr

SegmentTerminator is the string used to terminate segments in HL7v2 messages.

Variables

This section is empty.

Functions

func BuildAL1

func BuildAL1(id int, a *ir.Allergy) (string, error)

BuildAL1 builds and returns a HL7 AL1 segment.

func BuildDG1

func BuildDG1(id int, diagnose *ir.DiagnosisOrProcedure) (string, error)

BuildDG1 builds and returns a HL7 DG1 segment.

func BuildEVN

func BuildEVN(t time.Time, messageType *Type, planned ir.NullTime, operator *ir.Doctor, occurred ir.NullTime) (string, error)

BuildEVN builds and returns a HL7 EVN segment.

func BuildMRG

func BuildMRG(mrns []string) (string, error)

BuildMRG builds and returns a HL7 MRG segment.

func BuildMSA

func BuildMSA(orderMessageControlID string) (string, error)

BuildMSA builds and returns a HL7 MSA segment.

func BuildMSH

func BuildMSH(t time.Time, messageType *Type, header *HeaderInfo) (string, error)

BuildMSH builds and returns a HL7 MSH segment.

func BuildNK1

func BuildNK1(id int, p *ir.AssociatedParty) (string, error)

BuildNK1 builds and returns a HL7 NK1 segment.

func BuildNTE

func BuildNTE(id int, note string) (string, error)

BuildNTE builds and returns a HL7 NTE segment.

func BuildOBR

func BuildOBR(o *ir.Order) (string, error)

BuildOBR builds and returns a HL7 OBR segment.

func BuildOBX

func BuildOBX(id int, r *ir.Result, o *ir.Order) (string, error)

BuildOBX builds and returns a HL7 OBX segment.

func BuildOBXForClinicalNote

func BuildOBXForClinicalNote(id, contentIndex int, r *ir.Result, o *ir.Order) (string, error)

BuildOBXForClinicalNote build and returns a HL7 OBX segment for a Clinical Note.

func BuildOBXForMDM

func BuildOBXForMDM(id int, o *ir.CodedElement, line string) (string, error)

BuildOBXForMDM builds and returns a HL7 OBX segment for MDMT02 type for an MDM message.

func BuildORC

func BuildORC(o *ir.Order) (string, error)

BuildORC builds and returns a HL7 ORC segment.

func BuildPD1

func BuildPD1(p *ir.PatientInfo) (string, error)

BuildPD1 builds and returns a HL7 PD1 segment.

func BuildPID

func BuildPID(p *ir.Person) (string, error)

BuildPID builds and returns a HL7 PID segment.

func BuildPR1

func BuildPR1(id int, procedure *ir.DiagnosisOrProcedure) (string, error)

BuildPR1 builds and returns a HL7 PR1 segment.

func BuildPV1

func BuildPV1(p *ir.PatientInfo) (string, error)

BuildPV1 builds and returns a HL7 PV1 segment.

func BuildPV2

func BuildPV2(p *ir.PatientInfo) (string, error)

BuildPV2 builds and returns a HL7 PV2 segment.

func BuildPseudoPV1

func BuildPseudoPV1() string

BuildPseudoPV1 builds and returns a HL7 PV1 segment without any patient information. A PV1 that some messages need to send for backwards compatibility but where the visit is not relevant to the message, e.g. ADT^08. The PatientClass is set to N - Not applicable.

func BuildTXA

func BuildTXA(p *ir.PatientInfo, d *ir.Document) (string, error)

BuildTXA builds and returns a HL7 TXA segment.

func ToHL7Date

func ToHL7Date(t ir.Formattable) (string, error)

ToHL7Date converts a date into a string with HL7 date format.

Types

type HL7Message

type HL7Message struct {
	Type    *Type
	Message string
}

HL7Message represents a HL7 Message.

func BuildAddPersonADTA28

func BuildAddPersonADTA28(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildAddPersonADTA28 builds and returns a HL7 ADT^A28 message.

func BuildAdmissionADTA01

func BuildAdmissionADTA01(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildAdmissionADTA01 builds and returns a HL7 ADT^A01 message.

func BuildBedSwapADTA17

func BuildBedSwapADTA17(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time, otherP *ir.PatientInfo) (*HL7Message, error)

BuildBedSwapADTA17 builds and returns a HL7 ADT^A17 message.

func BuildCancelDischargeADTA13

func BuildCancelDischargeADTA13(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildCancelDischargeADTA13 builds and returns a HL7 ADT^A13 message.

func BuildCancelPendingAdmitADTA27

func BuildCancelPendingAdmitADTA27(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildCancelPendingAdmitADTA27 builds and returns a HL7 ADT^A27 message.

func BuildCancelPendingDischargeADTA25

func BuildCancelPendingDischargeADTA25(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildCancelPendingDischargeADTA25 builds and returns a HL7 ADT^A25 message.

func BuildCancelPendingTransferADTA26

func BuildCancelPendingTransferADTA26(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildCancelPendingTransferADTA26 builds and returns a HL7 ADT^A26 message.

func BuildCancelTransferADTA12

func BuildCancelTransferADTA12(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildCancelTransferADTA12 builds and returns a HL7 ADT^A12 message.

func BuildCancelVisitADTA11

func BuildCancelVisitADTA11(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildCancelVisitADTA11 builds and returns a HL7 ADT^A11 message.

func BuildDeleteVisitADTA23

func BuildDeleteVisitADTA23(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildDeleteVisitADTA23 builds and returns a HL7 ADT^A23 message.

func BuildDischargeADTA03

func BuildDischargeADTA03(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildDischargeADTA03 builds and returns a HL7 ADT^A03 message.

func BuildDocumentNotificationMDMT02

func BuildDocumentNotificationMDMT02(h *HeaderInfo, p *ir.PatientInfo, d *ir.Document, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildDocumentNotificationMDMT02 builds and returns a HL7 MDM^T02 message.

func BuildMergeADTA34

func BuildMergeADTA34(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time, withMRN string) (*HL7Message, error)

BuildMergeADTA34 builds and returns a HL7 ADT^A34 message.

func BuildMergeADTA40

func BuildMergeADTA40(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time, withMRN []string) (*HL7Message, error)

BuildMergeADTA40 builds and returns a HL7 ADT^A40 message.

func BuildOrderORMO01

func BuildOrderORMO01(h *HeaderInfo, p *ir.PatientInfo, o *ir.Order, msgTime time.Time) (*HL7Message, error)

BuildOrderORMO01 builds and returns a HL7 ORM^O01 message.

func BuildPathologyORRO02

func BuildPathologyORRO02(h *HeaderInfo, p *ir.PatientInfo, o *ir.Order, msgTime time.Time) (*HL7Message, error)

BuildPathologyORRO02 builds and returns a HL7 ORR^O02 message.

func BuildPendingAdmissionADTA14

func BuildPendingAdmissionADTA14(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildPendingAdmissionADTA14 builds and returns a HL7 ADT^A14 message.

func BuildPendingDischargeADTA16

func BuildPendingDischargeADTA16(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildPendingDischargeADTA16 builds and returns a HL7 ADT^A16 message.

func BuildPendingTransferADTA15

func BuildPendingTransferADTA15(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildPendingTransferADTA15 builds and returns a HL7 ADT^A15 message.

func BuildPreAdmitADTA05

func BuildPreAdmitADTA05(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildPreAdmitADTA05 builds and returns a HL7 ADT^A05 message.

func BuildRegistrationADTA04

func BuildRegistrationADTA04(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildRegistrationADTA04 builds and returns a HL7 ADT^A04 message.

func BuildResultORUR01

func BuildResultORUR01(h *HeaderInfo, p *ir.PatientInfo, o *ir.Order, msgTime time.Time) (*HL7Message, error)

BuildResultORUR01 builds and returns a HL7 ORU^R01 message.

func BuildResultORUR03

func BuildResultORUR03(h *HeaderInfo, p *ir.PatientInfo, o *ir.Order, msgTime time.Time) (*HL7Message, error)

BuildResultORUR03 builds and returns a HL7 ORU^R03 message.

func BuildResultORUR32

func BuildResultORUR32(h *HeaderInfo, p *ir.PatientInfo, o *ir.Order, msgTime time.Time) (*HL7Message, error)

BuildResultORUR32 builds and returns a HL7 ORU^R32 message.

func BuildTrackArrivalADTA10

func BuildTrackArrivalADTA10(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildTrackArrivalADTA10 builds and returns a HL7 ADT^A10 message.

func BuildTrackDepartureADTA09

func BuildTrackDepartureADTA09(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildTrackDepartureADTA09 builds and returns a HL7 ADT^A09 message.

func BuildTransferADTA02

func BuildTransferADTA02(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildTransferADTA02 builds and returns a HL7 ADT^A02 message.

func BuildUpdatePatientADTA08

func BuildUpdatePatientADTA08(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildUpdatePatientADTA08 builds and returns a HL7 ADT^A08 message.

func BuildUpdatePersonADTA31

func BuildUpdatePersonADTA31(h *HeaderInfo, p *ir.PatientInfo, eventTime time.Time, msgTime time.Time) (*HL7Message, error)

BuildUpdatePersonADTA31 builds and returns a HL7 ADT^A31 message.

func (HL7Message) String

func (m HL7Message) String() string

type HeaderInfo

type HeaderInfo struct {
	SendingApplication   string
	SendingFacility      string
	ReceivingApplication string
	ReceivingFacility    string
	// MessageControlID is the MSH -> Message Control ID.
	MessageControlID string
}

HeaderInfo contains information relevant to a header of a HL7 Message.

type Type

type Type struct {
	MessageType  string
	TriggerEvent string
}

Type represents the message type for a HL7 Message.

func (Type) String

func (m Type) String() string

Jump to

Keyboard shortcuts

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