Ensemble Virtual Documents
Curly Bracket { } Syntax
[Back] [Next]
   
Server:docs1
Instance:LATEST
User:UnknownUser
 
-
Go to:
Search:    

Describes how to use curly bracket { } syntax to access virtual properties.
Where Applicable
You can use this syntax in business rules, search tables, search filters, BPL elements (other than <code> and <sql>), and DTL elements (other than <code> and <sql>).
For curly bracket syntax to resolve, the message structure must be known. If the message structure is unknown in the current context, use square bracket [ ] syntax instead, if possible.
Details
To use curly bracket { } syntax to access a virtual property, use the following syntax:
message.{myVirtualPropertyPath}
Where:
The preceding syntax is equivalent to the following method call:
message.GetValueAt("myVirtualPropertyPath")
Curly bracket {} syntax is simpler and so is commonly used where available.
Wholesale Copy
When you are using curly bracket {} notation in BPL or DTL, you can copy whole segments, groups of segments, or whole composite fields within a segment. To do so, omit the field part of the virtual property path (as well as the colon separator). Thus, the following DTL <assign> statements are all legal:
<assign property='target.{MSH}' value='source.{MSH}' />
<assign property='target.{DG1()}' value='source.{DG1()}' />
<assign property='target.{DG1(1):DiagnosingClinician}' value='"^Bones^Billy"'/>
Note:
If the source and target types are different, such as copying from an EnsLib.HL7.Message to an EnsLib.EDI.XML.Document, you cannot use the wholesale copy to assign subproperties, even if the structures appear to be parallel. For such a copy, you must assign each leaf node of a structure independently and add a For Each action to process iterations.
The last line of the previous example uses the caret (^) as a component separator character. For details specific to each EDI format, see:
Examples
Here is a BPL example:
<if condition='source.{MSH:9.1}="BAR"'>
Here is a DTL example:
<transform targetClass='EnsLib.HL7.Message'
           targetDocType='2.3:ADT_A01'
           sourceClass='EnsLib.HL7.Message'
           sourceDocType='2.3:ADT_A01'
           create='copy'
           language='objectscript'>
  <assign property='target.{PR1grp(1).PR1:Anesthesiologist.nametype}'
          value='"M"'
          action='set'/>
</transform>
Here is an example from a business rule:
Document.Name
Document.Parent.DocType
Document.{PIDgrp.PV1grp.PV1:18}
Document.{PIDgrp.PID:PatientName.familylastname}
Document.{ORCgrp(1).OBRuniongrp.OBRunion.OBR:4.3}
Here is an excerpt from a search table:
<Item DocType="" PropName="MSHControlID"
                 PropType="String:CaseSensitive" >{1:10}</Item>