I am trying to parse some clinical information from XML file that is standardized to HL7 V3 CDA standard .
Xml file :
To do this you can use the following code:
using(XmlStateReader xr = new XmlStateReader(XmlReader.Create(@"C:\path-to-file.xml")))
{
var fmtr = new XmlIts1Formatter();
fmtr.ValidateConformance = false;
fmtr.GraphAides.Add(new ClinicalDocumentDatatypeFormatter());
var parseResult = fmtr.Parse(xr, typeof(ClinicalDocument));
// There is a variable called structure which will contain your
var cda = parseResult.Structure as ClinicalDocument;
}
Not sure if that will help you transform, but that will read a CDA into a ClinicalDocument class.