public DeletePatientSystemByPatientIdDataResponse DeletePatientSystemByPatientId(DeletePatientSystemByPatientIdDataRequest request) { DeletePatientSystemByPatientIdDataResponse response = null; try { response = new DeletePatientSystemByPatientIdDataResponse(); var repo = Factory.GetRepository(RepositoryType.PatientSystem); List <PatientSystemData> patientSystems = repo.FindByPatientId(request.PatientId) as List <PatientSystemData>; List <string> deletedIds = null; if (patientSystems != null) { deletedIds = new List <string>(); patientSystems.ForEach(u => { request.Id = u.Id; repo.Delete(request); deletedIds.Add(request.Id); }); response.DeletedIds = deletedIds; } response.Success = true; return(response); } catch (Exception ex) { throw ex; } }
public DeletePatientSystemByPatientIdDataResponse Delete(DeletePatientSystemByPatientIdDataRequest request) { DeletePatientSystemByPatientIdDataResponse response = new DeletePatientSystemByPatientIdDataResponse(); try { RequireUserId(request); response = Manager.DeletePatientSystemByPatientId(request); response.Version = request.Version; } catch (Exception ex) { RaiseException(response, ex); } return(response); }
public void DeletePatientSystemByPatientId_Test() { double version = 1.0; string contractNumber = "InHealth001"; string context = "NG"; string patientId = "5325db70d6a4850adcbba946"; string userId = "000000000000000000000000"; string ddUrl = "http://localhost:8888/PatientSystem"; IRestClient client = new JsonServiceClient(); // [Route("/{Context}/{Version}/{ContractNumber}/PatientSystem/Patient/{PatientId}/Delete", "DELETE")] string url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/PatientSystem/Patient/{4}/Delete", ddUrl, context, version, contractNumber, patientId), userId); DeletePatientSystemByPatientIdDataResponse response = client.Delete <DeletePatientSystemByPatientIdDataResponse>(url); Assert.IsNotNull(response); }
public void Execute() { try { //[Route("/{Context}/{Version}/{ContractNumber}/Patient/{PatientId}/PatientSystem", "DELETE")] string psUrl = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/Patient/{4}/PatientSystem", DDPatientSystemUrl, "NG", request.Version, request.ContractNumber, request.Id), request.UserId); DeletePatientSystemByPatientIdDataResponse psDDResponse = client.Delete <DeletePatientSystemByPatientIdDataResponse>(psUrl); if (psDDResponse != null && psDDResponse.Success) { deletedIds = psDDResponse.DeletedIds; } } catch (Exception ex) { throw new Exception("AD: PatientSystemCommand Execute::" + ex.Message, ex.InnerException); } }