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 DD_Get_Action_EndDate_Test() { DateTime?time = Convert.ToDateTime("1/1/1801"); 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"); DateTime? mTime = action.AttrEndDate; Assert.AreEqual(time, mTime); }
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_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_Action_Description_Test() { string desc = "BSHSI - Outreach & Enrollment action description"; 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"); string mDesc = action.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 static List <ActionsDetail> GetADActions(List <Actions> list) { try { List <ActionsDetail> ad = new List <ActionsDetail>(); if (list != null) { list.ForEach(a => { ActionsDetail adi = new ActionsDetail { AssignBy = a.AssignById, AssignDate = a.AssignDate, AssignTo = a.AssignToId, Completed = a.Completed, CompletedBy = a.CompletedBy, DateCompleted = a.DateCompleted, Description = a.Description, ElementState = a.ElementState, StateUpdatedOn = a.StateUpdatedOn, Enabled = a.Enabled, Id = a.Id, ModuleId = a.ModuleId, Name = a.Name, Next = a.Next, Objectives = GetADObjectives(a.Objectives), Order = a.Order, Previous = a.Previous, SourceId = a.SourceId, SpawnElement = GetADSpawnElements(a.SpawnElement), Status = a.Status, Steps = GetADSteps(a.Steps), Text = a.Text, Archived = a.Archived, ArchivedDate = a.ArchivedDate, ArchiveOriginId = a.ArchiveOriginId, DeleteFlag = a.DeleteFlag }; ad.Add(adi); }); } return(ad); } catch (Exception ex) { throw new Exception("AD:GetADActions()::" + ex.Message, ex.InnerException); } }
public void DD_Get_With_Action_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"); ActionsDetail action = module.Actions.Find(a => a.SourceId == "123456789012345678901234"); List <ObjectiveInfoData> objs = action.Objectives; Assert.IsNotNull(objs); }
public void DD_Get_With_Action_AssignedBy() { string ctrl = "123456789011111111112233"; 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 smpl = action.AssignBy; Assert.AreEqual(ctrl, smpl); }
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); }