Beispiel #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = ItemId;
         hashCode = (hashCode * 397) ^ (Id != null ? Id.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (FieldName != null ? FieldName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ValueAsString != null ? ValueAsString.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ ValueAsDecimal.GetHashCode();
         hashCode = (hashCode * 397) ^ ValueAsDateTime.GetHashCode();
         hashCode = (hashCode * 397) ^ ValueAsBool.GetHashCode();
         return(hashCode);
     }
 }
Beispiel #2
0
 public override int GetHashCode()
 {
     return(PersonId.GetHashCode() ^
            ConceptId.GetHashCode() ^
            (StartDate.GetHashCode()) ^
            (EndDate.GetHashCode()) ^
            TypeConceptId.GetHashCode() ^
            VisitOccurrenceId.GetHashCode() ^
            ValueAsNumber.GetHashCode() ^
            RangeLow.GetHashCode() ^
            RangeHigh.GetHashCode() ^
            VisitOccurrenceId.GetHashCode() ^
            ValueAsConceptId.GetHashCode() ^
            Time.GetHashCode() ^
            ProviderId.GetHashCode() ^
            RelevantConditionConceptId.GetHashCode() ^
            UnitsConceptId.GetHashCode() ^
            (ValueAsString != null ? ValueAsString.GetHashCode() : 0) ^
            (UnitsSourceValue != null ? UnitsSourceValue.GetHashCode() : 0) ^
            (SourceValue != null ? SourceValue.GetHashCode() : 0));
 }
Beispiel #3
0
        //--------------------------------------------------------------------------------------------------------
        //--------------------------------------------------------------------------------------------------------
        internal override decimal GetValueAfterApplyingPrecisionTruncation(int PrecisionValue)
        {
            if (this.NumericType == false)
            {
                throw new NotSupportedException();
            }
            decimal ValueAsDecimal = Convert.ToDecimal(this.ValueAsString);

            if (PrecisionValue > 0)
            {
                string WholePart;
                string TruncationAsString;

                int DecimalPointIndex = ValueAsString.IndexOf('.');
                if (DecimalPointIndex == -1)
                {
                    WholePart = ValueAsString;
                }
                else
                {
                    WholePart = ValueAsString.Substring(0, DecimalPointIndex);
                }
                if (PrecisionValue < WholePart.Length)
                {
                    TruncationAsString = WholePart;
                }
                else
                {
                    StringBuilder TruncationBuilder = new StringBuilder(WholePart.Substring(0, PrecisionValue));
                    for (int AddZeroCounter = 0; AddZeroCounter < (WholePart.Length - PrecisionValue); AddZeroCounter++)
                    {
                        TruncationBuilder.Append('0');
                    }
                    TruncationAsString = TruncationBuilder.ToString();
                }
                ValueAsDecimal = Convert.ToDecimal(TruncationAsString);
            }
            return(ValueAsDecimal);
        }
Beispiel #4
0
 public override int GetHashCode()
 => SubExpression.GetHashCode() + 37 *ValueAsString.GetHashCode();