Exemplo n.º 1
0
        public string GetInitialInterventionRequest(GetInitializeInterventionRequest request)
        {
            try
            {
                string result = string.Empty;

                IRestClient client = new JsonServiceClient();

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

                PutInitializeInterventionResponse response = client.Put <PutInitializeInterventionResponse>(
                    url,
                    new PutInitializeInterventionRequest() as object);

                if (response != null)
                {
                    result = response.Id;
                }

                return(result);
            }
            catch (WebServiceException ex)
            {
                throw new WebServiceException("AD:GetInitialInterventionRequest()::" + ex.Message, ex.InnerException);
            }
        }
Exemplo n.º 2
0
        public PutInitializeInterventionResponse InsertNewPatientIntervention(PutInitializeInterventionRequest request)
        {
            try
            {
                PutInitializeInterventionResponse result = new PutInitializeInterventionResponse();

                IGoalRepository repo = Factory.GetRepository(request, RepositoryType.PatientIntervention);

                result.Id = (string)repo.Initialize(request);
                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 3
0
        public void Put_Patient_Intervention_Insert()
        {
            string      url            = "http://localhost:8888/PatientGoal";
            string      patientId      = "52a0da34fe7a5915485bdfd6";
            string      contractNumber = "InHealth001";
            string      context        = "NG";
            string      version        = "v1";
            string      patientGoalId  = "52a0da34fe7a5915485bd111";
            IRestClient client         = new JsonServiceClient();

            PutInitializeInterventionResponse response = client.Put <PutInitializeInterventionResponse>(
                string.Format("{0}/{1}/{2}/{3}/Patient/{4}/Goal/{5}/Intervention/Initialize",
                              url,
                              context,
                              version,
                              contractNumber,
                              patientId,
                              patientGoalId),
                new PutInitializeTaskRequest() as object);
        }
Exemplo n.º 4
0
        public PutInitializeInterventionResponse Put(PutInitializeInterventionRequest request)
        {
            PutInitializeInterventionResponse response = new PutInitializeInterventionResponse();

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

                response         = Manager.InsertNewPatientIntervention(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);
        }