Class Name: |
HL7PlusMSHInfo |
HL7+ Category: |
|
Description: |
General utility object for holding significant HL7 MSH Segment Values |
Common Scenario: I need to create many HL7 messages. These messages are all the same type, same event, they are all going to the same destination and are from the same sender. You can use the HL7PlusMSHInfo object to shortcut your process by having the HL7PlusMessage object create and populate the MSH segment automatically when you create the message. See the Implementation Example below.
Programming Note: If you leave these fields blank (or set them to "") when you call HL7PlusController.NewHL7PlusMessage(obMSHInfo) then the HL7 Message MSH segment values will be automatically populated for you with MakeHL7ControlID() and HL7Now see the Implementation Example below for more information.
|
|
This object class uses our standard HL7PlusException Class interface for error handling wherever possible.
See the HL7PlusException Implementation Reference
|
*All example code is in Visual Basic.Net
'Create a HL7PlusMSHInfo Object for Reuse Dim oMSH As New HL7PlusMSHInfo With oMSH '..NOTE: What kind of HL7 Message is it .MSH_MessageType = "ADT" .MSH_MessageEvent = "A01" '..END NOTE
'..NOTE: Who is the message FROM .MSH_SendingApplication = MyController.InstallationName .MSH_SendingFacility = "12345" '..END NOTE
'..NOTE: Who is the message going TO .MSH_ReceivingApplication = "NationalLab" .MSH_ReceivingFacility = "54321" 'Their facility ID '..END NOTE
'..NOTE 'If these fields are blank the message will 'Dynamically create these values .MSH_MessageControlID = "" .MSH_MessageDate = "" '..END NOTE '...Set Other Properties .MSH_TestProdFlag = "T" 'It's a Test message .MSH_HL7Version = "2.5.1" .MSH_AcceptAcknowledgementType = "AL" .MSH_ApplicationAcknowledgementType = "" .MSH_Security = "NO SECURITY" End With
Dim idx As Integer For idx = 0 To myTasks.Count - 1 '..NOTE: Now I can just reuse oMSH over and over again Dim obMsg As HL7PlusMessage = MyController.NewHL7PlusMessage(oMSH) If IsNothing(obMsg) Then MessageBox.Show("There was an error: " & MyController.LastError, "Error") Return End If '..NOTE: The new message now has a MSH segment populated with the '..values from oMSH. I don't have to call obMsg.AddEmptySegment("MSH") '...Code..Add other segments and data.. '...Code..Add other segments and data.. '...Code..Add other segments and data.. '...Code..Save or dispatch the final message.. Next
|