How to convert Hl7 2.3 to XML in Ensemble 2010.

95 views
Skip to first unread message

Ankur Saini

unread,
Nov 16, 2011, 11:31:31 AM11/16/11
to ensemble-in...@googlegroups.com
Hello Everyone,
 
Does anyone have experience how to convert HL7 message to XML in 2010?
The input will be in HL7 format and output will be XML.
 
Thanks in advance...
 
Regards,
AS
 
 
 
 
 

Marc Lang

unread,
Nov 16, 2011, 11:53:39 AM11/16/11
to ensemble-in...@googlegroups.com
Hi Ankur,

My recommendation would be to start with the schema of the XML you
need to build up.
I would then use the XML Schema Wizard in studio to generate classes
representing the structure based on this XSD.

From there, I would do a Data Transform mapping the HL7 message into
the target classes.

You could then project the object to XML.
Plenty of documentation in the Cache docs about how to project an object to XML.

> --
> 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

Ankur Saini

unread,
Nov 16, 2011, 12:31:48 PM11/16/11
to ensemble-in...@googlegroups.com
Thanks a lot Mike.....
 
Regards,
AS

Ted Peck

unread,
Nov 16, 2011, 1:55:26 PM11/16/11
to ensemble-in...@googlegroups.com, Ankur Saini
I'm afraid the schema-and-transform approach might be quite tedious.  You should also consider the alternative provided by EnsLib.HL7.Util.FormatSimpleXMLv2.  This is a helper class that first appeared in 2010.2 and provides an example of how to import and export HL7 objects directly from/to XML.  Using this concept each HL7 object can be expressed either as XML or as v2 pipe-and-hat.  You use it like this for example:

Set obj=##class(EnsLib.HL7.Message).ImportFromFile("C:\sampleADT.txt")
Do obj.OutputToDevice(,,"EnsLib.HL7.Util.FormatSimpleXMLv2")

Based on this example you could produce your own Format... class to produce whatever flavor of XML you require.

I think you should also consider your goals.  Most of the projects I've heard of involving v2 XML had little practical benefit.

Ted

David Loveluck

unread,
Nov 16, 2011, 1:55:53 PM11/16/11
to ensemble-in...@googlegroups.com
That is good but it depends on the nature of the XML you are producing.

If the XML is fairly simple then it is a very good approach. But if the XML is complex such as a CCD document or many of the other standard XML standards and you want to just extract a few fields, then object projection gets unwieldy.

At that point, it may be easier to use a combination of object script and XSLT.

As for the future: In the current field test version you could try the XML virtual document functionality provides and avoid instantiating the objects. And for people who want to generate CCD documents (which is the most common thing I hear) HealthShare Foundation (also in field test) will be a great help.


dave

Ankur Saini

unread,
Nov 16, 2011, 2:00:13 PM11/16/11
to ensemble-in...@googlegroups.com
Thank you everyone for your inputs.
 
Regards,
AS
Reply all
Reply to author
Forward
0 new messages