コード例 #1
0
        public static void Setup(TestContext context)
        {
            ExportTests.tdb = new MockObjectRepository();
            TrifoliaImporter importer = new TrifoliaImporter(ExportTests.tdb);

            ExportTests.tdb.InitializeFHIR3Repository();
            ExportTests.tdb.InitializeLCGAndLogin();

            string importContent = Helper.GetSampleContents(IMPORT_XML);
            var    importModel   = ImportModel.Deserialize(importContent);

            var importStatus = importer.Import(importModel);

            Assert.IsTrue(importStatus.Success, "Expected import to succeed");
            Assert.AreNotEqual(importStatus.ImplementationGuides.Count, 0, "Expected import to include implementation guides");

            ImplementationGuide ig = ExportTests.tdb.ImplementationGuides.SingleOrDefault(y => y.Id == importStatus.ImplementationGuides.First().InternalId);
            var schema             = ig.ImplementationGuideType.GetSimpleSchema();
            ImplementationGuideExporter exporter = new ImplementationGuideExporter(ExportTests.tdb, schema, "localhost", "http");

            ExportTests.exportedBundle = exporter.GetImplementationGuides(implementationGuideId: ig.Id, include: "ImplementationGuide:resource");

            ExportTests.exportedXml = FhirSerializer.SerializeResourceToXml(ExportTests.exportedBundle);

            Assert.IsNotNull(ExportTests.exportedXml);
        }
コード例 #2
0
        public static void Setup(TestContext context)
        {
            FHIRDSTU1ExportTest.tdb = new MockObjectRepository();
            TrifoliaImporter importer = new TrifoliaImporter(FHIRDSTU1ExportTest.tdb);

            FHIRDSTU1ExportTest.tdb.InitializeFHIRRepository();
            FHIRDSTU1ExportTest.tdb.InitializeLCGAndLogin();

            string importContent = Helper.GetSampleContents(IMPORT_XML);
            var    importModel   = ImportModel.Deserialize(importContent);

            var importStatus = importer.Import(importModel);

            Assert.IsTrue(importStatus.Success, "Expected import to succeed");
            Assert.AreNotEqual(importStatus.ImplementationGuides.Count, 0, "Expected import to include implementation guides");

            IGSettingsManager igManager = new IGSettingsManager(tdb, importStatus.ImplementationGuides.First().InternalId);

            TemplateImporter templateImporter = new TemplateImporter(tdb, shouldUpdate: true);

            FHIRDSTU1ExportTest.exportedXml = FHIRExporter.GenerateExport(tdb, templateImporter.Import(importModel.Template), igManager);

            Assert.IsNotNull(FHIRDSTU1ExportTest.exportedXml);
        }
コード例 #3
0
        public ImportStatusModel ImportTrifoliaModel(NativeModel model)
        {
            TrifoliaImporter importer = new TrifoliaImporter(this.tdb);

            return(importer.Import(model));
        }