UpdateElementProperties()

Top  Previous  Next

Object: EHL7.HL7Vendors

FileName: EHL7.dll

 

METHOD

 

Name: UpdateElementProperties()

Parameters:

1.strElementGUID (string) the GUID of the HL7 Field Element. See GetElementGUID().
2.strProperties (string) the properties string (see below)

Returns: Boolean

Description: This is an advanced feature of the interface.  It is strongly advised that you use the ShowElementProperties() method and update this value through the user interface.

 

*NOTE* Development license required to call this method successfully

 

The extended properties of an element is a proprietary string based structure composed of 4 delimited string arrays (delimited with a '|' character) inside of a string which is delimited with Ascii Character 167 (HEX 0xA7) '§' which is an XML safe standard delimiter character recommended by MicroSoft.  The string can be a maximum of 256 characters.

 

For Example:

clip0022

 

The Extended Properties String represented by the screen above is: 0|36§1|1§8|6§0|ML

The parent datatype is a custom datatype called CMC with two components. 

The First Array: 0|36 represents the HL7 table IDs for each of the two components 0 for component 1 and 36 for component 2.
The Second Array: 1|1 represents the requiredness of the two components, (0 = false, 1 = true).
The Third Array: 8|6 represents the maximum length of the two components.  Component 1 has a maximum length of 8 and component 2 has a maximum length of 6.
The Fourth Array: 0|ML represents the default values for the components, 0 (zero) for component 1 and 'ML' for component 2.

 

The important thing to keep in mind is that each of the string arrays must contain the same number of elements and that number must match the number of components for the data type of the element.  Values within each element can be eliminated without danger.  Also in the 1st to 3rd arrays all elements must be numeric values (0 should be the default and would mean do nothing). In the fourth array (the default values) you must ensure that the data in the elements does not contain either ascii character 167 or the "|" character.

 

Example A: 0|36§1|1§8|6§|ML.  In this Properties string, component 1 of the element does not have a default value.  This is fine.

 

Example B: |§1|1§8|6§|ML.  In this Properties string, the table IDs have not been set.  This also is fine and will not generate an error but is bad practice.  You should pass 0|0§1|1§8|6§|ML instead.

 

Example C: 0§1|1§8|6§|ML.  In this Properties string, one table ID has been set but without the delimiter it has fewer elements than the others and may cause problems. 

 

To ONLY set the default value on component 2 to 'KG' you would pass: 0|0§0|0§0|0§|KG
To clear the extended element properties pass an empty string ("").

 

Code Example:

 

Private Sub TestProps()

Dim strProps As String

Dim aMain() As String

Dim aTables() As String

Dim aRequired() As String

Dim aMaxLen() As String

Dim aDefaults() As String

strProps = "0|36§1|1§8|6§0|ML"

  aMain = Split(strProps,Chr$(167))

  aTables = Split(aMain(0), "|")

  aRequired = Split(aMain(1), "|")

  aMaxLen = Split(aMain(2), "|")

  aDefaults = Split(aMain(3), "|")

  If CBool(aRequired(1)) Then

     MsgBox "Component 2 is required"

  Else

    MsgBox "Component 2 is not required"

End If

MsgBox "The default value for component 2 = " & aDefaults(1)

End Sub