示例#1
0
        public virtual void TestGetAttributeNameValuePairsExtensionNotFilled()
        {
            Identifier ii = new Identifier("11.22.33.44", null);
            IDictionary <string, string> result = new IiR2PropertyFormatterTest.TestableIiR2PropertyFormatter().GetAttributeNameValuePairsForTest
                                                      (new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl(new ModelToXmlResult(), null, "name", null, null
                                                                                                                                 , null, false), ii, new IIImpl(ii));

            Assert.AreEqual(1, result.Count, "map size");
            AssertKeyValuePairInMap(result, "root", "11.22.33.44");
            AssertKeyNotInMap(result, "extension");
        }
示例#2
0
        public virtual void TestGetAttributeNameValuePairsForValidIIAsOid()
        {
            Identifier       ii               = new Identifier("11.22.33.44");
            II               iiHl7            = new IIImpl();
            ModelToXmlResult modelToXmlResult = new ModelToXmlResult();

            Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl context = new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl
                                                                                                (modelToXmlResult, null, "name", "II", null, null, false, SpecificationVersion.R02_04_02, null, null, null, false);
            IDictionary <string, string> result = new IiR2PropertyFormatterTest.TestableIiR2PropertyFormatter().GetAttributeNameValuePairsForTest
                                                      (context, ii, iiHl7);

            Assert.AreEqual(1, result.Count, "map size");
            Assert.IsTrue(modelToXmlResult.GetHl7Errors().IsEmpty(), "no errors");
            AssertKeyValuePairInMap(result, "root", "11.22.33.44");
        }
示例#3
0
        public virtual void TestGetAttributeNameValuePairsForInvalidIIAsUuid()
        {
            UUID             randomUUID       = UUID.RandomUUID();
            string           root             = randomUUID.ToString() + "_zyx";
            Identifier       ii               = new Identifier(root);
            II               iiHl7            = new IIImpl();
            ModelToXmlResult modelToXmlResult = new ModelToXmlResult();

            Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl context = new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl
                                                                                                (modelToXmlResult, null, "name", "II", null, null, false, SpecificationVersion.R02_04_02, null, null, null, false);
            IDictionary <string, string> result = new IiR2PropertyFormatterTest.TestableIiR2PropertyFormatter().GetAttributeNameValuePairsForTest
                                                      (context, ii, iiHl7);

            Assert.AreEqual(1, result.Count, "map size");
            Assert.IsFalse(modelToXmlResult.GetHl7Errors().IsEmpty());
            Assert.AreEqual(1, modelToXmlResult.GetHl7Errors().Count);
            Assert.AreEqual("root '" + root + "' must conform to be either a UUID, RUID, or OID.", modelToXmlResult.GetHl7Errors()[0]
                            .GetMessage());
            AssertKeyValuePairInMap(result, "root", root);
        }
示例#4
0
        public virtual void TestGetAttributeNameValuePairsForValidII()
        {
            Identifier ii = new Identifier("11.22.33.44", "extensionString");

            ii.AssigningAuthorityName = "aaName";
            ii.Displayable            = "d_true";
            II iiHl7 = new IIImpl();

            iiHl7.DataType = StandardDataType.II;
            ModelToXmlResult modelToXmlResult = new ModelToXmlResult();

            Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl context = new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl
                                                                                                (modelToXmlResult, null, "name", "II", null, null, false, SpecificationVersion.R02_04_02, null, null, null, false);
            IDictionary <string, string> result = new IiR2PropertyFormatterTest.TestableIiR2PropertyFormatter().GetAttributeNameValuePairsForTest
                                                      (context, ii, iiHl7);

            Assert.AreEqual(4, result.Count, "map size");
            Assert.IsTrue(modelToXmlResult.GetHl7Errors().IsEmpty(), "no errors");
            AssertKeyValuePairInMap(result, "root", "11.22.33.44");
            AssertKeyValuePairInMap(result, "extension", "extensionString");
            AssertKeyValuePairInMap(result, "assigningAuthorityName", "aaName");
            AssertKeyValuePairInMap(result, "displayable", "d_true");
        }