Ejemplo n.º 1
0
        public void GetImplementationGuideVocabulary_Valueset3()
        {
            Template           t  = this.tdb.GenerateTemplate("1.2.3.4.5", "Document", "Test Template 1", this.ig);
            TemplateConstraint tc = this.tdb.GenerateConstraint(t, null, null, "code", "SHALL", "1..1", valueConformance: "SHALL", valueSet: this.vs3);

            tc.IsStatic = true;

            VocabService service = new VocabService(this.tdb);
            string       vocXml  = service.GetImplementationGuideVocabulary(ig.Id, 0, 1, "UTF-8");
            XmlDocument  doc     = new XmlDocument();

            doc.LoadXml(vocXml);

            XmlNamespaceManager nsManager = new XmlNamespaceManager(doc.NameTable);

            nsManager.AddNamespace("voc", "http://www.lantanagroup.com/voc");

            Assert.AreEqual("systems", doc.DocumentElement.LocalName);
            Assert.AreEqual(1, doc.DocumentElement.ChildNodes.Count);

            XmlElement exportValueSet = doc.DocumentElement.ChildNodes[0] as XmlElement;

            Assert.AreEqual(4, exportValueSet.ChildNodes.Count);
            Assert.IsNotNull(exportValueSet.SelectSingleNode("voc:code[@value='1']", nsManager));
            Assert.IsNotNull(exportValueSet.SelectSingleNode("voc:code[@value='2']", nsManager));
            Assert.IsNotNull(exportValueSet.SelectSingleNode("voc:code[@value='4']", nsManager));
            Assert.IsNotNull(exportValueSet.SelectSingleNode("voc:code[@value='5']", nsManager));
        }
Ejemplo n.º 2
0
        public void ProcessRequest(HttpContext context)
        {
            this.context = context;

            if (string.IsNullOrEmpty(ValueSetOid) && ImplementationGuideId == null)
            {
                return;
            }

            // TODO: Make this an actual call to the service, rather than an instatiation of the service
            VocabularyService service = new VocabularyService();

            context.Response.Clear();
            context.Response.ContentType = "text/xml";

            if (!string.IsNullOrEmpty(ValueSetOid))
            {
                context.Response.Write(service.GetValueSet(ValueSetOid, (int)VocabularyOutputType.Default, "UTF-8"));
            }
            else if (ImplementationGuideId != null)
            {
                context.Response.Write(service.GetImplementationGuideVocabulary(ImplementationGuideId.Value, MaxValueSetMembers, (int)VocabularyOutputType.Default, "UTF-8"));
            }

            context.Response.Flush();
            context.Response.End();
        }
Ejemplo n.º 3
0
        public void GetImplementationGuideVocabulary_NoStaticValuesets()
        {
            Template           t  = this.tdb.GenerateTemplate("1.2.3.4.5", "Document", "Test Template 1", this.ig);
            TemplateConstraint tc = this.tdb.GenerateConstraint(t, null, null, "code", "SHALL", "1..1", valueConformance: "SHALL", valueSet: this.vs1);

            tc.IsStatic = false;

            VocabService service = new VocabService(this.tdb);
            string       vocXml  = service.GetImplementationGuideVocabulary(ig.Id, 0, 1, "UTF-8");
            XmlDocument  doc     = new XmlDocument();

            doc.LoadXml(vocXml);

            Assert.AreEqual("systems", doc.DocumentElement.LocalName);
            Assert.AreEqual(0, doc.DocumentElement.ChildNodes.Count);
        }