I am wondering if I could get some suggestions on the best way to use the data from an HL7 Order Message to format a text file like the image attached.
I’m not familiar with HRL, I see that it lets you name segments, but I’m not sure how that would help with this? I’m also not great with tcl, I just do the basics.
I have a VRL set up with the data elements I need. I’m just not sure what the next step should be.
I am new myself. My best advice, use Google to find the TCL commands you’d like to use. I knew nothing about TCL (or much about coding in general) but successfully put together a volume reporting feature on our Cloverleaf Engine by searching the internet for code snippets. I was able to create a directory of text files that were organized pretty intuitively.
A broad solution is that you will want to break down the message using the delimiters and assign the specific fields to variables. After that you will want to format the output using tabs and newlines, along with your stored variables.
A few searches you may want to perform:
“TCL open and write to text file”
“TCL list commands”
“TCL splitting a string”
TCL seems intimidating, but using the Testing tool in Cloverleaf can help out a lot. If you create the TCL in Cloverleaf, you’ll be able to see the output using the Testing tool.