Exemple #1
0
        public void FindByTemplateId_Status_Open_Or_Met()
        {
            var repo    = new PatientGoalRepositoryFactory();
            var request = new GetPatientGoalByTemplateIdRequest
            {
                TemplateId     = "545a91a1fe7a59218cef2d6d",
                PatientId      = "5325db9cd6a4850adcbba9ca",
                Context        = "NG",
                ContractNumber = "InHealth001",
                UserId         = "1234",
            };
            var rep         = repo.GetRepository(request, RepositoryType.PatientGoal);
            var patientGoal = rep.FindByTemplateId(request.PatientId, request.TemplateId);

            Assert.IsNotNull(patientGoal);
        }
Exemple #2
0
        public void GetPatientByTemplateIdGoalTest()
        {
            var pgm = new PatientGoalDataManager()
            {
                Factory = new StubPatientGoalRepositoryFactory()
            };
            var request = new GetPatientGoalByTemplateIdRequest
            {
                TemplateId     = "545a91a1fe7a59218cef2d6d",
                PatientId      = "5325db9cd6a4850adcbba9ca",
                Context        = "NG",
                ContractNumber = "InHealth001",
                UserId         = "1234",
                Version        = 1
            };

            var response = pgm.GetPatientByTemplateIdGoal(request);

            Assert.IsNotNull(response);
        }
Exemple #3
0
        public GetPatientGoalByTemplateIdResponse GetPatientByTemplateIdGoal(GetPatientGoalByTemplateIdRequest request)
        {
            GetPatientGoalByTemplateIdResponse result = null;

            try
            {
                result = new GetPatientGoalByTemplateIdResponse();
                IGoalRepository repo = Factory.GetRepository(request, RepositoryType.PatientGoal);

                PatientGoalData patientGoalData = repo.FindByTemplateId(request.PatientId, request.TemplateId) as PatientGoalData;

                result.GoalData = patientGoalData;
                result.Version  = request.Version;
                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public GetPatientGoalByTemplateIdResponse Get(GetPatientGoalByTemplateIdRequest request)
        {
            GetPatientGoalByTemplateIdResponse response = new GetPatientGoalByTemplateIdResponse();

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

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