/// <summary> /// Load a single CDA Document and extract the data and serialize to a XML file /// </summary> public static void LoadSingleCdaDocument() { try { XmlDocument cdaDocument = LoadDocument(@"AdvanceCareInformationSampleAuthorNonHealthcareProvider_3A_Max.xml"); ICdaDataExtractor cdaDataExtractor = new CdaDataExtractor(); CdaDocument uberModel = cdaDataExtractor.Extract(cdaDocument); // serialize to a XML file var result = Serialize(uberModel); File.WriteAllBytes("uber.xml", result); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
/// <summary> /// Load a single CDA Document and extract the data and serialize to a XML file /// </summary> public void LoadSingleCdaDocument() { try { XmlDocument cdaDocument = LoadDocument("CdaDocumentPath.xml"); ICdaDataExtractor cdaDataExtractor = new CdaDataExtractor(); CdaDocument uberModel = cdaDataExtractor.Extract(cdaDocument); // serialize to a XML file var result = Serialize(uberModel); File.WriteAllBytes("uber.xml", result); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
/// <summary> /// Load a multiple CDA Documents and extract the Metadata to a list and serialize to a XML file /// </summary> public void LoadMultipleCdaDocuments() { try { List <XmlDocument> cdaDocuments = LoadDocuments(new List <string> { "CdaDocumentPath1.xml", "CdaDocumentPath2.xml" }); ICdaDataExtractor cdaDataExtractor = new CdaDataExtractor(); List <CdaDocument> uberModel = cdaDataExtractor.Extract(cdaDocuments); // serialize to a XML file var result = Serialize(uberModel); File.WriteAllBytes("uber_multiple.xml", result); } catch (Exception ex) { Console.WriteLine(ex.Message); } }