Esempio n. 1
0
 public void Set(aECGValuePair vp)
 {
     this.Type           = vp.Type;
     this.Unit           = vp.Unit;
     this.Value          = vp.Value;
     this.Code           = vp.Code;
     this.CodeSystem     = vp.CodeSystem;
     this.CodeSystemName = vp.CodeSystemName;
     this.DisplayName    = vp.DisplayName;
 }
Esempio n. 2
0
        public aECGControlVariable(string name) : base(name)
        {
            _InnerName = ControlVariableName;

            Value = new aECGValuePair("value");
        }
Esempio n. 3
0
        public override int Read(XmlReader reader)
        {
            Type = reader.GetAttribute("xsi:type");

            Unit = reader.GetAttribute("unit");

            string val = reader.GetAttribute("value");

            if (val != null)
            {
                if (Unit != null)
                {
                    try
                    {
                        _Value = (val.Length == 0) ? 29999 : double.Parse(val, System.Globalization.CultureInfo.InvariantCulture.NumberFormat);
                    }
                    catch
                    {
                        return(2);
                    }
                }
                else
                {
                    try
                    {
                        // code for special case files should not bother other situations
                        if (val.EndsWith("x"))
                        {
                            val = val.Replace("x", "");
                        }

                        _Time = (string.Compare(val, "0") == 0) ? DateTime.MinValue : aECGTime.ParseDate(val);
                    }
                    catch
                    {
                        return(2);
                    }
                }
            }
            else
            {
                Code           = reader.GetAttribute("code");
                CodeSystem     = reader.GetAttribute("codeSystem");
                CodeSystemName = reader.GetAttribute("codeSystemName");
                DisplayName    = reader.GetAttribute("displayName");
            }

            if (!reader.IsEmptyElement)
            {
                while (reader.Read() &&
                       (reader.NodeType == XmlNodeType.Whitespace))
                {
                    ;
                }

                if ((string.Compare(reader.Name, Name) == 0) &&
                    (reader.NodeType == XmlNodeType.EndElement))
                {
                    return(0);
                }
                else if (reader.NodeType != XmlNodeType.Element)
                {
                    _InnerValue = reader.Value;

                    reader.Read();
                }

                if (reader.NodeType == XmlNodeType.Element)
                {
                    do
                    {
                        if ((reader.NodeType == XmlNodeType.Comment) ||
                            (reader.NodeType == XmlNodeType.Whitespace))
                        {
                            continue;
                        }

                        if ((string.Compare(reader.Name, Name) == 0) &&
                            (reader.NodeType == XmlNodeType.EndElement))
                        {
                            break;
                        }

                        if (reader.NodeType == XmlNodeType.Element)
                        {
                            aECGValuePair temp = new aECGValuePair(reader.Name);

                            int ret = temp.Read(reader);

                            if (ret != 0)
                            {
                                return(ret > 0 ? 3 + ret : ret);
                            }

                            _InnerList.Add(temp.Name, temp);
                        }
                    } while (reader.Read());

                    if (_InnerList.Count != 0)
                    {
                        _InnerValue = null;
                    }
                }
                else if ((reader.Name != Name) ||
                         (reader.NodeType != XmlNodeType.EndElement))
                {
                    return(1);
                }
            }

            return(0);
        }