Example #1
0
 public ActionResult Edit([Bind(Include = "InterventionId,PatientId,Activity1,Activity2,Activity3,Activity4,RouteGiven,ResponseToTreatment,HowTolerated,DateDone,TimeDone")] Intervention intervention)
 {
     if (ModelState.IsValid)
     {
         db.Entry(intervention).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PatientId = new SelectList(db.Patients, "PatientId", "PatientFirst", intervention.PatientId);
     return(View(intervention));
 }
Example #2
0
        public ActionResult Create([Bind(Include = "VitalId,PatientId,DateDone,TimeDone,UpperLeftSound,UpperRightSound,LowerLeftSound,LowerRightSound,MiddleSound,RR,HR,BP,Saturation,Cough,O2Device,Flow")] Vital vital)
        {
            if (ModelState.IsValid)
            {
                db.Vitals.Add(vital);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.PatientId = new SelectList(db.Patients, "PatientId", "PatientFirst", vital.PatientId);
            return(View(vital));
        }
Example #3
0
        public ActionResult Chart(ChartViewModel chartVM)
        {
            if (ModelState.IsValid)
            {
                var intervention = new Intervention
                {
                    EmployeeId   = chartVM.EmployeeId,
                    DateTimeDone = new DateTime(chartVM.DateDone.Year, chartVM.DateDone.Month, chartVM.DateDone.Day,
                                                chartVM.TimeDone.Hour, chartVM.TimeDone.Minute, chartVM.TimeDone.Second),
                    Activity1          = chartVM.Activity1,
                    Activity2          = chartVM.Activity2,
                    Activity3          = chartVM.Activity3,
                    Activity4          = chartVM.Activity4,
                    HowTolerated       = chartVM.HowTolerated,
                    PatientId          = chartVM.PatientId,
                    ResponeToTreatment = chartVM.ResponseToTreatment,
                    RouteGiven         = chartVM.RouteGiven
                };

                var vital = new Vital
                {
                    EmployeeId   = chartVM.EmployeeId,
                    BP           = chartVM.BP,
                    RR           = chartVM.RR,
                    Saturation   = chartVM.Saturation,
                    DateTimeDone = new DateTime(chartVM.DateDone.Year, chartVM.DateDone.Month, chartVM.DateDone.Day,
                                                chartVM.TimeDone.Hour, chartVM.TimeDone.Minute, chartVM.TimeDone.Second),
                    Cough           = chartVM.Cough,
                    HR              = chartVM.HR,
                    Flow            = chartVM.Flow,
                    O2Device        = chartVM.O2Device,
                    PatientId       = chartVM.PatientId,
                    UpperLeftSound  = chartVM.UpperLeftSound,
                    UpperRightSound = chartVM.UpperRightSound,
                    LowerLeftSound  = chartVM.LowerLeftSound,
                    LowerRightSound = chartVM.LowerRightSound,
                    MiddleSound     = chartVM.MiddleSound
                };
                db.Interventions.Add(intervention);
                db.Vitals.Add(vital);
                db.SaveChanges();
                return(RedirectToAction("Index", "Visits"));
            }
            return(View(chartVM));
        }
Example #4
0
        public ActionResult Create([Bind(Include = "Room,VisitDate,DischargeDate,Room")] Visit visit)
        {
            if (ModelState.IsValid)
            {
                db.Visits.Add(visit);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.VisitorId = new SelectList(db.Patients, "PatientId", "PatientFirst", visit.PatientId);
            return(View(visit));
        }
Example #5
0
        public async Task <ActionResult> Register(RegisterViewModel model)
        {
            if (ModelState.IsValid)
            {
                var user = new ApplicationUser {
                    UserName = model.Email, Email = model.Email
                };
                var result = await UserManager.CreateAsync(user, model.Password);

                if (result.Succeeded)
                {
                    var employee = new Employee
                    {
                        AccountId          = user.Id,
                        FirstName          = model.FirstName,
                        LastName           = model.LastName,
                        LicenseCredentials = model.LicenseCredentials,
                        Position           = model.Position
                    };

                    ChartEntities db = new ChartEntities();
                    db.Employees.Add(employee);
                    db.SaveChanges();


                    await SignInManager.SignInAsync(user, isPersistent : false, rememberBrowser : false);

                    // For more information on how to enable account confirmation and password reset please visit https://go.microsoft.com/fwlink/?LinkID=320771
                    // Send an email with this link
                    // string code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id);
                    // var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
                    // await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking <a href=\"" + callbackUrl + "\">here</a>");

                    return(RedirectToAction("Index", "Visits"));
                }
                AddErrors(result);
            }

            // If we got this far, something failed, redisplay form
            return(View(model));
        }