Пример #1
0
        /// <summary>
        /// Creates a default offline cached ArtifactResolver
        /// Default only searches in the executable directory files and the core zip.
        /// </summary>
        public static ArtifactResolver CreateOffline()
        {
            // Making requests to a WebArtifactSource is time consuming. So for performance we have an Offline Resolver.
            IArtifactSource multi = new MultiArtifactSource(new FileDirectoryArtifactSource(true), ZipArtifactSource.CreateValidationSource());

            return(new ArtifactResolver(new CachedArtifactSource(multi)));
        }
Пример #2
0
        public void RetrieveArtifactMulti()
        {
            var resolver = new MultiArtifactSource(ZipArtifactSource.CreateValidationSource(), new WebArtifactSource());

            var vs = resolver.LoadConformanceResourceByUrl("http://hl7.org/fhir/ValueSet/v2-0292");
            Assert.IsNotNull(vs);
            Assert.IsTrue(vs is ValueSet);

            using (var a = resolver.LoadArtifactByName("patient.sch"))
            {
                Assert.IsNotNull(a);
            }

            var artifact = resolver.LoadConformanceResourceByUrl("http://fhir-dev.healthintersections.com.au/open/StructureDefinition/flag");

            Assert.IsNotNull(artifact);
            Assert.IsTrue(artifact is StructureDefinition);
            Assert.AreEqual("Flag", ((StructureDefinition)artifact).Name);
        }
Пример #3
0
 /// <summary>
 /// Creates a default offline cached ArtifactResolver
 /// Default only searches in the executable directory files and the core zip. 
 /// </summary>
 public static ArtifactResolver CreateOffline()
 {
     // Making requests to a WebArtifactSource is time consuming. So for performance we have an Offline Resolver.
     IArtifactSource multi = new MultiArtifactSource(new FileDirectoryArtifactSource(true), ZipArtifactSource.CreateValidationSource());
     return new ArtifactResolver(new CachedArtifactSource(multi));
 }