UpdateElementProperties() |
Top Previous Next |
Object: EHL7.HL7Vendors FileName: EHL7.dll
METHOD
Name: UpdateElementProperties() Parameters:
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:
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 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.
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
|