Exemple #1
0
        public void UpdateTagsUsingPost()
        {
            var rl = new ResourceLocation(latest.SelfLink);

            var update   = new Tag(NUTAG, Tag.FHIRTAGNS, "newVersion");
            var existing = new Tag(OTHERTAG, Tag.FHIRTAGNS);

            HttpTests.AssertSuccess(client, () => client.AffixTags(
                                        new List <Tag> {
                update
            }, ResourceType.Patient, rl.Id));

            var result = client.Fetch <Patient>(latest.Id);

            if (result.Tags.Count() != 2)
            {
                TestResult.Fail("update modified the number of tags");
            }

            if (!result.Tags.Any(t => t.Equals(existing)))
            {
                TestResult.Fail("update removed an existing but unchanged tag");
            }

            if (!result.Tags.Any(t => t.Equals(update) && t.Label == update.Label))
            {
                TestResult.Fail("update did not change the tag");
            }

            if (result.SelfLink != latest.SelfLink)
            {
                TestResult.Fail("updating the tags created a new version");
            }
        }
        public void ReadTags()
        {
            FhirClient client = new FhirClient(testEndpoint);

            var tags = new List <Tag>()
            {
                new Tag("http://readtag.nu.nl", Tag.FHIRTAGSCHEME_GENERAL, "readTagTest")
            };
            var identity = ResourceIdentity.Build("Location", "1");

            client.AffixTags(identity, tags);

            var affixedEntry = client.Read(identity);
            IEnumerable <Tag> list;

            //BP/EK: Our server can't yet do this (as noted above in the history test)
            // list = client.WholeSystemTags();
            // Assert.IsTrue(list.Any(t => t.Equals(tags.First())));

            list = client.TypeTags <Location>();
            Assert.IsTrue(list.Any(t => t.Equals(tags.First())));

            list = client.Tags(affixedEntry.SelfLink);
            Assert.IsTrue(list.Any(t => t.Equals(tags.First())));

            // BP: Furore server having issues with this at present (17 April 2014)
            // causes the test to fail
            client.DeleteTags(affixedEntry.SelfLink, tags);
            //TODO: verify tags have really been removed. Should generate random tag so this is repeatable
        }
Exemple #3
0
        public void ReadTags()
        {
            FhirClient client = new FhirClient(testEndpoint);

            var tags = new List <Tag>()
            {
                new Tag("http://readtag.nu.nl", "readTagTest")
            };

            client.AffixTags(tags, ResourceType.Location, "1");

            var list = client.GetTags();

            Assert.IsTrue(list.Any(t => t == tags.First()));

            list = client.GetTags(ResourceType.Location);
            Assert.IsTrue(list.Any(t => t == tags.First()));

            list = client.GetTags(ResourceType.Location, "1", "1");
            Assert.IsTrue(list.Any(t => t == tags.First()));

            client.DeleteTags(tags, ResourceType.Location, "1", "1");

            list = client.GetTags();
            Assert.IsFalse(list.Any(t => t == tags.First()));
        }
        public void ReadTags()
        {
            FhirClient client = new FhirClient(testEndpoint);

            var tags = new List <Tag>()
            {
                new Tag("http://readtag.nu.nl", Tag.FHIRTAGSCHEME_GENERAL, "readTagTest")
            };

            client.AffixTags <Location>(tags, "1");
            var affixedEntry = client.Read <Location>("1");
            var version      = new ResourceIdentity(affixedEntry.SelfLink).VersionId;
            var list         = client.GetTags();

            Assert.IsTrue(list.Any(t => t.Equals(tags.First())));

            list = client.GetTags <Location>();
            Assert.IsTrue(list.Any(t => t.Equals(tags.First())));

            list = client.GetTags <Location>("1", version);
            Assert.IsTrue(list.Any(t => t.Equals(tags.First())));

            client.DeleteTags <Location>(tags, "1", version);
        }
Exemple #5
0
        public void ReadTags()
        {
            FhirClient client = new FhirClient(testEndpoint);

            var tags = new List<Tag>() { new Tag("http://readtag.nu.nl", Tag.FHIRTAGNS, "readTagTest") };

            client.AffixTags(tags, ResourceType.Location, "1");

            var list = client.GetTags();
            Assert.IsTrue(list.Any(t => t == tags.First()));

            list = client.GetTags(ResourceType.Location);
            Assert.IsTrue(list.Any(t => t == tags.First()));

            list = client.GetTags(ResourceType.Location, "1", "1");
            Assert.IsTrue(list.Any(t => t == tags.First()));

            client.DeleteTags(tags, ResourceType.Location, "1", "1");

            list = client.GetTags();
            Assert.IsFalse(list.Any(t => t == tags.First()));
        }
        public void ReadTags()
        {
            FhirClient client = new FhirClient(testEndpoint);

            var tags = new List<Tag>() { new Tag("http://readtag.nu.nl", Tag.FHIRTAGSCHEME_GENERAL, "readTagTest") };
            var identity = ResourceIdentity.Build("Location", "1");

            client.AffixTags(identity, tags);

            var affixedEntry = client.Read(identity);
			IEnumerable<Tag> list;
			//BP/EK: Our server can't yet do this (as noted above in the history test)
			// list = client.WholeSystemTags();
            // Assert.IsTrue(list.Any(t => t.Equals(tags.First())));

            list = client.TypeTags<Location>();
            Assert.IsTrue(list.Any(t => t.Equals(tags.First())));

            list = client.Tags(affixedEntry.SelfLink);
            Assert.IsTrue(list.Any(t => t.Equals(tags.First())));

			// BP: Furore server having issues with this at present (17 April 2014)
			// causes the test to fail
            client.DeleteTags(affixedEntry.SelfLink, tags);
            //TODO: verify tags have really been removed. Should generate random tag so this is repeatable
        }