Esempio n. 1
0
        public void IVLExampleTest02()
        {
            IVL <TS> currentlyOccuring = new IVL <TS>(DateTime.Now);

            currentlyOccuring.NullFlavor = NullFlavor.Other;
            Console.WriteLine(currentlyOccuring.ToString());
            Assert.IsFalse(currentlyOccuring.Validate());
        }
Esempio n. 2
0
        public void IVLExampleTest01()
        {
            // create new timestamp interval
            IVL <TS> currentlyOccuring = new IVL <TS>(DateTime.Now);

            currentlyOccuring.NullFlavor = null;
            Console.WriteLine(currentlyOccuring.ToString());
            Assert.IsTrue(currentlyOccuring.Validate());
        }
Esempio n. 3
0
        public void IVLNULLNullflavorHighLowIncludedHighIncludedWidthValidationTest()
        {
            IVL <INT> ivl = new IVL <INT>();

            ivl.NullFlavor = null;
            ivl.High       = null;
            ivl.LowClosed  = null;
            ivl.HighClosed = null;
            ivl.Width      = null;
            Assert.IsFalse(ivl.Validate());
        }
Esempio n. 4
0
        public void ConstructingIVLTest01()
        {
            // Using low/high
            IVL <TS> janStart = new IVL <TS>(
                new TS(new DateTime(2012, 01, 01), DatePrecision.Day),
                new TS(new DateTime(2012, 01, 01), DatePrecision.Day)
                );

            janStart.NullFlavor = null;
            Assert.IsTrue(janStart.Validate());
        }
Esempio n. 5
0
        public void IVLValidationNULLNullflavorHighLowIncludedHighIncludedWidthPOPLowTest()
        {
            IVL <INT> ivl = new IVL <INT>();

            ivl.NullFlavor = null;
            ivl.High       = null;
            ivl.LowClosed  = null;
            ivl.HighClosed = null;
            ivl.Width      = null;
            ivl.Low        = 0;
            Assert.IsTrue(ivl.Validate());
        }
Esempio n. 6
0
        public void IVLValidationNULLHighLowIncludedHighIncludedWidthPOPNullflavorLowTest()
        {
            IVL <INT> ivl = new IVL <INT>();

            ivl.High       = null;
            ivl.LowClosed  = null;
            ivl.HighClosed = null;
            ivl.Width      = null;
            ivl.Low        = 0;
            ivl.NullFlavor = NullFlavor.NotAsked;
            Assert.IsFalse(ivl.Validate());
        }
Esempio n. 7
0
        public void IVLValidationNULLNullflavorLowLowIncludedHighIncludedPOPHighWidthTest()
        {
            IVL <INT> ivl = new IVL <INT>();

            ivl.NullFlavor = null;
            ivl.Low        = null;
            ivl.LowClosed  = null;
            ivl.HighClosed = null;
            ivl.High       = 10;
            ivl.Width      = 5;
            Assert.IsTrue(ivl.Validate());
        }//Should validate
Esempio n. 8
0
        public void ConstructingIVLTest02()
        {
            // Using low/width
            IVL <TS> janStartLow = new IVL <TS>()
            {
                Low   = new TS(new DateTime(2012, 01, 01), DatePrecision.Day),
                Width = new PQ(15, "d")
            };

            janStartLow.NullFlavor = null;
            Assert.IsTrue(janStartLow.Validate());
        }
Esempio n. 9
0
        public void ConstructingIVLTest03()
        {
            // Using high/width
            IVL <TS> janStartHigh = new IVL <TS>()
            {
                Width = new PQ(15, "d"),
                High  = new TS(new DateTime(2012, 01, 05), DatePrecision.Day)
            };

            janStartHigh.NullFlavor = null;
            Assert.IsTrue(janStartHigh.Validate());
        }
Esempio n. 10
0
        public void ConstructingIVLTest04()
        {
            // Using low
            IVL <TS> janStart = new IVL <TS>()
            {
                Low  = new TS(new DateTime(2012, 01, 05), DatePrecision.Day),
                High = new TS(new DateTime(2012, 01, 05), DatePrecision.Day)
            };

            janStart.NullFlavor = NullFlavor.Unknown;
            Assert.IsFalse(janStart.Validate());
        }
Esempio n. 11
0
        public void ConstructingIVLTest05()
        {
            // Using low
            IVL <TS> janStart = new IVL <TS>()
            {
                LowClosed = true,
                //Low = new TS(new DateTime(2012, 01, 05), DatePrecision.Day),
                High = new TS(new DateTime(2012, 01, 05), DatePrecision.Day)
            };

            Assert.IsFalse(janStart.Validate());
        }
Esempio n. 12
0
        public void IVLValidationNULLNullflavorLowHighWidthPOPHighIncludedLowIncludedTest()
        {
            IVL <INT> ivl = new IVL <INT>();

            ivl.NullFlavor = null;
            ivl.Low        = null;
            ivl.High       = null;
            ivl.Width      = null;
            ivl.HighClosed = true;
            ivl.LowClosed  = true;
            Assert.IsFalse(ivl.Validate());
        }
Esempio n. 13
0
        public void IVLValidationNULLLowLowIncludedHighIncludedHighWidthValuePOPNullflavorTest()
        {
            IVL <INT> ivl = new IVL <INT>();

            ivl.Low        = null;
            ivl.LowClosed  = null;
            ivl.HighClosed = null;
            ivl.High       = null;
            ivl.Width      = null;
            ivl.Value      = null;
            ivl.NullFlavor = NullFlavor.NotAsked;
            Assert.IsTrue(ivl.Validate());
        }
Esempio n. 14
0
        public void IVLValidationNULLNullflavorLowIncludedHighIncludedPOPLowHighWidthValueTest()
        {
            IVL <INT> ivl = new IVL <INT>();

            ivl.Low        = 0;
            ivl.LowClosed  = null;
            ivl.HighClosed = null;
            ivl.High       = 5;
            ivl.Width      = 5;
            ivl.Value      = 1;
            ivl.NullFlavor = null;
            Assert.IsTrue(ivl.Validate());
        }
Esempio n. 15
0
        public void ConstructingIVLTest07()
        {
            // Using low
            IVL <TS> janStart = new IVL <TS>();

            janStart.Value      = null;
            janStart.NullFlavor = null;
            janStart.High       = null;
            janStart.Low        = null;
            janStart.HighClosed = null;
            janStart.LowClosed  = null;
            Assert.IsFalse(janStart.Validate());
        }
Esempio n. 16
0
        public void ConstructingIVLTest06()
        {
            // Using low
            IVL <TS> janStart = new IVL <TS>()
            {
                HighClosed = true,
                Low        = new TS(new DateTime(2012, 01, 05), DatePrecision.Day),
                // High = new TS(new DateTime(2012, 01, 05), DatePrecision.Day)
            };

            janStart.NullFlavor = null;
            Assert.IsFalse(janStart.Validate());
        }
Esempio n. 17
0
        public void IvlToSetTest01()
        {
            IVL <INT> interval = new IVL <INT>(1, 10)
            {
                HighClosed = true
            };

            foreach (var i in interval.ToSet())
            {
                Console.WriteLine(i);
            }
            interval.NullFlavor = null;
            Assert.IsTrue(interval.Validate());
        }
Esempio n. 18
0
        public void IVL_INTSerializationTest04()
        {
            IVL <INT> ivl = new IVL <INT>(null, 100)
            {
                Width      = 90,
                HighClosed = true
            };

            Assert.IsTrue(ivl.Validate());
            var expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" highClosed=""true""><high value=""100""/><width value=""90""/></test>";
            var actualXml   = R2SerializationHelper.SerializeAsString(ivl);

            R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
        }
Esempio n. 19
0
        public void IVL_TSSerializationTest03()
        {
            IVL <TS> ivl = new IVL <TS>(
                null,                                                  // low
                new TS(new DateTime(2008, 01, 31), DatePrecision.Day)  // high
                );

            ivl.Width      = new PQ(1, "w");
            ivl.HighClosed = true;

            Assert.IsTrue(ivl.Validate());
            var expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" highClosed=""true""><high value=""20080131""/><width value=""1"" unit=""w""/></test>";
            var actualXml   = R2SerializationHelper.SerializeAsString(ivl);

            R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
        }
Esempio n. 20
0
        public void IVL_PQParseTest02()
        {
            IVL <PQ> ivl = new IVL <PQ>(
                new PQ(1, "s"),
                new PQ(10, "s")
                );

            ivl.ValidTimeLow  = new TS(new DateTime(2008, 01, 01), DatePrecision.Day);
            ivl.ValidTimeHigh = new TS(new DateTime(2008, 01, 31), DatePrecision.Day);
            ivl.UpdateMode    = UpdateMode.Add;
            ivl.Width         = null;
            ivl.NullFlavor    = null;
            ivl.OriginalText  = "Test";

            // normalize the ivl expression
            Assert.IsTrue(ivl.Validate());
            var actualXml = R2SerializationHelper.SerializeAsString(ivl);
            var ivl2      = R2SerializationHelper.ParseString <IVL <PQ> >(actualXml);

            Assert.AreEqual(ivl, ivl2);
        }
Esempio n. 21
0
        public void IVL_PQSerializationTest01()
        {
            IVL <PQ> ivl = new IVL <PQ>(
                new PQ(1, "s"),
                new PQ(10, "s")
                );

            ivl.LowClosed     = true;
            ivl.HighClosed    = true;
            ivl.ValidTimeLow  = null;;
            ivl.ValidTimeHigh = null;
            ivl.UpdateMode    = null;
            ivl.Width         = null;
            ivl.NullFlavor    = null;

            Assert.IsTrue(ivl.Validate());
            var expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" lowClosed=""true"" highClosed=""true""><low value=""1"" unit=""s"" /><high value=""10"" unit=""s""/></test>";
            var actualXml   = R2SerializationHelper.SerializeAsString(ivl);

            R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
        }
Esempio n. 22
0
        public void IVL_PQParseTest01()
        {
            IVL <PQ> ivl = new IVL <PQ>(
                new PQ(1, "s"),
                new PQ(10, "s")
                );

            ivl.Width         = new PQ(1, "w");
            ivl.HighClosed    = true;
            ivl.ValidTimeLow  = null;;
            ivl.ValidTimeHigh = null;
            ivl.UpdateMode    = null;
            ivl.Width         = null;
            ivl.NullFlavor    = null;

            // normalize the ivl expression
            Assert.IsTrue(ivl.Validate());
            var actualXml = R2SerializationHelper.SerializeAsString(ivl);
            var ivl2      = R2SerializationHelper.ParseString <IVL <PQ> >(actualXml);

            Assert.AreEqual(ivl, ivl2);
        }
Esempio n. 23
0
        public void IVL_PQSerializationTest02()
        {
            IVL <PQ> ivl = new IVL <PQ>(
                new PQ(1, "s"),
                new PQ(10, "s")
                );

            ivl.ValidTimeLow  = new TS(new DateTime(2008, 01, 01), DatePrecision.Day);
            ivl.ValidTimeHigh = new TS(new DateTime(2008, 01, 31), DatePrecision.Day);
            ivl.UpdateMode    = UpdateMode.Add;
            ivl.LowClosed     = true;
            ivl.HighClosed    = true;
            ivl.Width         = null;
            ivl.OriginalText  = "Test";
            ivl.NullFlavor    = null;

            Assert.IsTrue(ivl.Validate());
            var expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" lowClosed=""true"" highClosed=""true"" validTimeLow=""20080101"" validTimeHigh=""20080131"" updateMode=""A""><originalText language=""en-US"" value=""Test"" /><low value=""1"" unit=""s"" /><high value=""10"" unit=""s"" /></test>";
            var actualXml   = R2SerializationHelper.SerializeAsString(ivl);

            R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
        }
Esempio n. 24
0
        public void IVL_INTSerializationTest04()
        {
            IVL<INT> ivl = new IVL<INT>(null, 100)
            {
                Width = 90,
                HighClosed = true
            };

            Assert.IsTrue(ivl.Validate());
            var expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" highClosed=""true""><high value=""100""/><width value=""90""/></test>";
            var actualXml = R2SerializationHelper.SerializeAsString(ivl);
            R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
        }
Esempio n. 25
0
 public void IVLValidationNULLNullflavorLowIncludedHighIncludedPOPLowHighWidthValueTest()
 {
     IVL<INT> ivl = new IVL<INT>();
     ivl.Low = 0;
     ivl.LowClosed = null;
     ivl.HighClosed = null;
     ivl.High = 5;
     ivl.Width = 5;
     ivl.Value = 1;
     ivl.NullFlavor = null;
     Assert.IsTrue(ivl.Validate());
 }
Esempio n. 26
0
 public void IVLValidationNULLNullflavorHighLowIncludedHighIncludedWidthPOPLowTest()
 {
     IVL<INT> ivl = new IVL<INT>();
     ivl.NullFlavor = null;
     ivl.High = null;
     ivl.LowClosed = null;
     ivl.HighClosed = null;
     ivl.Width = null;
     ivl.Low = 0;
     Assert.IsTrue(ivl.Validate());
 }
Esempio n. 27
0
 public void IvlToSetTest01()
 {
     IVL<INT> interval = new IVL<INT>(1, 10)
     {
         HighClosed = true
     };
     foreach (var i in interval.ToSet())
         Console.WriteLine(i);
     interval.NullFlavor = null;
     Assert.IsTrue(interval.Validate());
 }
Esempio n. 28
0
 public void SXCMNullValueTest()
 {
     SXCM<TEL> sxcm = new IVL<TEL>();
     sxcm.Value = null;
     Assert.IsFalse(sxcm.Validate());
 }
Esempio n. 29
0
 public void IVLValidationNULLLowLowIncludedHighIncludedHighWidthValuePOPNullflavorTest()
 {
     IVL<INT> ivl = new IVL<INT>();
     ivl.Low = null;
     ivl.LowClosed = null;
     ivl.HighClosed = null;
     ivl.High = null;
     ivl.Width = null;
     ivl.Value = null;
     ivl.NullFlavor = NullFlavor.NotAsked;
     Assert.IsTrue(ivl.Validate());
 }
Esempio n. 30
0
 public void IVLExampleTest04()
 {
     IVL<TS> currentlyOccuring = new IVL<TS>();
     currentlyOccuring.NullFlavor = null;
     Console.WriteLine(currentlyOccuring.ToString());
     Assert.IsFalse(currentlyOccuring.Validate());
 }
Esempio n. 31
0
 public void ConstructingIVLTest02()
 {
     // Using low/width
     IVL<TS> janStartLow = new IVL<TS>()
     {
         Low = new TS(new DateTime(2012, 01, 01), DatePrecision.Day),
         Width = new PQ(15, "d")
     };
     janStartLow.NullFlavor = null;
     Assert.IsTrue(janStartLow.Validate());
 }
Esempio n. 32
0
 public void ConstructingIVLTest04()
 {
     // Using low
     IVL<TS> janStart = new IVL<TS>()
     {
         Low = new TS(new DateTime(2012, 01, 05), DatePrecision.Day),
         High = new TS(new DateTime(2012, 01, 05), DatePrecision.Day)
     };
     janStart.NullFlavor = NullFlavor.Unknown;
     Assert.IsFalse(janStart.Validate());
 }
Esempio n. 33
0
 public void IVLValidationNULLHighLowIncludedHighIncludedWidthPOPNullflavorLowTest()
 {
     IVL<INT> ivl = new IVL<INT>();
     ivl.High = null;
     ivl.LowClosed = null;
     ivl.HighClosed = null;
     ivl.Width = null;
     ivl.Low = 0;
     ivl.NullFlavor = NullFlavor.NotAsked;
     Assert.IsFalse(ivl.Validate());
 }
Esempio n. 34
0
        public void IVL_PQParseTest02()
        {
           IVL<PQ> ivl = new IVL<PQ>(
                new PQ(1, "s"),
                new PQ(10, "s")
            );

            ivl.ValidTimeLow = new TS(new DateTime(2008, 01, 01), DatePrecision.Day);
            ivl.ValidTimeHigh = new TS(new DateTime(2008, 01, 31), DatePrecision.Day);
            ivl.UpdateMode = UpdateMode.Add;
            ivl.Width = null;
            ivl.NullFlavor = null;
            ivl.OriginalText = "Test";

            // normalize the ivl expression
            Assert.IsTrue(ivl.Validate());
            var actualXml = R2SerializationHelper.SerializeAsString(ivl);
            var ivl2 = R2SerializationHelper.ParseString<IVL<PQ>>(actualXml);
            Assert.AreEqual(ivl, ivl2);
        }
Esempio n. 35
0
 public void IVLExampleTest03()
 {
     IVL<TS> currentlyOccuring = new IVL<TS>();
     currentlyOccuring.NullFlavor = NullFlavor.Other;
     Console.WriteLine(currentlyOccuring.ToString());
     Assert.IsTrue(currentlyOccuring.Validate());
 }
Esempio n. 36
0
        public void IVL_TSSerializationTest03()
        {
            IVL<TS> ivl = new IVL<TS>(
                null,                                                   // low
                new TS(new DateTime(2008, 01, 31), DatePrecision.Day)  // high
                );

            ivl.Width = new PQ(1, "w");
            ivl.HighClosed = true;

            Assert.IsTrue(ivl.Validate());
            var expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" highClosed=""true""><high value=""20080131""/><width value=""1"" unit=""w""/></test>";
            var actualXml = R2SerializationHelper.SerializeAsString(ivl);
            R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
        }
Esempio n. 37
0
 public void IVLValidationNULLNullflavorLowLowIncludedHighIncludedPOPHighWidthTest()
 {
     IVL<INT> ivl = new IVL<INT>();
     ivl.NullFlavor = null;
     ivl.Low = null;
     ivl.LowClosed = null;
     ivl.HighClosed = null;
     ivl.High = 10;
     ivl.Width = 5;
     Assert.IsTrue(ivl.Validate());
 }//Should validate
Esempio n. 38
0
 public void IVLNULLNullflavorHighLowIncludedHighIncludedWidthValidationTest()
 {
     IVL<INT> ivl = new IVL<INT>();
     ivl.NullFlavor = null;
     ivl.High = null;
     ivl.LowClosed = null;
     ivl.HighClosed = null;
     ivl.Width = null;
     Assert.IsFalse(ivl.Validate());
 }
Esempio n. 39
0
 public void IVLExampleTest01()
 {
     // create new timestamp interval
     IVL<TS> currentlyOccuring = new IVL<TS>(DateTime.Now);
     currentlyOccuring.NullFlavor = null;
     Console.WriteLine(currentlyOccuring.ToString());
     Assert.IsTrue(currentlyOccuring.Validate());
 }
Esempio n. 40
0
 public void ConstructingIVLTest07()
 {
     // Using low
     IVL<TS> janStart = new IVL<TS>();
     janStart.Value = null;
     janStart.NullFlavor = null;
     janStart.High = null;
     janStart.Low = null;
     janStart.HighClosed = null;
     janStart.LowClosed = null;
     Assert.IsFalse(janStart.Validate());
 }
Esempio n. 41
0
 public void ConstructingIVLTest05()
 {
     // Using low
     IVL<TS> janStart = new IVL<TS>()
     {
         LowClosed = true,
         //Low = new TS(new DateTime(2012, 01, 05), DatePrecision.Day),
         High = new TS(new DateTime(2012, 01, 05), DatePrecision.Day)
     };
     Assert.IsFalse(janStart.Validate());
 }
Esempio n. 42
0
        public void IVL_PQParseTest01()
        {
            IVL<PQ> ivl = new IVL<PQ>(
                new PQ(1, "s"),
                new PQ(10, "s")
            );

            ivl.Width = new PQ(1, "w");
            ivl.HighClosed = true;
            ivl.ValidTimeLow = null; ;
            ivl.ValidTimeHigh = null;
            ivl.UpdateMode = null;
            ivl.Width = null;
            ivl.NullFlavor = null;

            // normalize the ivl expression
            Assert.IsTrue(ivl.Validate());
            var actualXml = R2SerializationHelper.SerializeAsString(ivl);
            var ivl2 = R2SerializationHelper.ParseString<IVL<PQ>>(actualXml);
            Assert.AreEqual(ivl, ivl2);
        }
Esempio n. 43
0
 public void ConstructingIVLTest03()
 {
     // Using high/width
     IVL<TS> janStartHigh = new IVL<TS>()
     {
         Width = new PQ(15, "d"),
         High = new TS(new DateTime(2012, 01, 05), DatePrecision.Day)
     };
     janStartHigh.NullFlavor = null;
     Assert.IsTrue(janStartHigh.Validate());
 }
Esempio n. 44
0
        public void IVL_PQSerializationTest03()
        {
            PQ low = new PQ(1, "s");
            low.CodingRationale = new SET<CodingRationale>(
                CodingRationale.Required
                );

            PQ high = new PQ(10, "s");
            high.CodingRationale = new SET<CodingRationale>(
                CodingRationale.Required
                );

            IVL<PQ> ivl = new IVL<PQ>(
                low, high
            );

            ivl.ValidTimeLow = new TS(new DateTime(2008, 01, 01), DatePrecision.Day);
            ivl.ValidTimeHigh = new TS(new DateTime(2008, 01, 31), DatePrecision.Day);
            ivl.UpdateMode = UpdateMode.Add;
            ivl.Width = null;
            ivl.LowClosed = true;
            ivl.HighClosed = true;
            ivl.NullFlavor = null;
            ivl.OriginalText = "Test";

            Assert.IsTrue(ivl.Validate());
            var expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" lowClosed=""true"" highClosed=""true"" validTimeLow=""20080101"" validTimeHigh=""20080131"" updateMode=""A"" ><originalText language=""en-US"" value=""Test"" /><low value=""1"" unit=""s"" codingRationale=""Required""/><high value=""10"" unit=""s"" codingRationale=""Required""/></test>";
            var actualXml = R2SerializationHelper.SerializeAsString(ivl);
            R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
        } 
Esempio n. 45
0
 public void ConstructingIVLTest01()
 {
     // Using low/high
     IVL<TS> janStart = new IVL<TS>(
         new TS(new DateTime(2012, 01, 01), DatePrecision.Day),
         new TS(new DateTime(2012, 01, 01), DatePrecision.Day)
     );
     janStart.NullFlavor = null;
     Assert.IsTrue(janStart.Validate());
 }
Esempio n. 46
0
 public void SXCMValueTest1()
 {
     SXCM<TEL> sxcm = new IVL<TEL>();
     sxcm.Value = "HOLA";
     Assert.IsTrue(sxcm.Validate());
 }
Esempio n. 47
0
 public void ConstructingIVLTest06()
 {
     // Using low
     IVL<TS> janStart = new IVL<TS>()
     {
         HighClosed = true,
         Low = new TS(new DateTime(2012, 01, 05), DatePrecision.Day),
         // High = new TS(new DateTime(2012, 01, 05), DatePrecision.Day)
     };
     janStart.NullFlavor = null;
     Assert.IsFalse(janStart.Validate());
 }
Esempio n. 48
0
 public void IVLValidationNULLNullflavorLowHighWidthPOPHighIncludedLowIncludedTest()
 {
     IVL<INT> ivl = new IVL<INT>();
     ivl.NullFlavor = null;
     ivl.Low = null;
     ivl.High = null;
     ivl.Width = null;
     ivl.HighClosed = true;
     ivl.LowClosed = true;
     Assert.IsFalse(ivl.Validate());
 }
Esempio n. 49
0
 public void IVLExampleTest02()
 {
     IVL<TS> currentlyOccuring = new IVL<TS>(DateTime.Now);
     currentlyOccuring.NullFlavor = NullFlavor.Other;
     Console.WriteLine(currentlyOccuring.ToString());
     Assert.IsFalse(currentlyOccuring.Validate());
 }
Esempio n. 50
0
        public void IVL_PQSerializationTest01()
        {
            IVL<PQ> ivl = new IVL<PQ>(
                new PQ(1, "s"),
                new PQ(10, "s")
            );

            ivl.LowClosed = true;
            ivl.HighClosed = true;
            ivl.ValidTimeLow = null; ;
            ivl.ValidTimeHigh = null;
            ivl.UpdateMode = null;
            ivl.Width = null;
            ivl.NullFlavor = null;

            Assert.IsTrue(ivl.Validate());
            var expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" lowClosed=""true"" highClosed=""true""><low value=""1"" unit=""s"" /><high value=""10"" unit=""s""/></test>";
            var actualXml = R2SerializationHelper.SerializeAsString(ivl);
            R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
        }