Question
BRAD ANDERSON · Jul 31, 2017

M Global Data export to XML with schema

Have very little XML experience and have been able to manually create output. Have a need to take data that I store in a M global (example: ^TML("HDATA", ) and out put it in CCDA XML format.

Are there any examples of M code using the XMLWriter to accomplish this?

Or can anyone provide some guidance 

Any help would be greatly appreciated.

0
0 522
Discussion (2)1
Log in or sign up to continue

Do you have an XSD for your CCDA XML format? If so you can use the XML Schema Wizard to create the Cache classes that represent your XML Data. Then just read the data from your global into the generated classes and export to XML. I have done this many times for complicated medical data and it works very reliably.

Mike, thanks for the answer. I'm not exactly sure what you mean by XSD. We are converting from one EHR to another and need to output 2-3 years of PAMI data. I can gather the info in M and store in a temp global but not sure if it would need to be stored with element tags or not and then output in CCDA format. They provided a schema file but not sure what to do with it. At the moment I am a bit confused. I've read the Intersystems documents but the examples don't shed much light on how it all fits together.....but that could just be me having not done anything with classes or schema before. Any help would be great.