/// <inheritdoc/> public string ToDelimitedString() { CultureInfo culture = CultureInfo.CurrentCulture; return(string.Format( culture, StringHelper.StringFormatSequence(0, 44, Configuration.FieldSeparator), Id, SetIdFt1.HasValue ? SetIdFt1.Value.ToString(culture) : null, TransactionId, TransactionBatchId, TransactionDate?.ToDelimitedString(), TransactionPostingDate.HasValue ? TransactionPostingDate.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null, TransactionType?.ToDelimitedString(), TransactionCode?.ToDelimitedString(), TransactionDescription, TransactionDescriptionAlt, TransactionQuantity.HasValue ? TransactionQuantity.Value.ToString(Consts.NumericFormat, culture) : null, TransactionAmountExtended?.ToDelimitedString(), TransactionAmountUnit?.ToDelimitedString(), DepartmentCode?.ToDelimitedString(), HealthPlanId?.ToDelimitedString(), InsuranceAmount?.ToDelimitedString(), AssignedPatientLocation?.ToDelimitedString(), FeeSchedule?.ToDelimitedString(), PatientType?.ToDelimitedString(), DiagnosisCodeFt1 != null ? string.Join(Configuration.FieldRepeatSeparator, DiagnosisCodeFt1.Select(x => x.ToDelimitedString())) : null, PerformedByCode != null ? string.Join(Configuration.FieldRepeatSeparator, PerformedByCode.Select(x => x.ToDelimitedString())) : null, OrderedByCode != null ? string.Join(Configuration.FieldRepeatSeparator, OrderedByCode.Select(x => x.ToDelimitedString())) : null, UnitCost?.ToDelimitedString(), FillerOrderNumber?.ToDelimitedString(), EnteredByCode != null ? string.Join(Configuration.FieldRepeatSeparator, EnteredByCode.Select(x => x.ToDelimitedString())) : null, ProcedureCode?.ToDelimitedString(), ProcedureCodeModifier != null ? string.Join(Configuration.FieldRepeatSeparator, ProcedureCodeModifier.Select(x => x.ToDelimitedString())) : null, AdvancedBeneficiaryNoticeCode?.ToDelimitedString(), MedicallyNecessaryDuplicateProcedureReason?.ToDelimitedString(), NdcCode?.ToDelimitedString(), PaymentReferenceId?.ToDelimitedString(), TransactionReferenceKey != null ? string.Join(Configuration.FieldRepeatSeparator, TransactionReferenceKey.Select(x => x.ToString(Consts.NumericFormat, culture))) : null, PerformingFacility != null ? string.Join(Configuration.FieldRepeatSeparator, PerformingFacility.Select(x => x.ToDelimitedString())) : null, OrderingFacility?.ToDelimitedString(), ItemNumber?.ToDelimitedString(), ModelNumber, SpecialProcessingCode != null ? string.Join(Configuration.FieldRepeatSeparator, SpecialProcessingCode.Select(x => x.ToDelimitedString())) : null, ClinicCode?.ToDelimitedString(), ReferralNumber?.ToDelimitedString(), AuthorizationNumber?.ToDelimitedString(), ServiceProviderTaxonomyCode?.ToDelimitedString(), RevenueCode?.ToDelimitedString(), PrescriptionNumber, NdcQtyAndUom?.ToDelimitedString() ).TrimEnd(Configuration.FieldSeparator.ToCharArray())); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (TransactionID != null) { hashCode = hashCode * 59 + TransactionID.GetHashCode(); } if (BuyerFirstName != null) { hashCode = hashCode * 59 + BuyerFirstName.GetHashCode(); } if (BuyerLastName != null) { hashCode = hashCode * 59 + BuyerLastName.GetHashCode(); } if (BuyerAddress != null) { hashCode = hashCode * 59 + BuyerAddress.GetHashCode(); } if (BuyerCity != null) { hashCode = hashCode * 59 + BuyerCity.GetHashCode(); } if (BuyerEmail != null) { hashCode = hashCode * 59 + BuyerEmail.GetHashCode(); } if (BuyerUserId != null) { hashCode = hashCode * 59 + BuyerUserId.GetHashCode(); } if (PaymentStatus != null) { hashCode = hashCode * 59 + PaymentStatus.GetHashCode(); } if (PaymentReferenceId != null) { hashCode = hashCode * 59 + PaymentReferenceId.GetHashCode(); } if (TotalAmount != null) { hashCode = hashCode * 59 + TotalAmount.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if Transaction instances are equal /// </summary> /// <param name="other">Instance of Transaction to be compared</param> /// <returns>Boolean</returns> public bool Equals(Transaction other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( TransactionID == other.TransactionID || TransactionID != null && TransactionID.Equals(other.TransactionID) ) && ( BuyerFirstName == other.BuyerFirstName || BuyerFirstName != null && BuyerFirstName.Equals(other.BuyerFirstName) ) && ( BuyerLastName == other.BuyerLastName || BuyerLastName != null && BuyerLastName.Equals(other.BuyerLastName) ) && ( BuyerAddress == other.BuyerAddress || BuyerAddress != null && BuyerAddress.Equals(other.BuyerAddress) ) && ( BuyerCity == other.BuyerCity || BuyerCity != null && BuyerCity.Equals(other.BuyerCity) ) && ( BuyerEmail == other.BuyerEmail || BuyerEmail != null && BuyerEmail.Equals(other.BuyerEmail) ) && ( BuyerUserId == other.BuyerUserId || BuyerUserId != null && BuyerUserId.Equals(other.BuyerUserId) ) && ( PaymentStatus == other.PaymentStatus || PaymentStatus != null && PaymentStatus.Equals(other.PaymentStatus) ) && ( PaymentReferenceId == other.PaymentReferenceId || PaymentReferenceId != null && PaymentReferenceId.Equals(other.PaymentReferenceId) ) && ( TotalAmount == other.TotalAmount || TotalAmount != null && TotalAmount.Equals(other.TotalAmount) )); }