Proper syntax for setting values of HL7 Messages from COS

105 views
Skip to first unread message

Adam

unread,
Nov 4, 2009, 7:36:24 PM11/4/09
to InterSystems: Ensemble in Healthcare
I am looking to build HL7 messages from legacy globals and passing it
to a production for routing and data transformation. I am struggling
with the proper syntax for creating the HL7 message individual
properties from a class method using cache object script. I have
searched the doc books but what I am finding is the syntax for BPL’s
and DTL’s….Is there any documentation for creating and HL7 message
from scratch? Or am I going about this the wrong way? It would appear
that the syntax that I have seen so far relies on the VDoc paths.

Suggestions or examples would be great.
Thanks

David Loveluck

unread,
Nov 4, 2009, 10:32:59 PM11/4/09
to ensemble-in...@googlegroups.com

Adam

 

I assume that you are referring to seeing references to syntax of the form HL7.{PID:3.1} or similar.

 

The primary COS equivalents are the GetValueAt() and SetValueAt() methods or the EnsLib.HL7.Message class.

 

The best documentation for these methods is 'documatic'. That is the class reference documentation see in the top strip menu of the documentation home page. You can get to the same place from the studio using the menu options View --> Show Class Documentation. In either case you just need to make sure you are in the right namespace (top left) and then navigate to the right class.

 

For example

 

<assign property='target.{PIDgrp.PID:PatientIdentifierList(1).ID}' value='123456789' action='set'/>

 

is equivalent to

 

Set   tSC1=target.SetValueAt(123456789,"PIDgrp.PID:PatientIdentifierList(1).ID"

 

(Although you don't need action='set' because it is the default).

 

[line wraps may have confused this example]

 

There are lots of other useful methods of EnsLib.HL7.Message and EnsLib.HL7.Segment so browse documatic.

 

Dave

 

PS:  A brilliant way to find COS equivalents of DTL is to write DTL that is as close to what you want as possible, and then use the "View Other" button in the studion twice to see the generated code in zTransform. It is generated code and not supposed to be viewed, so it is all scrunched up, but if you are happy reading COS it can give a lot of insights in how to do conditionals and loops in complicated situations.

--

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

Adam

unread,
Nov 5, 2009, 12:41:50 PM11/5/09
to InterSystems: Ensemble in Healthcare
This is the code that I am using. It will save the message however it
does not create the PID segment. Am I missing somthing?

ClassMethod BuildFromGlobal()
{
Set target=##Class(EnsLib.HL7.Message).%New()
Set target.DocType="2.4:DFT_P03"
Set tSC=target.SetValueAt(123456789,"PIDgrp.PID:PatientIdentifierList
(1).ID")
Set sc=target.%Save()
Do target.%Close()
}

David Loveluck

unread,
Nov 5, 2009, 1:04:44 PM11/5/09
to ensemble-in...@googlegroups.com
Adam

there is no PIDgrp in this message type. The segment name is just "PID".
The status returned from SetValueAt() should contain an error to that
effect.

If you go to the message structure definitions in management portal and
hover over the segment in the message structure definition for this
message it will show you the name. If you click on the segment it will
show you the name at the top in a form you can copy and paste.

Also if you hover over the segment name when viewing the content of the
message you get the full name.

dave

David Loveluck
617 225 3122

-----Original Message-----
From: Adam [mailto:asie...@interpathlab.com]
Sent: Thursday, November 05, 2009 12:42 PM
To: InterSystems: Ensemble in Healthcare
Subject: [InterSystems-EnsHlth] Re: Proper syntax for setting values of
HL7 Messages from COS

Reply all
Reply to author
Forward
0 new messages