public async Task <Domain.Models.ResponseModels.AddFormModel> AddFormsAsync(string formKey) { Domain.Models.RequestModels.AddFormModel domainUser = new Domain.Models.RequestModels.AddFormModel(); SetBaseProperties(domainUser); domainUser.FormKey = formKey; domainUser.VisitId = Settings.GetVisitId(); // Call REST service Domain.Models.ResponseModels.AddFormModel res = await _authService.AddFormsAsync(domainUser); return(res); }
public async System.Threading.Tasks.Task <Domain.Models.ResponseModels.AddFormModel> AddFormsAsync(string formKey) { Domain.Models.RequestModels.AddFormModel domainUser = new Domain.Models.RequestModels.AddFormModel(); domainUser.ApplicationId = Settings.GetApplicationId(); domainUser.SerialNumber = Settings.GetSerialNumber(); domainUser.Version = Settings.GetVersion(); domainUser.AuthToken = Settings.GetAuthorizationToken(); domainUser.AccessToken = Settings.GetAccessToken(); domainUser.FormKey = formKey; domainUser.VisitID = Settings.GetVisitId(); // TODO: Call the REST Service for authentication Domain.Models.ResponseModels.AddFormModel res = await _authService.AddFormsAsync(domainUser); return(res); }
// // FORMS -- TODO: Forms need to be broken out into their own service, viewModel and interface // public async Task <Domain.Models.ResponseModels.AddFormModel> AddFormsAsync( Domain.Models.RequestModels.AddFormModel addFormReq) { Domain.Models.ResponseModels.AddFormModel result = null; try { var client = new HttpClient(); client.BaseAddress = new Uri(Settings.GetBaseUrl()); var data = JsonConvert.SerializeObject(addFormReq); var content = new StringContent(data, Encoding.UTF8, "application/json"); HttpResponseMessage response = await client.PostAsync(Settings.GetBaseUrl() + "/efr/patient/form", content); result = JsonConvert.DeserializeObject <Domain.Models.ResponseModels.AddFormModel>( response.Content.ReadAsStringAsync().Result); } catch (Exception erf) { Debug.Write(erf); } return(result); }