public void UpdatePatient_Test() { GetInitializeGoalRequest request = new GetInitializeGoalRequest(); request.ContractNumber = "InHealth001"; request.UserId = "531f2df4072ef727c4d2a3b2"; request.Version = 1; request.PatientId = "52f55874072ef709f84e68c5"; GoalsManager gManager = new GoalsManager(); GetInitializeGoalResponse response = gManager.GetInitialGoalRequest(request); Assert.IsNotNull(response); }
public void InitializePatientGoal_Test() { GetInitializeGoalRequest request = new GetInitializeGoalRequest(); request.ContractNumber = "InHealth001"; request.UserId = "AD_TestHarness"; request.Version = 1; request.PatientId = "531f2dcd072ef727c4d29fb0"; request.UserId = "531f2df5072ef727c4d2a3bc"; GoalsManager gManager = new GoalsManager(); GetInitializeGoalResponse response = gManager.GetInitialGoalRequest(request); Assert.IsNotNull(response); }
public GetInitializeGoalResponse GetInitialGoalRequest(GetInitializeGoalRequest request) { try { GetInitializeGoalResponse response = new GetInitializeGoalResponse(); PatientGoalData pg = (PatientGoalData)GoalsEndpointUtil.GetInitialGoalRequest(request); response.Goal = GoalsUtil.GetPatientGoalForInitialize(request, pg); response.Version = request.Version; return(response); } catch (Exception ex) { throw new Exception("AD:GetInitialGoalRequest()::" + ex.Message, ex.InnerException); } }
public GetInitializeGoalResponse Get(GetInitializeGoalRequest request) { GetInitializeGoalResponse response = new GetInitializeGoalResponse(); GoalsManager gm = new GoalsManager(); ValidateTokenResponse result = null; try { request.Token = base.Request.Headers["Token"] as string; result = Security.IsUserValidated(request.Version, request.Token, request.ContractNumber); if (result.UserId.Trim() != string.Empty) { request.UserId = result.UserId; response = gm.GetInitialGoalRequest(request); } else { throw new UnauthorizedAccessException(); } } catch (Exception ex) { CommonFormatter.FormatExceptionResponse(response, base.Response, ex); if ((ex is WebServiceException) == false) { gm.LogException(ex); } } finally { List <string> patientIds = null; if (response.Goal != null) { patientIds = new List <string>(); patientIds.Add(response.Goal.PatientId); } if (result != null) { AuditHelper.LogAuditData(request, result.SQLUserId, patientIds, System.Web.HttpContext.Current.Request, request.GetType().Name); } } return(response); }
public void Post_PatientGoal_Initialize_Test() { string contractNumber = "InHealth001"; string context = "NG"; double version = 1.0; string token = "530376c0d6a4850698fb3bb1"; string patientId = "52e26f0b072ef7191c111c4d"; string patientGoalId = "52fd2d6cd433231c845e7d25"; IRestClient client = new JsonServiceClient(); GetInitializeGoalResponse response = client.Get <GetInitializeGoalResponse>( string.Format(@"http://localhost:888/Nightingale/{0}/{1}/Patient/{2}/Goal/Initialize/?Token={3}", version, contractNumber, patientId, token)); }