public void UndoDeletePatientNotes_Test() { double version = 1.0; string contractNumber = "InHealth001"; string context = "NG"; string userId = "000000000000000000000000"; string ddUrl = "http://localhost:8888/PatientNote"; IRestClient client = new JsonServiceClient(); //[Route("/{Context}/{Version}/{ContractNumber}/PatientNote/UndoDelete", "PUT")] string url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/PatientNote/UndoDelete", ddUrl, context, version, contractNumber), userId); List <string> ids = new List <string>(); ids.Add("53c5ab5cd6a48506ec660ad4"); ids.Add("53c5ab59d6a48506ec660ad0"); UndoDeletePatientNotesDataResponse response = client.Put <UndoDeletePatientNotesDataResponse>(url, new UndoDeletePatientNotesDataRequest { Ids = ids, Context = context, ContractNumber = contractNumber, UserId = userId, Version = version }); Assert.IsNotNull(response); }
public UndoDeletePatientNotesDataResponse Put(UndoDeletePatientNotesDataRequest request) { UndoDeletePatientNotesDataResponse response = new UndoDeletePatientNotesDataResponse(); try { RequireUserId(request); response = Manager.UndoDeletePatientNotes(request); response.Version = request.Version; } catch (Exception ex) { RaiseException(response, ex); } return(response); }
public UndoDeletePatientNotesDataResponse UndoDeletePatientNotes(UndoDeletePatientNotesDataRequest request) { UndoDeletePatientNotesDataResponse response = null; try { response = new UndoDeletePatientNotesDataResponse(); IMongoPatientNoteRepository repo = Factory.GetRepository(RepositoryType.PatientNote); if (request.Ids != null && request.Ids.Count > 0) { request.Ids.ForEach(u => { request.PatientNoteId = u; repo.UndoDelete(request); }); } response.Success = true; return(response); } catch (Exception ex) { throw ex; } }
public void Undo() { try { //[Route("/{Context}/{Version}/{ContractNumber}/PatientNote/UndoDelete", "PUT")] string url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/PatientNote/UndoDelete", DDPatientNoteUrl, "NG", request.Version, request.ContractNumber), request.UserId); UndoDeletePatientNotesDataResponse response = client.Put <UndoDeletePatientNotesDataResponse>(url, new UndoDeletePatientNotesDataRequest { Ids = deletedIds, Context = "NG", ContractNumber = request.ContractNumber, UserId = request.UserId, Version = request.Version } as object); } catch (Exception ex) { throw new Exception("AD: PatientNoteCommand Undo::" + ex.Message, ex.InnerException); } }