Exemple #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);
        }
Exemple #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);
            });
        }
Exemple #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;
        }
Exemple #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;
        }
Exemple #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);
        }
Exemple #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 );
                        } );
        }