public GetPatientProblemsResponse GetPatientProblemsSummary(GetPatientProblemsRequest request) { try { GetPatientProblemsResponse response = new GetPatientProblemsResponse(); List <PatientObservation> problems = ObservationEndpointUtil.GetPatientProblemSummary(request); response.Problems = problems; response.Version = request.Version; return(response); } catch (Exception ex) { throw new Exception("AD:GetPatientProblemsSummary()::" + ex.Message, ex.InnerException); } }
internal static List <PatientObservation> GetPatientProblemSummary(GetPatientProblemsRequest request) { try { List <PatientObservation> result = new List <PatientObservation>(); IRestClient client = new JsonServiceClient(); string url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/Patient/{4}/Observation/Problems", DDPatientObservationsServiceUrl, "NG", request.Version, request.ContractNumber, request.PatientId), request.UserId); GetPatientProblemsSummaryResponse dataDomainResponse = client.Get <GetPatientProblemsSummaryResponse>(url); if (dataDomainResponse != null) { dataDomainResponse.PatientObservations.ForEach(r => { result.Add( new PatientObservation { Id = r.Id, ObservationId = r.ObservationId, Name = r.Name, PatientId = r.PatientId, StateId = r.StateId, DisplayId = r.DisplayId, StartDate = r.StartDate, EndDate = r.EndDate, Source = r.Source, Standard = r.Standard, TypeId = r.TypeId, DataSource = r.DataSource, ExternalRecordId = r.ExternalRecordId }); }); } return(result); } catch (WebServiceException ex) { throw new WebServiceException("AD:GetPatientProblemSummary()::" + ex.Message, ex.InnerException); } }
public GetPatientProblemsResponse Get(GetPatientProblemsRequest request) { GetPatientProblemsResponse response = new GetPatientProblemsResponse(); ObservationsManager om = new ObservationsManager(); ValidateTokenResponse result = null; try { request.Token = base.Request.Headers["Token"] as string; result = Security.IsUserValidated(request.Version, request.Token, request.ContractNumber); if (result.UserId.Trim() != string.Empty) { request.UserId = result.UserId; response = om.GetPatientProblemsSummary(request); } else { throw new UnauthorizedAccessException(); } } catch (Exception ex) { CommonFormatter.FormatExceptionResponse(response, base.Response, ex); if ((ex is WebServiceException) == false) { om.LogException(ex); } } finally { if (result != null) { AuditHelper.LogAuditData(request, result.SQLUserId, null, System.Web.HttpContext.Current.Request, request.GetType().Name); } } return(response); }