everest icon indicating copy to clipboard operation
everest copied to clipboard

Error: Could not find a type to de-serialize 'ClinicalDocument' into @ /urn:hl7-org:v3#ClinicalDocument

Open vinayaroratech opened this issue 2 years ago • 1 comments

I'm using following code to parse the CCDA format .xml file in C#

var formatter = new XmlIts1Formatter();

            // Add CDA data types
            formatter.GraphAides.Add(new DatatypeFormatter() { CompatibilityMode = DatatypeFormatterCompatibilityMode.ClinicalDocumentArchitecture });

            // Disable validation
            formatter.ValidateConformance = false;

            // Open stream or data source
            using (var s = System.IO.File.OpenRead(filePath))
            {
                var result = formatter.Parse(s, typeof(ClinicalDocument).Assembly);
                var instance = result.Structure as ClinicalDocument;

                // do whatever you like with the CDA
            }

image

vinayaroratech avatar Jul 10 '23 15:07 vinayaroratech

You need to add a reference to the CDA model types in Everest to your project. You may also need to force the parsing to use ClinicalDocument using the generic version of the Parse method.

justin-fyfe avatar Jul 10 '23 17:07 justin-fyfe