/// <summary> /// 新增患教 /// </summary> /// <param name="entity">患教实体</param> /// <returns>患教Id</returns> public void Add(AddCourseInput addCourseInput, long patientId, long doctorId, string batchNumber) { var id = _idGenerator.CreateId(); var entity = new PatientEducation { Id = id, BatchNumber = batchNumber, DoctorId = doctorId, PatientId = patientId, CourseTypeId = addCourseInput.CourseTypeId, AddTime = DateTime.Now, PatientEducationDetail = new List <PatientEducationDetail>() }; foreach (var item in addCourseInput.CourseIds) { entity.PatientEducationDetail.Add(new PatientEducationDetail { CourseId = item, PatientEducationId = id, Id = _idGenerator.CreateId(), AddTime = DateTime.Now }); } _context.PatientEducation.Add(entity); }
/// <summary> /// 新增消息 /// </summary> /// <param name="entity">消息实体</param> public void Add(Message entity) { entity.Id = _idGenerator.CreateId(); entity.SendTime = DateTime.Now; _context.Message.Add(entity); }
/// <summary> /// 新增报警 /// </summary> /// <param name="entity">报警实体</param> public void Add(Alarm entity) { entity.Id = _idGenerator.CreateId(); entity.AddTime = DateTime.Now; _context.Alarm.Add(entity); }
/// <summary> /// 新增课程 /// </summary> /// <param name="entity">课程实体</param> public void Add(Course entity) { entity.Id = _idGenerator.CreateId(); entity.AddTime = DateTime.Now; entity.UpdateTime = DateTime.Now; _context.Course.Add(entity); }
/// <summary> /// 新增患者联系人 /// </summary> /// <param name="patientContact">患者联系人</param> /// <returns></returns> public void Add(PatientContact patientContact) { patientContact.Id = _idGenerator.CreateId(); patientContact.Password = CommConstant.InitialPassword; patientContact.AddTime = DateTime.Now; patientContact.UpdateTime = DateTime.Now; _context.PatientContact.Add(patientContact); }
/// <summary> /// 新增医护人员 /// </summary> /// <param name="entity">医护人员实体</param> public void Add(Doctor entity) { entity.Id = _idGenerator.CreateId(); entity.Password = CommConstant.InitialPassword; entity.AddTime = DateTime.Now; entity.UpdateTime = DateTime.Now; _context.Doctor.Add(entity); }
/// <summary> /// 上传图片 /// </summary> /// <param name="input">上传图片请求</param> /// <returns></returns> public async Task <string> UploadImage(UploadImageInput input) { var fileName = string.Format("{0}-{1}.{2}", _idGenerator.CreateId().ToString(), DateTime.Now.ToString(CommConstant.FullTimeFormatString), "jpg"); var key = _optionsAccessor.OssPatientDir + input.Folder + "/" + fileName; var mimeType = GetContentTypeBySuffix(Path.GetExtension(fileName)); using (var stream = new MemoryStream(input.AvatarBuffer)) { return(await PutObject(stream, key, mimeType)); } }
/// <summary> /// 新增患者 /// </summary> /// <param name="patient">患者</param> /// <returns></returns> public long Add(Patient patient) { DateTime now = DateTime.Now; patient.Id = _idGenerator.CreateId(); patient.AddTime = now; patient.UpdateTime = now; _context.Patient.Add(patient); return(patient.Id); }
/// <summary> /// 新增血糖 /// </summary> /// <param name="patientId">患者Id</param> /// <param name="value">血糖值</param> /// <returns></returns> public void Add(long patientId, decimal value) { var entity = new BloodSugar { Id = _idGenerator.CreateId(), PatientId = patientId, Value = value, AddTime = DateTime.Now }; _context.BloodSugar.Add(entity); }
/// <summary> /// 批量新增饮水量 /// </summary> /// <param name="input"></param> public void BatchAdd(AddWaterInput input) { List <Water> waterList = new List <Water>(); DateTime currentTime = DateTime.Now; foreach (var item in input.Drink) { waterList.Add(new Water { Id = _idGenerator.CreateId(), PatientId = input.PatientId, DrinkVolume = item.DrinkVolume, DrinkTime = item.DrinkTime, AddTime = currentTime }); } _context.Water.AddRange(waterList); }
/// <summary> /// 新增血压 /// </summary> /// <param name="bloodPressure"></param> public void Add(BloodPressure bloodPressure) { bloodPressure.Id = _idGenerator.CreateId(); _context.BloodPressure.Add(bloodPressure); }
/// <summary> /// 新增 /// </summary> /// <param name="entity"></param> public void Add(HandRing entity) { entity.Id = _idGenerator.CreateId(); _context.HandRing.Add(entity); }
/// <summary> /// 新增血压 /// </summary> /// <param name="entity"></param> public void Add(BloodPressure entity) { entity.Id = _idGenerator.CreateId(); entity.AddTime = DateTime.Now; _context.BloodPressures.Add(entity); }
/// <summary> /// 新增医院 /// </summary> /// <param name="entity">医院实体</param> public void Add(Hospital entity) { entity.Id = _idGenerator.CreateId(); _context.Hospital.Add(entity); }
/// <summary> /// 新增排班 /// </summary> /// <param name="shift">排班</param> /// <returns></returns> public void Add(Shift shift) { shift.Id = _idGenerator.CreateId(); _context.Shift.Add(shift); }
/// <summary> /// 新增体重 /// </summary> /// <param name="weight"></param> public void Add(Weight weight) { weight.Id = _idGenerator.CreateId(); _context.Weights.Add(weight); }
/// <summary> /// 新增透析记录 /// </summary> /// <param name="dialysis"></param> public void Add(Domain.Models.Dialysis dialysis) { dialysis.Id = _idGenerator.CreateId(); _context.Dialysis.Add(dialysis); }