public void Complete_Single_Action_Tests()
        {
            string      contractNumber = "InHealth001";
            string      context        = "NG";
            string      priority       = "3";
            double      version        = 1.0;
            string      token          = "52d58da0d6a4850e90240706";
            string      programId      = "52deedd0d6a4850fac29d83a";
            string      patientId      = "528f6cfa072ef708ecd68c94";
            string      actionID       = "52a0f33bd43323141c9eb274";
            IRestClient client         = new JsonServiceClient();

            JsonServiceClient.HttpWebRequestFilter = x =>
                                                     x.Headers.Add(string.Format("{0}: {1}", "x-Phytel-UserID", "531f2df9072ef727c4d2a3df"));

            PutProgramActionProcessingResponse response = client.Put <PutProgramActionProcessingResponse>(
                string.Format(@"http://localhost:8888/Program/{0}/{1}/{2}/Patient/{3}/Programs/{4}/Update",
                              context,
                              version,
                              contractNumber,
                              patientId,
                              programId,
                              token), new PutProgramActionProcessingRequest {
                Program = GenTestProgram(), UserId = "roumel"
            });
        }
Beispiel #2
0
        public PutProgramActionProcessingResponse PutProgramActionUpdate(PutProgramActionProcessingRequest request)
        {
            try
            {
                PutProgramActionProcessingResponse response = new PutProgramActionProcessingResponse();

                IProgramRepository patProgRepo =
                    Factory.GetRepository(request, RepositoryType.PatientProgram);

                response.program            = (ProgramDetail)patProgRepo.Update((object)request);
                response.program.Attributes = GetProgramAttributes(response.program.Id, request);

                return(response);
            }
            catch (Exception ex)
            {
                throw new Exception("DD:DataProgramManager:PutProgramActionUpdate()::" + ex.Message, ex.InnerException);
            }
        }
Beispiel #3
0
        public AD.Outcome SaveProgramAttributeChanges(
            PostProgramAttributesChangeRequest request, ProgramDetail pD)
        {
            try
            {
                PostProgramAttributesChangeResponse sResponse = new PostProgramAttributesChangeResponse();

                IRestClient client = new JsonServiceClient();

                var url = Common.Helper.BuildURL(string.Format(@"{0}/{1}/{2}/{3}/Patient/{4}/Programs/{5}/Update",
                                                               DDProgramServiceUrl,
                                                               "NG",
                                                               request.Version,
                                                               request.ContractNumber,
                                                               request.PatientId,
                                                               request.ProgramId,
                                                               request.Token), request.UserId);

                PutProgramActionProcessingResponse response = client.Put <PutProgramActionProcessingResponse>(
                    url, new PutProgramActionProcessingRequest {
                    Program = pD, UserId = request.UserId
                });

                if (response != null)
                {
                    sResponse.Outcome = new AD.Outcome
                    {
                        Reason = "Success",
                        Result = 1
                    };
                }

                return(sResponse.Outcome);
            }
            catch (Exception ex)
            {
                throw new Exception("AD:PlanElementEndpointUtil:SaveProgramAttributeChanges()::" + ex.Message,
                                    ex.InnerException);
            }
        }
Beispiel #4
0
        public PutProgramActionProcessingResponse Put(PutProgramActionProcessingRequest request)
        {
            PutProgramActionProcessingResponse response = new PutProgramActionProcessingResponse();

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

                response         = ProgramDataManager.PutProgramActionUpdate(request);
                response.Version = request.Version;
            }
            catch (Exception ex)
            {
                CommonFormatterUtil.FormatExceptionResponse(response, base.Response, ex);

                string aseProcessID = ConfigurationManager.AppSettings.Get("ASEProcessID") ?? "0";
                Helpers.LogException(int.Parse(aseProcessID), ex);
            }
            return(response);
        }