public PatientIntervention GetOpenNotMetPatientInterventionByTemplateId(string gid, string templateId, string patientId, string userId, IAppDomainRequest req) { try { var request = new GetPatientInterventionByTemplateIdRequest(); PatientIntervention intervention = null; IRestClient client = new JsonServiceClient(); var url = Helper.BuildURL( string.Format(@"{0}/{1}/{2}/{3}/Patient/{4}/Goal/Interventions?TemplateId={5}&GoalId={6}", "http://localhost:8888/PatientGoal", "NG", req.Version, req.ContractNumber, patientId, "5461bb4ffe7a59064cd074c0", "54652e3a84ac050f50239ded"), userId); var response = client.Get <GetPatientInterventionByTemplateIdResponse>(url); if (response.InterventionData != null) { intervention = Mapper.Map <PatientIntervention>(response.InterventionData); } return(intervention); } catch (Exception ex) { throw new Exception("AD:PlanElementEndpointUtil:GetGoalById()::" + ex.Message, ex.InnerException); } }
public PatientIntervention GetOpenNotMetPatientInterventionByTemplateId(string goalid, string tempId, string patientId, string userId, IAppDomainRequest req) { try { var request = new GetPatientInterventionByTemplateIdRequest(); PatientIntervention intervention = null; IRestClient client = new JsonServiceClient(); var url = Common.Helper.BuildURL( string.Format(@"{0}/{1}/{2}/{3}/Patient/{4}/Goal/Interventions?TemplateId={5}&GoalId={6}", DDPatientGoalsServiceUrl, "NG", req.Version, req.ContractNumber, patientId, tempId, goalid), userId); var response = client.Get <GetPatientInterventionByTemplateIdResponse>(url); if (response.InterventionData != null) { intervention = Mapper.Map <PatientIntervention>(response.InterventionData); } return(intervention); } catch (Exception ex) { throw new Exception("AD:PlanElementEndpointUtil:GetOpenNotMetPatientInterventionByTemplateId()::" + ex.Message, ex.InnerException); } }
public GetPatientInterventionByTemplateIdResponse Get(GetPatientInterventionByTemplateIdRequest request) { GetPatientInterventionByTemplateIdResponse response = new GetPatientInterventionByTemplateIdResponse(); try { if (string.IsNullOrEmpty(request.UserId)) { throw new UnauthorizedAccessException("PatientGoalDD:Get()::Unauthorized Access"); } response = Manager.GetPatientInterventionByTemplateId(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 GetPatientInterventionByTemplateIdResponse GetPatientInterventionByTemplateId(GetPatientInterventionByTemplateIdRequest request) { GetPatientInterventionByTemplateIdResponse result = null; try { result = new GetPatientInterventionByTemplateIdResponse(); IGoalRepository repo = Factory.GetRepository(request, RepositoryType.PatientIntervention); PatientInterventionData patientInterventionData = repo.FindByTemplateId(request.GoalId, request.TemplateId) as PatientInterventionData; //if (patientGoalData != null) //{ // //Get all barriers for a given goal // patientGoalData.BarriersData = getBarriersByPatientGoalId(request, patientGoalData.Id); // //Get all tasks for a given goal // patientGoalData.TasksData = getTasksByPatientGoalId(request, patientGoalData.Id); // //Get all interventions for a given goal // patientGoalData.InterventionsData = getInterventionsByPatientGoalId(request, patientGoalData.Id); //} result.InterventionData = patientInterventionData; result.Version = request.Version; return(result); } catch (Exception ex) { throw ex; } }