Parse XML doc (Clinical Document Architecture-CDA,HL7 standard) using Everest Framework

后端 未结 3 1297
暗喜
暗喜 2021-02-07 22:07

I am trying to parse some clinical information from XML file that is standardized to HL7 V3 CDA standard .

Xml file :

 

        
3条回答
  •  误落风尘
    2021-02-07 22:55

    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.

提交回复
热议问题