Beispiel #1
0
        /// <summary>
        /// Creates the patient account.
        /// </summary>
        /// <param name="billingOffice">The billing office.</param>
        /// <param name="medicalRecordNumber">The medical record number.</param>
        /// <param name="name">The name.</param>
        /// <param name="birthDate">The birth date.</param>
        /// <param name="homeAddress">The home address.</param>
        /// <param name="administrativeGender">The administrative gender.</param>
        /// <returns>A patient account.</returns>
        public virtual PatientAccount CreatePatientAccount(BillingOffice billingOffice, long medicalRecordNumber, PersonName name, DateTime?birthDate, Address homeAddress, AdministrativeGender administrativeGender)
        {
            var patientAccount = new PatientAccount(billingOffice, medicalRecordNumber, name, birthDate, homeAddress, administrativeGender);

            _patientAccountRepository.MakePersistent(patientAccount);
            return(patientAccount);
        }
Beispiel #2
0
        /// <summary>
        /// Creates the payor.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="billingOffice">The billing office.</param>
        /// <param name="electronicTransmitterIdentificationNumber">The electronic transmitter identification number.</param>
        /// <returns>A payor.</returns>
        public Payor CreatePayor(string name, BillingOffice billingOffice, string electronicTransmitterIdentificationNumber)
        {
            var payor = new Payor(name, billingOffice, electronicTransmitterIdentificationNumber);

            _payorRepository.MakePersistent(payor);
            return(payor);
        }
Beispiel #3
0
        /// <summary>
        /// Creates the type of the payor.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="billingOffice">The billing office.</param>
        /// <param name="billingForm">The billing form.</param>
        /// <returns>A payor type.</returns>
        public PayorType CreatePayorType(string name, BillingOffice billingOffice, BillingForm billingForm)
        {
            var payorType = new PayorType(name, billingOffice, billingForm);

            _payorTypeRepository.MakePersistent(payorType);
            return(payorType);
        }
        /// <summary>
        /// Processes the single aggregate.
        /// </summary>
        /// <param name="dto">The dto.</param>
        /// <param name="billingOffice">The billing office.</param>
        /// <returns>A <see cref="System.Boolean"/></returns>
        protected override bool ProcessSingleAggregate(BillingOfficeProfileDto dto, BillingOffice billingOffice)
        {
            var billingOfficeProfile = new BillingOfficeProfile(
                dto.Name, new DateRange(dto.EffectiveDate, dto.EndDate), dto.EmailAddress == null ? null : new EmailAddress(dto.EmailAddress));

            billingOffice.ReviseProfile(billingOfficeProfile);

            return(true);
        }
Beispiel #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PayorType"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="billingOffice">The billing office.</param>
        /// <param name="billingForm">The billing form.</param>
        public PayorType(string name, BillingOffice billingOffice, BillingForm billingForm)
            : this()
        {
            Check.IsNotNullOrWhitespace(name, () => Name);
            Check.IsNotNull(billingOffice, () => BillingOffice);
            Check.IsNotNull(billingForm, () => BillingForm);

            Name          = name;
            BillingOffice = billingOffice;
            BillingForm   = billingForm;
        }
Beispiel #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Payor"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="billingOffice">The billing office.</param>
        /// <param name="electronicTransmitterIdentificationNumber">The electronic transmitter identification number.</param>
        public Payor(string name, BillingOffice billingOffice, string electronicTransmitterIdentificationNumber)
            : this()
        {
            Check.IsNotNull(name, () => Name);
            Check.IsNotNull(billingOffice, () => BillingOffice);
            Check.IsNotNull(electronicTransmitterIdentificationNumber, () => ElectronicTransmitterIdentificationNumber);

            Name          = name;
            BillingOffice = billingOffice;
            ElectronicTransmitterIdentificationNumber = electronicTransmitterIdentificationNumber;
        }
        /// <summary>
        /// Processes the single aggregate.
        /// </summary>
        /// <param name="dto">The dto.</param>
        /// <param name="billingOffice">The billing office.</param>
        /// <returns>A <see cref="System.Boolean"/></returns>
        protected override bool ProcessSingleAggregate(BillingOfficePhonesDto dto, BillingOffice billingOffice)
        {
            _mappingResult &=
                new AggregateNodeCollectionMapper <BillingOfficePhoneDto, BillingOffice, BillingOfficePhone> (
                    dto.PhoneNumbers, billingOffice, billingOffice.PhoneNumbers)
                .MapRemovedItem(RemoveBillingOfficePhone)
                .MapAddedItem(AddBillingOfficePhone)
                .MapChangedItem(ChangeBillingOfficePhone)
                .Map();

            return(_mappingResult);
        }
Beispiel #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PatientAccount"/> class.
        /// </summary>
        /// <param name="billingOffice">The billing office.</param>
        /// <param name="medicalRecordNumber">The medical record number.</param>
        /// <param name="name">The name.</param>
        /// <param name="birthDate">The birth date.</param>
        /// <param name="homeAddress">The home address.</param>
        /// <param name="administrativeGender">The administrative gender.</param>
        protected internal PatientAccount(BillingOffice billingOffice, long medicalRecordNumber, PersonName name, DateTime?birthDate, Address homeAddress, AdministrativeGender administrativeGender) : this()
        {
            Check.IsNotNull(billingOffice, "Billing office is required.");
            Check.IsNotNull(name, "Name is required.");
            Check.IsNotNull(medicalRecordNumber, "Medical record number is required.");
            Check.IsNotNull(homeAddress, () => HomeAddress);
            Check.IsNotNull(administrativeGender, "Gender is required.");

            BillingOffice       = billingOffice;
            MedicalRecordNumber = medicalRecordNumber;
            Name                 = name;
            BirthDate            = birthDate;
            HomeAddress          = homeAddress;
            AdministrativeGender = administrativeGender;
        }
Beispiel #9
0
 /// <summary>
 /// Revises the billing office.
 /// </summary>
 /// <param name="billingOffice">The billing office.</param>
 public virtual void ReviseBillingOffice(BillingOffice billingOffice)
 {
     Check.IsNotNull(billingOffice, () => BillingOffice);
     BillingOffice = billingOffice;
 }
        private void AddBillingOfficePhone(BillingOfficePhoneDto billingOfficePhoneDto, BillingOffice billingOffice)
        {
            var phoneType = _mappingHelper.MapLookupField <BillingOfficePhoneType> (billingOfficePhoneDto.BillingOfficePhoneType);

            var phoneNumber = new PhoneBuilder()
                              .WithPhoneNumber(billingOfficePhoneDto.PhoneNumber)
                              .WithPhoneExtensionNumber(billingOfficePhoneDto.Extension)
                              .Build();

            var billingOfficePhone = new BillingOfficePhone(phoneType, phoneNumber);

            billingOffice.AddPhoneNumber(billingOfficePhone);
        }
 private static void RemoveBillingOfficePhone(
     BillingOfficePhoneDto billingOfficePhoneDto, BillingOffice billingOffice, BillingOfficePhone billingOfficePhone)
 {
     billingOffice.RemovePhoneNumber(billingOfficePhone);
 }
 private void ChangeBillingOfficePhone(
     BillingOfficePhoneDto billingOfficePhoneDto, BillingOffice billingOffice, BillingOfficePhone billingOfficePhone)
 {
     RemoveBillingOfficePhone(billingOfficePhoneDto, billingOffice, billingOfficePhone);
     AddBillingOfficePhone(billingOfficePhoneDto, billingOffice);
 }
        private void AddBillingOfficeAddress(BillingOfficeAddressDto billingOfficeAddressDto, BillingOffice billingOffice)
        {
            var addressType         = _mappingHelper.MapLookupField <BillingOfficeAddressType> (billingOfficeAddressDto.BillingOfficeAddressType);
            var countyAreaLookup    = _mappingHelper.MapLookupField <CountyArea> (billingOfficeAddressDto.CountyArea);
            var stateProvinceLookup = _mappingHelper.MapLookupField <StateProvince> (billingOfficeAddressDto.StateProvince);
            var countryLookup       = _mappingHelper.MapLookupField <Country> (billingOfficeAddressDto.Country);

            var address = new AddressBuilder()
                          .WithFirstStreetAddress(billingOfficeAddressDto.FirstStreetAddress)
                          .WithSecondStreetAddress(billingOfficeAddressDto.SecondStreetAddress)
                          .WithCityName(billingOfficeAddressDto.CityName)
                          .WithCountyArea(countyAreaLookup)
                          .WithStateProvince(stateProvinceLookup)
                          .WithCountry(countryLookup)
                          .WithPostalCode(
                string.IsNullOrWhiteSpace(billingOfficeAddressDto.PostalCode)
                        ? null
                        : new PostalCode(billingOfficeAddressDto.PostalCode))
                          .Build();

            var billingOfficeAddress = new BillingOfficeAddress(addressType, address);

            billingOffice.AddAddress(billingOfficeAddress);
        }
 private static void RemoveBillingOfficeAddress(
     BillingOfficeAddressDto billingOfficeAddressDto, BillingOffice billingOffice, BillingOfficeAddress billingOfficeAddress)
 {
     billingOffice.RemoveAddress(billingOfficeAddress);
 }
 private void ChangeBillingOfficeAddress(
     BillingOfficeAddressDto billingOfficeAddressDto, BillingOffice billingOffice, BillingOfficeAddress billingOfficeAddress)
 {
     RemoveBillingOfficeAddress(billingOfficeAddressDto, billingOffice, billingOfficeAddress);
     AddBillingOfficeAddress(billingOfficeAddressDto, billingOffice);
 }