AddHL7Segment() |
Top Previous Next |
Object: EHL7.HL7Vendors FileName: EHL7.dll
METHOD
Name: AddHL7Segment() Parameters: 1) strXML (String) An XML string containing information for the Segment you wish to add to the vendor definitions. Returns: Boolean Description: Returns True if the segment is successfully added to the vendor definition and false on failure. On failure check the LastError property for the error description.
Example XML: <SEGMENT NAME="EHL" DESCRIPTION="Fictional new segment for Default vendor version 2.3" ITEMGUID="9C5451C8F32ADB42BC5F09A9A4296597" />
*Note: XML node and attribute names are case sensitive and should be uppercase:
*NOTE* Development license required to call this method successfully
Example Code to do this: Private Sub VendorTest() Dim myVendorObj As New EHL7.HL7Vendors Dim strVendorID As String Dim strXML As String Dim domNode As Object Dim myXMLObj As New EHL7.qsXML myVendorObj.VendorPath = "C:\EasyHL7" 'Process the XML strVendorID = myVendorObj.GetVendorID("Default","2.3") If strVendorID = "" Then MsgBox myVendorObj.LastError Set myVendorObj = Nothing Exit Sub End If If Not MyVendorObj.OpenVendor(strVendorID) Then MsgBox myVendorObj.LastError Set myVendorObj = Nothing Exit Sub End If With myXMLObj strXML = "<SEGMENT></SEGMENT>" .OpenFromString strXML Set domNode = .GetRootElement() .SetAttribute domNode, "NAME", "DHL" .SetAttribute domNode, "DESCRIPTION", "My Test Segment" .SetAttribute domNode, "ITEMGUID", CreateGUID() 'The order of the attributes is not important strXML = .XML End With If Not myVendorObj.AddHL7Segment(strXML) Then MsgBox myVendorObj.LastError Exit Sub End If 'Now we have added the Segment let's add some field elements End Sub
|