protected void Page_Load(object sender, EventArgs e) { var aId = Request.QueryString["aId"]; EncounterService service = new EncounterService(); medications = service.GetMedications(Convert.ToInt64(aId)); asId.Value = aId; }
protected void Page_Load(object sender, EventArgs e) { var pm = Request.QueryString["pm"]; pageMode.Value = pm; EncounterService service = new EncounterService(); if (pm == "edit") { var medId = Request.QueryString["medId"]; mId.Value = medId; medication = service.GetMedication(Convert.ToInt64(medId)); medications.Text = medication.Medicine; dosage.Text = medication.Dosage; var atv = medication.IsActive; radioMedications.Items[0].Selected = atv; radioMedications.Items[1].Selected = !atv; startDate.Text = medication.StartDate == SqlDateTime.MinValue ? string.Empty : medication.StartDate.ToString(Utility.GlobalDateFormat); medicationStop.Text = medication.StopDate == SqlDateTime.MinValue ? string.Empty : medication.StartDate.ToString(Utility.GlobalDateFormat); } else if (pm == "add") { var aId = Request.QueryString["aId"]; asId.Value = aId; } }
protected void Page_Load(object sender, EventArgs e) { var aId = Request.QueryString["aId"]; EncounterService service = new EncounterService(); bfBabyList = service.GetFeedingBabies(Convert.ToInt64(aId)); asId.Value = aId; }
public void Initialize() { factory = new EncounterFactory(); sport = new Sport("Soccer", true); teamA = new Mock <Team>(1, "teamA", "photo", sport).Object; teamB = new Mock <Team>(2, "teamB", "photo", sport).Object; teamC = new Mock <Team>(3, "teamC", "photo", sport).Object; teamD = new Mock <Team>(4, "teamD", "photo", sport).Object; testFixture = new FixtureDto() { fixtureName = "ObligatorioDA2.BusinessLogic.FixtureAlgorithms.OneMatchFixture" , initialDate = DateTime.Today, daysBetweenRounds = 5, roundLength = 2 }; teamsCollection = GetTeamsList(); teamsNames = teamsCollection.Select(tn => tn.Name).ToList(); SetUpRepository(); mapper = new EncounterDtoMapper(teamStorage, matchStorage, sportStorage); context.Database.EnsureDeleted(); Mock <IAuthenticationService> auth = new Mock <IAuthenticationService>(); auth.Setup(a => a.GetConnectedUser()).Returns(GetFakeUser()); EncounterService service = new EncounterService(matchStorage, teamStorage, sportStorage, auth.Object); algorithmPaths = @".\"; Mock <ILoggerService> logService = new Mock <ILoggerService>(); fixtureService = new FixtureService(teamStorage, service, auth.Object, logService.Object); }
public void NoClaims() { RequestResult <MSPVisitHistoryResponse> delegateResult = new RequestResult <MSPVisitHistoryResponse>() { ResultStatus = Common.Constants.ResultType.Success, PageSize = 100, PageIndex = 1, ResourcePayload = new MSPVisitHistoryResponse() { Claims = null, } }; string hdid = "MOCKHDID"; string ipAddress = "127.0.0.1"; using Microsoft.Extensions.Logging.ILoggerFactory loggerFactory = LoggerFactory.Create(builder => builder.AddConsole()); var mockMSPDelegate = new Mock <IMSPVisitDelegate>(); mockMSPDelegate.Setup(s => s.GetMSPVisitHistoryAsync(It.IsAny <ODRHistoryQuery>(), It.IsAny <string>(), It.IsAny <string>())).Returns(Task.FromResult(delegateResult)); RequestResult <PatientModel> patientResult = new RequestResult <PatientModel>() { ResultStatus = Common.Constants.ResultType.Success, ResourcePayload = new PatientModel() { PersonalHealthNumber = "912345678", Birthdate = DateTime.ParseExact("1983/07/15", "yyyy/MM/dd", CultureInfo.InvariantCulture) } }; var mockPatientService = new Mock <IPatientService>(); mockPatientService.Setup(s => s.GetPatient(It.IsAny <string>(), It.IsAny <PatientIdentifierType>())).Returns(Task.FromResult(patientResult)); var mockHttpContextAccessor = new Mock <IHttpContextAccessor>(); var context = new DefaultHttpContext() { Connection = { RemoteIpAddress = IPAddress.Parse(ipAddress), }, }; context.Request.Headers.Add("Authorization", "MockJWTHeader"); mockHttpContextAccessor.Setup(_ => _.HttpContext).Returns(context); IEncounterService service = new EncounterService(new Mock <ILogger <EncounterService> >().Object, mockHttpContextAccessor.Object, mockPatientService.Object, mockMSPDelegate.Object); var actualResult = service.GetEncounters(hdid).Result; Assert.True(actualResult.ResultStatus == Common.Constants.ResultType.Success && actualResult.ResourcePayload.Count() == 0); }
protected void Page_Load(object sender, EventArgs e) { var aId = Request.QueryString["aId"]; // TODO EncounterService service = new EncounterService(); babies = service.GetChiefComplaints(Convert.ToInt64(aId),true); mothes = service.GetChiefComplaints(Convert.ToInt64(aId),false); asId.Value = aId; }
protected void Page_Load(object sender, EventArgs e) { var aId = Request.QueryString["aId"]; // TODO var userid =Convert.ToString(Session["userid"]); var peerid = Session["peerId"]; EncounterService service = new EncounterService(); summary = service.GetCompleteAssessmentSummary(Convert.ToInt64(aId), Convert.ToInt64(peerid)); asId.Value = aId; }
public void Remove(int playerId) { if (!Raid.Finalized) { var player = Players.Where(p => p.Id == playerId).First(); Console.WriteLine($"Removing {player.Name}"); EncounterService.DeleteCharacter(Raid, Encounter, Encounter.Characters.First(p => p.PlayerId == playerId)); Encounter.Characters.RemoveAll(p => p.PlayerId == playerId); } }
protected void Page_Load(object sender, EventArgs e) { userId.Value = Convert.ToString(Session["userid"]); peerId.Value = Request.QueryString["peerId"]; Session["peerId"] = peerId.Value; //var patientId = Convert.ToString(Session["patientid"]); //var userId = Convert.ToString(Session["userid"]); EncounterService service = new EncounterService(); summaries = service.GetAssessmentSummaries(Convert.ToInt64(peerId.Value)); }
public async void AddEncounter() { if (!Raid.Finalized && SelectedBoss.Id != null) { Console.WriteLine($"Preparing to add encounter for boss {SelectedBoss.Name}"); var encounter = await EncounterService.AddEncounter(Raid, SelectedBoss); RaidForm.AddEncounter(encounter); UpdateList(); } }
protected void Page_Load(object sender, EventArgs e) { var aId = Request.QueryString["aId"]; // TODO EncounterService service = new EncounterService(); var coordinationOfCare = service.GetCoordicationOfCare(Convert.ToInt64(aId)); dob.Text = coordinationOfCare.Date.ToString(Utility.GlobalDateFormat); time.Text = coordinationOfCare.Time; txtNotes.Text = coordinationOfCare.Notes; objid.Value = Convert.ToString(coordinationOfCare.Id); asId.Value = aId; }
protected void Page_Load(object sender, EventArgs e) { var aId = Request.QueryString["aId"]; // TODO EncounterService service = new EncounterService(); var plan = service.GetPlan(Convert.ToInt64(aId)); dob.Text = plan.Date.ToString(Utility.GlobalDateFormat); time.Text = plan.Time; txtNotes.Text = plan.Notes; objid.Value = Convert.ToString(plan.Id); asId.Value = aId; }
public void Add(Player player, Character character, Role role) { if (!Raid.Finalized) { Console.WriteLine($"Adding {player.Name} as {role}"); var encounterCharacter = new EncounterCharacter { PlayerId = (int)player.Id, CharacterId = (int)character.Id, Role = role }; EncounterService.AddCharacter(Raid, Encounter, encounterCharacter); Encounter.Characters.Add(encounterCharacter); } }
public void PatientError() { RequestResult <MSPVisitHistoryResponse> delegateResult = new RequestResult <MSPVisitHistoryResponse>() { }; string hdid = "MOCKHDID"; string ipAddress = "127.0.0.1"; using Microsoft.Extensions.Logging.ILoggerFactory loggerFactory = LoggerFactory.Create(builder => builder.AddConsole()); var mockMSPDelegate = new Mock <IMSPVisitDelegate>(); mockMSPDelegate.Setup(s => s.GetMSPVisitHistoryAsync(It.IsAny <ODRHistoryQuery>(), It.IsAny <string>(), It.IsAny <string>())).Returns(Task.FromResult(delegateResult)); RequestResult <PatientModel> patientResult = new RequestResult <PatientModel>() { ResultStatus = Common.Constants.ResultType.Error, ResultError = new RequestResultError() { ErrorCode = "Mock Error", ResultMessage = "Mock Error Message", } }; var mockPatientService = new Mock <IPatientService>(); mockPatientService.Setup(s => s.GetPatient(It.IsAny <string>(), It.IsAny <PatientIdentifierType>())).Returns(Task.FromResult(patientResult)); var mockHttpContextAccessor = new Mock <IHttpContextAccessor>(); var context = new DefaultHttpContext() { Connection = { RemoteIpAddress = IPAddress.Parse(ipAddress), }, }; context.Request.Headers.Add("Authorization", "MockJWTHeader"); mockHttpContextAccessor.Setup(_ => _.HttpContext).Returns(context); IEncounterService service = new EncounterService(new Mock <ILogger <EncounterService> >().Object, mockHttpContextAccessor.Object, mockPatientService.Object, mockMSPDelegate.Object); var actualResult = service.GetEncounters(hdid).Result; Assert.True(actualResult.ResultStatus == Common.Constants.ResultType.Error && actualResult.ResultError.IsDeepEqual(patientResult.ResultError)); }
public async void DeleteEncounter() { if (!Raid.Finalized) { bool confirmed = await JSRuntime.InvokeAsync <bool>("confirm", $"Are you sure you want to delete encounter {GetBossById(Encounter.BossId).Name}?"); if (confirmed) { await EncounterService.DeleteEncounter(Raid, Encounter); RaidForm.DeleteEncounter(Encounter); } } }
protected void Page_Load(object sender, EventArgs e) { var aId = Request.QueryString["aId"]; var pm = Request.QueryString["pm"]; EncounterService service = new EncounterService(); babyPCP = service.GetBabyPCP(Convert.ToInt64(aId)); states = service.GeStatesMaster(); momobid.Value = babyPCP.Id.ToString(); asId.Value = aId; phy_name.Text = babyPCP.Name; ph_no.Text = babyPCP.Phone; address1.Text = babyPCP.Address1; address2.Text = babyPCP.Address2; city.Text = babyPCP.City; zip.Text = babyPCP.ZipCode; }
protected void Page_Load(object sender, EventArgs e) { var aId = Request.QueryString["aId"]; // TODO EncounterService service = new EncounterService(); observation = service.GetFeedingObservations(Convert.ToInt64(aId)); if(observation.IsObserved) { radioconditions.Items[0].Selected = true; } else { radioconditions.Items[1].Selected = true; } asId.Value = aId; }
private void SetUpController() { sportsRepo = new Mock <ISportRepository>(); sportsRepo.Setup(r => r.Get((testSport.Name))).Returns(testSport); sportsRepo.Setup(r => r.Get(It.Is <string>(x => (!x.Equals(testSport.Name))))).Throws(new SportNotFoundException()); sportsRepo.Setup(r => r.Get(testSport.Name)).Returns(testSport); sportsRepo.Setup(r => r.Exists(testSport.Name)).Returns(true); sportsRepo.Setup(r => r.GetAll()).Returns(new List <Sport>() { testSport }); matchesRepo = new Mock <IEncounterRepository>(); matchesRepo.Setup(m => m.Add(It.IsAny <Match>())).Returns((Match mat) => { return(mat); }); teamsRepo = new Mock <ITeamRepository>(); teamsRepo.Setup(t => t.GetTeams(It.IsAny <string>())).Returns(teamsCollection); teamsRepo.Setup(t => t.GetAll()).Returns(teamsCollection); Mock <IAuthenticationService> auth = new Mock <IAuthenticationService>(); auth.Setup(a => a.GetConnectedUser()).Returns(GetFakeUser()); EncounterService matchService = new EncounterService(matchesRepo.Object, teamsRepo.Object, sportsRepo.Object, auth.Object); innerMatches = matchService; logger = new Mock <ILoggerService>(); logger.Setup(l => l.Log(LogType.FIXTURE, It.IsAny <string>(), It.IsAny <string>(), It.IsAny <DateTime>())).Returns(1); fixture = new FixtureService(teamsRepo.Object, innerMatches, auth.Object, logger.Object); Mock <IOptions <FixtureStrategies> > mockSettings = new Mock <IOptions <FixtureStrategies> >(); FileInfo dllFile = new FileInfo(@".\"); mockSettings.Setup(m => m.Value).Returns(new FixtureStrategies() { DllPath = dllFile.FullName }); controller = new FixturesController(fixture, mockSettings.Object, auth.Object); controller.ControllerContext = GetFakeControllerContext(); }
protected void Page_Load(object sender, EventArgs e) { var pm = Request.QueryString["pm"]; pageMode.Value = pm; EncounterService service = new EncounterService(); if (pm == "edit") { var conId = Request.QueryString["conId"]; var condition = service.GetCondition(Convert.ToInt64(conId)); // TODO CodeConditions.Text = condition.ICDCode; OnsetDate.Text = condition.ActiveDate.ToString(Utility.GlobalDateFormat); //TODO var atv = condition.IsActive; radioconditions.Items[0].Selected = atv; radioconditions.Items[1].Selected = !atv; inactivescience.Text = condition.InActiveDate == SqlDateTime.MinValue ? string.Empty : condition.InActiveDate.ToString(Utility.GlobalDateFormat); // TODO cId.Value = condition.Id.ToString(); } else if (pm == "add") { var aId = Request.QueryString["aId"]; asId.Value = aId; } }
public void ValidateEncounters() { var sameClaim = new Claim() { ClaimId = 1, PractitionerName = "Mock Name 1", LocationName = "Mock Name 1", SpecialtyDesc = "Mocked SpecialtyDesc 1", ServiceDate = DateTime.ParseExact("2000/07/15", "yyyy/MM/dd", CultureInfo.InvariantCulture), LocationAddress = new LocationAddress() { Province = "BC", City = "Victoria", PostalCode = "V6Y 0C2", AddrLine1 = "NoWay", AddrLine2 = "Alt" }, }; RequestResult <MSPVisitHistoryResponse> delegateResult = new RequestResult <MSPVisitHistoryResponse>() { ResultStatus = Common.Constants.ResultType.Success, PageSize = 100, PageIndex = 1, ResourcePayload = new MSPVisitHistoryResponse() { Claims = new List <Claim>() { sameClaim, new Claim() { ClaimId = 2, PractitionerName = "Mock Name 2", ServiceDate = DateTime.ParseExact("2015/07/15", "yyyy/MM/dd", CultureInfo.InvariantCulture) }, sameClaim, }, } }; var expectedResult = EncounterModel.FromODRClaimModelList(delegateResult.ResourcePayload.Claims.ToList()); string hdid = "MOCKHDID"; string ipAddress = "127.0.0.1"; using Microsoft.Extensions.Logging.ILoggerFactory loggerFactory = LoggerFactory.Create(builder => builder.AddConsole()); var mockMSPDelegate = new Mock <IMSPVisitDelegate>(); mockMSPDelegate.Setup(s => s.GetMSPVisitHistoryAsync(It.IsAny <ODRHistoryQuery>(), It.IsAny <string>(), It.IsAny <string>())).Returns(Task.FromResult(delegateResult)); RequestResult <PatientModel> patientResult = new RequestResult <PatientModel>() { ResultStatus = Common.Constants.ResultType.Success, ResourcePayload = new PatientModel() { PersonalHealthNumber = "912345678", Birthdate = DateTime.ParseExact("1983/07/15", "yyyy/MM/dd", CultureInfo.InvariantCulture) } }; var mockPatientService = new Mock <IPatientService>(); mockPatientService.Setup(s => s.GetPatient(It.IsAny <string>(), It.IsAny <PatientIdentifierType>())).Returns(Task.FromResult(patientResult)); var mockHttpContextAccessor = new Mock <IHttpContextAccessor>(); var context = new DefaultHttpContext() { Connection = { RemoteIpAddress = IPAddress.Parse(ipAddress), }, }; context.Request.Headers.Add("Authorization", "MockJWTHeader"); mockHttpContextAccessor.Setup(_ => _.HttpContext).Returns(context); IEncounterService service = new EncounterService(new Mock <ILogger <EncounterService> >().Object, mockHttpContextAccessor.Object, mockPatientService.Object, mockMSPDelegate.Object); var actualResult = service.GetEncounters(hdid).Result; Assert.True(actualResult.ResultStatus == Common.Constants.ResultType.Success); Assert.Equal(2, actualResult.ResourcePayload.Count()); // should return distint claims only. #pragma warning disable CA5351 // Do Not Use Broken Cryptographic Algorithms #pragma warning disable SCS0006 // Weak hashing function using var md5CryptoService = MD5.Create(); #pragma warning restore SCS0006 // Weak hashing function #pragma warning restore CA5351 // Do Not Use Broken Cryptographic Algorithms var model = actualResult.ResourcePayload.First(); var generatedId = new Guid(md5CryptoService.ComputeHash(Encoding.Default.GetBytes($"{model.EncounterDate:yyyyMMdd}{model.SpecialtyDescription}{model.PractitionerName}{model.Clinic.Name}{model.Clinic.Province}{model.Clinic.City}{model.Clinic.PostalCode}{model.Clinic.AddressLine1}{model.Clinic.AddressLine2}{model.Clinic.AddressLine3}{model.Clinic.AddressLine4}"))); var expectedGeneratedId = new Guid(md5CryptoService.ComputeHash(Encoding.Default.GetBytes($"{sameClaim.ServiceDate:yyyyMMdd}{sameClaim.SpecialtyDesc}{sameClaim.PractitionerName}{sameClaim.LocationName}{sameClaim.LocationAddress.Province}{sameClaim.LocationAddress.City}{sameClaim.LocationAddress.PostalCode}{sameClaim.LocationAddress.AddrLine1}{sameClaim.LocationAddress.AddrLine2}{sameClaim.LocationAddress.AddrLine3}{sameClaim.LocationAddress.AddrLine4}"))); Assert.Equal(expectedGeneratedId, generatedId); }
public static List<MasterICD9Codes> GetMasterICD9CodesAutoComplete(string pre) { EncounterService service = new EncounterService(); return service.GetMasterICD9CodesAutoComplete(pre); }
public EncounterController(EncounterService encounterService) { _encounterService = encounterService; }