Example #1
0
        /// <summary>
        /// Removes the phone number.
        /// </summary>
        /// <param name="patientPhone">The patient phone.</param>
        public virtual void RemovePhoneNumber(PatientPhone patientPhone)
        {
            Check.IsNotNull(patientPhone, "patient phone is required.");

            _phoneNumbers.Delete(patientPhone);
            NotifyItemRemoved(() => PhoneNumbers, patientPhone);
        }
Example #2
0
        /// <summary>
        /// Adds the phone number.
        /// </summary>
        /// <param name="patientPhone">The patient phone.</param>
        public virtual void AddPhoneNumber(PatientPhone patientPhone)
        {
            Check.IsNotNull(patientPhone, "patient phone is required.");

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

            var valuesEqual =
                Equals(PatientPhoneType.Key, patientPhone.PatientPhoneType.Key) &&
                Equals(PhoneNumber, patientPhone.PhoneNumber) &&
                Equals(PhoneExtensionNumber, patientPhone.PhoneExtensionNumber) &&
                Equals(_confidentialIndicator, patientPhone._confidentialIndicator);

            return(valuesEqual);
        }
        /// <summary>
        /// Translates the specified patient phone.
        /// </summary>
        /// <param name="patientPhone">The patient phone.</param>
        /// <returns>A PatientAccountPhone.</returns>
        public PatientAccountPhone Translate(PatientPhone patientPhone)
        {
            if (patientPhone == null)
            {
                return null;
            }

            var patientAccountPhoneTypeWellKnownName = WellKnownNames.PatientAccountModule.PatientAccountPhoneType.Home;

            if (patientPhone.PatientPhoneType.WellKnownName == WellKnownNames.PatientModule.PatientPhoneType.Cell)
            {
                patientAccountPhoneTypeWellKnownName = WellKnownNames.PatientAccountModule.PatientAccountPhoneType.Cell;
            }

            var patientAccountPhoneType = _lookupValueRepository.GetLookupByWellKnownName<PatientAccountPhoneType>(patientAccountPhoneTypeWellKnownName);

            var patientAccountPhone = new PatientAccountPhone(patientAccountPhoneType, new Phone(patientPhone.PhoneNumber, patientPhone.PhoneExtensionNumber));

            return patientAccountPhone;
        }
Example #5
0
        /// <summary>
        /// Determines if the values are equal.
        /// </summary>
        /// <param name="patientPhone">
        /// The other object.
        /// </param>
        /// <returns>
        /// A boolean denoting equality of the values.
        /// </returns>           
        public virtual bool ValuesEqual( PatientPhone patientPhone )
        {
            if (patientPhone == null)
            {
                return false;
            }

            var valuesEqual =
                Equals ( PatientPhoneType.Key, patientPhone.PatientPhoneType.Key ) &&
                Equals ( PhoneNumber, patientPhone.PhoneNumber ) &&
                Equals ( PhoneExtensionNumber, patientPhone.PhoneExtensionNumber ) &&
                Equals ( _confidentialIndicator, patientPhone._confidentialIndicator );
            return valuesEqual;
        }
Example #6
0
        /// <summary>
        /// Removes the phone number.
        /// </summary>
        /// <param name="patientPhone">The patient phone.</param>
        public virtual void RemovePhoneNumber(PatientPhone patientPhone)
        {
            Check.IsNotNull(patientPhone, "patient phone is required.");

            _phoneNumbers.Delete(patientPhone);
            NotifyItemRemoved(() => PhoneNumbers, patientPhone);
        }
Example #7
0
        /// <summary>
        /// Adds the phone number.
        /// </summary>
        /// <param name="patientPhone">The patient phone.</param>
        public virtual void AddPhoneNumber(PatientPhone patientPhone)
        {
            Check.IsNotNull(patientPhone, "patient phone is required.");

            DomainRuleEngine.CreateRuleEngine<Patient, PatientPhone> ( this, () => AddPhoneNumber )
                .WithContext ( patientPhone )
                .Execute (
                    () =>
                        {
                            patientPhone.Patient = this;
                            _phoneNumbers.Add ( patientPhone );
                            NotifyItemAdded ( () => PhoneNumbers, patientPhone );
                        } );
        }