public ReferenceRange(Text.DvText meaning, DvInterval <T> range) : this() { this.meaning = meaning; this.range = range; this.CheckInvariants(); }
public DvProportion(float numerator, float denominator, ProportionKind type, bool isIntegral, int precision, DvInterval <DvProportion> normalRange, ReferenceRange <DvProportion>[] otherReferenceRanges) : this() { DesignByContract.Check.Require(isIntegral || (type != ProportionKind.pkFraction && type != ProportionKind.pkIntegerFraction)); DesignByContract.Check.Require(otherReferenceRanges == null || otherReferenceRanges.Length > 0); DesignByContract.Check.Require(type != ProportionKind.pkUnitary || denominator == 1); DesignByContract.Check.Require(type != ProportionKind.pkPercent || denominator == 100); this.type = type; if (type == ProportionKind.pkFraction || type == ProportionKind.pkIntegerFraction) { this.numerator = (float)Math.Truncate(numerator); this.denominator = (float)Math.Truncate(denominator); this.precision = 0; this.precisionSet = true; } else { this.numerator = numerator; this.denominator = denominator; } this.numeratorSet = true; this.denominatorSet = true; this.precision = precision; this.precisionSet = true; SetBaseData(null, normalRange, otherReferenceRanges); this.CheckInvariants(); }
public DvQuantity(Double magnitude, string units, int precision, DvInterval <DvQuantity> normalRange, ReferenceRange <DvQuantity>[] referenceRanges, float accuracy, bool accuracyIsPercent, string magnitudeStatus) : this(magnitude, units, precision, accuracy, accuracyIsPercent, magnitudeStatus, null, normalRange, referenceRanges) { }
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(); } }
protected void SetBaseData(string magnitudeStatus, CodePhrase normalStatus, DvInterval <T> normalRange, ReferenceRange <T>[] otherReferenceRanges) { DesignByContract.Check.Require(magnitudeStatus == null || ValidMagnitudeStatus(magnitudeStatus), "if magnitudeStatus is not null or empty, it must be a valid value."); base.SetBaseData(normalStatus, normalRange, otherReferenceRanges); this.magnitudeStatus = magnitudeStatus; }
private DvQuantity(double magnitude, string units, float accuracy, bool accuracyIsPercent, string magnitudeStatus, CodePhrase normalStatus, DvInterval <DvQuantity> normalRange, ReferenceRange <DvQuantity>[] otherReferenceRanges) : this() { this.magnitude = magnitude; this.units = units; SetBaseData(accuracy, accuracyIsPercent, magnitudeStatus, normalStatus, normalRange, otherReferenceRanges); }
public DvCount(long magnitude, float accuracy, bool accuracyIsPercent, string magnitudeStatus, CodePhrase normalStatus, DvInterval <DvCount> normalRange, ReferenceRange <DvCount>[] otherReferenceRanges) : this() { this.magnitude = magnitude; this.magnitudeSet = true; SetBaseData(accuracy, accuracyIsPercent, magnitudeStatus, normalStatus, normalRange, otherReferenceRanges); CheckInvariants(); }
public DvQuantity(double magnitude, string units, int precision, float accuracy, bool accuracyIsPercent, string magnitudeStatus, CodePhrase normalStatus, DvInterval <DvQuantity> normalRange, ReferenceRange <DvQuantity>[] otherReferenceRanges) : this(magnitude, units, accuracy, accuracyIsPercent, magnitudeStatus, normalStatus, normalRange, otherReferenceRanges) { DesignByContract.Check.Require(precision >= -1, "precision must be greater or equal to -1"); this.precision = precision; this.precisionSet = true; }
protected void SetBaseData(CodePhrase normalStatus, DvInterval <T> normalRange, ReferenceRange <T>[] otherReferenceRanges) { DesignByContract.Check.Require(otherReferenceRanges == null || otherReferenceRanges.Length > 0, "if otherReferenceRanges is not null, it must not be empty."); this.normalStatus = normalStatus; this.normalRange = normalRange; if (otherReferenceRanges != null) { this.otherReferenceRanges = new List <ReferenceRange <T> >(otherReferenceRanges); } }
protected void SetBaseData(float accuracy, bool accuracyIsPercent, string magnitudeStatus, CodePhrase normalStatus, DvInterval <T> normalRange, ReferenceRange <T>[] otherReferenceRanges) { DesignByContract.Check.Require(accuracy >= -1, "accuracy must be greater or equal to -1"); base.SetBaseData(magnitudeStatus, normalStatus, normalRange, otherReferenceRanges); // means accuracy should be set if (accuracy != unknownAccuracyValue) { this.accuracy = accuracy; this.accuracyIsPercent = accuracyIsPercent; this.accuracyIsPercentSet = true; } }
public DvOrdinal(int value, Text.DvCodedText symbol, CodePhrase normalStatus, DvInterval <DvOrdinal> normalRange, ReferenceRange <DvOrdinal>[] otherReferenceRanges) : this() { DesignByContract.Check.Require(symbol != null, "symbol must not be null."); this.value = value; this.valueSet = true; this.symbol = symbol; SetBaseData(normalStatus, normalRange, otherReferenceRanges); this.CheckInvariants(); }
internal void ReadXml(System.Xml.XmlReader reader) { reader.ReadStartElement(); reader.MoveToContent(); Check.Assert(reader.LocalName == "meaning", "Expected LocalName is meaning rather than " + reader.LocalName); if (this.meaning == null) { string meaningType = RmXmlSerializer.ReadXsiType(reader); if (meaningType == null) { this.meaning = new DvText(); } else { this.meaning = RmFactory.DataValue(meaningType) as DvText; } } this.meaning.ReadXml(reader); DesignByContract.Check.Assert(reader.LocalName == "range", "Expected LocalName is range rather than " + reader.LocalName); if (this.range == null) { this.range = new DvInterval <T>(); } this.range.ReadXml(reader); if (!reader.IsStartElement()) { reader.ReadEndElement(); } reader.MoveToContent(); this.CheckInvariants(); }
protected override void ReadXmlBase(System.Xml.XmlReader reader) { if (reader.LocalName == "normal_range") { if (this.normalRange == null) { this.normalRange = new DvInterval <T>(); } this.normalRange.ReadXml(reader); } if (reader.LocalName == "other_reference_ranges") { List <ReferenceRange <T> > otherRefRanges = new List <ReferenceRange <T> >(); do { ReferenceRange <T> refRange = new ReferenceRange <T>(); refRange.ReadXml(reader); otherRefRanges.Add(refRange); } while (reader.LocalName == "other_reference_ranges"); this.otherReferenceRanges = otherRefRanges; } if (reader.LocalName == "normal_status") { if (this.normalStatus == null) { this.normalStatus = new CodePhrase(); } // CM: 06/03/08 this.normalStatus.ReadXml(reader); } }
public DvQuantity(Double magnitude, string units, int precision, DvInterval <DvQuantity> normalRange, ReferenceRange <DvQuantity>[] referenceRanges, string magnitudeStatus) : this(magnitude, units, precision, -1, false, magnitudeStatus, null, normalRange, referenceRanges) { }
public DvOrdinal(int value, Text.DvCodedText symbol, DvInterval <DvOrdinal> normalRange, ReferenceRange <DvOrdinal>[] referenceRanges) : this(value, symbol, null, normalRange, referenceRanges) { }
public DvCount(long magnitude, DvInterval <DvCount> normalRange, ReferenceRange <DvCount>[] referenceRanges, float accuracy, bool accuracyIsPercent, string magnitudeStatus) : this(magnitude, accuracy, accuracyIsPercent, magnitudeStatus, null, normalRange, referenceRanges) { }
public DvCount(long magnitude, DvInterval <DvCount> normalRange) : this(magnitude, -1, false, null, null, normalRange, null) { }
public DvQuantity(Double magnitude, string units, int precision, DvInterval <DvQuantity> normalRange) : this(magnitude, units, precision, -1, false, null, null, normalRange, null) { }
public DvQuantity(Double magnitude, string units, DvInterval <DvQuantity> normalRange, ReferenceRange <DvQuantity>[] referenceRanges) : this(magnitude, units, -1, false, null, null, normalRange, referenceRanges) { }
protected void SetBaseData(string magnitudeStatus, CodePhrase normalStatus, DvInterval <T> normalRange, ReferenceRange <T>[] otherReferenceRanges) { base.SetBaseData(magnitudeStatus, normalStatus, normalRange, otherReferenceRanges); }