public void DD_Get_With_Action_AssignedOn_Test() { DateTime?time = Convert.ToDateTime("1/1/1899"); // ProgramDataManager pm = new ProgramDataManager { Factory = new ProgramRepositoryFactory(), DTOUtility = new DTOUtility { Factory = new ProgramRepositoryFactory() } }; ProgramDataManager pm = new ProgramDataManager { Factory = new StubProgramRepositoryFactory(), DTOUtility = new StubDTOUtility { Factory = new StubProgramRepositoryFactory() } }; GetProgramDetailsSummaryRequest request = new GetProgramDetailsSummaryRequest { Version = 1.0, ProgramId = _programId, PatientId = _patientId, UserId = "000000000000000000000000", ContractNumber = "InHealth001", Context = "NG" }; GetProgramDetailsSummaryResponse response = pm.GetPatientProgramDetailsById(request); ModuleDetail module = response.Program.Modules.Find(m => m.SourceId == "532b5585a381168abe00042c"); ActionsDetail action = module.Actions.Find(a => a.SourceId == "123456789012345678901234"); DateTime? mTime = action.AssignDate; Assert.AreEqual(time, mTime); }
public void DD_Get_With_Module_Description_Test() { string desc = "BSHSI - Outreach & Enrollment"; ProgramService ps = new ProgramService { ProgramDataManager = new StubProgramDataManager(), Helpers = new StubHelper(), CommonFormatterUtil = new StubCommonFormatterUtil() }; GetProgramDetailsSummaryRequest request = new GetProgramDetailsSummaryRequest { Context = "NG", ContractNumber = "InHealth001", PatientId = "", ProgramId = "", UserId = "nguser", Version = 1.0 }; GetProgramDetailsSummaryResponse response = ps.Get(request); ModuleDetail module = response.Program.Modules.Find(m => m.SourceId == "532b5585a381168abe00042c"); string mDesc = module.Description.Trim(); Assert.AreEqual(desc, mDesc, true); }
public void DD_Get_With_Action_Description_Test() { string desc = "BSHSI - Outreach & Enrollment action description"; // ProgramDataManager pm = new ProgramDataManager { Factory = new ProgramRepositoryFactory(), DTOUtility = new DTOUtility { Factory = new ProgramRepositoryFactory() } }; ProgramDataManager pm = new ProgramDataManager { Factory = new StubProgramRepositoryFactory(), DTOUtility = new StubDTOUtility { Factory = new StubProgramRepositoryFactory() } }; GetProgramDetailsSummaryRequest request = new GetProgramDetailsSummaryRequest { Version = 1.0, ProgramId = _programId, PatientId = _patientId, UserId = "000000000000000000000000", ContractNumber = "InHealth001", Context = "NG" }; GetProgramDetailsSummaryResponse response = pm.GetPatientProgramDetailsById(request); ModuleDetail module = response.Program.Modules.Find(m => m.SourceId == "532b5585a381168abe00042c"); ActionsDetail action = module.Actions.Find(a => a.SourceId == "123456789012345678901234"); string mDesc = action.Description.Trim(); Assert.AreEqual(desc, mDesc, true); }
public void DD_Get_Module_AssignedOn_Test() { DateTime?time = Convert.ToDateTime("1/1/1999"); ProgramService ps = new ProgramService { ProgramDataManager = new StubProgramDataManager(), Helpers = new StubHelper(), CommonFormatterUtil = new StubCommonFormatterUtil() }; GetProgramDetailsSummaryRequest request = new GetProgramDetailsSummaryRequest { Context = "NG", ContractNumber = "InHealth001", PatientId = "", ProgramId = "", UserId = "nguser", Version = 1.0 }; GetProgramDetailsSummaryResponse response = ps.Get(request); ModuleDetail module = response.Program.Modules.Find(m => m.SourceId == "532b5585a381168abe00042c"); DateTime? mTime = module.AssignDate; Assert.AreEqual(time, mTime); }
public HttpResponseMessage ModuleDetails(string moduleList) { var siteDetails = new SiteDetail { SiteName = PortalSettings.PortalName, DnnVersion = _dnnVersion, IsHost = UserInfo.IsSuperUser, IsAdmin = UserInfo.IsInRole("Administrators") }; foreach (var moduleName in moduleList.Split(',')) { foreach ( var tabmodule in GetTabModules(moduleName) .Where(tabmodule => TabPermissionController.CanViewPage(tabmodule.TabInfo) && ModulePermissionController.CanViewModule(tabmodule.ModuleInfo))) { var moduleDetail = new ModuleDetail { ModuleName = moduleName }; moduleDetail.ModuleVersion = tabmodule.ModuleVersion; moduleDetail.ModuleInstances.Add(new ModuleInstance { TabId = tabmodule.TabInfo.TabID, ModuleId = tabmodule.ModuleInfo.ModuleID, PageName = tabmodule.TabInfo.TabName, PagePath = tabmodule.TabInfo.TabPath }); siteDetails.Modules.Add(moduleDetail); } } return(Request.CreateResponse(HttpStatusCode.OK, siteDetails)); }
public void DD_Get_Action_AssignedBy_Test() { string ctrl = "123456789011111111112233"; ProgramService ps = new ProgramService { ProgramDataManager = new StubProgramDataManager(), Helpers = new StubHelper(), CommonFormatterUtil = new StubCommonFormatterUtil() }; GetProgramDetailsSummaryRequest request = new GetProgramDetailsSummaryRequest { Context = "NG", ContractNumber = "InHealth001", PatientId = "", ProgramId = "", UserId = "nguser", Version = 1.0 }; GetProgramDetailsSummaryResponse response = ps.Get(request); ModuleDetail module = response.Program.Modules.Find(m => m.SourceId == "532b5585a381168abe00042c"); ActionsDetail action = module.Actions.Find(a => a.SourceId == "123456789012345678901234"); Assert.AreEqual(ctrl, action.AssignBy); }
public void DD_Get_Action_Objectives_Test() { ProgramService ps = new ProgramService { ProgramDataManager = new StubProgramDataManager(), Helpers = new StubHelper(), CommonFormatterUtil = new StubCommonFormatterUtil() }; GetProgramDetailsSummaryRequest request = new GetProgramDetailsSummaryRequest { Context = "NG", ContractNumber = "InHealth001", PatientId = "", ProgramId = "", UserId = "nguser", Version = 1.0 }; GetProgramDetailsSummaryResponse response = ps.Get(request); ModuleDetail module = response.Program.Modules.Find(m => m.SourceId == "532b5585a381168abe00042c"); ActionsDetail action = module.Actions.Find(a => a.SourceId == "123456789012345678901234"); List <ObjectiveInfoData> objs = action.Objectives; Assert.IsNotNull(objs); }
public void AD_With_Module_Description_Test() { string desc = "BSHSI - Outreach & Enrollment"; StubPlanElementEndpointUtils peu = new StubPlanElementEndpointUtils { Client = new StubJsonRestClient() }; GetPatientProgramDetailsSummaryRequest request = new GetPatientProgramDetailsSummaryRequest(); GetProgramDetailsSummaryResponse response = peu.RequestPatientProgramDetailsSummary(request); ModuleDetail module = response.Program.Modules.Find(m => m.SourceId == "532b5585a381168abe00042c"); string mDesc = module.Description.Trim(); Assert.AreEqual(desc, mDesc, true); }
public static List <ModuleDetail> GetADModules(List <Module> list) { try { List <ModuleDetail> md = new List <ModuleDetail>(); if (list != null) { list.ForEach(m => { ModuleDetail mdi = new ModuleDetail { Actions = GetADActions(m.Actions), AssignBy = m.AssignById, AssignTo = m.AssignToId, AssignDate = m.AssignDate, AttrEndDate = m.AttrEndDate, // night 919 AttrStartDate = m.AttrStartDate, // night 919 Completed = m.Completed, CompletedBy = m.CompletedBy, DateCompleted = m.DateCompleted, Description = m.Description, ElementState = m.ElementState, StateUpdatedOn = m.StateUpdatedOn, Enabled = m.Enabled, Id = m.Id, Name = m.Name, Next = m.Next, Objectives = GetADObjectives(m.Objectives), Order = m.Order, Previous = m.Previous, ProgramId = m.ProgramId, SourceId = m.SourceId, SpawnElement = GetADSpawnElements(m.SpawnElement), Status = m.Status, Text = m.Text }; md.Add(mdi); }); } return(md); } catch (Exception ex) { throw new Exception("AD:GetADModules()::" + ex.Message, ex.InnerException); } }
public void DD_Get_With_Module_Objectives() { ProgramDataManager pm = new ProgramDataManager { Factory = new StubProgramRepositoryFactory(), DTOUtility = new StubDTOUtility { Factory = new StubProgramRepositoryFactory() } }; GetProgramDetailsSummaryRequest request = new GetProgramDetailsSummaryRequest { Version = 1.0, ProgramId = _programId, PatientId = _patientId, UserId = "000000000000000000000000", ContractNumber = "InHealth001", Context = "NG" }; GetProgramDetailsSummaryResponse response = pm.GetPatientProgramDetailsById(request); ModuleDetail module = response.Program.Modules.Find(m => m.SourceId == "532b5585a381168abe00042c"); Assert.IsNotNull(module.Objectives); }
public void DD_Get_With_Module_AssignedBy() { string ctrl = "123456789011111111112223"; ProgramDataManager pm = new ProgramDataManager { Factory = new StubProgramRepositoryFactory(), DTOUtility = new StubDTOUtility { Factory = new StubProgramRepositoryFactory() } }; GetProgramDetailsSummaryRequest request = new GetProgramDetailsSummaryRequest { Version = 1.0, ProgramId = _programId, PatientId = _patientId, UserId = "000000000000000000000000", ContractNumber = "InHealth001", Context = "NG" }; GetProgramDetailsSummaryResponse response = pm.GetPatientProgramDetailsById(request); ModuleDetail module = response.Program.Modules.Find(m => m.SourceId == "532b5585a381168abe00042c"); string smpl = module.AssignBy; Assert.AreEqual(ctrl, smpl); }
public void DD_Get_With_Action_AssignedTo_Test() { string assnTC = "123456789011111111112232"; ProgramDataManager pm = new ProgramDataManager { Factory = new StubProgramRepositoryFactory(), DTOUtility = new StubDTOUtility { Factory = new StubProgramRepositoryFactory() } }; GetProgramDetailsSummaryRequest request = new GetProgramDetailsSummaryRequest { Version = 1.0, ProgramId = _programId, PatientId = _patientId, UserId = "000000000000000000000000", ContractNumber = "InHealth001", Context = "NG" }; GetProgramDetailsSummaryResponse response = pm.GetPatientProgramDetailsById(request); ModuleDetail module = response.Program.Modules.Find(m => m.SourceId == "532b5585a381168abe00042c"); ActionsDetail action = module.Actions.Find(a => a.SourceId == "123456789012345678901234"); string assnT = action.AssignTo; Assert.AreEqual(assnTC, assnT); }
private SiteDetail GetSiteDetails(string moduleList) { var siteDetails = new SiteDetail { SiteName = PortalSettings.PortalName, DnnVersion = _dnnVersion, IsHost = UserInfo.IsSuperUser, IsAdmin = UserInfo.IsInRole("Administrators") }; foreach (var moduleName in (moduleList ?? "").Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)) { var modulesCollection = GetTabModules((moduleName ?? "").Trim()) .Where(tabmodule => TabPermissionController.CanViewPage(tabmodule.TabInfo) && ModulePermissionController.CanViewModule(tabmodule.ModuleInfo)); foreach (var tabmodule in modulesCollection) { var moduleDetail = new ModuleDetail { ModuleName = moduleName, ModuleVersion = tabmodule.ModuleVersion }; moduleDetail.ModuleInstances.Add(new ModuleInstance { TabId = tabmodule.TabInfo.TabID, ModuleId = tabmodule.ModuleInfo.ModuleID, PageName = tabmodule.TabInfo.TabName, PagePath = tabmodule.TabInfo.TabPath }); siteDetails.Modules.Add(moduleDetail); } } return(siteDetails); }
public void Add(ModuleDetail moduleDetail) { this.commonTableEntities.ModuleDetails.Add(moduleDetail); }
public void AddModuleDetail(ModuleDetail moduleDetail) { this.commonTableEntities.ModuleDetails.Add(moduleDetail); }
public void Remove(ModuleDetail moduleDetail) { this.commonTableEntities.ModuleDetails.Remove(moduleDetail); }
private static ProgramDetail GenTestProgram() { StepsDetail s = new StepsDetail() { Id = "52a641e8d433231824878c8f", ActionId = "52a0f33bd43323141c9eb274", ControlType = 1, Description = "description", Enabled = true, Question = "Are you an ABC Employee?", Notes = "Example notes", Completed = true, Order = 1, Status = 1, Responses = new List <ResponseDetail> { new ResponseDetail { Id = "52a641f1d433231824878c90", Nominal = true, Order = 1, NextStepId = "52a641f1d433231824878c90", StepId = "52a641e8d433231824878c8f" }, new ResponseDetail { Id = "52a641f1d433231824878c90", Nominal = true, Order = 2, NextStepId = "52a641f1d433231824878c90", StepId = "52a641e8d433231824878c8f" } } }; StepsDetail s1 = new StepsDetail() { Id = "52a641f1d433231824878c90", ActionId = "52a0f33bd43323141c9eb274", ControlType = 1, Description = "description", Enabled = true, Question = "Are you a spouse of an ABC Employee?", Notes = "Example notes", Completed = true, Order = 2, Status = 1, Responses = new List <ResponseDetail> { new ResponseDetail { Id = "52a641f1d433231824878c90", Nominal = true, Order = 1, NextStepId = "52a641f1d433231824878c90", StepId = "52a641f1d433231824878c90" }, new ResponseDetail { Id = "52a641f1d433231824878c90", Nominal = true, Order = 2, NextStepId = "52a641f1d433231824878c90", StepId = "52a641f1d433231824878c90" } } }; StepsDetail s2 = new StepsDetail() { Id = "52a641f1d433231824871234", ActionId = "52a0f33bd43323141c9eb274", ControlType = 1, Description = "description", Enabled = true, Question = "Are you a spouse of an ABC Employee?", Notes = "Example notes", Completed = true, Order = 2, Status = 1, StepTypeId = 7 }; List <SpawnElementDetail> se = new List <SpawnElementDetail>(); se.Add(new SpawnElementDetail { ElementId = "aaaaf33bd43323141c9eb274", ElementType = 3 }); se.Add(new SpawnElementDetail { ElementId = "52a0a775fe7a5915485b8866", ElementType = 2 }); se.Add(new SpawnElementDetail { ElementId = "52a0a775fe7a5915485b1212", ElementType = 2 }); ActionsDetail act = new ActionsDetail { Enabled = true, Id = "52a0f33bd43323141c9eb274", ModuleId = "52a0a775fe7a5915485bdfd1", Name = "act Verify P4H Eligibility", Description = "act - Assess whether individual is eligible for the program", CompletedBy = "Care Manager", Completed = false, Order = 1, Text = "testtest", Status = 1, SpawnElement = se, Steps = new List <StepsDetail> { s, s1, s2 } }; ActionsDetail act1 = new ActionsDetail { Enabled = true, Id = "5555f33bd43323141c9eb275", ModuleId = "52a0a775fe7a5915485bdfd1", Name = "act1 Verify P4H Eligibility", Description = "act1 Assess whether individual is eligible for the program", CompletedBy = "Care Manager", Completed = false, Order = 2, Text = "testtest", Status = 1, Previous = "52a0f33bd43323141c9eb274", Steps = new List <StepsDetail> { s, s1 } }; ActionsDetail act2 = new ActionsDetail { Enabled = false, Id = "aaaaf33bd43323141c9eb274", ModuleId = "52a0a775fe7a5915485bdfd1", Name = "act2 Verify P4H Eligibility", Description = "dependent on act1", CompletedBy = "Care Manager", Completed = false, Order = 3, Text = "testtest", Status = 1, Previous = "5555f33bd43323141c9eb275", Steps = new List <StepsDetail> { s, s1 } }; List <SpawnElementDetail> sem = new List <SpawnElementDetail>(); sem.Add(new SpawnElementDetail { ElementId = "9990a775fe7a5915485b1212", ElementType = 2 }); ModuleDetail mod = new ModuleDetail { Id = "52a0a775fe7a5915485bdfd1", Enabled = true, ProgramId = "52c71fd7d6a4850a1cf69494", Description = "Reduce the amount of crabs in the diet", Name = "Low Carb Diet Module", Completed = false, Order = 1, Text = "testtest", Status = 1, Actions = new List <ActionsDetail> { act, act1, act2 }, SpawnElement = sem }; ModuleDetail mod1 = new ModuleDetail { Id = "52a0a775fe7a5915485b8866", Enabled = false, ProgramId = "52c71fd7d6a4850a1cf69494", Text = "Reduce the amount of crabs in the diet", Description = "Reduce the amount of crabs in the diet", Name = "Low Carb Diet Module", Completed = false, Order = 1, Status = 1 }; ModuleDetail mod2 = new ModuleDetail { Id = "52a0a775fe7a5915485b1212", Enabled = false, ProgramId = "52c71fd7d6a4850a1cf69494", Text = "Reduce the amount of crabs in the diet", Description = "Reduce the amount of crabs in the diet", Name = "Low Carb Diet Module", Completed = false, Order = 1, Status = 1 }; ModuleDetail mod3 = new ModuleDetail { Id = "9990a775fe7a5915485b1212", Enabled = false, ProgramId = "52c71fd7d6a4850a1cf69494", Text = "Testgen module number 3", Description = "module number 3", Name = "Low Carb Diet Module", Completed = false, Order = 1, Status = 1 }; ProgramDetail pMap = new ProgramDetail() { Enabled = true, Id = "52c71fd7d6a4850a1cf69494", PatientId = "1234", Text = "THIS IS THE PROGRAM", Modules = new List <ModuleDetail> { mod, mod1, mod2, mod3 }, Completed = false, Order = 1, Status = 1 }; return(pMap); }
public void Remove(ModuleDetail moduleDetail) { this.totalSalesPortalEntities.ModuleDetails.Remove(moduleDetail); }
public void Add(ModuleDetail moduleDetail) { this.totalSalesPortalEntities.ModuleDetails.Add(moduleDetail); }
public void AddModuleDetail(ModuleDetail moduleDetail) { this.totalSmartPortalEntities.ModuleDetails.Add(moduleDetail); }