Ejemplo n.º 1
0
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();

            //var connectionString = config["connectionStrings:hAPIConnection"].Replace("#dir#", TestContext.CurrentContext.TestDirectory.HasToEndWith(@"\"));

            var connectionString = config["connectionStrings:livehAPIConnection"];


            var options = new DbContextOptionsBuilder <LiveHAPIContext>()
                          .UseSqlServer(connectionString)
                          .Options;

            _reader  = new ClientUserReader(new RestClient(_baseUrl));
            _context = new LiveHAPIContext(options);

            _repository = new UserRepository(_context);

            _clientStageRepository             = new ClientStageRepository(_context);
            _clientStageRelationshipRepository = new ClientStageRelationshipRepository(_context);
            _clientRepository             = new ClientRepository(_context);
            _clientPretestStageRepository = new ClientPretestStageRepository(_context);
            var clientStageExtractor =
                new ClientStageExtractor(new PersonRepository(_context), new ClientStageRepository(_context), new SubscriberSystemRepository(_context), new ClientRepository(_context), new PracticeRepository(_context));
            var clientStageRelationshipExtractor =
                new ClientStageRelationshipExtractor(new ClientRelationshipRepository(_context), new ClientStageRelationshipRepository(_context), new SubscriberSystemRepository(_context));
            var clientPretestStageExtractor =
                new ClientPretestStageExtractor(new ClientStageRepository(_context), new ClientPretestStageRepository(_context), new SubscriberSystemRepository(_context), new ClientEncounterRepository(_context), new ClientRepository(_context));

            _service = new ExtractClientsService(clientStageExtractor, clientStageRelationshipExtractor, clientPretestStageExtractor);
        }
Ejemplo n.º 2
0
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();
            //var connectionString = config["connectionStrings:hAPIConnection"].Replace("#dir#", TestContext.CurrentContext.TestDirectory.HasToEndWith(@"\"));
            var connectionString = config["connectionStrings:livehAPIConnection"];
            var options          = new DbContextOptionsBuilder <LiveHAPIContext>()
                                   .UseSqlServer(connectionString)
                                   .Options;

            _context = new LiveHAPIContext(options);

            _personRepository           = new PersonRepository(_context);
            _clientStageRepository      = new ClientStageRepository(_context);
            _subscriberSystemRepository = new SubscriberSystemRepository(_context);

            _clientStageExtractor =
                new ClientStageExtractor(_personRepository, _clientStageRepository, _subscriberSystemRepository, new ClientRepository(_context), new PracticeRepository(_context));

            subscriber = Builder <SubscriberSystem> .CreateNew()
                         .With(x => x.Id           = new Guid("16E23877-9D69-11E7-ABC4-CEC278B6B50A"))
                         .With(x => x.Translations = TestData.TestTranslations())
                         .Build();

            person = Builder <Person> .CreateNew().With(x => x.Gender = "F").Build();

            var client = Builder <Client> .CreateNew()
                         .With(x => x.KeyPop        = "O")
                         .With(x => x.MaritalStatus = "S")
                         .Build();

            person.Clients.Add(client);
        }
Ejemplo n.º 3
0
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();

            string connectionString = string.Empty;

            connectionString = config["connectionStrings:livehAPIConnection"];

            var options = new DbContextOptionsBuilder <LiveHAPIContext>()
                          .UseSqlServer(connectionString)
                          .Options;

            _context = new LiveHAPIContext(options);

            _clientPretestStageRepository = new ClientPretestStageRepository(_context);
            _clientEncounterRepository    = new ClientEncounterRepository(_context);
            _subscriberSystemRepository   = new SubscriberSystemRepository(_context);
            _practiceRepository           = new PracticeRepository(_context);
            _clientStageRepository        = new ClientStageRepository(_context);
            _contactsEncounterRepository  = new ContactsEncounterRepository(_context);


            _clientMessageLoader =
                new FamilyClientMessageLoader(

                    _practiceRepository, _clientStageRepository, new ClientStageRelationshipRepository(_context),
                    new ClientFamilyScreeningStageExtractor(_contactsEncounterRepository, _subscriberSystemRepository),
                    new ClientFamilyTracingStageExtractor(_contactsEncounterRepository, _subscriberSystemRepository));

            _clientMessageWriter =
                new FamilyWriter(new RestClient(_baseUrl), _clientMessageLoader, _clientStageRepository);
        }
Ejemplo n.º 4
0
        public static void Clear(LiveHAPIContext context, params DbSet <object>[] entities)
        {
            context.RemoveRange(context.Obses);
            context.RemoveRange(context.Encounters);
            context.RemoveRange(context.Providers);
            context.RemoveRange(context.Users);
            context.RemoveRange(context.PersonNames);
            context.RemoveRange(context.PersonContacts);
            context.RemoveRange(context.PersonAddresss);
            context.RemoveRange(context.Persons);
            context.RemoveRange(context.ClientRelationships);
            context.RemoveRange(context.ClientIdentifiers);
            context.RemoveRange(context.Clients);
            context.RemoveRange(context.PracticeActivations);
            context.RemoveRange(context.Practices);
            context.RemoveRange(context.PracticeTypes);
            context.RemoveRange(context.ProviderTypes);
            context.RemoveRange(context.IdentifierTypes);
            context.RemoveRange(context.RelationshipTypes);

            context.RemoveRange(context.Forms);
            context.RemoveRange(context.Questions);
            context.RemoveRange(context.Concepts);
            context.RemoveRange(context.ConceptTypes);
            context.RemoveRange(context.EncounterTypes);
            context.RemoveRange(context.Modules);

            context.RemoveRange(context.SubCounties);
            context.RemoveRange(context.MasterFacilities);
            context.RemoveRange(context.Counties);
            context.SaveChanges();
        }
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();
            var connectionString = config["connectionStrings:livehAPIConnection"];
            //var connectionString = config["connectionStrings:livehAPIConnection"].Replace("#dir#", TestContext.CurrentContext.TestDirectory.HasToEndWith(@"\"));
            var options = new DbContextOptionsBuilder <LiveHAPIContext>()
                          .UseSqlServer(connectionString)
                          .Options;

            _context = new LiveHAPIContext(options);

            _clientPretestStageRepository = new ClientPretestStageRepository(_context);
            _clientEncounterRepository    = new ClientEncounterRepository(_context);
            _subscriberSystemRepository   = new SubscriberSystemRepository(_context);
            _practiceRepository           = new PracticeRepository(_context);
            _clientStageRepository        = new ClientStageRepository(_context);
            _contactsEncounterRepository  = new ContactsEncounterRepository(_context);
            _clientMessageLoader          =
                new FamilyClientMessageLoader(

                    _practiceRepository, _clientStageRepository, new ClientStageRelationshipRepository(_context),
                    new ClientFamilyScreeningStageExtractor(_contactsEncounterRepository, _subscriberSystemRepository),
                    new ClientFamilyTracingStageExtractor(_contactsEncounterRepository, _subscriberSystemRepository));

            _clientStageExtractor             = new ClientStageExtractor(new PersonRepository(_context), _clientStageRepository, _subscriberSystemRepository, new ClientRepository(_context), new PracticeRepository(_context));
            _clientPretestStageExtractor      = new ClientPretestStageExtractor(_clientStageRepository, _clientPretestStageRepository, _subscriberSystemRepository, _clientEncounterRepository, new ClientRepository(_context));
            _clientStageRelationshipExtractor = new ClientStageRelationshipExtractor(new ClientRelationshipRepository(_context), new ClientStageRelationshipRepository(_context), _subscriberSystemRepository);
        }
Ejemplo n.º 6
0
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();
            var connectionString = config["connectionStrings:livehAPIConnection"];
            var options          = new DbContextOptionsBuilder <LiveHAPIContext>()
                                   .UseSqlServer(connectionString)
                                   .Options;

            _context = new LiveHAPIContext(options);

            _clientEncounterRepository    = new ClientEncounterRepository(_context);
            _clientStageRepository        = new ClientStageRepository(_context);
            _clientPretestStageRepository = new ClientPretestStageRepository(_context);
            _subscriberSystemRepository   = new SubscriberSystemRepository(_context);

            _clientPretestStageExtractor =
                new ClientPretestStageExtractor(_clientStageRepository, _clientPretestStageRepository,
                                                _subscriberSystemRepository, _clientEncounterRepository, new ClientRepository(_context));


            var x = new ClientStageExtractor(new PersonRepository(_context), _clientStageRepository,
                                             _subscriberSystemRepository,
                                             new ClientRepository(_context), new PracticeRepository(_context)
                                             ).Extract().Result;

            _clientStageExtractor = new ClientStageExtractor(new PersonRepository(_context), _clientStageRepository,
                                                             _subscriberSystemRepository, new ClientRepository(_context), new PracticeRepository(_context));
        }
Ejemplo n.º 7
0
 public static void Create(LiveHAPIContext context, params IEnumerable <object>[] entities)
 {
     foreach (IEnumerable <object> t in entities)
     {
         context.AddRange(t);
     }
     context.SaveChanges();
 }
Ejemplo n.º 8
0
        public static void Init(LiveHAPIContext context)
        {
            var counties          = TestData.TestCounties();
            var facs              = TestData.TestFacilities();
            var subCounties       = TestData.TestSubCounties();
            var practiceTypes     = TestData.TestPracticeTypes();
            var providerTypes     = TestData.TestProviderTypes();
            var identifierTypes   = TestData.TestIdentifierTypes();
            var relationshipTypes = TestData.TestRelationshipTypes();
            var conceptTypes      = TestData.TestConceptTypes();
            var encounterTypes    = TestData.TestEncounterTypes();

            var modules   = TestData.TestModules();
            var forms     = TestData.TestForms();
            var concepts  = TestData.TestConcepts();
            var questions = TestData.TestQuestions();

            var systems      = TestData.TestSubscriberSystem();
            var translations = TestData.TestSubscriberTranslations();

            var practices           = TestData.TestPracticeWithActivation();
            var practiceActivations = practices.SelectMany(x => x.Activations).ToList();
            var persons             = TestData.TestPersons();
            var personNames         = persons.SelectMany(x => x.Names).ToList();
            var personAddresses     = persons.SelectMany(x => x.Addresses).ToList();
            var personContacts      = persons.SelectMany(x => x.Contacts).ToList();

            var rPersons     = TestData.TestRealPersons();
            var rPersonNames = rPersons.SelectMany(x => x.Names).ToList();


            var users               = TestData.TestUsers();
            var providers           = TestData.TestProviders();
            var clients             = TestData.TestClients();
            var clientIdentifiers   = clients.SelectMany(x => x.Identifiers).ToList();
            var clientRelationships = clients.SelectMany(x => x.Relationships).ToList();

            var rClients           = TestData.TestRealClients();
            var rClientIdentifiers = rClients.SelectMany(x => x.Identifiers).ToList();

            var encounters = TestData.TestEncounters();
            var obses      = encounters.SelectMany(x => x.Obses).ToList();

            Clear(context);
            Create(context,
                   counties, facs, subCounties, practiceTypes, relationshipTypes, providerTypes, identifierTypes,
                   conceptTypes, encounterTypes,
                   modules, forms, concepts, questions,
                   practices, practiceActivations,
                   systems, translations,
                   persons, personNames, personAddresses, personContacts,
                   users,
                   providers,
                   clients, clientIdentifiers, clientRelationships, rPersons, rPersonNames, rClients, rClientIdentifiers, encounters, obses);
        }
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();
            var connectionString = config["connectionStrings:hAPIConnection"].Replace("#dir#", TestContext.CurrentContext.TestDirectory.HasToEndWith(@"\"));

            var options = new DbContextOptionsBuilder <LiveHAPIContext>()
                          .UseSqlServer(connectionString)
                          .Options;

            _context = new LiveHAPIContext(options);
            _contactsEncounterRepository = new ContactsEncounterRepository(_context);
        }
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();

            string connectionString = string.Empty;

            if (goLive)
            {
                connectionString = config["connectionStrings:livehAPIConnection"];
            }
            else
            {
                connectionString = config["connectionStrings:hAPIConnection"].Replace("#dir#",
                                                                                      TestContext.CurrentContext.TestDirectory.HasToEndWith(@"\"));
            }


            var options = new DbContextOptionsBuilder <LiveHAPIContext>()
                          .UseSqlServer(connectionString)
                          .Options;

            _context = new LiveHAPIContext(options);


            _clientPretestStageRepository = new ClientPretestStageRepository(_context);
            _clientEncounterRepository    = new ClientEncounterRepository(_context);
            _subscriberSystemRepository   = new SubscriberSystemRepository(_context);
            _practiceRepository           = new PracticeRepository(_context);
            _clientStageRepository        = new ClientStageRepository(_context);

            _clientStageExtractor        = new ClientStageExtractor(new PersonRepository(_context), _clientStageRepository, _subscriberSystemRepository, new ClientRepository(_context), new PracticeRepository(_context));
            _clientPretestStageExtractor = new ClientPretestStageExtractor(_clientStageRepository, _clientPretestStageRepository, _subscriberSystemRepository, _clientEncounterRepository, new ClientRepository(_context));


            _clientMessageLoader =
                new IndexClientMessageLoader(_practiceRepository, _clientStageRepository, _clientPretestStageRepository,
                                             new ClientTestingStageExtractor(_clientEncounterRepository, _subscriberSystemRepository),
                                             new ClientFinalTestStageExtractor(_clientEncounterRepository, _subscriberSystemRepository),
                                             new ClientReferralStageExtractor(_clientEncounterRepository, _subscriberSystemRepository),
                                             new ClientTracingStageExtractor(_clientEncounterRepository, _subscriberSystemRepository),
                                             new ClientLinkageStageExtractor(_clientEncounterRepository, _subscriberSystemRepository)

                                             );

            _clientMessageWriter =
                new IndexClientMessageWriter(new RestClient(_baseUrl), _clientMessageLoader, _clientStageRepository);
        }
Ejemplo n.º 11
0
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();
            var connectionString = config["connectionStrings:hAPIConnection"];

            var options = new DbContextOptionsBuilder <LiveHAPIContext>()
                          .UseSqlServer(connectionString)
                          .Options;

            _context = new LiveHAPIContext(options);
            TestData.Init();
            TestDataCreator.Init(_context);
            _encounterRepository = new EncounterRepository(_context);
            //_encounterService =new EncounterService(new ClientRepository(_context),new PracticeRepository(_context),_encounterRepository,new ObsRepository(_context)  );
        }
Ejemplo n.º 12
0
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();
            var connectionString = config["connectionStrings:livehAPIConnection"];

            var options = new DbContextOptionsBuilder <LiveHAPIContext>()
                          .UseSqlServer(connectionString)
                          .Options;

            _reader  = new ClientUserReader(new RestClient(_baseUrl));
            _context = new LiveHAPIContext(options);

            _repository = new UserRepository(_context);
            _service    = new SyncUserService(_reader, _repository);
        }
Ejemplo n.º 13
0
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();
            var connectionString = config["connectionStrings:hAPIConnection"];

            var options = new DbContextOptionsBuilder <LiveHAPIContext>()
                          .UseSqlServer(connectionString)
                          .Options;

            _context = new LiveHAPIContext(options);
            // TestData.Init();
            //TestDataCreator.Init(_context);

            _lookupRepository = new LookupRepository(_context);
        }
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();
            var connectionString = config["connectionStrings:hAPIConnection"];

            var options = new DbContextOptionsBuilder <LiveHAPIContext>()
                          .UseSqlServer(connectionString)
                          .Options;

            _context = new LiveHAPIContext(options);
            TestData.Init();
            TestDataCreator.Init(_context);
            _subscriberSystems = _context.SubscriberSystems.ToList();
            _subscriberSystem  = _subscriberSystems.First(x => x.IsDefault);
            _subscriberTranslationRepository = new SubscriberTranslationRepository(_context);
        }
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();
            //var connectionString = config["connectionStrings:hAPIConnection"].Replace("#dir#", TestContext.CurrentContext.TestDirectory.HasToEndWith(@"\"));
            var connectionString = config["connectionStrings:LIVEhAPIConnection"];
            var options          = new DbContextOptionsBuilder <LiveHAPIContext>()
                                   .UseSqlServer(connectionString)
                                   .Options;

            _context = new LiveHAPIContext(options);
            _clientEncounterRepository  = new ContactsEncounterRepository(_context);
            _subscriberSystemRepository = new SubscriberSystemRepository(_context);

            _stageExtractor =
                new ClientFamilyScreeningStageExtractor(_clientEncounterRepository, _subscriberSystemRepository);
        }
Ejemplo n.º 16
0
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();
            var connectionString = config["connectionStrings:realConnection"];

            var options = new DbContextOptionsBuilder <LiveHAPIContext>()
                          .UseSqlServer(connectionString)
                          .Options;

            _context = new LiveHAPIContext(options);
            // TestDataCreator.Init(_context);
            var pr = new PracticeRepository(_context);

            _practice = pr.GetAll().First();

            _activationService = new ActivationService(new PracticeRepository(_context), new PracticeActivationRepository(_context), new MasterFacilityRepository(_context));
        }
Ejemplo n.º 17
0
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();
            var connectionString = config["connectionStrings:livehAPIConnection"];

            var options = new DbContextOptionsBuilder <LiveHAPIContext>()
                          .UseSqlServer(connectionString)
                          .Options;

            _reader  = new ClientLookupReader(new RestClient(_baseUrl));
            _context = new LiveHAPIContext(options);

            _repository = new SubscriberTranslationRepository(_context);
            _subscriberSystemRepository = new SubscriberSystemRepository(_context);
            _service = new SyncLookupService(_reader, _repository);
            _emr     = _subscriberSystemRepository.GetDefault();
        }
Ejemplo n.º 18
0
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();
            var connectionString = config["connectionStrings:hAPIConnection"];

            var options = new DbContextOptionsBuilder <LiveHAPIContext>()
                          .UseSqlServer(connectionString)
                          .Options;

            _context = new LiveHAPIContext(options);
            TestData.Init();
            TestDataCreator.Init(_context);

            _personRepository = new PersonRepository(_context);
            var activationService = new ActivationService(new PracticeRepository(_context), new PracticeActivationRepository(_context), new MasterFacilityRepository(_context));

            _staffService = new StaffService(new PersonNameRepository(_context), new PersonRepository(_context), new UserRepository(_context), new ProviderRepository(_context), activationService);
        }
Ejemplo n.º 19
0
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();
            var connectionString = config["connectionStrings:hAPIConnection"];

            var options = new DbContextOptionsBuilder <LiveHAPIContext>()
                          .UseSqlServer(connectionString)
                          .Options;

            _context = new LiveHAPIContext(options);
            TestData.Init();
            TestDataCreator.Init(_context);
            _clientInfos        = TestData.TestClientInfos();
            _practiceRepository = new PracticeRepository(_context);
            _personRepository   = new PersonRepository(_context);
            _clientRepository   = new ClientRepository(_context);
            _clientService      = new ClientService(_practiceRepository, new PersonRepository(_context),
                                                    new ClientRepository(_context), new InvalidMessageRepository(_context));
        }
Ejemplo n.º 20
0
        public void SetUp()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();
            var connectionString = config["connectionStrings:realConnection"];

            var options = new DbContextOptionsBuilder <LiveHAPIContext>()
                          .UseSqlServer(connectionString)
                          .Options;

            _context = new LiveHAPIContext(options);

            _practiceRepository = new PracticeRepository(_context);
            _personRepository   = new PersonRepository(_context);
            _clientRepository   = new ClientRepository(_context);
            _clientService      = new ClientService(_practiceRepository, new PersonRepository(_context),
                                                    new ClientRepository(_context), new InvalidMessageRepository(_context));
            _syncManagerService = new SyncManagerService(new ClientStageRepository(_context));
            _summaryService     = new SummaryService(new ItemRepository(_context), new ClientSummaryRepository(_context), new UserSummaryRepository(_context), new EncounterRepository(_context), _syncManagerService);
        }
Ejemplo n.º 21
0
 public MasterFacilityRepository(LiveHAPIContext context) : base(context)
 {
 }
Ejemplo n.º 22
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, LiveHAPIContext dbcontext, IServiceProvider serviceProvider)
        {
            bool imHapi = true;

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseBrowserLink();
            }

            app.UseForwardedHeaders(new ForwardedHeadersOptions
            {
                ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
            });



            app.Use(async(context, next) =>
            {
                await next();
                if (context.Response.StatusCode == 404 &&
                    !Path.HasExtension(context.Request.Path.Value) &&
                    !context.Request.Path.Value.StartsWith("/api/"))
                {
                    context.Request.Path = "/index.html";
                    await next();
                }
            });

            app.UseMvcWithDefaultRoute();
            app.UseDefaultFiles();
            app.UseStaticFiles();

            Log.Debug($"database initializing...");

            var bulkConfigName = Startup.Configuration["bulkConfig:name"];
            var bulkConfigCode = Startup.Configuration["bulkConfig:code"];

            try
            {
                DapperPlusManager.AddLicense(bulkConfigName, bulkConfigCode);
                if (!Z.Dapper.Plus.DapperPlusManager.ValidateLicense(out var licenseErrorMessage))
                {
                    throw new Exception(licenseErrorMessage);
                }
            }
            catch (Exception e)
            {
                Log.Debug($"{e}");
                throw;
            }



            string herror = "";

            try
            {
                EnsureMigrationOfContext <LiveHAPIContext>(serviceProvider);
            }
            catch (Exception e)
            {
                imHapi = false;
                Log.Error(new string('<', 30));
                Log.Error($"{e}");
                Log.Error(new string('>', 30));
            }

            #region HangFire
            try
            {
                app.UseHangfireDashboard("/api/hangfire", new DashboardOptions()
                {
                    Authorization = new[] { new CustomAuthorizeFilter() }
                });

                app.UseHangfireServer();
                GlobalJobFilters.Filters.Add(new ProlongExpirationTimeAttribute());
                GlobalJobFilters.Filters.Add(new AutomaticRetryAttribute()
                {
                    Attempts = 3
                });
            }
            catch (Exception e)
            {
                Log.Fatal(e, "Hangfire is down !");
                imHapi = false;
            }


            #endregion



            AutoMapper.Mapper.Initialize(cfg =>
            {
                cfg.CreateMap <PracticeDTO, Practice>();
                cfg.CreateMap <ClientStateInfo, ClientState>();
                cfg.CreateMap <TempClientRelationship, ClientRelationship>();
                cfg.CreateMap <ClientRelationship, TempClientRelationship>();

                cfg.CreateMap <County, CountyInfo>();
                cfg.CreateMap <SubCounty, SubCountyInfo>();

                cfg.CreateMap <Category, CategoryInfo>();
                cfg.CreateMap <Item, ItemInfo>();
                cfg.CreateMap <CategoryItem, CategoryItemInfo>();

                cfg.CreateMap <PracticeType, PracticeTypeInfo>();
                cfg.CreateMap <IdentifierType, IdentifierTypeInfo>();
                cfg.CreateMap <RelationshipType, RelationshipTypeInfo>();
                cfg.CreateMap <KeyPop, KeyPopInfo>();
                cfg.CreateMap <MaritalStatus, MaritalStatusInfo>();
                cfg.CreateMap <ProviderType, ProviderTypeInfo>();
                cfg.CreateMap <Action, ActionInfo>();
                cfg.CreateMap <Condition, ConditionInfo>();
                cfg.CreateMap <ValidatorType, ValidatorTypeInfo>();
                cfg.CreateMap <CategoryItem, CategoryItemInfo>();
                cfg.CreateMap <ConceptType, ConceptTypeInfo>();
                cfg.CreateMap <Validator, ValidatorInfo>();
                cfg.CreateMap <EncounterType, EncounterTypeInfo>();

                cfg.CreateMap <SubscriberCohort, CohortInfo>();

                cfg.CreateMap <Encounter, EncounterInfo>();
                cfg.CreateMap <Obs, ObsInfo>();
                cfg.CreateMap <ObsTestResult, ObsTestResultInfo>();
                cfg.CreateMap <ObsFinalTestResult, ObsFinalTestResultInfo>();
                cfg.CreateMap <ObsTraceResult, ObsTraceResultInfo>();
                cfg.CreateMap <ObsLinkage, ObsLinkageInfo>();
                cfg.CreateMap <ObsMemberScreening, ObsMemberScreeningInfo>();
                cfg.CreateMap <ObsPartnerScreening, ObsPartnerScreeningInfo>();
                cfg.CreateMap <ObsFamilyTraceResult, ObsFamilyTraceResultInfo>();
                cfg.CreateMap <ObsPartnerTraceResult, ObsPartnerTraceResultInfo>();

                cfg.CreateMap <ClientSummaryInfo, ClientSummary>();

                int userId;
                cfg.CreateMap <Core.Model.People.User, UserDTO>()
                .ForMember(x => x.Password, o => o.MapFrom(s => s.DecryptedPassword))
                .ForMember(x => x.UserId, o => o.MapFrom(s => int.TryParse(s.SourceRef, out userId) ? userId : 0));

                cfg.CreateMap <Person, PersonDTO>()
                .ForMember(x => x.FirstName,
                           o => o.MapFrom(s => null != s.Names.FirstOrDefault() ? s.Names.FirstOrDefault().FirstName : ""))
                .ForMember(x => x.MiddleName,
                           o => o.MapFrom(s =>
                                          null != s.Names.FirstOrDefault() ? s.Names.FirstOrDefault().MiddleName : ""))
                .ForMember(x => x.LastName,
                           o => o.MapFrom(s => null != s.Names.FirstOrDefault() ? s.Names.FirstOrDefault().LastName : ""));
                cfg.CreateMap <Provider, ProviderDTO>();
            });

            Log.Debug(@"
                            ╔═╗┌─┐┬ ┬┌─┐  ╔╦╗┌─┐┌┐ ┬ ┬  ┌─┐
                            ╠═╣├┤ └┬┘├─┤  ║║║│ │├┴┐│ │  ├┤
                            ╩ ╩└   ┴ ┴ ┴  ╩ ╩└─┘└─┘┴ ┴─┘└─┘
                      ");
            Log.Debug("");
            Log.Debug(@"
                                  _        _    ____ ___
                                 | |__    / \  |  _ \_ _|
                                 | '_ \  / _ \ | |_) | |
                                 | | | |/ ___ \|  __/| |
                                 |_| |_/_/   \_\_|  |___|
                    ");

            if (imHapi)
            {
                Log.Debug($"im hAPI !!! ");
            }
            else
            {
                Log.Error($"im NOT hAPI    >*|*< ");
                Log.Error($"cause: {herror}");
            }
        }
Ejemplo n.º 23
0
 public UserRepository(LiveHAPIContext context) : base(context)
 {
 }
Ejemplo n.º 24
0
 public PersonRepository(LiveHAPIContext context) : base(context)
 {
 }
 public InvalidMessageRepository(LiveHAPIContext context) : base(context)
 {
 }
 public SubscriberSystemRepository(LiveHAPIContext context) : base(context)
 {
 }
 public ObsFinalTestResultRepository(LiveHAPIContext context) : base(context)
 {
 }
Ejemplo n.º 28
0
 public void SetUp()
 {
     _context          = TestInitializer.ServiceProvider.GetService <LiveHAPIContext>();
     _personRepository = TestInitializer.ServiceProvider.GetService <IPersonRepository>();
 }
Ejemplo n.º 29
0
 public CountyRepository(LiveHAPIContext context) : base(context)
 {
 }
Ejemplo n.º 30
0
 public ClientStageRepository(LiveHAPIContext context) : base(context)
 {
 }