Exemple #1
0
        public void Post_PatientGoalByID()
        {
            string      url            = "http://localhost:8888/Program";
            string      ProgramID      = "52a0da34fe7a5915485bdfd6";
            string      contractNumber = "InHealth001";
            string      context        = "NG";
            string      version        = "v1";
            IRestClient client         = new JsonServiceClient();

            GetPatientGoalDataResponse response = client.Post <GetPatientGoalDataResponse>(
                string.Format("{0}/{1}/{2}/{3}/PatientGoal/{4}", url, context, version, contractNumber, ProgramID),
                new GetPatientGoalDataResponse() as object);

            Assert.AreEqual(string.Empty, string.Empty);
        }
        public GetPatientGoalDataResponse Get(GetPatientGoalDataRequest request)
        {
            GetPatientGoalDataResponse response = new GetPatientGoalDataResponse();

            try
            {
                if (string.IsNullOrEmpty(request.UserId))
                {
                    throw new UnauthorizedAccessException("PatientGoalDD:Get()::Unauthorized Access");
                }

                response         = Manager.GetPatientGoal(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);
        }
Exemple #3
0
        public static PatientGoal GetPatientGoal(GetPatientGoalRequest request)
        {
            try
            {
                PatientGoal result = null;
                //[Route("/{Context}/{Version}/{ContractNumber}/Patient/{PatientId}/Goal/{Id}", "GET")]
                IRestClient client = new JsonServiceClient();

                string url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/Patient/{4}/Goal/{5}",
                                                                  DDPatientGoalsServiceUrl,
                                                                  "NG",
                                                                  request.Version,
                                                                  request.ContractNumber,
                                                                  request.PatientId,
                                                                  request.Id), request.UserId);

                GetPatientGoalDataResponse ddResponse = client.Get <GetPatientGoalDataResponse>(
                    url);

                if (ddResponse != null && ddResponse.GoalData != null)
                {
                    //Make a call to AttributeLibrary to get attributes details for Goal and Task.
                    List <CustomAttribute> goalAttributesLibrary = GoalsEndpointUtil.GetAttributesLibraryByType(request, 1);
                    List <CustomAttribute> taskAttributesLibrary = GoalsEndpointUtil.GetAttributesLibraryByType(request, 2);

                    result               = GoalsUtil.ConvertToGoal(ddResponse.GoalData, goalAttributesLibrary);
                    result.Barriers      = GoalsUtil.ConvertToBarriers(ddResponse.GoalData.BarriersData);
                    result.Tasks         = GoalsUtil.ConvertToTasks(ddResponse.GoalData.TasksData, taskAttributesLibrary);
                    result.Interventions = GoalsUtil.ConvertToInterventions(request, client, ddResponse.GoalData.InterventionsData);
                }
                return(result);
            }
            catch (WebServiceException ex)
            {
                throw new WebServiceException("AD:GetPatientGoal()::" + ex.Message, ex.InnerException);
            }
        }