예제 #1
0
        public void GetSomeBundledArtifacts()
        {
            var za = ZipArtifactSource.CreateValidationSource();

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

            using (var a = za.LoadArtifactByName("v3-codesystems.xml"))
            {
                Assert.IsNotNull(a);
            }

            using (var a = za.LoadArtifactByName("patient.xsd"))
            {
                Assert.IsNotNull(a);
            }
        }
        public void GetSomeArtifactsById()
        {
            var fa = ZipArtifactSource.CreateValidationSource();

            var vs = fa.LoadConformanceResourceByUrl("http://hl7.org/fhir/ValueSet/v2-0292");

            Assert.IsNotNull(vs);
            Assert.IsTrue(vs is ValueSet);

            vs = fa.LoadConformanceResourceByUrl("http://hl7.org/fhir/ValueSet/administrative-gender");
            Assert.IsNotNull(vs);
            Assert.IsTrue(vs is ValueSet);

            vs = fa.LoadConformanceResourceByUrl("http://hl7.org/fhir/ValueSet/location-status");
            Assert.IsNotNull(vs);
            Assert.IsTrue(vs is ValueSet);

            var rs = fa.LoadConformanceResourceByUrl("http://hl7.org/fhir/StructureDefinition/Condition");

            Assert.IsNotNull(rs);
            Assert.IsTrue(rs is StructureDefinition);

            rs = fa.LoadConformanceResourceByUrl("http://hl7.org/fhir/StructureDefinition/ValueSet");
            Assert.IsNotNull(rs);
            Assert.IsTrue(rs is StructureDefinition);

            var dt = fa.LoadConformanceResourceByUrl("http://hl7.org/fhir/StructureDefinition/Money");

            Assert.IsNotNull(dt);
            Assert.IsTrue(dt is StructureDefinition);

            // Try to find a core extension
            var ext = fa.LoadConformanceResourceByUrl("http://hl7.org/fhir/StructureDefinition/diagnosticorder-reason");

            Assert.IsNotNull(ext);
            Assert.IsTrue(ext is StructureDefinition);

            // Try to find an additional US profile (they are distributed with the spec for now)
            var us = fa.LoadConformanceResourceByUrl("http://hl7.org/fhir/StructureDefinition/uslab-dr");

            Assert.IsNotNull(us);
            Assert.IsTrue(us is StructureDefinition);
        }
예제 #3
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);
        }
예제 #4
0
        public void TestSetupIsOnce()
        {
            var fa = ZipArtifactSource.CreateValidationSource();

            var sw = new Stopwatch();

            sw.Start();
            var vs = fa.LoadConformanceResourceByUrl("http://hl7.org/fhir/v2/vs/0292");

            sw.Stop();

            var sw2 = new Stopwatch();

            sw2.Start();
            var vs2 = fa.LoadConformanceResourceByUrl("http://hl7.org/fhir/v2/vs/0292");

            sw2.Stop();

            Assert.IsTrue(sw2.ElapsedMilliseconds < sw.ElapsedMilliseconds);
            Debug.WriteLine(String.Format("First time {0}, second time {1}", sw.ElapsedMilliseconds, sw2.ElapsedMilliseconds));
        }
예제 #5
0
        public void ValidateConformanceInformationScanner()
        {
            var fa = ZipArtifactSource.CreateValidationSource();

            var allConformanceInformation = fa.ListConformanceResources();

            var dicomVS = allConformanceInformation.Where(ci => ci.ValueSetSystem == "http://nema.org/dicom/dicm").SingleOrDefault();

            Assert.IsNotNull(dicomVS);
            Assert.AreEqual("http://hl7.org/fhir/ValueSet/dicom-dcim", dicomVS.Url);
            Assert.AreEqual("DICOM Controlled Terminology Definitions", dicomVS.Name);

            var moneySD = allConformanceInformation.Where(ci => ci.Url == "http://hl7.org/fhir/StructureDefinition/Money").SingleOrDefault();

            Assert.IsNotNull(moneySD);
            Assert.AreEqual("http://hl7.org/fhir/StructureDefinition/Money", moneySD.Url);
            Assert.AreEqual("Money", moneySD.Name);

            var reasonEXT = allConformanceInformation.Where(ci => ci.Url == "http://hl7.org/fhir/StructureDefinition/diagnosticorder-reason").SingleOrDefault();

            Assert.IsNotNull(reasonEXT);
            Assert.AreEqual("http://hl7.org/fhir/StructureDefinition/diagnosticorder-reason", reasonEXT.Url);
            Assert.AreEqual("Reason for this order", reasonEXT.Name);
        }