Exemplo n.º 1
0
        private void verifyCDvQuantityValue(org.openehr.am.archetype.constraintmodel.ArchetypeConstraint node)
        {
            Assert.IsTrue(node is org.openehr.am.openehrprofile.datatypes.quantity.CDvQuantity, "CDvQuantity expected");

            org.openehr.am.openehrprofile.datatypes.quantity.CDvQuantity cdvquantity = (org.openehr.am.openehrprofile.datatypes.quantity.CDvQuantity)node;

            // verify property
            org.openehr.rm.datatypes.text.CodePhrase property = cdvquantity.getProperty();
            Assert.IsNotNull(property, "property is null");
            Assert.AreEqual("openehr", property.getTerminologyId().name());
            Assert.AreEqual("128", property.getCodeString());

            // verify item list
            java.util.List list = cdvquantity.getList();
            Assert.AreEqual(2, list.size(), "unexpected size of list");
            java.lang.Double  temp1 = new java.lang.Double(0.0);
            java.lang.Double  temp2 = new java.lang.Double(200.0);
            java.lang.Integer temp3 = new java.lang.Integer(2);
            assertCDvQuantityItem((org.openehr.am.openehrprofile.datatypes.quantity.CDvQuantityItem)list.get(0), "yr", new org.openehr.rm.support.basic.Interval(temp1, temp2), new org.openehr.rm.support.basic.Interval(temp3, temp3));
            temp1 = new java.lang.Double(1.0);
            temp2 = new java.lang.Double(36.0);
            assertCDvQuantityItem((org.openehr.am.openehrprofile.datatypes.quantity.CDvQuantityItem)list.get(1), "mth", new org.openehr.rm.support.basic.Interval(temp1, temp2), new org.openehr.rm.support.basic.Interval(temp3, temp3));

            org.openehr.rm.support.measurement.MeasurementService ms       = org.openehr.rm.support.measurement.SimpleMeasurementService.getInstance();
            org.openehr.rm.datatypes.quantity.DvQuantity          expected = new org.openehr.rm.datatypes.quantity.DvQuantity("yr", new java.lang.Double(8.0), new java.lang.Integer(2), ms);
            Assert.AreEqual(expected,
                            cdvquantity.getAssumedValue(), "assumed value wrong");
        }
Exemplo n.º 2
0
        private void verifyCDvQuantityValue(org.openehr.am.archetype.constraintmodel.ArchetypeConstraint node)
        {
            Assert.IsTrue(node is org.openehr.am.openehrprofile.datatypes.quantity.CDvQuantity, "CDvQuantity expected");

            org.openehr.am.openehrprofile.datatypes.quantity.CDvQuantity cdvquantity = (org.openehr.am.openehrprofile.datatypes.quantity.CDvQuantity) node;

            // verify property
            org.openehr.rm.datatypes.text.CodePhrase property = cdvquantity.getProperty();
            Assert.IsNotNull(property, "property is null");
            Assert.AreEqual("openehr", property.getTerminologyId().name());
            Assert.AreEqual("128", property.getCodeString());

            // verify item list
            java.util.List list = cdvquantity.getList();
            Assert.AreEqual(2, list.size(), "unexpected size of list");
            java.lang.Double temp1 = new java.lang.Double(0.0);
            java.lang.Double temp2 = new java.lang.Double(200.0);
            java.lang.Integer temp3 = new java.lang.Integer(2);
            assertCDvQuantityItem((org.openehr.am.openehrprofile.datatypes.quantity.CDvQuantityItem)list.get(0), "yr", new org.openehr.rm.support.basic.Interval(temp1, temp2), new org.openehr.rm.support.basic.Interval(temp3, temp3));
            temp1 = new java.lang.Double(1.0);
            temp2 = new java.lang.Double(36.0);
            assertCDvQuantityItem((org.openehr.am.openehrprofile.datatypes.quantity.CDvQuantityItem)list.get(1), "mth", new org.openehr.rm.support.basic.Interval(temp1, temp2), new org.openehr.rm.support.basic.Interval(temp3, temp3));

            org.openehr.rm.support.measurement.MeasurementService ms = org.openehr.rm.support.measurement.SimpleMeasurementService.getInstance();
            org.openehr.rm.datatypes.quantity.DvQuantity expected = new org.openehr.rm.datatypes.quantity.DvQuantity("yr", new java.lang.Double(8.0), new java.lang.Integer(2), ms);
            Assert.AreEqual(expected,
                    cdvquantity.getAssumedValue(), "assumed value wrong");
        }