// public async Task<ReceiveContext> UpdateProcedureParticipant(string url,ProcedureParticipantDetails participant) // { // url = Consts.BaseServerURL+ "/anesservices/ProcParticipants/"+participant.ProcID.ToString(); // string putData = JsonConvert.SerializeObject(participant,Formatting.Indented); // ReceiveContext responseObj = await UpdateDetails (url,putData); // // return responseObj; // } public async Task<ReceiveContext> DeleteProcedureDiagnostic(int ProcCodeID) { Stream requestWriter; string received=string.Empty; ReceiveContext responseObj; try { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Consts.BaseServerURL + "/anesservices/ProcCodes/"+ProcCodeID); request.ContentType = "application/json; charset=utf-8"; // Set the Method property to 'POST' to post data to the URI. request.Method = "DELETE"; request.Headers ["Token"] =Consts.AuthenticationToken; requestWriter = await request.GetRequestStreamAsync(); WebResponse resp = await request.GetResponseAsync(); using (var responseStream = resp.GetResponseStream()) { using (var sr = new StreamReader(responseStream)) { received = await sr.ReadToEndAsync(); } } } catch { } responseObj = (ReceiveContext)JsonConvert.DeserializeObject(received , typeof(ReceiveContext)); return responseObj; }
public async Task<ReceiveContext> UpdateDetails(string url,string dataToPUT) { Stream requestWriter; string received=string.Empty; ReceiveContext responseObj; try { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.ContentType = "application/json; charset=utf-8"; request.Method = "PUT"; request.Headers ["Token"] = Consts.AuthenticationToken; requestWriter = await request.GetRequestStreamAsync(); byte[] data = Encoding.UTF8.GetBytes(dataToPUT); requestWriter.Write(data,0,data.Length); WebResponse resp = await request.GetResponseAsync(); using (var responseStream = resp.GetResponseStream()){ using (var sr = new StreamReader(responseStream)){ received = await sr.ReadToEndAsync(); } } }catch { } responseObj = (ReceiveContext)JsonConvert.DeserializeObject(received , typeof(ReceiveContext)); return responseObj; }
public async Task<ReceiveContext> UpdateProcedureDiagnostic(DataResults procedurediagnosticlist) { Stream requestWriter; string received=string.Empty; ReceiveContext responseObj; try { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Consts.BaseServerURL+"/anesservices/ProcCodes"); request.ContentType = "application/json; charset=utf-8"; // Set the Method property to 'POST' to post data to the URI. request.Method = "PUT"; request.Headers ["Token"] =Consts.AuthenticationToken; requestWriter = await request.GetRequestStreamAsync(); string postData=JsonConvert.SerializeObject(procedurediagnosticlist,Formatting.Indented); byte[] data = Encoding.UTF8.GetBytes(postData); requestWriter.Write(data,0,data.Length); WebResponse resp = await request.GetResponseAsync(); using (var responseStream = resp.GetResponseStream()) { using (var sr = new StreamReader(responseStream)) { received = await sr.ReadToEndAsync(); } } } catch { } responseObj = (ReceiveContext)JsonConvert.DeserializeObject(received , typeof(ReceiveContext)); return responseObj; }
public async Task<ReceiveContext> GetPatientProcFullDetails(int ProcId) { Stream requestWriter; string received=string.Empty; ReceiveContext responseObj; try { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Consts.BaseServerURL + "/anesservices/procs/"+ProcId); request.ContentType = "application/json; charset=utf-8"; // Set the Method property to 'POST' to post data to the URI. request.Method = "GET"; request.Headers ["Token"] =Consts.AuthenticationToken; using (var response = (HttpWebResponse)(await Task<WebResponse>.Factory.FromAsync(request.BeginGetResponse, request.EndGetResponse, null))) { using (var responseStream = response.GetResponseStream()) { using (var sr = new StreamReader(responseStream)) { received = await sr.ReadToEndAsync(); } } } } catch (Exception ex) { string str = ex.Message; } responseObj = (ReceiveContext)JsonConvert.DeserializeObject(received , typeof(ReceiveContext)); return responseObj; }
public async Task<RcvdJSONData> AuthenticateCode(string Code) { // Stream requestWriter; string received=string.Empty; RcvdJSONData responseObj; try { // HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://test.iprocedures.com/anesservices/Domain/"+Code); HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://reference.iprocedures.com/domain/"+Code); // request.ContentType = "application/json; charset=utf-8"; // Set the Method property to 'POST' to post data to the URI. request.Method = "GET"; using (var response = (HttpWebResponse)(await Task<WebResponse>.Factory.FromAsync(request.BeginGetResponse, request.EndGetResponse, null))){ using (var responseStream = response.GetResponseStream()){ using (var sr = new StreamReader(responseStream)){ received = await sr.ReadToEndAsync(); } } } }catch (Exception ex){ string str = ex.Message; } responseObj = (RcvdJSONData)JsonConvert.DeserializeObject(received , typeof(RcvdJSONData)); return responseObj; // Uri uri = new Uri(url); // HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); // string received; // // using (var response = (HttpWebResponse)(await Task<WebResponse>.Factory.FromAsync(request.BeginGetResponse, request.EndGetResponse, null))){ // using (var responseStream = response.GetResponseStream()){ // using (var sr = new StreamReader(responseStream)){ // received = await sr.ReadToEndAsync(); // } // } // } // // ReceiveContext responseObj = (ReceiveContext)JsonConvert.DeserializeObject(received , typeof(ReceiveContext)); // return responseObj; }
public async Task<ReceiveContext> UpdatePatintProcedureInfo(PatientProcedureFullDetails Profile) { Stream requestWriter; string received=string.Empty; ReceiveContext responseObj; try { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Consts.BaseServerURL + "/anesservices/procs"); request.ContentType = "application/json; charset=utf-8"; // Set the Method property to 'POST' to post data to the URI. request.Method = "PUT"; request.Headers ["Token"] =Consts.AuthenticationToken; requestWriter = await request.GetRequestStreamAsync(); string postData=JsonConvert.SerializeObject(Profile,Formatting.Indented); //string postData = "{\n \"ID\": "+Profile.ID+",\n \"Mrn\": \"54576576876\",\n \"FirstName\": \"Johnkumar\",\n \"LastName\": \"Doe1\",\n \"Sex\": \"M\",\n \"Height\": \"5)6\",\n \"Weight\": \"67\",\n \"Allergies\": \"Tablet\",\n \"PersonProvidingInfo\": \"Patient\",\n \"DOB\": \"1962-02-02T00:00:00\",\n \"AccountNo\": \"3564546466\",\n \"HNENumber\": null,\n \"ddlEncounterType\": null,\n \"ddlASAType\": null,\n \"cbEmergency\": null,\n \"Race\": null,\n \"DeathDate\": null,\n \"DeathIndicator\": null,\n \"CreatedOn\": null,\n \"LastModifiedDate\": \"2015-07-15T06:12:11.52\",\n \"LastModifiedBy\": \"admin\",\n \"RecordType\": null,\n \"FacilityID\": null,\n \"SSN\": null,\n \"PrimaryLanguage\": null,\n \"Ethnicity\": null,\n \"HomePhone\": null,\n \"CellPhone\": null,\n \"MaritalStatus\": null,\n \"QuickAdd\": \"N\",\n \"AptID\": null,\n \"isDFTExported\": null,\n \"ddlHghtType\": null,\n \"ddlWghtType\": null,\n \"tbBMI\": null,\n \"cbNKDA\": null,\n \"cbIVDye\": null\n }\n"; //string postData = "{\n \"ID\": 17517,\n \"Mrn\": \"54576576876\",\n \"FirstName\": \"Johnkumar\",\n \"LastName\": \"Doe1\",\n \"Sex\": \"M\",\n \"Height\": \"5)6\",\n \"Weight\": \"67\",\n \"Allergies\": \"Tablet\",\n \"PersonProvidingInfo\": \"Patient\",\n \"DOB\": \"1962-02-02T00:00:00\",\n \"AccountNo\": \"3564546466\",\n \"HNENumber\": null,\n \"ddlEncounterType\": null,\n \"ddlASAType\": null,\n \"cbEmergency\": null,\n \"Race\": null,\n \"DeathDate\": null,\n \"DeathIndicator\": null,\n \"CreatedOn\": null,\n \"LastModifiedDate\": \"2015-07-15T06:12:11.52\",\n \"LastModifiedBy\": \"admin\",\n \"RecordType\": null,\n \"FacilityID\": null,\n \"SSN\": null,\n \"PrimaryLanguage\": null,\n \"Ethnicity\": null,\n \"HomePhone\": null,\n \"CellPhone\": null,\n \"MaritalStatus\": null,\n \"QuickAdd\": \"N\",\n \"AptID\": null,\n \"isDFTExported\": null,\n \"ddlHghtType\": null,\n \"ddlWghtType\": null,\n \"tbBMI\": null,\n \"cbNKDA\": null,\n \"cbIVDye\": null\n }\n"; byte[] data = Encoding.UTF8.GetBytes(postData); requestWriter.Write(data,0,data.Length); WebResponse resp = await request.GetResponseAsync(); using (var responseStream = resp.GetResponseStream()) { using (var sr = new StreamReader(responseStream)) { received = await sr.ReadToEndAsync(); } } } catch { } responseObj = (ReceiveContext)JsonConvert.DeserializeObject(received , typeof(ReceiveContext)); return responseObj; }