How to obtain object value in DTL Trace Event
I have an existing DTL and I need to insert a trace statement so that it writes the value of the target object. However, I haven't been successful in completing this.
I have opened the DTL viewer in Studio, and have inserted a trace statement.
- If I insert just plain text, the trace statement works, e.g., Value="Hello World"
- If I insert the target variable, it does not work, e.g., target.Patient.Allergies.(k1).AllergyID. For this value, compile fails with an InvalidName error
ERROR #1011: Invalid name : '##class(Ens.Util.Trace).WriteTrace("user","PHI.DTL.SDAtoACX","Transform",target.Patient.Allergies.(k1).AllergyID)'
- If I use curly braces, e.g., target.{Patient.Allergies.(k1).AllergyID}, I can compile without errors.
- The intermediate file shows the following: Do
##class(Ens.Util.Trace).WriteTrace("user","PHI.DTL.SDAtoACX","Transform",target.GetValueAt("Patient.Allergies.("_(k1)_").AllergyID"))
- When I send a document to the server, the process fails.
So, what is the proper syntax to see the value of the AllergyID during the DTL process?
Product version: Ensemble 2013.1