Example #1
0
 public SubstanceAdministration()
 {
     this.moodCode               = new CS_R2Impl <Ca.Infoway.Messagebuilder.Model.Cda_ab_shr.Domainvalue.x_DocumentSubstanceMood>();
     this.negationInd            = new BLImpl();
     this.typeId                 = new IIImpl();
     this.templateId             = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.id                     = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.code                   = new CD_R2Impl <Code>();
     this.text                   = new EDImpl <EncapsulatedData>();
     this.statusCode             = new CS_R2Impl <Code>();
     this.effectiveTime          = new LISTImpl <SXCM_R2 <MbDate>, MbDate>(typeof(SXCM_R2Impl <MbDate>));
     this.priorityCode           = new CE_R2Impl <Code>();
     this.repeatNumber           = new IVLImpl <INT, Interval <int?> >();
     this.routeCode              = new CE_R2Impl <Code>();
     this.approachSiteCode       = new LISTImpl <CD_R2 <Code>, CodedTypeR2 <Code> >(typeof(CD_R2Impl <Code>));
     this.doseQuantity           = new IVLImpl <PQ, Interval <PhysicalQuantity> >();
     this.rateQuantity           = new IVLImpl <PQ, Interval <PhysicalQuantity> >();
     this.maxDoseQuantity        = new RTOImpl <PhysicalQuantity, PhysicalQuantity>();
     this.administrationUnitCode = new CE_R2Impl <Code>();
     this.specimen               = new List <Ca.Infoway.Messagebuilder.Model.Cda_ab_shr.Basemodel.Specimen>();
     this.performer              = new List <Ca.Infoway.Messagebuilder.Model.Cda_ab_shr.Merged.Performer1>();
     this.author                 = new List <Ca.Infoway.Messagebuilder.Model.Cda_ab_shr.Basemodel.Author>();
     this.informant              = new List <Ca.Infoway.Messagebuilder.Model.Cda_ab_shr.Merged.Informant12>();
     this.participant            = new List <Ca.Infoway.Messagebuilder.Model.Cda_ab_shr.Merged.Participant1>();
     this.entryRelationship      = new List <Ca.Infoway.Messagebuilder.Model.Cda_ab_shr.Basemodel.EntryRelationship>();
     this.reference              = new List <Ca.Infoway.Messagebuilder.Model.Cda_ab_shr.Basemodel.Reference>();
     this.precondition           = new List <Ca.Infoway.Messagebuilder.Model.Cda_ab_shr.Basemodel.Precondition>();
 }
Example #2
0
 public SubstanceAdministration()
 {
     this.moodCode               = new CS_R2Impl <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Domainvalue.EvnIntMoodCode>();
     this.negationInd            = new BLImpl();
     this.typeId                 = new IIImpl();
     this.templateId             = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.id                     = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.code                   = new CD_R2Impl <Code>();
     this.text                   = new EDImpl <EncapsulatedData>();
     this.statusCode             = new CS_R2Impl <Code>();
     this.effectiveTime          = new LISTImpl <SXCM_R2 <MbDate>, MbDate>(typeof(SXCM_R2Impl <MbDate>));
     this.priorityCode           = new CE_R2Impl <Code>();
     this.repeatNumber           = new IVLImpl <INT, Interval <int?> >();
     this.routeCode              = new CE_R2Impl <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Domainvalue.MedicationRoute>();
     this.approachSiteCode       = new CD_R2Impl <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Domainvalue.BodySite>();
     this.doseQuantity           = new IVLImpl <PQ, Interval <PhysicalQuantity> >();
     this.rateQuantity           = new IVLImpl <PQ, Interval <PhysicalQuantity> >();
     this.maxDoseQuantity        = new RTOImpl <PhysicalQuantity, PhysicalQuantity>();
     this.administrationUnitCode = new CE_R2Impl <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Domainvalue.MedicationProductForm>();
     this.specimen               = new List <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Merged.Specimen>();
     this.author                 = new List <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Merged.Author_1>();
     this.informant              = new List <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Merged.Informant12>();
     this.participant            = new List <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Merged.Participant2>();
     this.entryRelationship      = new List <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Immunizationactivity.IEntryRelationshipChoice>();
     this.reference              = new List <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Basemodel.Reference>();
     this.precondition           = new List <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Merged.IPreconditionChoice>();
 }
Example #3
0
        public void R2RTOUncertainRangeParseTest()
        {
            RTO <IQuantity, IQuantity> inti = new RTO <IQuantity, IQuantity>();

            inti.UncertainRange = new IVL <MARC.Everest.DataTypes.Interfaces.IQuantity>(
                new RTO <PQ, PQ>(
                    new PQ(1, "d")
            {
                Translation = new SET <PQR>(
                    new PQR(24, "hr", "UCUM")
                    )
            },
                    new PQ(2, "d")
                    ),
                new RTO <PQ, PQ>(
                    new PQ(3, "d"),
                    new PQ(4, "d")
                    )
                );
            //string expectedXml = @"<test xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""urn:hl7-org:v3""><uncertainRange><low xsi:type=""RTO""><numerator xsi:type=""MO"" value=""1.23"" currency=""CAD""/><denominator xsi:type=""PQ"" value=""1"" unit=""hr""/></low><high xsi:type=""RTO""><numerator xsi:type=""MO"" value=""2.23"" currency=""CAD""/><denominator xsi:type=""PQ"" value=""1"" unit=""hr""/></high></uncertainRange></test>";
            var actualXml = R2SerializationHelper.SerializeAsString(inti);
            var int2      = R2SerializationHelper.ParseString <RTO <IQuantity, IQuantity> >(actualXml);

            Assert.AreEqual(inti, int2);
        }
Example #4
0
        public async Task <IActionResult> Edit(long id, [Bind("Id,VehicleId,ExpirationDate,CertifiedBy")] RTO rTO)
        {
            if (id != rTO.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(rTO);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RTOExists(rTO.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["VehicleId"] = new SelectList(_context.Set <Vehicle>(), "Id", "Id", rTO.VehicleId);
            return(View(rTO));
        }
 public SubstanceAdministration()
 {
     this.moodCode               = new CSImpl();
     this.negationInd            = new BLImpl();
     this.typeId                 = new IIImpl();
     this.templateId             = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.id                     = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.code                   = new CDImpl();
     this.text                   = new EDImpl <EncapsulatedData>();
     this.statusCode             = new CSImpl();
     this.effectiveTime          = new LISTImpl <SXCMTSCDAR1, MbDate>(typeof(SXCMTSCDAR1Impl));
     this.priorityCode           = new CEImpl();
     this.repeatNumber           = new IVLImpl <INT, Interval <int?> >();
     this.routeCode              = new CEImpl();
     this.approachSiteCode       = new LISTImpl <CD, Code>(typeof(CDImpl));
     this.doseQuantity           = new IVLImpl <PQ, Interval <PhysicalQuantity> >();
     this.rateQuantity           = new IVLImpl <PQ, Interval <PhysicalQuantity> >();
     this.maxDoseQuantity        = new RTOImpl <PhysicalQuantity, PhysicalQuantity>();
     this.administrationUnitCode = new CEImpl();
     this.specimen               = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Specimen>();
     this.performer              = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Performer2_1>();
     this.author                 = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Author_1>();
     this.informant              = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Informant12>();
     this.participant            = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Participant2_2>();
     this.entryRelationship      = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.EntryRelationship_2>();
     this.reference              = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Basemodel.Reference>();
     this.precondition           = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Basemodel.Precondition>();
 }
        public void RTOExample29Test02()
        {
            RTO <MO, PQ> payrate = new RTO <MO, PQ>();

            payrate.NullFlavor = NullFlavor.NoInformation;
            Assert.IsTrue(payrate.Validate());
        }
Example #7
0
 public InvoiceElementIntent2() {
     this.code = new CVImpl();
     this.unitQuantity = new PQImpl();
     this.unitPriceAmt = new RTOImpl<Money, PhysicalQuantity>();
     this.netAmt = new MOImpl();
     this.factorNumber = new INTImpl();
 }
        public void RTOExample29Test03()
        {
            // create ratio with no values
            RTO <MO, PQ> payrate = new RTO <MO, PQ>();

            payrate.NullFlavor = null;
            Assert.IsFalse(payrate.Validate());
        }
Example #9
0
 public AdjudicatedInvoiceElementDetail()
 {
     this.id           = new SETImpl <II, Identifier>(typeof(IIImpl));
     this.code         = new CVImpl();
     this.unitQuantity = new PQImpl();
     this.unitPriceAmt = new RTOImpl <Money, PhysicalQuantity>();
     this.netAmt       = new MOImpl();
     this.factorNumber = new REALImpl();
 }
Example #10
0
 public AdjudicatedInvoiceElementLineItem()
 {
     this.id           = new IIImpl();
     this.code         = new CVImpl();
     this.unitQuantity = new PQImpl();
     this.unitPriceAmt = new RTOImpl <Money, PhysicalQuantity>();
     this.netAmt       = new MOImpl();
     this.factorNumber = new INTImpl();
 }
Example #11
0
 public override void Dispose()
 {
     if (!base._isDisposed)
     {
         _value = null;
         GC.SuppressFinalize(this);
         base._isDisposed = !base._isDisposed;
     }
 }
        public void RTOExample29Test04()
        {
            // test RTO given simple integers
            RTO <INT, INT> fraction = new RTO <INT, INT>(5, 10);

            fraction.NullFlavor = null;
            Console.WriteLine(fraction.ToString());
            Assert.AreEqual("5/10", fraction.ToString());
        }
Example #13
0
        public virtual void TestParseNullNode()
        {
            XmlNode node = CreateNode("<something nullFlavor=\"NI\" />");
            RTO <Money, PhysicalQuantity> rto = (RTO <Money, PhysicalQuantity>) new RtoMoPqElementParser().Parse(CreateContext(), node,
                                                                                                                 null);

            Assert.IsNull(rto.Value, "value");
            Assert.AreEqual(Ca.Infoway.Messagebuilder.Domainvalue.Nullflavor.NullFlavor.NO_INFORMATION, rto.NullFlavor, "null flavor"
                            );
        }
Example #14
0
 public InvoiceElementDetail()
 {
     this.id           = new IIImpl();
     this.code         = new CVImpl();
     this.netAmt       = new MOImpl();
     this.unitQuantity = new PQImpl();
     this.unitPriceAmt = new RTOImpl <Money, PhysicalQuantity>();
     this.factorNumber = new REALImpl();
     this.reasonOfBillableActChoice = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Common.Coct_mt280001ca.IA_BillableActChoice>();
 }
Example #15
0
 public SubmittedInvoiceElementDetails()
 {
     this.id           = new IIImpl();
     this.code         = new CVImpl();
     this.netAmt       = new MOImpl();
     this.unitQuantity = new PQImpl();
     this.unitPriceAmt = new RTOImpl <Money, PhysicalQuantity>();
     this.factorNumber = new INTImpl();
     this.reasonOfBillableActChoice = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2007_v02_r02.Claims.Coct_mt280001ca.IA_BillableActChoice>();
 }
Example #16
0
        public async Task <IActionResult> Create([Bind("Id,VehicleId,ExpirationDate,CertifiedBy")] RTO rTO)
        {
            if (ModelState.IsValid)
            {
                _context.Add(rTO);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["VehicleId"] = new SelectList(_context.Set <Vehicle>(), "Id", "Id", rTO.VehicleId);
            return(View(rTO));
        }
Example #17
0
        public void R2RTONullFlavorSerializationTest()
        {
            RTO <MO, PQ> inti = new RTO <MO, PQ>(
                new MO((decimal)12.30, "CAD"),
                new PQ((decimal)1, "hr")
                );

            inti.NullFlavor = NullFlavor.PositiveInfinity;
            string expectedXml = @"<test xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" nullFlavor=""PINF"" xmlns=""urn:hl7-org:v3"" />";
            var    actualXml   = R2SerializationHelper.SerializeAsString(inti);

            R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
        }
Example #18
0
        public void R2RTOExpressionParseTest()
        {
            RTO <IQuantity, IQuantity> inti = new RTO <IQuantity, IQuantity>();

            inti.NullFlavor = NullFlavor.Derived;
            inti.Expression = new ED(
                System.Text.Encoding.UTF8.GetBytes("i = (10 + 2) / 2 + 2)"),
                "application/mathml+xml"
                );
            var actualXml = R2SerializationHelper.SerializeAsString(inti);
            var int2      = R2SerializationHelper.ParseString <RTO <IQuantity, IQuantity> >(actualXml);

            Assert.AreEqual(inti, int2);
        }
Example #19
0
        public void R2RTOBasicSerializationTest()
        {
            RTO <MO, PQ> inti = new RTO <MO, PQ>(
                new MO((decimal)12.30, "CAD")
            {
                Precision = 2
            },
                new PQ((decimal)1, "hr")
                );
            string expectedXml = @"<test xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""urn:hl7-org:v3""><numerator xsi:type=""MO"" value=""12.30"" currency=""CAD""/><denominator xsi:type=""PQ"" value=""1"" unit=""hr""/></test>";
            var    actualXml   = R2SerializationHelper.SerializeAsString(inti);

            R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
        }
        public void RTOExample29Test01()
        {
            // create a new payrate ratio ($34 per hour)
            RTO <MO, PQ> payrate = new RTO <MO, PQ>(
                new MO((decimal)34.50, "CAD")
            {
                Precision = 2
            },
                new PQ(1, "hr")
                );

            payrate.NullFlavor = null;
            Assert.IsTrue(payrate.Validate());
        }
Example #21
0
        public void R2RTOExpressionSerializationTest()
        {
            RTO <PQ, MO> inti = new RTO <PQ, MO>();

            inti.NullFlavor = NullFlavor.Derived;
            inti.Expression = new ED(
                System.Text.Encoding.UTF8.GetBytes("i = (10 + 2) / 2 + 2)"),
                "application/mathml+xml"
                );
            string expectedXml = @"<test xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""urn:hl7-org:v3"" nullFlavor=""DER""><expression mediaType=""application/mathml+xml""><data>aSA9ICgxMCArIDIpIC8gMiArIDIp</data></expression></test>";
            var    actualXml   = R2SerializationHelper.SerializeAsString(inti);

            R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
        }
Example #22
0
        public void R2RTOUncertaintySerializationTest()
        {
            RTO <MO, PQ> inti = new RTO <MO, PQ>(
                new MO((decimal)14.23, "CAD")
            {
                Uncertainty = new MO((decimal)0.94, "CAD"), UncertaintyType = QuantityUncertaintyType.Normal
            },
                new PQ(1, "hr")
                );
            string expectedXml = @"<test xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""urn:hl7-org:v3"" ><numerator xsi:type=""MO"" value=""14.23"" currency=""CAD"" uncertaintyType=""N""><uncertainty value=""0.94"" xsi:type=""MO"" currency=""CAD""/></numerator><denominator value=""1"" unit=""hr"" xsi:type=""PQ""/></test>";
            var    actualXml   = R2SerializationHelper.SerializeAsString(inti);

            R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
        }
Example #23
0
        public void R2RTOBasicParseTest()
        {
            RTO <MO, PQ> inti = new RTO <MO, PQ>(
                new MO((decimal)12.30, "CAD")
            {
                Precision = 2
            },
                new PQ((decimal)1, "hr")
                );
            var actualXml = R2SerializationHelper.SerializeAsString(inti);
            var int2      = R2SerializationHelper.ParseString <RTO <MO, PQ> >(actualXml);

            Assert.AreEqual(inti, int2);

            Assert.AreEqual(2, int2.Numerator.Precision);
        }
Example #24
0
        internal static RTO<PQ, PQ> CreateRtoOfPqAndPq(UseContext context)
        {
            Tracer.Trace("Creating RTO<PQ,PQ>", context);

            RTO<PQ, PQ> result = new RTO<PQ, PQ>();

            result.Numerator = new PQ();
            result.Denominator = new PQ();

            result.Numerator.Value = 1000000001;
            result.Numerator.Unit = "CAD";

            result.Denominator.Unit = "day";
            result.Denominator.Value = 1;

            return result;
        }
        internal static RTO <MO, PQ> CreateRtoOfMoAndPq(UseContext context)
        {
            Tracer.Trace("Creating RTO<MO,PQ>", context);

            RTO <MO, PQ> result = new RTO <MO, PQ>();

            result.Numerator   = new MO();
            result.Denominator = new PQ();

            result.Numerator.Value    = 1000000001;
            result.Numerator.Currency = "CAD";

            result.Denominator.Unit  = "day";
            result.Denominator.Value = 1;

            return(result);
        }
Example #26
0
        public void R2RTOUncertainRangeSerializationTest()
        {
            RTO <MO, PQ> inti = new RTO <MO, PQ>();

            inti.UncertainRange = new IVL <MARC.Everest.DataTypes.Interfaces.IQuantity>(
                new RTO <MO, PQ>(
                    new MO((decimal)1.23, "CAD"),
                    new PQ(1, "hr")
                    ),
                new RTO <MO, PQ>(
                    new MO((decimal)2.23, "CAD"),
                    new PQ(1, "hr")
                    )
                );
            string expectedXml = @"<test xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""urn:hl7-org:v3""><uncertainRange><low xsi:type=""RTO""><numerator xsi:type=""MO"" value=""1.23"" currency=""CAD""/><denominator xsi:type=""PQ"" value=""1"" unit=""hr""/></low><high xsi:type=""RTO""><numerator xsi:type=""MO"" value=""2.23"" currency=""CAD""/><denominator xsi:type=""PQ"" value=""1"" unit=""hr""/></high></uncertainRange></test>";
            var    actualXml   = R2SerializationHelper.SerializeAsString(inti);

            R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
        }
Example #27
0
 public void RTOToString()
 {
     RTO<INT, INT> testRTO = new RTO<INT, INT>(1,5);
     Assert.AreEqual("1/5", testRTO.ToString());
 }
Example #28
0
 public void R2RTOExpressionSerializationTest()
 {
     RTO<PQ, MO> inti = new RTO<PQ,MO>();
     inti.NullFlavor = NullFlavor.Derived;
     inti.Expression = new ED(
         System.Text.Encoding.UTF8.GetBytes("i = (10 + 2) / 2 + 2)"),
         "application/mathml+xml"
     );
     string expectedXml = @"<test xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""urn:hl7-org:v3"" nullFlavor=""DER""><expression mediaType=""application/mathml+xml""><data>aSA9ICgxMCArIDIpIC8gMiArIDIp</data></expression></test>";
     var actualXml = R2SerializationHelper.SerializeAsString(inti);
     R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
 }
Example #29
0
 public DispensedIn()
 {
     this.quantity = new RTOImpl <PhysicalQuantity, PhysicalQuantity>();
     this.containerPackagedMedicineFormCode = new CVImpl();
 }
Example #30
0
 public void R2RTONullFlavorSerializationTest()
 {
     RTO<MO, PQ> inti = new RTO<MO, PQ>(
         new MO((decimal)12.30, "CAD"),
         new PQ((decimal)1, "hr")
     );
     inti.NullFlavor = NullFlavor.PositiveInfinity;
     string expectedXml = @"<test xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" nullFlavor=""PINF"" xmlns=""urn:hl7-org:v3"" />";
     var actualXml = R2SerializationHelper.SerializeAsString(inti);
     R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
 }
Example #31
0
 public void R2RTOUncertainRangeParseTest()
 {
     RTO<IQuantity, IQuantity> inti = new RTO<IQuantity, IQuantity>();
     inti.UncertainRange = new IVL<MARC.Everest.DataTypes.Interfaces.IQuantity>(
         new RTO<PQ, PQ>(
             new PQ(1, "d")
             {
                 Translation = new SET<PQR>(
                     new PQR(24, "hr", "UCUM")
                     )
             },
             new PQ(2, "d")
         ),
         new RTO<PQ, PQ>(
             new PQ(3, "d"),
             new PQ(4, "d")
         )
     );
     //string expectedXml = @"<test xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""urn:hl7-org:v3""><uncertainRange><low xsi:type=""RTO""><numerator xsi:type=""MO"" value=""1.23"" currency=""CAD""/><denominator xsi:type=""PQ"" value=""1"" unit=""hr""/></low><high xsi:type=""RTO""><numerator xsi:type=""MO"" value=""2.23"" currency=""CAD""/><denominator xsi:type=""PQ"" value=""1"" unit=""hr""/></high></uncertainRange></test>";
     var actualXml = R2SerializationHelper.SerializeAsString(inti);
     var int2 = R2SerializationHelper.ParseString<RTO<IQuantity, IQuantity>>(actualXml);
     Assert.AreEqual(inti, int2);
 }
Example #32
0
        public void Graph(System.Xml.XmlWriter s, object o, DatatypeFormatterGraphResult result)
        {
            ANYFormatter anyFormatter = new ANYFormatter();

            anyFormatter.Graph(s, o, result);

            // Now graph the attributes
            Type   pivlType                  = o.GetType();
            object valueValue                = pivlType.GetProperty("Value").GetValue(o, null),
                   operatorValue             = pivlType.GetProperty("Operator").GetValue(o, null),
                   alignmentValue            = pivlType.GetProperty("Alignment").GetValue(o, null),
                   phaseValue                = pivlType.GetProperty("Phase").GetValue(o, null),
                   periodValue               = pivlType.GetProperty("Period").GetValue(o, null),
                   institutionSpecifiedValue = pivlType.GetProperty("InstitutionSpecified").GetValue(o, null),
                   countValue                = pivlType.GetProperty("Count").GetValue(o, null),
                   frequencyValue            = pivlType.GetProperty("Frequency").GetValue(o, null);

            // Append the attributes to the writer
            if ((o as ANY).NullFlavor != null)
            {
                return; // Nothing to report
            }
            if (valueValue != null)
            {
                result.AddResultDetail(new UnsupportedDatatypeR1PropertyResultDetail(ResultDetailType.Warning, "Value", "PIVL", s.ToString()));
            }
            //s.WriteAttributeString("value", Util.ToWireFormat(valueValue));
            if (operatorValue != null)
            {
                s.WriteAttributeString("operator", Util.ToWireFormat(operatorValue));
            }
            if (alignmentValue != null)
            {
                s.WriteAttributeString("alignment", Util.ToWireFormat(alignmentValue));
            }
            if (institutionSpecifiedValue != null)
            {
                s.WriteAttributeString("institutionSpecified", Util.ToWireFormat(institutionSpecifiedValue));
            }

            if (countValue != null)
            {
                result.AddResultDetail(new UnsupportedDatatypeR1PropertyResultDetail(ResultDetailType.Warning, "Count", "PIVL", s.ToString()));
            }

            // Write elements
            if (phaseValue != null)
            {
                s.WriteStartElement("phase", "urn:hl7-org:v3");
                Host.GraphObject(s, (IGraphable)phaseValue);
                s.WriteEndElement();
            }

            if (frequencyValue != null)
            {
                // JF - Frequency is not supported by UV R1
                if (result.CompatibilityMode == DatatypeFormatterCompatibilityMode.Canadian)
                {
                    s.WriteStartElement("frequency", "urn:hl7-org:v3");
                    var hostResult = this.Host.Graph(s, (IGraphable)frequencyValue);
                    result.AddResultDetail(hostResult.Details);
                    result.Code = hostResult.Code;
                    s.WriteEndElement();
                }
                else
                {
                    RTO <INT, PQ> rto = frequencyValue as RTO <INT, PQ>;
                    periodValue = rto.Denominator / rto.Numerator;
                    result.AddResultDetail(new PropertyValuePropagatedResultDetail(ResultDetailType.Warning, "Frequency", "Period", periodValue, s.ToString()));
                    s.WriteStartElement("period", "urn:hl7-org:v3");
                    var hostResult = Host.Graph(s, (IGraphable)periodValue);
                    result.AddResultDetail(hostResult.Details);
                    result.Code = hostResult.Code;
                    s.WriteEndElement();
                }
            }
            else if (periodValue != null)
            {
                s.WriteStartElement("period", "urn:hl7-org:v3");
                var hostResult = Host.Graph(s, (IGraphable)periodValue);
                result.AddResultDetail(hostResult.Details);
                result.Code = hostResult.Code;
                s.WriteEndElement();
            }
        }
Example #33
0
        public void RTOToString()
        {
            RTO <INT, INT> testRTO = new RTO <INT, INT>(1, 5);

            Assert.AreEqual("1/5", testRTO.ToString());
        }
Example #34
0
 public void RTOExample29Test03()
 {
     // create ratio with no values
     RTO<MO, PQ> payrate = new RTO<MO, PQ>();
     payrate.NullFlavor = null;
     Assert.IsFalse(payrate.Validate());
 }
Example #35
0
 public void RTOExample29Test04()
 {
     // test RTO given simple integers
     RTO<INT, INT> fraction = new RTO<INT, INT>(5, 10);
     fraction.NullFlavor = null;
     Console.WriteLine(fraction.ToString());
     Assert.AreEqual("5/10", fraction.ToString());
 }
Example #36
0
 public void R2RTOBasicParseTest()
 {
     RTO<MO, PQ> inti = new RTO<MO, PQ>(
         new MO((decimal)12.30, "CAD") { Precision = 2 },
         new PQ((decimal)1, "hr")
     );
     var actualXml = R2SerializationHelper.SerializeAsString(inti);
     var int2 = R2SerializationHelper.ParseString<RTO<MO, PQ>>(actualXml);
     Assert.AreEqual(inti, int2);
     
     Assert.AreEqual(2, int2.Numerator.Precision);
 }
Example #37
0
        public void RTOExample29Test01()
        {
            // create a new payrate ratio ($34 per hour)
            RTO<MO, PQ> payrate = new RTO<MO, PQ>(
                new MO((decimal)34.50, "CAD") { Precision = 2 },
                new PQ(1, "hr")
                );

            payrate.NullFlavor = null;
            Assert.IsTrue(payrate.Validate());
        }
Example #38
0
 public void R2RTOUncertaintySerializationTest()
 {
     RTO<MO, PQ> inti = new RTO<MO, PQ>(
         new MO((decimal)14.23, "CAD") { Uncertainty = new MO((decimal)0.94, "CAD"), UncertaintyType = QuantityUncertaintyType.Normal },
         new PQ(1, "hr") 
     );
     string expectedXml = @"<test xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""urn:hl7-org:v3"" ><numerator xsi:type=""MO"" value=""14.23"" currency=""CAD"" uncertaintyType=""N""><uncertainty value=""0.94"" xsi:type=""MO"" currency=""CAD""/></numerator><denominator value=""1"" unit=""hr"" xsi:type=""PQ""/></test>";
     var actualXml = R2SerializationHelper.SerializeAsString(inti);
     R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
 }
Example #39
0
        public IRTOBuilder Clear()
        {
            _value = base.ResetValue <RTO>();

            return(this);
        }
Example #40
0
 public void R2RTOExpressionParseTest()
 {
     RTO<IQuantity, IQuantity> inti = new RTO<IQuantity, IQuantity>();
     inti.NullFlavor = NullFlavor.Derived;
     inti.Expression = new ED(
         System.Text.Encoding.UTF8.GetBytes("i = (10 + 2) / 2 + 2)"),
         "application/mathml+xml"
     );
     var actualXml = R2SerializationHelper.SerializeAsString(inti);
     var int2 = R2SerializationHelper.ParseString<RTO<IQuantity, IQuantity>>(actualXml);
     Assert.AreEqual(inti, int2);
 }
Example #41
0
 public void R2RTOBasicSerializationTest()
 {
     RTO<MO, PQ> inti = new RTO<MO, PQ>(
         new MO((decimal)12.30, "CAD") { Precision = 2 },
         new PQ((decimal)1, "hr")
     );
     string expectedXml = @"<test xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""urn:hl7-org:v3""><numerator xsi:type=""MO"" value=""12.30"" currency=""CAD""/><denominator xsi:type=""PQ"" value=""1"" unit=""hr""/></test>";
     var actualXml = R2SerializationHelper.SerializeAsString(inti);
     R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
 }
Example #42
0
 public void R2RTOUncertainRangeSerializationTest()
 {
     RTO<MO, PQ> inti = new RTO<MO, PQ>();
     inti.UncertainRange = new IVL<MARC.Everest.DataTypes.Interfaces.IQuantity>(
         new RTO<MO, PQ>(
             new MO((decimal)1.23, "CAD"),
             new PQ(1, "hr")
         ),
         new RTO<MO, PQ>(
             new MO((decimal)2.23, "CAD"),
             new PQ(1, "hr")
         )
     );
     string expectedXml = @"<test xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""urn:hl7-org:v3""><uncertainRange><low xsi:type=""RTO""><numerator xsi:type=""MO"" value=""1.23"" currency=""CAD""/><denominator xsi:type=""PQ"" value=""1"" unit=""hr""/></low><high xsi:type=""RTO""><numerator xsi:type=""MO"" value=""2.23"" currency=""CAD""/><denominator xsi:type=""PQ"" value=""1"" unit=""hr""/></high></uncertainRange></test>";
     var actualXml = R2SerializationHelper.SerializeAsString(inti);
     R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
 }
Example #43
0
 public void RTOExample29Test02()
 {
     RTO<MO, PQ> payrate = new RTO<MO, PQ>();
     payrate.NullFlavor = NullFlavor.NoInformation;
     Assert.IsTrue(payrate.Validate());
 }