private void ChangeTaddYoungVisitOneToCheckedIn() { StructureMapContainer.Configure( s => s.For <IVisitStatusRepository> ().Use(new VisitStatusRepository(SessionProvider))); TaddYoungVisitOne.CheckIn(new DateTime(2002, 3, 28, 9, 0, 0)); Session.SaveOrUpdate(TaddYoungVisitOne); }
private static void InicializadorInyectorDependencia() { var ioc = new StructureMapContainer(); ioc.Configure(); new StructureMapDependencyResolver(ObjectFactory.Container); new StructureMapFilterProvider(ObjectFactory.Container); }
protected override void OnSetup() { base.OnSetup(); StructureMapContainer.Configure( x => x.Scan(scanner => { scanner.AssembliesFromApplicationBaseDirectory(p => (p.FullName == null) ? false : p.FullName.Contains("HL7Generator.Infrastructure")); scanner.LookForRegistries(); })); }
protected virtual void SetupSystemAccountProvider() { var systemAccount = new SystemAccount("{2342-23434593-345345-345-345-3}", "sytemuser displayname", new EmailAddress("*****@*****.**"), "uri:FakeProvider", "FakeProvider"); using (ITransaction trans = Session.BeginTransaction()) { Session.SaveOrUpdate(systemAccount); trans.Commit(); } var systemAccountProviderMock = new Mock <ISystemAccountProvider> (); systemAccountProviderMock .SetupGet(x => x.SystemAccount) .Returns(systemAccount); StructureMapContainer.Configure(s => s .For <ISystemAccountProvider> () .Singleton() .Use(systemAccountProviderMock.Object)); }
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(); }
protected override void OnSetup() { base.OnSetup(); StructureMapContainer.Configure( s => s.For <IPatientFactory> ().Use(new PatientFactory(new PatientRepository(SessionProvider), new PatientUniqueIdentifierGenerator()))); }