public void ExpandProfile() { var expander = new ProfileExpander(_source); // This file will be found local to the test DLL, based on its it, not its url //var diff = (Profile)FhirParser.ParseResourceFromXml(File.ReadAllText(@"TestData\ProfileProcedureNO.xml")); var diff = (Profile)FhirParser.ParseResourceFromXml(File.ReadAllText(@"TestData\example-lipid-profile-differential.xml")); Assert.IsNotNull(diff); expander.Expand(diff); var snapshot = expander.Expand(diff); Assert.IsNotNull(diff); var xmlA = FhirSerializer.SerializeResourceToXml(diff); File.WriteAllText("c:\\temp\\expanded.xml", xmlA); var xmlE = File.ReadAllText(@"TestData\example-lipid-profile.xml"); XmlAssert.AreSame(xmlE, xmlA); }
public static void ExpandProfileFile(string inputfile, string outputfile) { var source = new CachedArtifactSource(ArtifactResolver.CreateOffline()); var expander = new ProfileExpander(source); string xml = File.ReadAllText(inputfile); var diff = (Profile)FhirParser.ParseResourceFromXml(xml); expander.Expand(diff); xml = FhirSerializer.SerializeResourceToXml(diff); File.WriteAllText(outputfile, xml); }
public void ExpandProfile() { var expander = new ProfileExpander(_source); // This file will be found local to the test DLL, based on its it, not its url //var diff = (Profile)FhirParser.ParseResourceFromXml(File.ReadAllText(@"TestData\ProfileProcedureNO.xml")); var diff = (Profile)FhirParser.ParseResourceFromXml(File.ReadAllText(@"TestData\example-lipid-profile-differential.xml")); Assert.IsNotNull(diff); expander.Expand(diff); var snapshot = expander.Expand(diff); Assert.IsNotNull(diff); var xmlA = FhirSerializer.SerializeResourceToXml(diff); File.WriteAllText("c:\\temp\\expanded.xml", xmlA); var xmlE = File.ReadAllText(@"TestData\example-lipid-profile.xml"); XmlAssert.AreSame(xmlE, xmlA); }
public void ExpandProfile() { var expander = new ProfileExpander(_source); // This file will be found local to the test DLL, based on its it, not its url var diff = (Profile)_source.ReadResourceArtifact(new Uri("http://test.nu/Profile/example-lipid-profile-differential")); Assert.IsNotNull(diff); var snapshot = expander.Expand(diff); Assert.IsNotNull(diff); var xml = FhirSerializer.SerializeResourceToXml(snapshot); File.WriteAllText("c:\\temp\\expanded.xml", xml); }