コード例 #1
0
        /// <summary>
        /// Returns a value indicating whether two <see cref="ComponentGroup"/> are the same.
        /// </summary>
        /// <param name="other"></param>
        /// <param name="options"></param>
        /// <returns></returns>
        public bool AreSame(ComponentGroup other, PersonNameComparisonOptions options)
        {
            if (other == null)
                return false;

            if (IsEmpty)
                return other.IsEmpty;
            else
            {
                return AreSame(FamilyName, other.FamilyName, options) &&
                       AreSame(GivenName, other.GivenName, options) &&
                       AreSame(MiddleName, other.MiddleName, options) &&
                       AreSame(Prefix, other.Prefix, options) &&
                       AreSame(Suffix, other.Suffix, options);                
            }

        }
コード例 #2
0
			private void ValidatePatientNamesNotEqual(ComponentGroup original, ComponentGroup anonymized, string componentGroup)
			{
				string format = "The anonymized name component ({0}:{1}) cannot be the same as the original.";

				//may not have the same family, given, or middle name
				ValidateNotEqual(original.FamilyName, anonymized.FamilyName, "PatientsName", String.Format(format, componentGroup, "Family"));
				ValidateNotEqual(original.GivenName, anonymized.GivenName, "PatientsName", String.Format(format, componentGroup, "Given"));
				ValidateNotEqual(original.MiddleName, anonymized.MiddleName, "PatientsName", String.Format(format, componentGroup, "Middle"));
			}