DTL : HL7 to XML

274 views
Skip to first unread message

Steve Roselius

unread,
May 3, 2009, 12:11:37 PM5/3/09
to InterSystems: Ensemble in Healthcare
Does anybody have a DTL which accepts an HL7 message as a source and
outputs an XML document as a target? Do I need the XSD to make this
work? I have no desire to re-invent the wheel if somebody else has
already done this, thanks.

Liang (Simon) Sha

unread,
May 3, 2009, 2:05:27 PM5/3/09
to Ensemble-in...@googlegroups.com, InterSystems: Ensemble in Healthcare
The easiest is to use ToEasyXML() of HL7 class

Do hl7.toEasyXML(.xml)

Sent from my iPhone

On May 3, 2009, at 9:20 AM, "Steve Roselius"

Ted Peck

unread,
May 3, 2009, 8:47:34 PM5/3/09
to Ensemble-in...@googlegroups.com, InterSystems: Ensemble in Healthcare
It all depends what kind of XML document you need. There are two basic
approaches:

1) Import an XSD to generate a tree of classes using the XML Schema wizard,
then use DTL to construct an instance of the desired class from the input
HL7 document. This is a good approach if you have an XSD and the schema it
represents is not too complex, and there are not too many kinds of HL7 input
documents you will be exporting.

2) write a method to generate XML directly from the input HL7 document,
simiilar to the way we generate HTML for the portal pages that display HL7
content. This is a good approach if you need to automatically generate XML
for many different kinds of input HL7 documents and you don't want to code a
lot of distinct DTLs nor generate a huge number of XML classes and object
instantiations of them to represent your output XML document.

ToEasyXML() is now deprecated - it was never documented nor recommended for
customer use and we found we didn't have a good use for it internally
either. The problem is, every XML output schema is different and there is
no such thing as generic XML output. We plan to supersede toEasyXML() with a
framework for calling customer-written HL7 importXML and exportXML methods
and examples of each.

Ted

Steve Roselius

unread,
May 3, 2009, 9:03:33 PM5/3/09
to InterSystems: Ensemble in Healthcare
The first of these two options is most appropriate for my needs I
think.

I have asked for the XSD so that I can build the class, then I can
populate an instance from the incoming HL7 message. That makes a
whole lot of sense to me and I guess it's where I was going with
this. Thanks Ted! (And Simon too.)
> > <rosel...@intersystems.com> wrote:
>
> >> Does anybody have a DTL which accepts an HL7 message as a source and
> >> outputs an XML document as a target?  Do I need the XSD to make this
> >> work?  I have no desire to re-invent the wheel if somebody else has
> >> already done this, thanks.- Hide quoted text -
>
> - Show quoted text -

Liang (Simon) Sha

unread,
May 3, 2009, 10:22:55 PM5/3/09
to Ensemble-in...@googlegroups.com
Steve,

Attached is a very simple ADT XSD. You could import it and then do the DTL from HL7 object as Ted suggested.
ADTMessage_v1_5.xsd

anaya

unread,
Feb 15, 2013, 4:12:00 PM2/15/13
to Ensemble-in...@googlegroups.com
Hello Ted,
 
I have been working in a project that will received an HL7 message (TCP) and it will deliver an XML doc (Web Service). I already imported all 17 XSD and created the classes using the XML Schema Wizard. I finished most of the DTL (17), but I was wondering if there another way to go, so looking into old post, I came up to this one and you were suggesting that we can create a methof that will generate the XML from the HL7, do you have any examples on how we do that with the HTML? I could give that a try. 
 
Regards,
 
Glenda 

Ted Peck

unread,
Feb 15, 2013, 4:24:08 PM2/15/13
to Ensemble-in...@googlegroups.com, anaya
Yes, in Ensemble there is a class called EnsLib.HL7.Util.FormatSimpleXMLv2.  It is a simple illustration of the concept but it doesn't conform to the XSDs.
In Ensemble 2012.2 there is another class called EnsLib.ITK.HL7.FormatXMLv2 that is probably closer to what you want.

It may be a bit of work to tune this the way you need it but it will probably run a lot faster than using DTL to construct objects and export them as XML. Also it could potentially work for all HL7 message types documents so it might be less code and easier to maintain.

Please let me know if this works out for you.

Ted
--
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
---
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare" group.
To unsubscribe from this group and stop receiving emails from it, send an email to Ensemble-in-Healt...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

anaya

unread,
Feb 18, 2013, 2:22:45 PM2/18/13
to Ensemble-in...@googlegroups.com, anaya, t...@intersystems.com
Thak you Ted,
 
I going to check the first class today and let you know if it works out for us. We are running Ensemble 2012.1.2, and I could not find the second class so I am not sure if it ia available.  Tomorrow I have some testing to do with the end-application (Web Service), do you know if the Web service configuration we have in Ensemble 2012.1.2 has proved reliable?  it is the first time we are doing this type of interface and we are not so sure it will work out well, even with us using the process HL7-Schema XSD, DTL and Web service. We tried to do some testing sending our XML to an EDI XML file business operation just to see if the whole process works and we keep getting an error
 
<PROPERTY DOES NOT EXIST>zOnMessage+1^EnsLib.EDI.XML.Operation.FileOperation.1 *Source,chl.prod.idxWeb.ADT -- logged as '-' number - @' Set tFilename=..Adapter.CreateTimestamp(##class(%Library.File).GetFilename($P(pRequest.Source,$C(13))),..Filename)'
 
We tried what it was suggested in this Post, create a subclass of the business operation, define a filename and set the message as a GlobalCharacterStream and we got the same error, using file outbound adapter.  In the error message we don`t even see the original filename, so we were wondering if we set the WebService right away, this error will not longer be an issue.. that is also why we want to try the another way by using Ens Lib Util formatSimpleXMLV2.
 
Any advice will greatly appreaciated.
 
Regards,
 
Glenda
To unsubscribe from this group, send email to Ensemble-in-Healthcare-unsub...@googlegroups.com

For more options, visit this group at http://groups.google.com/group/Ensemble-in-Healthcare?hl=en
---
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare" group.
To unsubscribe from this group and stop receiving emails from it, send an email to Ensemble-in-Healthcare+unsub...@googlegroups.com.

Ted Peck

unread,
Feb 18, 2013, 4:44:24 PM2/18/13
to anaya, Ensemble-in...@googlegroups.com
Hi Glenda,

I assume you're still using your object classes to represent the XML and populating instances using your DTL. This sort of object is not compatible with the EnsLib.EDI.XML classes.  Those are meant for representing XML as a virtual document and they are still "experimental", particularly in your 2012.1 version.  To output your objects as XML you will need to create a Business Operation that accepts the root class as input and exports it to a file, most likely using the %XML.Writer class.  Perhaps we could include such a BO class with our product but we haven't yet. It would be a little challenging because we can't really be sure what sort of XML enabled objects customers would send to it.

On the other hand, if you follow the alternative approach of building an XML formatting class to work with the HL7 object, your result will be a character stream and you could put that in a StreamContainer and send it to a standard File Passthrough Operation.

Finally, if you are intending to send this XML to a web service, then File Operations are probably not the thing to use.  In fact, I always advise customers sending HL7 to a Web Service not to use XML at all. If you have any choice in the design of the web service that will be receiving the HL7 data, please consider sending the HL7 as a simple string argument as our EnsLib.HL7.SOAPOperation does, or pre-processing the HL7 and sending the information in some format better suited to XML representation.

I recommend that you ask for some help from our support organization or your sales engineer because when constructing productions of this sort you need to understand how the various parts of Ensemble are meant to work together.

Best,
Ted

Kevin Mayfield

unread,
Feb 19, 2013, 1:43:12 AM2/19/13
to Ensemble-in...@googlegroups.com
The ITK class does exactly this, it may only be in 2012.2 which is where I used it.

anaya

unread,
Feb 19, 2013, 4:00:43 PM2/19/13
to Ensemble-in...@googlegroups.com, anaya, t...@intersystems.com
Hello Ted,
Thanks for replying; We wanted to try the alternative approach just to test the whole process, but the main project is to send the this XML (17 schemas/methods) to a WebService, I don`t have a choice in the matter. We already contacted Intersystem to follow on-site training, but next training session is jut in May.  I am going to keep reading the doc for SOAP messages and web service creation. If any question I am going to contact my support organisation.
 
 
 
Thanks,
 
Glenda
Reply all
Reply to author
Forward
0 new messages