Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vinayaroratech opened this issue Jul 10, 2023 · 1 comment

Comments

@vinayaroratech
Copy link

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

@justin-fyfe
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants