Question
Viroj (Pat) Pad... · Jun 11, 2020

How to set HL7 value inside "code" in the DTL

Hello, In the DTL, is there a way to set a value for the HL7 data element in the code section? For example, set target.SetValueAt("PID:3(k1).1)") = mrn (mrn is the value returned from the SQL query) When I ran the test utility, I got this error message. ERROR ErrException: zTransform+27^testclass.TEST.1 *SetValueAt,EnsLib.HL7.Message -- logged as '-' number - @' set target.SetValueAt("PID:3(k1).1)") = mrn' I tried both target.SetValueAt("PID:3(k1).1)") and target.GetValueAt("PID:3(k1).1)"). That didn’t make a difference. The code still error out. Thank you in advance for your input.

00
2 0 3 201
Log in or sign up to continue

Replies

Hello Viroj,

You need to pass the value and path into the first and second parameters of SetValueAt respectively. Check out the following example:

Using Code and SetValueAt

Hi Vic,

I saw the document earlier, but I didn't know how to apply to my code. In my example, is the value = mrn and path = PID:3(k1).1?

Thank you,

You can find a bunch of examples of using SetValueAt around the community, but based on what you said yes that seems right.