コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #4
0
        /// <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);
        }
コード例 #5
0
ファイル: PayorType.cs プロジェクト: girish66/REM
        /// <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;
        }
コード例 #6
0
ファイル: Payor.cs プロジェクト: girish66/REM
        /// <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;
        }
コード例 #7
0
        /// <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);
        }
コード例 #8
0
ファイル: PatientAccount.cs プロジェクト: girish66/REM
        /// <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;
        }
コード例 #9
0
ファイル: PayorType.cs プロジェクト: girish66/REM
 /// <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;
 }
コード例 #10
0
        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);
        }
コード例 #11
0
 private static void RemoveBillingOfficePhone(
     BillingOfficePhoneDto billingOfficePhoneDto, BillingOffice billingOffice, BillingOfficePhone billingOfficePhone)
 {
     billingOffice.RemovePhoneNumber(billingOfficePhone);
 }
コード例 #12
0
 private void ChangeBillingOfficePhone(
     BillingOfficePhoneDto billingOfficePhoneDto, BillingOffice billingOffice, BillingOfficePhone billingOfficePhone)
 {
     RemoveBillingOfficePhone(billingOfficePhoneDto, billingOffice, billingOfficePhone);
     AddBillingOfficePhone(billingOfficePhoneDto, billingOffice);
 }
コード例 #13
0
        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);
        }
コード例 #14
0
 private static void RemoveBillingOfficeAddress(
     BillingOfficeAddressDto billingOfficeAddressDto, BillingOffice billingOffice, BillingOfficeAddress billingOfficeAddress)
 {
     billingOffice.RemoveAddress(billingOfficeAddress);
 }
コード例 #15
0
 private void ChangeBillingOfficeAddress(
     BillingOfficeAddressDto billingOfficeAddressDto, BillingOffice billingOffice, BillingOfficeAddress billingOfficeAddress)
 {
     RemoveBillingOfficeAddress(billingOfficeAddressDto, billingOffice, billingOfficeAddress);
     AddBillingOfficeAddress(billingOfficeAddressDto, billingOffice);
 }