string UpdateStatusAction(string sessionID, string action) { string result = ""; try { //action = approve, deny or hold. string computerName = SecurityUtilities.GetComputerName(); string userName = SecurityUtilities.GetUserName(); Authentication auth; if (Utilities.Auth == null) { auth = SecurityUtilities.GetAuthentication(serviceName); } else { auth = Utilities.Auth; } HttpsClient client = new HttpsClient(); Uri fhirAddress = new Uri(UpdatePendingStatusUri); result = client.UpdatePendingStatus(fhirAddress, auth, sessionID, action, computerName, userName); } catch (Exception ex) { throw ex; } return(result); }
public bool postConfirmExistingPatient(string passedLocalNoID, string birthYear, string birthMonth, string birthDay) { bool result = false; try { Authentication auth; if (Utilities.Auth == null) { auth = SecurityUtilities.GetAuthentication(serviceName); } else { auth = Utilities.Auth; } HttpsClient client = new HttpsClient(); Uri endpoint = new Uri(IdentityChallengeUri); string isoBirthDate = formatDateOfBirth(birthYear, birthMonth, birthDay); string resultResponse = client.SendIdentityChallenge(endpoint, auth, localNoID, "birthdate", isoBirthDate, SecurityUtilities.GetComputerName(), ClinicArea); if (resultResponse.ToLower() == "yes") { _existingDOBMatch = "match"; result = true; } else if (resultResponse.ToLower().Contains("error") == true) { errorDescription = "Error in PatientBridge::postConfirmExistingPatient: " + resultResponse.Substring(3); } } catch (Exception ex) { errorDescription = "Error in PatientBridge::postConfirmExistingPatient: " + ex.Message; } return(result); }
//TODO: Update function in JavaScript and C# to postUnknownDOBExistingPatient public bool postUnknownDOBExistingpatient(string passedLocalNoID) { bool result = false; try { Authentication auth; if (Utilities.Auth == null) { auth = SecurityUtilities.GetAuthentication(serviceName); } else { auth = Utilities.Auth; } localNoID = passedLocalNoID; HttpsClient client = new HttpsClient(); Uri endpoint = new Uri(IdentityChallengeUri); string resultResponse = client.SendIdentityChallenge(endpoint, auth, passedLocalNoID, "failedchallenge", "", SecurityUtilities.GetComputerName(), ClinicArea); if (resultResponse.ToLower() == "yes") { result = true; } else if (resultResponse.ToLower().Contains("error") == true) { errorDescription = "Error in PatientBridge::postUnknownDOBExistingPatient: " + resultResponse.Substring(3); } } catch (Exception ex) { errorDescription = "Error in PatientBridge::postUnknownDOBExistingPatient: " + ex.Message; } return(result); }
public string SendIdentityChallenge(string localNoID, string confirmFieldName, string confirmReponse, string clinicArea) { string jsonResponse = null; try { string UriWithQueryString = _enpoint.ToString() + "?localnoid=" + HttpUtility.UrlEncode(localNoID) + "&fieldname=" + HttpUtility.UrlEncode(confirmFieldName) + "&confirmreponse=" + HttpUtility.UrlEncode(confirmReponse) + "&clinicarea=" + HttpUtility.UrlEncode(clinicArea) + "&computername=" + HttpUtility.UrlEncode(SecurityUtilities.GetComputerName()); Uri uriQueryString = new Uri(UriWithQueryString); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uriQueryString); request.Method = "GET"; //request.AutomaticDecompression = DecompressionMethods.GZip;//TODO: test compression request.Headers.Add("Authorization", "Basic " + _auth.BasicAuthentication); // call BeforeHttpRequest event using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) using (Stream stream = response.GetResponseStream()) using (StreamReader reader = new StreamReader(stream)) { jsonResponse = reader.ReadToEnd(); } // call AfterHttpResponse event } catch (Exception ex) { throw ex; } return(jsonResponse); }