Exemple #1
0
        /// <summary>
        /// Removes the alias.
        /// </summary>
        /// <param name="patientAlias">The patient alias.</param>
        public virtual void RemoveAlias(PatientAlias patientAlias)
        {
            Check.IsNotNull(patientAlias, "alias is required.");

            _aliases.Delete(patientAlias);
            NotifyItemRemoved(() => Aliases, patientAlias);
        }
Exemple #2
0
        /// <summary>
        /// Adds the alias.
        /// </summary>
        /// <param name="patientAlias">The patient alias.</param>
        public virtual void AddAlias(PatientAlias patientAlias)
        {
            Check.IsNotNull(patientAlias, "patient alias is required.");

            DomainRuleEngine.CreateRuleEngine <Patient, PatientAlias> (this, () => AddAlias)
            .WithContext(patientAlias)
            .Execute(
                () =>
            {
                patientAlias.Patient = this;
                _aliases.Add(patientAlias);
                NotifyItemAdded(() => Aliases, patientAlias);
            });
        }
Exemple #3
0
        /// <summary>
        /// Determines if the values are equal.
        /// </summary>
        /// <param name="patientAlias">
        /// The other object.
        /// </param>
        /// <returns>
        /// A boolean denoting equality of the values.
        /// </returns>
        public virtual bool ValuesEqual(PatientAlias patientAlias)
        {
            if (patientAlias == null)
            {
                return(false);
            }

            var valuesEqual =
                Equals(FirstName, patientAlias.FirstName) &&
                Equals(MiddleName, patientAlias.MiddleName) &&
                Equals(LastName, patientAlias.LastName) &&
                Equals(PatientAliasType, patientAlias.PatientAliasType);

            return(valuesEqual);
        }
Exemple #4
0
        /// <summary>
        /// Removes the alias.
        /// </summary>
        /// <param name="patientAlias">The patient alias.</param>
        public virtual void RemoveAlias(PatientAlias patientAlias)
        {
            Check.IsNotNull(patientAlias, "alias is required.");

            _aliases.Delete(patientAlias);
            NotifyItemRemoved(() => Aliases, patientAlias);
        }
Exemple #5
0
        /// <summary>
        /// Adds the alias.
        /// </summary>
        /// <param name="patientAlias">The patient alias.</param>
        public virtual void AddAlias(PatientAlias patientAlias)
        {
            Check.IsNotNull(patientAlias, "patient alias is required.");

            DomainRuleEngine.CreateRuleEngine<Patient, PatientAlias> ( this, () => AddAlias )
                .WithContext ( patientAlias )
                .Execute (
                    () =>
                        {
                            patientAlias.Patient = this;
                            _aliases.Add ( patientAlias );
                            NotifyItemAdded ( () => Aliases, patientAlias );
                        } );
        }
Exemple #6
0
        /// <summary>
        /// Determines if the values are equal.
        /// </summary>
        /// <param name="patientAlias">
        /// The other object.
        /// </param>
        /// <returns>
        /// A boolean denoting equality of the values.
        /// </returns>              
        public virtual bool ValuesEqual( PatientAlias patientAlias )
        {
            if (patientAlias == null)
            {
                return false;
            }

            var valuesEqual =
                Equals ( FirstName, patientAlias.FirstName ) &&
                Equals ( MiddleName, patientAlias.MiddleName ) &&
                Equals ( LastName, patientAlias.LastName ) &&
                Equals ( PatientAliasType, patientAlias.PatientAliasType );

            return valuesEqual;
        }