public void CreateAmbulatoryList(AmbulatoryListInputModel input) { var doctor = this._db.Users.Find(input.DoctorId); var patient = this._db.Users.Find(input.PatientId); if (doctor == null || patient == null) { return; } var ambulatoryList = new AmbulatoryList { CreatedOn = input.CreatedOn, AccompanyingConditions = input.AccompanyingConditions, Diagnosis = input.Diagnosis, Doctor = doctor, Examinations = input.Examinations, MedicalHistory = input.MedicalHistory, NZOKNumber = input.NZOKNumber, ObjectiveCondition = input.ObjectiveCondition, Patient = patient, SubstituteType = input.SubstituteType, Therapy = input.Therapy, TypeOfCheckup = input.TypeOfCheckup, VisitReason = input.VisitReason }; this._db.AmbulatoryLists.Add(ambulatoryList); this._db.SaveChanges(); }
public AmbulatoryListInputModel PrepareAmbListInputModel() { var listAllPatients = this.GetAllPatients(); var doctorUserName = _signInManager.Context.User.Identity.Name; var doctor = this._db.Users.Where(x => x.UserName == doctorUserName).FirstOrDefault(); var ambulatoryListInputModel = new AmbulatoryListInputModel { PatientsList = listAllPatients, DoctorFullName = doctor.FullName, DoctorId = doctor.Id, DoctorSpecialtyCode = doctor.SpecialtyCode, DoctorUIN = doctor.UIN, CreatedOn = DateTime.Now }; return(ambulatoryListInputModel); }
public IActionResult CreateAmbulatoryList(AmbulatoryListInputModel input) { _doctorService.CreateAmbulatoryList(input); return(this.Redirect("/")); }