public void UndoDeletePatientObservations_Test() { double version = 1.0; string contractNumber = "InHealth001"; string context = "NG"; string userId = "000000000000000000000000"; string ddUrl = "http://localhost:8888/PatientObservation"; IRestClient client = new JsonServiceClient(); //[Route("/{Context}/{Version}/{ContractNumber}/PatientObservation/UndoDelete", "PUT")] string url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/PatientObservation/UndoDelete", ddUrl, context, version, contractNumber), userId); List <string> ids = new List <string>(); ids.Add("53c6a795d6a48506ec49f9a6"); ids.Add("53c6a7a1d6a48506ec49fa59"); ids.Add("53c6a7a1d6a48506ec49fa64"); ids.Add("53c6a7add6a48506ec49fa97"); ids.Add("53c6a7bad6a48506ec49fb11"); UndoDeletePatientObservationsDataResponse response = client.Put <UndoDeletePatientObservationsDataResponse>(url, new UndoDeletePatientObservationsDataRequest { Ids = ids, Context = context, ContractNumber = contractNumber, UserId = userId, Version = version }); Assert.IsNotNull(response); }
public UndoDeletePatientObservationsDataResponse UndoDeletePatientObservations(UndoDeletePatientObservationsDataRequest request) { UndoDeletePatientObservationsDataResponse response = null; try { response = new UndoDeletePatientObservationsDataResponse(); IPatientObservationRepository repo = Factory.GetRepository(request, RepositoryType.PatientObservation); if (request.Ids != null && request.Ids.Count > 0) { request.Ids.ForEach(u => { request.PatientObservationId = u; repo.UndoDelete(request); }); } response.Success = true; return(response); } catch (Exception ex) { throw ex; } }
public UndoDeletePatientObservationsDataResponse Put(UndoDeletePatientObservationsDataRequest request) { UndoDeletePatientObservationsDataResponse response = new UndoDeletePatientObservationsDataResponse(); try { if (string.IsNullOrEmpty(request.UserId)) { throw new UnauthorizedAccessException("PatientObservationDD:PatientObservatioUndoDelete()::Unauthorized Access"); } response = Omgr.UndoDeletePatientObservations(request); response.Version = request.Version; } catch (Exception ex) { CommonFormatter.FormatExceptionResponse(response, base.Response, ex); string aseProcessID = ConfigurationManager.AppSettings.Get("ASEProcessID") ?? "0"; Common.Helper.LogException(int.Parse(aseProcessID), ex); } return(response); }
public void Undo() { try { //[Route("/{Context}/{Version}/{ContractNumber}/PatientObservation/UndoDelete", "PUT")] string url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/PatientObservation/UndoDelete", DDPatientObservationsServiceUrl, "NG", request.Version, request.ContractNumber), request.UserId); UndoDeletePatientObservationsDataResponse response = client.Put <UndoDeletePatientObservationsDataResponse>(url, new UndoDeletePatientObservationsDataRequest { Ids = deletedIds, Context = "NG", ContractNumber = request.ContractNumber, UserId = request.UserId, Version = request.Version } as object); } catch (Exception ex) { throw new Exception("AD: PatientObservationCommand Undo::" + ex.Message, ex.InnerException); } }