Пример #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());
        }
Пример #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());
        }
Пример #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());
        }
Пример #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());
        }
Пример #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());
        }
Пример #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());
        }
Пример #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
Пример #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());
        }
Пример #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());
        }
Пример #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());
        }
Пример #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());
        }
Пример #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());
        }
Пример #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());
        }
Пример #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());
        }
Пример #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());
        }
Пример #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());
        }
Пример #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());
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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());
 }
Пример #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());
 }
Пример #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());
 }
Пример #28
0
 public void SXCMNullValueTest()
 {
     SXCM<TEL> sxcm = new IVL<TEL>();
     sxcm.Value = null;
     Assert.IsFalse(sxcm.Validate());
 }
Пример #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());
 }
Пример #30
0
 public void IVLExampleTest04()
 {
     IVL<TS> currentlyOccuring = new IVL<TS>();
     currentlyOccuring.NullFlavor = null;
     Console.WriteLine(currentlyOccuring.ToString());
     Assert.IsFalse(currentlyOccuring.Validate());
 }
Пример #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());
 }
Пример #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());
 }
Пример #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());
 }
Пример #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);
        }
Пример #35
0
 public void IVLExampleTest03()
 {
     IVL<TS> currentlyOccuring = new IVL<TS>();
     currentlyOccuring.NullFlavor = NullFlavor.Other;
     Console.WriteLine(currentlyOccuring.ToString());
     Assert.IsTrue(currentlyOccuring.Validate());
 }
Пример #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);
        }
Пример #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
Пример #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());
 }
Пример #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());
 }
Пример #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());
 }
Пример #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());
 }
Пример #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);
        }
Пример #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());
 }
Пример #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);
        } 
Пример #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());
 }
Пример #46
0
 public void SXCMValueTest1()
 {
     SXCM<TEL> sxcm = new IVL<TEL>();
     sxcm.Value = "HOLA";
     Assert.IsTrue(sxcm.Validate());
 }
Пример #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());
 }
Пример #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());
 }
Пример #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());
 }
Пример #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);
        }