public GetPatientProblemsSummaryResponse GetPatientProblemList(GetPatientProblemsSummaryRequest request) { try { GetPatientProblemsSummaryResponse result = new GetPatientProblemsSummaryResponse(); IPatientObservationRepository oRepo = Factory.GetRepository(request, RepositoryType.Observation); IPatientObservationRepository repo = Factory.GetRepository(request, RepositoryType.PatientObservation); // 1) get all observationIds that are of type problem that are active. List <ObservationData> oData = (List <ObservationData>)oRepo.GetObservationsByType("533d8278d433231deccaa62d", null, null); List <string> oIds = oData.Select(i => i.Id).ToList(); // 2) find all current patientobservations within these observationids. List <PatientObservationData> ol = ((MongoPatientObservationRepository)repo).GetAllPatientProblems(request, oIds) as List <PatientObservationData>; result.PatientObservations = ol; return(result); } catch (Exception ex) { throw new Exception("DD.DataPatientObservationManager:GetPatientObservationList()::" + 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 void Get_PatientProblems() { string url = "http://localhost:8888/PatientObservation"; string patientId = "5325da6fd6a4850adcbba63e"; string contractNumber = "InHealth001"; string context = "NG"; double version = 1.0; string userId = "531f2df9072ef727c4d2a3df"; IRestClient client = new JsonServiceClient(); JsonServiceClient.HttpWebRequestFilter = x => x.Headers.Add(string.Format("{0}: {1}", "x-Phytel-UserID", userId)); // /{Context}/{Version}/{ContractNumber}/Patient/{PatientId}/Observation// GetPatientProblemsSummaryResponse response = client.Get <GetPatientProblemsSummaryResponse>( string.Format("{0}/{1}/{2}/{3}/Patient/{4}/Observation/Problems?UserId={5}", url, context, version, contractNumber, patientId, userId)); Assert.AreEqual(string.Empty, string.Empty); }
public GetPatientProblemsSummaryResponse Get(GetPatientProblemsSummaryRequest request) { GetPatientProblemsSummaryResponse response = new GetPatientProblemsSummaryResponse(); try { if (string.IsNullOrEmpty(request.UserId)) { throw new UnauthorizedAccessException("PatientObservationDD:Post()::Unauthorized Access"); } response = Omgr.GetPatientProblemList(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); }