Question
· Jul 7, 2020

DTL vs. ObjectScript

As I've become a little more familiar with HealthShare, I'd like to start exploring different ways of doing things. To date, the bulk of my data transformations have been using DTL; only using ObjectScript for a few operations that write to external SQL tables that were largely based on examples provided by my sales engineer.

I'd like to trying doing all of the data transformation in a process using ObjectScript. This would be a much closer approach to my experience doing transforms using JavaScript in our other interface engine, and I think using this as a method to better learn the idiosynchronies of ObjectScript will serve me well.

To use "DTL-speak", I know how to get a value in the "source" inbound message, but not how to set a value in the "target" outbound message. In the simple example below, I'm grabbing the patient mrn from the inbound and looking to prefix it in the outbound message (a typical change). How is this accomplished?

Class TestClassName Extends Ens.BusinessProcess [ Language = objectscript ]
{
Method OnMessage(msgIn As EnsLib.HL7.Message, Output msgOut As EnsLib.HL7.Message) As %Status
{
set tSC = $$$OK
set patientMRN = msgIn.GetValueAt("PID:3.1")

//how do set this going out? Like this?
set msgOut.GetValueAt("PID:3.1") = "PRE"_patientMRN
}
}

Discussion (4)0
Log in or sign up to continue