AddHL7DataType()

Top  Previous  Next

Object: EHL7.HL7Vendors

FileName: EHL7.dll

 

METHOD

 

Name: AddHL7DataType()

Parameters: strXML (String) an XML string containing the information about the HL7 Datatype to be added to current vendors HL7 definition.

Returns: Boolean

Description: Returns True if the datatype was successfully added.

*NOTE* Development license required to call this method successfully

 

 

Programming Note: When a new datatype is added, it is automatically assumed to have 1 component. 

 

Example XML String:

 

<DATATYPE HL7TYPE="TST" DESCRIPTION="Test HL7 Data Type" BASETYPE="Definition Editing demo" INSTRUCTIONS="Can supply up to 512 bytes of instructions for each data type." ITEMGUID="057CCE8485E8714DB6CB65767A23D4C3" />

 

*Note: XML node and attribute names are case sensitive and should be uppercase:

The HL7TYPE attribute is the name of the new HL7 datatype.
The DESCRIPTION attribute is a short text description of the the datatype (max 100 characters)
The BASETYPE attribute is an optional short description of the category of the data type (up to 50 characters)
The INSTRUCTIONS attribute is an optional text string containing up to 512 characters of instructions
The ITEMGUID attribute is the GUID assigned to be assigned to the Segment by EasyHL7. 

 

 

 

See Also: HL7DataTypesXML(), Managing HL7 Data Types

 

 

Example:

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

strXML = "<DATATYPE></DATATYPE>"

With myXMLObj

  .OpenFromString strXML

  Set domNode = .GetRootElement()

  .SetAttribute domNode, "HL7TYPE", "TST"

  .SetAttribute domNode, "DESCRIPTION", "Test HL7 data type"

  .SetAttribute domNode, "BASETYPE", "Demo Type"

  .SetAttribute domNode, "INSTRUCTIONS", "Whatever you care for them to be"

  .SetAttribute domNode, "ITEMGUID", CreateGUID()

  strXML = .XML

End With

With myVendorObj

   If Not .AddHL7DataType(strXML) Then

      MsgBox .LastError

      Exit Sub

   End If

End With

End Sub