public StructuredDosageLines() { this.moodCode = new CSImpl(); this.text = new STImpl(); this.effectiveTime = new GTSImpl(); this.doseQuantity = new URGImpl <PQ, PhysicalQuantity>(); this.rateQuantity = new URGImpl <PQ, PhysicalQuantity>(); }
public void URGNullFlavor4Test() { URG <II> urg = new URG <II>(); urg.NullFlavor = NullFlavor.NotAsked; urg.HighClosed = null; Assert.IsTrue(urg.Validate()); }
public void URGOriginalTextTest() { URG <II> urg = new URG <II>(); urg.NullFlavor = null; urg.OriginalText = "test"; Assert.IsFalse(urg.Validate()); }
public void URGNullFlavor5Test() { URG <II> urg = new URG <II>(); urg.NullFlavor = NullFlavor.NotAsked; urg.Width = null; Assert.IsTrue(urg.Validate()); }
public void URGOriginalTextNullFlavorTest() { URG <II> urg = new URG <II>(); urg.NullFlavor = NullFlavor.NotAsked; urg.OriginalText = "test"; Assert.IsTrue(urg.Validate()); }
public void URGHighTest() { URG <II> urg = new URG <II>(); urg.NullFlavor = null; urg.Width = null; urg.Probability = (decimal)1; urg.Low = null; urg.High = new II("1.4", null); Assert.IsTrue(urg.Validate()); }
//internal static ResponseMode CreateResponseMode(UseContext context) //{ // Tracer.Trace("Creating ResponseMode", context); // return ResponseMode.Immediate; //} //internal static QueryRequestLimit CreateQueryRequestLimit(UseContext context) //{ // Tracer.Trace("Creating QueryRequestLimit", context); // return QueryRequestLimit.Record; //} internal static URG <PQ> CreateURG_PQ(UseContext context) { Tracer.Trace("Creating URG<PQ>", context); URG <PQ> result = new URG <PQ>(); result.Value = (decimal)Math.PI; result.Probability = (decimal)0.9999999999999; return(result); }
public RecommendedDosage() { this.effectiveTime = new IVLImpl <TS, Interval <PlatformDate> >(); this.doseQuantity = new URGImpl <PQ, PhysicalQuantity>(); this.componentObservationEventCriterion = new List <Ca.Infoway.Messagebuilder.Model.Ab_r02_04_03_imm.Common.Merged.DosagePreconditions>(); }
public DosagePreconditions() { this.code = new CVImpl(); this.value = new URGImpl <PQ, PhysicalQuantity>(); }
public object Parse(System.Xml.XmlReader s, DatatypeFormatterParseResult result) { // Parse the base PDV first PDVFormatter pdvFormatter = new PDVFormatter(); URG <Object> retVal = pdvFormatter.Parse <URG <Object> >(s, result); if (retVal.NullFlavor != null) // Null, no longer process { return(retVal); } if (s.GetAttribute("probability") != null) // Probability { decimal prob = (decimal)0.0f; if (!Decimal.TryParse(s.GetAttribute("probability"), out prob)) // Try to parse { result.AddResultDetail(new ResultDetail(ResultDetailType.Warning, string.Format("Value '{0}' can't be processed into 'Probability' on data type UVP", s.GetAttribute("probability")), s.ToString(), null)); } else // Success, so assign { retVal.Probability = prob; } } // Serialization IXmlStructureFormatter serHost = this.Host; // Elements #region Elements if (!s.IsEmptyElement) { int sDepth = s.Depth; string sName = s.Name; s.Read(); // string Name while (!(s.NodeType == System.Xml.XmlNodeType.EndElement && s.Depth == sDepth && s.Name == sName)) { string oldName = s.Name; // Name try { if (s.LocalName == "low") // Low , parse using the proper type { var hostResult = serHost.Parse(s, GenericArguments[0]); result.Code = hostResult.Code; result.AddResultDetail(hostResult.Details); retVal.Low = hostResult.Structure; } else if (s.LocalName == "width") // Width { var hostResult = serHost.Parse(s, typeof(PQ)); result.Code = hostResult.Code; result.AddResultDetail(hostResult.Details); retVal.Width = hostResult.Structure as PQ; } else if (s.LocalName == "high") // High { var hostResult = serHost.Parse(s, GenericArguments[0]); result.Code = hostResult.Code; result.AddResultDetail(hostResult.Details); retVal.High = hostResult.Structure; } } catch (MessageValidationException e) { result.AddResultDetail(new MARC.Everest.Connectors.ResultDetail(MARC.Everest.Connectors.ResultDetailType.Error, e.Message, e)); } finally { if (s.Name == oldName) { s.Read(); } } } } #endregion // Validate the data type ANYFormatter validator = new ANYFormatter(); string pathName = s is XmlStateReader ? (s as XmlStateReader).CurrentPath : s.Name; validator.Validate(retVal, pathName, result); return(retVal); }
public void URGOriginalTextTest() { URG<II> urg = new URG<II>(); urg.NullFlavor = null; urg.OriginalText = "test"; Assert.IsFalse(urg.Validate()); }
public void URGHighTest() { URG<II> urg = new URG<II>(); urg.NullFlavor = null; urg.Width = null; urg.Probability = (decimal)1; urg.Low = null; urg.High = new II("1.4", null); Assert.IsTrue(urg.Validate()); }
public void URGNullFlavor5Test() { URG<II> urg = new URG<II>(); urg.NullFlavor = NullFlavor.NotAsked; urg.Width = null; Assert.IsTrue(urg.Validate()); }
public void URGNullFlavor4Test() { URG<II> urg = new URG<II>(); urg.NullFlavor = NullFlavor.NotAsked; urg.HighClosed = null; Assert.IsTrue(urg.Validate()); }
public void URGOriginalTextNullFlavorTest() { URG<II> urg = new URG<II>(); urg.NullFlavor = NullFlavor.NotAsked; urg.OriginalText = "test"; Assert.IsTrue(urg.Validate()); }
//internal static ResponseMode CreateResponseMode(UseContext context) //{ // Tracer.Trace("Creating ResponseMode", context); // return ResponseMode.Immediate; //} //internal static QueryRequestLimit CreateQueryRequestLimit(UseContext context) //{ // Tracer.Trace("Creating QueryRequestLimit", context); // return QueryRequestLimit.Record; //} internal static URG<PQ> CreateURG_PQ(UseContext context) { Tracer.Trace("Creating URG<PQ>", context); URG<PQ> result = new URG<PQ>(); result.Value = (decimal)Math.PI; result.Probability = (decimal)0.9999999999999; return result; }