public void TestParseQuantity() { var i = new Model.Quantity(3.14m, "kg", "http://mysystsem.org"); var node = i.ToTypedElement(); var p = node.ParseQuantity(); Assert.True(p.IsExactly(i)); }
public void TestParseQuantity() { var i = new Model.Quantity(3.14m, "kg"); var nav = new PocoNavigator(i); var p = nav.ParseQuantity(); Assert.True(p.IsExactly(i)); }
public void TestParseBindableQuantity() { var iq = new Model.Quantity(4.0m, "kg", system: null); var node = iq.ToTypedElement(); var c = node.ParseBindable() as Coding; Assert.NotNull(c); Assert.Equal(iq.Code, c.Code); Assert.Equal("http://unitsofmeasure.org", c.System); // auto filled out by parsebinding() }
public void TestParseBindableQuantity() { var iq = new Model.Quantity(4.0m, "kg", system: null); var nav = new PocoNavigator(iq); var c = nav.ParseBindable() as Coding; Assert.NotNull(c); Assert.Equal(iq.Code, c.Code); Assert.Equal("http://unitsofmeasure.org", c.System); // auto filled out by parsebinding() }
public void TestParseBindable() { var ic = new Code("code"); var nav = new PocoNavigator(ic); var c = nav.ParseBindable(FHIRDefinedType.Code) as Coding; Assert.NotNull(c); Assert.Equal(ic.Value, c.Code); Assert.Null(c.System); var iq = new Model.Quantity(4.0m, "kg"); nav = new PocoNavigator(iq); c = nav.ParseBindable(FHIRDefinedType.Quantity) as Coding; Assert.NotNull(c); Assert.Equal(iq.Code, c.Code); Assert.Equal(iq.System, c.System); var ist = new Model.FhirString("Ewout"); nav = new PocoNavigator(ist); c = nav.ParseBindable(FHIRDefinedType.String) as Coding; Assert.NotNull(c); Assert.Equal(ist.Value, c.Code); Assert.Null(c.System); var iu = new Model.FhirUri("http://somewhere.org"); nav = new PocoNavigator(iu); c = nav.ParseBindable(FHIRDefinedType.Uri) as Coding; Assert.NotNull(c); Assert.Equal(iu.Value, c.Code); Assert.Null(c.System); // 'code','Coding','CodeableConcept','Quantity','Extension', 'string', 'uri' }