Documentation ¶
Overview ¶
Package testhl7 contains utility functions and helpers for testing with HL7 messages.
Index ¶
- func AccountStatus(t *testing.T, message string) string
- func AllAL1(t *testing.T, message string) []*hl7.AL1
- func AllDG1(t *testing.T, message string) []*hl7.DG1
- func AllOBX(t *testing.T, message string) []*hl7.OBX
- func AllPR1(t *testing.T, message string) []*hl7.PR1
- func DeathIndicator(t *testing.T, message string) string
- func DeathTime(t *testing.T, message string) *time.Time
- func EVN(t *testing.T, message string) *hl7.EVN
- func EventDateTime(t *testing.T, message string) time.Time
- func Fields(t *testing.T, messages []string, f func(*testing.T, string) string) []string
- func FirstName(t *testing.T, message string) string
- func MRG(t *testing.T, message string) *hl7.MRG
- func MRN(t *testing.T, message string) string
- func MSA(t *testing.T, message string) *hl7.MSA
- func MSH(t *testing.T, message string) *hl7.MSH
- func MessageControlIDFromMSA(t *testing.T, message string) string
- func MessageControlIDFromMSH(t *testing.T, message string) string
- func MessageDateTime(t *testing.T, message string) time.Time
- func MessageType(t *testing.T, message string) string
- func OBR(t *testing.T, message string) *hl7.OBR
- func OBX(t *testing.T, message string) *hl7.OBX
- func OBXFields(t *testing.T, messages []string, f func(*testing.T, *hl7.OBX) string) [][]string
- func OBXFieldsFromOBXs(t *testing.T, obxs []*hl7.OBX, f func(*testing.T, *hl7.OBX) string) []string
- func OBXResultStatus(t *testing.T, obx *hl7.OBX) string
- func OBXSetID(t *testing.T, obx *hl7.OBX) string
- func ORC(t *testing.T, message string) *hl7.ORC
- func ObservationValue(t *testing.T, message string) string
- func OrderStatus(t *testing.T, message string) string
- func PID(t *testing.T, message string) *hl7.PID
- func PV1(t *testing.T, message string) *hl7.PV1
- func PV2(t *testing.T, message string) *hl7.PV2
- func PV2OrNil(t *testing.T, message string) *hl7.PV2
- func Parse(t *testing.T, message string) *hl7.Message
- func PatientClass(t *testing.T, message string) string
- func PlacerNumber(t *testing.T, message string) string
- func PointOfCare(t *testing.T, message string) string
- func PriorPatientIdentifierList(t *testing.T, message string) []string
- func SendingApplication(t *testing.T, message string) string
- func SendingFacility(t *testing.T, message string) string
- func TXA(t *testing.T, message string) *hl7.TXA
- func TimeFields(t *testing.T, messages []string, f func(*testing.T, string) *time.Time) []*time.Time
- func ValueType(t *testing.T, obx *hl7.OBX) string
- func VisitNumber(t *testing.T, message string) string
- type Sender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccountStatus ¶
AccountStatus returns the PV1.AccountStatus.
func DeathIndicator ¶
DeathIndicator returns the PatientDeathIndicator.
func EventDateTime ¶
EventDateTime returns the event's date time.
func MessageControlIDFromMSA ¶
MessageControlIDFromMSA returns the message control ID from the MSA segment.
func MessageControlIDFromMSH ¶
MessageControlIDFromMSH returns the message control ID from the MSH segment.
func MessageDateTime ¶
MessageDateTime returns the message's date time.
func MessageType ¶
MessageType returns this message's message type.
func OBXFieldsFromOBXs ¶
OBXFieldsFromOBXs applies the function f to all of the given OBX segments.
func OBXResultStatus ¶
OBXResultStatus returns the observation result status.
func ObservationValue ¶
ObservationValue returns this message's OBX observation value.
func OrderStatus ¶
OrderStatus returns OrderStatus from the ORC segment.
func PatientClass ¶
PatientClass returns the PV1.PatientClass.
func PlacerNumber ¶
PlacerNumber returns the PlacerOrderNumber.
func PointOfCare ¶
PointOfCare returns the point of care from the PV1.AssignedPatientLocation.
func PriorPatientIdentifierList ¶
PriorPatientIdentifierList returns the PriorPatientIdentifierList from the MRG segment.
func SendingApplication ¶
SendingApplication returns the message's sending application.
func SendingFacility ¶
SendingFacility returns the message's sending facility.
func TimeFields ¶
func TimeFields(t *testing.T, messages []string, f func(*testing.T, string) *time.Time) []*time.Time
TimeFields computes the given function that returns times for each message.
Types ¶
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
Sender is an hl7.Sender that saves all sent messages in a list.
func SenderWithError ¶
SenderWithError returns a Sender that returns the provided error when Send() is invoked.
func (*Sender) EraseSentHistory ¶
func (s *Sender) EraseSentHistory()
EraseSentHistory erases the history of sent messages.
func (*Sender) GetSentMessages ¶
GetSentMessages returns the messages sent by this sender.