public async Task <MedicalRecordEntity> UpdateMedicalRecordByIdAsync(MedicalRecordEntity medicalRecordEntity, CancellationToken token) { _dbContext.MedicalRecords.Update(medicalRecordEntity); await _dbContext.SaveChangesAsync(token); return(await _dbContext.MedicalRecords .Include(x => x.Company) .Include(x => x.Facility) .Include(x => x.Encounter) .Include(x => x.Regulatory) .SingleAsync(medicalRecord => medicalRecord.Id == medicalRecordEntity.Id, token)); }
public Task <int> SubmitForm <TDto>(MedicalRecordEntity entity, TDto dto) where TDto : class { if (!string.IsNullOrEmpty(entity.F_Id)) { entity.Modify(entity.F_Id); entity.F_LastModifyUserId = _usersService.GetCurrentUserId(); return(_service.UpdateAsync(entity, dto)); } else { entity.Create(); entity.F_CreatorUserId = _usersService.GetCurrentUserId(); return(_service.InsertAsync(entity)); } }
public Task <int> InsertForm(MedicalRecordEntity entity) { return(_service.InsertAsync(entity)); }
public Task <int> UpdateForm(MedicalRecordEntity entity) { return(_service.UpdateAsync(entity)); }