Extract a Value from Default Values Table in DTL

37 views
Skip to first unread message

Charles_b

unread,
May 10, 2012, 7:55:11 AM5/10/12
to Ensemble-in...@googlegroups.com
OK, so I've written a nice DTL which takes HL7 and wraps a custom XML wrapper around it for a text based interface.  One piece of the code maps a destination ID, but this may change, and rather than
create multiple versions of the DTL, I was hoping to use the Default Values table to 'lookup' the Destination ID.

Here's my code (the last 2 lines of the Code section), and the relevant global entry:

<code>
<![CDATA[ Set temp=$ZDATETIME($ZTIMESTAMP,3,1)
  Set target.header.appTs=temp
  Set DID=$G(^Ens.Config.DefaultSettingsD("QDIB.Production","destID","*","destID"))
  Set target.header.destId=$LG(DID,1)
]]>
</code>

Global: 
^Ens.Config.DefaultSettingsD("QDIB.Production","destID","*","destID") = $lb("LIS.SJC.UAT.MSG","")

The Global value is a List?  So, I set a local variable to hold the data then $LG to pull the 1st item in the list, but it's not working

I need to do this in DTL, as it's data not coming from within the body of the HL7 message, and I have to 
transform anyway, so a custom Business Process seems unnecessary

I don't get any error with the code, it just merrily performs the rest of the DTL and seems to ignore this section

Thanks
Charles

David Loveluck

unread,
May 10, 2012, 4:11:12 PM5/10/12
to ensemble-in...@googlegroups.com

Charles

 

You should never directly access the global structure underneath a persistent class. Apart from making life difficult for yourself, InterSystems reserve the right to change the way data is stored. I suggest you look at the documentation for Ens.Config.DefaultSettings.

 

I don’t know what you are trying to do exactly, so I don’t know what you mean when you say it ignores your code

 

dave

--
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare Community" group.
To post to this group, send email to Ensemble-in...@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healt...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/Ensemble-in-Healthcare?hl=en

Reply all
Reply to author
Forward
0 new messages