private void MapAgencyPhone(AgencyAddressAndPhone agencyAddressAndPhone, AgencyAddressAndPhoneDto agencyAddressAndPhoneDto)
 {
     _mappingResult &=
         new AggregateNodeCollectionMapper <AgencyPhoneDto, AgencyAddressAndPhone, AgencyPhone> (
             agencyAddressAndPhoneDto.PhoneNumbers, agencyAddressAndPhone, agencyAddressAndPhone.PhoneNumbers).MapAddedItem(AddAgencyPhone)
         .MapChangedItem(
             ChangeAgencyPhone).MapRemovedItem(RemoveAgencyPhone).Map();
 }
Пример #2
0
        public void FixtureSetup_Succeeds()
        {
            Assert.IsTrue(SafeHarborAgency.Key > 0);

            AgencyAddressAndPhone addressAndPhone = SafeHarborAgency.AddressesAndPhones.Single();

            Assert.IsTrue(addressAndPhone.Key > 0);

            AgencyPhone tollFreeNumber = addressAndPhone.PhoneNumbers.Where(a => a.AgencyPhoneType == TollFreeAgencyPhoneType).Single();

            Assert.IsTrue(tollFreeNumber.Key > 0);
            AgencyPhone faxNumber = addressAndPhone.PhoneNumbers.Where(a => a.AgencyPhoneType == FaxAgencyPhoneType).Single();

            Assert.IsTrue(faxNumber.Key > 0);

            Assert.IsTrue(LeoSmithStaff.Key > 0);
            Assert.IsTrue(WendyJonesStaff.Key > 0);
            Assert.IsTrue(SheilaAndersonStaff.Key > 0);
            Assert.IsTrue(BethKnoxStaff.Key > 0);
            Assert.IsTrue(AnthonyBellStaff.Key > 0);

            AgencyIdentifier npiIdentifier = SafeHarborAgency.AgencyIdentifiers.Single();

            Assert.IsTrue(npiIdentifier.Key > 0);

            Assert.IsTrue(AlbertSmithPatient.Key > 0);

            Assert.IsTrue(AlbertSmithPatientClinicalCaseOne.Key > 0);

            Assert.IsTrue(AlbertSmithPatientAllergyOne.Key > 0);

            Assert.IsTrue(AlbertSmithPatientMedicationOne.Key > 0);

            Assert.IsTrue(AlbertSmithPatientClinicalCaseOne.Key > 0);
            Assert.IsTrue(AlbertSmithPatientClinicalCaseTwo.Key > 0);

            Assert.IsTrue(AlbertSmithPatientClinicalCaseOneProblemOne.Key > 0);
            Assert.IsTrue(AlbertSmithPatientClinicalCaseOneProblemTwo.Key > 0);

            Assert.IsTrue(AlbertSmithPatientClinicalCaseOneVisitOne.Key > 0);
            Assert.IsTrue(AlbertSmithPatientClinicalCaseOneVisitTwo.Key > 0);
            Assert.IsTrue(AlbertSmithPatientClinicalCaseOneVisitThree.Key > 0);
            Assert.IsTrue(AlbertSmithPatientClinicalCaseOneVisitFour.Key > 0);

            Assert.IsTrue(AlbertSmithPatientClinicalCaseOneVisitOneLabSpecimenOne.Key > 0);
            Assert.IsTrue(AlbertSmithPatientClinicalCaseOneVisitOneLabSpecimenTwo.Key > 0);

            Assert.IsTrue(AlbertSmithPatientClinicalCaseOneVisitOneLabSpecimenOneLabTestOne.Key > 0);
            Assert.IsTrue(AlbertSmithPatientClinicalCaseOneVisitOneLabSpecimenOneLabTestTwo.Key > 0);

            Assert.IsTrue(AlbertSmithPatientClinicalCaseOneVisitOneLabSpecimenOneLabTestOneLabResultOne.Key > 0);
            Assert.IsTrue(AlbertSmithPatientClinicalCaseOneVisitOneLabSpecimenOneLabTestOneLabResultTwo.Key > 0);

            Assert.IsTrue(AlbertSmithPatientClinicalCaseOneVisitFourImmunizationOne.Key > 0);

            Assert.IsTrue(AlbertSmithPatientClinicalCaseOneVisitOneVitalSignOne.Key > 0);
        }
        private void AddAgencyPhone(AgencyPhoneDto agencyPhoneDto, AgencyAddressAndPhone agencyAddressAndPhone)
        {
            var agencyPhoneType = _mappingHelper.MapLookupField <AgencyPhoneType> (agencyPhoneDto.AgencyPhoneType);

            agencyAddressAndPhone.AddPhone(
                new AgencyPhoneBuilder().WithAgencyPhoneType(agencyPhoneType).WithPhone(
                    new PhoneBuilder().WithPhoneNumber(agencyPhoneDto.PhoneNumber).WithPhoneExtensionNumber(
                        agencyPhoneDto.PhoneExtensionNumber)));
        }
        private void ChangeAgencyAddress(
            AgencyAddressAndPhoneDto agencyAddressAndPhoneDto, Agency agency, AgencyAddressAndPhone agencyAddressAndPhone)
        {
            var agencyAddressType = _mappingHelper.MapLookupField <AgencyAddressType> (agencyAddressAndPhoneDto.AgencyAddressType);
            var stateProvince     = _mappingHelper.MapLookupField <StateProvince> (agencyAddressAndPhoneDto.StateProvince);
            var countyArea        = _mappingHelper.MapLookupField <CountyArea> (agencyAddressAndPhoneDto.CountyArea);
            var country           = _mappingHelper.MapLookupField <Country> (agencyAddressAndPhoneDto.Country);

            agencyAddressAndPhone.ReviseAgencyAddress(
                new AgencyAddress(
                    agencyAddressType,
                    new AddressBuilder().WithFirstStreetAddress(agencyAddressAndPhoneDto.FirstStreetAddress).WithSecondStreetAddress(
                        agencyAddressAndPhoneDto.SecondStreetAddress).WithCityName(agencyAddressAndPhoneDto.CityName).WithCountyArea(
                        countyArea).WithStateProvince(stateProvince)
                    .WithCountry(country).WithPostalCode(new PostalCode(agencyAddressAndPhoneDto.PostalCode))));

            MapAgencyPhone(agencyAddressAndPhone, agencyAddressAndPhoneDto);
        }
Пример #5
0
        protected override void OnSetup()
        {
            base.OnSetup();

            StructureMapContainer.Configure(
                c =>
            {
                c.For <IAccessControlManager> ().Use(AccessControlManager);
                c.For <IVisitStatusRepository> ().Use(new VisitStatusRepository(SessionProvider));
                c.For <IRuleCollectionFactory>().Use <RuleCollectionFactory>();
                c.Scan(x =>
                {
                    // in the scan operation, include all needed dlls (Rem.*)
                    // be cautious in the future - this could still pick up unwanted assemblies,
                    // such as the stray test project that mistakenly ends up in the bin folder.
                    // so consider those possibilities if errors pop up, and you're led here.
                    x.AssembliesFromApplicationBaseDirectory(p => (p.FullName == null) ? false : p.FullName.Contains("Rem."));

                    x.ConnectImplementationsToTypesClosing(typeof(IRuleCollection <>));

                    x.ConnectImplementationsToTypesClosing(typeof(IRuleCollectionCustomizer <,>));
                });
            });

            using (ITransaction trans = Session.BeginTransaction())
            {
                SafeHarborAgency = BuildAgency(TreatmentProviderAgencyType, "Safe Harbor", "Safe Harbor");

                AgencyAddressAndPhone safeHarborWayAgencyAddressAndPhone =
                    SafeHarborAgency.AddAddressAndPhone(
                        new AgencyAddress(
                            AdministrationAgencyAddressType,
                            new AddressBuilder().WithFirstStreetAddress("123 Safe Harbor Way").WithCityName("Columbia").WithStateProvince(
                                MarylandStateProvince).WithPostalCode(new PostalCode("21046"))));

                safeHarborWayAgencyAddressAndPhone.AddPhone(
                    new AgencyPhoneBuilder().WithAgencyPhoneType(TollFreeAgencyPhoneType).WithPhone(
                        new PhoneBuilder().WithPhoneNumber(("555-555-5555"))));
                safeHarborWayAgencyAddressAndPhone.AddPhone(
                    new AgencyPhoneBuilder().WithAgencyPhoneType(FaxAgencyPhoneType).WithPhone(
                        new PhoneBuilder().WithPhoneNumber(("666-666-6666"))));

                SafeHarborAgency.AddIdentifier(
                    new AgencyIdentifierBuilder().WithAgencyIdentifierType(NpiAgencyIdentifierType).WithIdentifierNumber("154975646"));

                SafeHarborAgency.AddAgencyAlias(new AgencyAliasBuilder().WithName("Safe Harbor Ent").Build());

                LeoSmithStaff = BuildStaff(SafeHarborAgency, "Leo", "Smith");

                WendyJonesStaff     = BuildStaff(SafeHarborAgency, "Wendy", "Jones");
                SheilaAndersonStaff = BuildStaff(SafeHarborAgency, "Sheila", "Anderson");
                BethKnoxStaff       = BuildStaff(SafeHarborAgency, "Beth", "Knox");
                AnthonyBellStaff    = BuildStaff(SafeHarborAgency, "Anthony", "Bell");

                SafeHarborAgency.AddContact(
                    new AgencyContactBuilder().WithAgencyContactType(CeoAgencyContactType).WithContactStaff(LeoSmithStaff).WithStatusIndicator(true));

                SafeHarborAgency.AddContact(
                    new AgencyContactBuilder().WithAgencyContactType(BillingAgencyContactType).WithContactStaff(BethKnoxStaff).WithStatusIndicator(
                        false));

                SafeHarborLocation = BuildLocation(SafeHarborAgency, "Safe Harbor Counseling Center");

                BuildAlbertSmithPatient();

                AlbertSmithPatientAllergyOne = BuildAllergy(AlbertSmithPatient, ActiveAllergyStatus, AllergenCodedConcept);

                AlbertSmithPatientMedicationOne = BuildMedication(AlbertSmithPatient, MedicationCodeCodedConcept);

                AlbertSmithPatientClinicalCaseOne = BuildClinicalCase(AlbertSmithPatient, SafeHarborLocation, 1);
                AlbertSmithPatientClinicalCaseTwo = BuildClinicalCase(AlbertSmithPatient, SafeHarborLocation, 2);

                AlbertSmithPatientClinicalCaseOneProblemOne = BuildProblem(AlbertSmithPatientClinicalCaseOne, ProblemCodeCodedConcept);
                AlbertSmithPatientClinicalCaseOneProblemTwo = BuildProblem(AlbertSmithPatientClinicalCaseOne, ProblemCodeCodedConcept);

                AlbertSmithPatientClinicalCaseOneProblemThree = BuildProblem(AlbertSmithPatientClinicalCaseOne, ProblemCodeCodedConcept);
                AlbertSmithPatientClinicalCaseOneProblemThree.UpdateProblemStatus(ActiveProblemStatus, DateTime.Now);

                AlbertSmithPatientClinicalCaseOneVisitOne = BuildScheduledVisit(
                    LeoSmithStaff,
                    new DateTimeRange(new DateTime(2002, 3, 28, 9, 0, 0), new DateTime(2002, 3, 28, 10, 0, 0)),
                    AlbertSmithPatientClinicalCaseOne);
                AlbertSmithPatientClinicalCaseOneVisitTwo = BuildScheduledVisit(
                    LeoSmithStaff,
                    new DateTimeRange(new DateTime(2010, 3, 28, 9, 0, 0), new DateTime(2010, 3, 28, 10, 0, 0)),
                    AlbertSmithPatientClinicalCaseOne);
                AlbertSmithPatientClinicalCaseOneVisitThree = BuildScheduledVisit(
                    LeoSmithStaff,
                    new DateTimeRange(new DateTime(2011, 3, 28, 9, 0, 0), new DateTime(2011, 3, 28, 10, 0, 0)),
                    AlbertSmithPatientClinicalCaseOne,
                    AlbertSmithPatientClinicalCaseOneProblemThree);
                AlbertSmithPatientClinicalCaseOneVisitFour = BuildCheckedInVisit(
                    LeoSmithStaff,
                    new DateTimeRange(new DateTime(2011, 3, 28, 9, 0, 0), new DateTime(2011, 3, 28, 10, 0, 0)),
                    AlbertSmithPatientClinicalCaseOne);

                AlbertSmithPatientClinicalCaseOneVisitOneLabSpecimenOne = BuildLabSpecimen(
                    AlbertSmithPatientClinicalCaseOneVisitOne, LabSpecimentActivityType);
                AlbertSmithPatientClinicalCaseOneVisitOneLabSpecimenTwo = BuildLabSpecimen(
                    AlbertSmithPatientClinicalCaseOneVisitOne, LabSpecimentActivityType);

                AlbertSmithPatientClinicalCaseOneVisitOneLabSpecimenOneLabTestOne =
                    BuildLabTest(AlbertSmithPatientClinicalCaseOneVisitOneLabSpecimenOne, LabTestNameCodedConcept);
                AlbertSmithPatientClinicalCaseOneVisitOneLabSpecimenOneLabTestTwo =
                    BuildLabTest(AlbertSmithPatientClinicalCaseOneVisitOneLabSpecimenOne, LabTestNameCodedConcept);

                AlbertSmithPatientClinicalCaseOneVisitOneLabSpecimenOneLabTestOneLabResultOne =
                    BuildLabResult(AlbertSmithPatientClinicalCaseOneVisitOneLabSpecimenOneLabTestOne, LabTestResultNameCodedConcept, 15.09);
                AlbertSmithPatientClinicalCaseOneVisitOneLabSpecimenOneLabTestOneLabResultTwo =
                    BuildLabResult(AlbertSmithPatientClinicalCaseOneVisitOneLabSpecimenOneLabTestOne, LabTestResultNameCodedConcept, 19.67);

                AlbertSmithPatientClinicalCaseOneVisitFourImmunizationOne = BuildImmunization(
                    AlbertSmithPatientClinicalCaseOneVisitFour, ImmunizationActivityType);

                AlbertSmithPatientClinicalCaseOneVisitFourImmunizationTwo = BuildImmunization(
                    AlbertSmithPatientClinicalCaseOneVisitFour, ImmunizationActivityType, MmrVaccineCodedConcept);

                AlbertSmithPatientClinicalCaseOneVisitOneVitalSignOne = BuildVitalSign(AlbertSmithPatientClinicalCaseOneVisitOne, 3, 0, 50);

                BuildTaddYoungPatient();
                TaddYoungPatientClinicalCaseOne = BuildClinicalCase(TaddYoungPatient, SafeHarborLocation, 1);

                TaddYoungVisitOne = BuildScheduledVisit(
                    LeoSmithStaff,
                    new DateTimeRange(new DateTime(2002, 3, 28, 9, 0, 0), new DateTime(2002, 3, 28, 10, 0, 0)),
                    TaddYoungPatientClinicalCaseOne);

                ChangeTaddYoungVisitOneToCheckedIn();

                TaddYoungVitalSignOne = BuildVitalSign(TaddYoungVisitOne, 3, 0, 50);

                trans.Commit();
            }

            Session.Clear();
        }
 private static void RemoveAgencyPhone(
     AgencyPhoneDto agencyPhoneDto, AgencyAddressAndPhone agencyAddressAndPhone, AgencyPhone agencyPhone)
 {
     agencyAddressAndPhone.RemovePhone(agencyPhone);
 }
 private void RemoveAgencyAddress(
     AgencyAddressAndPhoneDto agencyAddressAndPhoneDto, Agency agency, AgencyAddressAndPhone agencyAddressAndPhone)
 {
     agency.RemoveAddress(agencyAddressAndPhone);
 }
 private void ChangeAgencyPhone(
     AgencyPhoneDto agencyPhoneDto, AgencyAddressAndPhone agencyAddressAndPhone, AgencyPhone agencyPhone)
 {
     RemoveAgencyPhone(agencyPhoneDto, agencyAddressAndPhone, agencyPhone);
     AddAgencyPhone(agencyPhoneDto, agencyAddressAndPhone);
 }