Beispiel #1
0
        public void ExternalServiceValidateCodeTest()
        {
            var client = new FhirClient("http://ontoserver.csiro.au/dstu2_1");
            var svc    = new ExternalTerminologyService(client);

            // Do common tests for service
            testService(svc);

            // Any good external service should be able to handle this one
            var result = svc.ValidateCode("http://hl7.org/fhir/ValueSet/substance-code", code: "1166006", system: "http://snomed.info/sct");

            Assert.True(result.Success);
        }
Beispiel #2
0
        public void FallbackServiceValidateCodeTest()
        {
            var client   = new FhirClient("http://ontoserver.csiro.au/dstu2_1");
            var external = new ExternalTerminologyService(client);
            var local    = new LocalTerminologyService(_resolver);
            var svc      = new FallbackTerminologyService(local, external);

            testService(svc);

            // Now, this should fall back
            var result = svc.ValidateCode("http://hl7.org/fhir/ValueSet/substance-code", code: "1166006", system: "http://snomed.info/sct");

            Assert.True(result.Success);
        }
Beispiel #3
0
        public void FallbackServiceValidateCodeTestWithVS()
        {
            var client  = new FhirClient("http://ontoserver.csiro.au/dstu2_1");
            var service = new ExternalTerminologyService(client);
            var vs      = _resolver.FindValueSet("http://hl7.org/fhir/ValueSet/substance-code");

            Assert.NotNull(vs);

            // Override the canonical with something the remote server cannot know
            vs.Url = "http://furore.com/fhir/ValueSet/testVS";
            var local    = new LocalTerminologyService(new IKnowOnlyMyTestVSResolver(vs));
            var fallback = new FallbackTerminologyService(local, service);

            // Now, this should fall back to external + send our vs (that the server cannot know about)
            var result = fallback.ValidateCode("http://furore.com/fhir/ValueSet/testVS", code: "1166006", system: "http://snomed.info/sct");

            Assert.True(result.Success);
        }