Пример #1
0
        protected override void WriteXmlBase(System.Xml.XmlWriter writer)
        {
            DvInterval <T> normalRange = NormalRange;

            if (this.NormalRange != null)
            {
                string prefix = RmXmlSerializer.UseOpenEhrPrefix(writer);
                writer.WriteStartElement(prefix, "normal_range", RmXmlSerializer.OpenEhrNamespace);
                NormalRange.WriteXml(writer);
                writer.WriteEndElement();
            }

            if (this.OtherReferenceRanges != null)
            {
                foreach (ReferenceRange <T> refRange in this.OtherReferenceRanges)
                {
                    writer.WriteStartElement("other_reference_ranges", RmXmlSerializer.OpenEhrNamespace);
                    refRange.WriteXml(writer);
                    writer.WriteEndElement();
                }
            }

            // CM: 06/03/08
            if (this.NormalStatus != null)
            {
                writer.WriteStartElement("normal_status", RmXmlSerializer.OpenEhrNamespace);
                this.NormalStatus.WriteXml(writer);
                writer.WriteEndElement();
            }
        }
Пример #2
0
 /// <summary>
 /// Serves as a hash function for a particular type.
 /// </summary>
 /// <returns>
 /// A hash code for the current <see cref="T:System.Object"/>.
 /// </returns>
 /// <filterpriority>2</filterpriority>
 public override int GetHashCode()
 {
     unchecked
     {
         int result = (NormalStatus != null ? NormalStatus.GetHashCode() : 0);
         result = (result * 397) ^ (NormalRange != null ? NormalRange.GetHashCode() : 0);
         result = (result * 397) ^ (OtherReferenceRanges != null ? OtherReferenceRanges.GetHashCode() : 0);
         return(result);
     }
 }
Пример #3
0
        /// <inheritdoc/>
        public string ToDelimitedString()
        {
            System.Globalization.CultureInfo culture = System.Globalization.CultureInfo.CurrentCulture;
            string separator = IsSubcomponent ? Configuration.SubcomponentSeparator : Configuration.ComponentSeparator;

            return(string.Format(
                       culture,
                       StringHelper.StringFormatSequence(0, 4, separator),
                       NormalRange?.ToDelimitedString(),
                       NumericThreshold.HasValue ? NumericThreshold.Value.ToString(Consts.NumericFormat, culture) : null,
                       ChangeComputation,
                       DaysRetained.HasValue ? DaysRetained.Value.ToString(Consts.NumericFormat, culture) : null
                       ).TrimEnd(separator.ToCharArray()));
        }
Пример #4
0
 public bool IsNormal()
 {
     return(NormalRange == null || NormalRange.HasElement((T)this));
 }
Пример #5
0
 public double NormalValue(NormalRange range)
 {
     return(Helpers.Clip(NormalValue(range.mean, range.std), range.min, range.max));
 }