public void UndoDelete(object entity) { UndoDeleteCohortPatientViewDataRequest request = (UndoDeleteCohortPatientViewDataRequest)entity; try { using (PatientMongoContext ctx = new PatientMongoContext(_dbName)) { var q = MB.Query <MECohortPatientView> .EQ(b => b.Id, ObjectId.Parse(request.Id)); var ub = new List <MB.UpdateBuilder>(); ub.Add(MB.Update.Set(MECohortPatientView.TTLDateProperty, BsonNull.Value)); ub.Add(MB.Update.Set(MECohortPatientView.DeleteFlagProperty, false)); ub.Add(MB.Update.Set(MECohortPatientView.LastUpdatedOnProperty, DateTime.UtcNow)); ub.Add(MB.Update.Set(MECohortPatientView.UpdatedByProperty, ObjectId.Parse(this.UserId))); IMongoUpdate update = MB.Update.Combine(ub); ctx.CohortPatientViews.Collection.Update(q, update); AuditHelper.LogDataAudit(this.UserId, MongoCollectionName.CohortPatientView.ToString(), request.Id.ToString(), Common.DataAuditType.UndoDelete, request.ContractNumber); } } catch (Exception) { throw; } }
public UndoDeleteCohortPatientViewDataResponse UndoDeleteCohortPatientView(UndoDeleteCohortPatientViewDataRequest request) { UndoDeleteCohortPatientViewDataResponse response = null; try { response = new UndoDeleteCohortPatientViewDataResponse(); IPatientRepository cpvRepo = Factory.GetRepository(request, RepositoryType.CohortPatientView); if (request.Id != null) { cpvRepo.UndoDelete(request); } response.Success = true; return(response); } catch (Exception ex) { throw ex; } }
public UndoDeleteCohortPatientViewDataResponse Put(UndoDeleteCohortPatientViewDataRequest request) { UndoDeleteCohortPatientViewDataResponse response = new UndoDeleteCohortPatientViewDataResponse(); try { if (string.IsNullOrEmpty(request.UserId)) { throw new UnauthorizedAccessException("PatientDD:UndoDeleteCohortPatientView()::Unauthorized Access"); } response = PatientManager.UndoDeleteCohortPatientView(request); response.Version = request.Version; } catch (Exception ex) { CommonFormatterUtil.FormatExceptionResponse(response, base.Response, ex); string aseProcessID = ConfigurationManager.AppSettings.Get("ASEProcessID") ?? "0"; Helpers.LogException(int.Parse(aseProcessID), ex); } return(response); }
UndoDeleteCohortPatientViewDataResponse IPatientDataManager.UndoDeleteCohortPatientView(UndoDeleteCohortPatientViewDataRequest request) { throw new NotImplementedException(); }
public UndoDeleteCohortPatientViewDataResponse UndoDeleteCohortPatientViewByPatientId(UndoDeleteCohortPatientViewDataRequest request) { throw new NotImplementedException(); }