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