public async Task <bool> SaveDoctorNote(DoctorNoteModel model)
        {
            var note = model.MapTo <DoctorNotes>();

            _dbContext.Notes.Add(note);
            await _dbContext.SaveChangesAsync();

            return(true);
        }
        public async Task <IActionResult> SendDoctorNotes(DoctorNoteModel model)
        {
            try
            {
                bool result = await _manager.SaveDoctorNote(model);

                var patient = await _patientManager.GetPatientDetailsById(model.PatientId);

                await _emailService.SendEmail(patient.Email, model.NoteContent, "Doctor notes");

                return(Ok(new JObject
                {
                    ["status"] = "Success"
                }.ToString()));
            }catch (Exception ex)
            {
                return(Ok(new JObject
                {
                    ["error"] = ex.Message,
                    ["stackTrace"] = ex.StackTrace
                }.ToString()));
            }
        }
示例#3
0
 public async Task <bool> SaveDoctorNote(DoctorNoteModel model)
 {
     return(await _repo.SaveDoctorNote(model));
 }