Beispiel #1
0
        public async Task <IActionResult> Create([Bind("id,profile_id,appointment_id,date_of_service,server,start_time,stop_time,length_of_session,type_of_session,service_code,visit_reason,past_history,family_history,symptoms_review,height,weight,blood_pressure,pulse,psychiatric_exam_note,allergies,additional_comment,risk_and_benefit_note,created_by,created_at")] mp_psychiatric_progress_note mp_psychiatric_progress_note)
        {
            if (ModelState.IsValid)
            {
                await _psychiatricProgressNote.Add(mp_psychiatric_progress_note);

                return(RedirectToAction(nameof(Index)));
            }
            return(View(mp_psychiatric_progress_note));
        }
Beispiel #2
0
        public async Task <IActionResult> PostPsychiatricProgress(mp_psychiatric_progress_note note)
        {
            var old = _psychiatricProgressNote.GetNote().FirstOrDefault(e => e.appointment_id == note.appointment_id);

            var email = _userManager.GetUserId(HttpContext.User);
            var user  = await _userManager.FindByEmailAsync(email);

            if (old == null)
            {
                //this is a new form
                note.created_by = user.Id;
                await _psychiatricProgressNote.Add(note);
            }
            else
            {
                //update the existing form
                note.created_by = old.created_by;
                note.id         = old.id;
                _psychiatricProgressNote.Update(note);
            }

            return(Ok(200));
        }