private void buttonTestAuthentication_Click(object sender, EventArgs e) { string username = textBoxUserName.Text; string pwd = PasswordManager.GetPassword(textBoxUserName.Text); if (pwd.Length == 0) { labelStatus.Text = "Password in keystore is blank."; return; } Authentication auth = new Authentication(username, pwd); Uri endpoint = new Uri(StringUtilities.RemoveTrailingBackSlash(System.Configuration.ConfigurationManager.AppSettings["AddNewPatientUri"].ToString())); Patient newPatient = FHIRUtilities.CreateTestFHIRPatientProfile(); WebSend ws = new WebSend(endpoint, auth, newPatient); try { ws.PostHttpWebRequest(); PasswordManager.SavePassword("Successful", username + "_Status"); labelStatus.Text = "Status: Authentication Successful"; } catch (Exception ex) { PasswordManager.SavePassword("Failed", username + "_Status"); labelStatus.Text = "Status: Authentication Failed " + ex.Message; } }
private static Patient TestPatient() { Patient testPatient = FHIRUtilities.CreateTestFHIRPatientProfile ( "Test NoID Org", Guid.NewGuid().ToString(), "", "English", "1961-04-22", "F", "No", "Donna", "Marie", "Kasick", "4712 W 3rd St.", "Apt 35", "New York", "NY", "10000-2221", "212-555-3000", "212-555-7400", "212-555-9555", "*****@*****.**" ); return(testPatient); }
public static void Main(string[] args) { if (args.Length > 0) { Utilities.Auth = new Authentication(_serviceName, args[0].ToString()); Uri endpoint = new Uri(StringUtilities.RemoveTrailingBackSlash(System.Configuration.ConfigurationManager.AppSettings["AddNewPatientUri"].ToString())); Patient newPatient = FHIRUtilities.CreateTestFHIRPatientProfile(); WebSend ws = new WebSend(endpoint, Utilities.Auth, newPatient); try { ws.PostHttpWebRequest(); } catch (Exception ex) { MessageBox.Show("Status: Authentication Failed " + ex.Message + " Closing NoID."); return; } } if (Utilities.Auth != null || PasswordManager.GetPassword(_serviceName + "_Status") == "Successful") { //For Windows 7 and above, best to include relevant app.manifest entries as well Cef.EnableHighDPISupport(); //Perform dependency check to make sure all relevant resources are in our output directory. Cef.Initialize(new CefSettings(), performDependencyCheck: true, browserProcessHandler: null); var browser = new BrowserForm(); Application.Run(browser); } else { var login = new LoginForm(); Application.Run(login); } }
/// <summary>Creates a test patient list for the ProviderBridge class /// <seealso cref="ProviderBridge"/> /// </summary> public static IList <PatientProfile> GetTestPatients(string organizationName) { string addressPending = StringUtilities.RemoveTrailingBackSlash(System.Configuration.ConfigurationManager.AppSettings["SparkEndpointAddress"].ToString()); Uri endPoint = new Uri(addressPending); List <PatientProfile> newList = new List <PatientProfile>(); Patient testPatient = FHIRUtilities.CreateTestFHIRPatientProfile ( organizationName, Guid.NewGuid().ToString(), "", "English", "1961-04-22", "F", "No", "Donna", "Marie", "Kasick", "4712 W 3rd St.", "Apt 35", "New York", "NY", "10000-2221", "212-555-3000", "212-555-7400", "212-555-9555", "*****@*****.**" ); PatientProfile newProfile = new PatientProfile(organizationName, endPoint, testPatient, "New", DateTime.UtcNow.AddMinutes(-3)); newList.Add(newProfile); testPatient = FHIRUtilities.CreateTestFHIRPatientProfile ( organizationName, Guid.NewGuid().ToString(), "", "English", "1992-10-30", "F", "Yes", "Christine", "J", "Pinkentinfuter", "2088 N 23nd St.", "Unit 51", "New York", "NY", "10012-0159", "", "318-777-8888", "318-222-4111", "*****@*****.**" ); newProfile = new PatientProfile(organizationName, endPoint, testPatient, "Return", DateTime.UtcNow.AddMinutes(-5)); newList.Add(newProfile); testPatient = FHIRUtilities.CreateTestFHIRPatientProfile ( organizationName, Guid.NewGuid().ToString(), "", "English", "1954-02-19", "M", "No", "Mitchel", "James", "Hendrichs", "2442 Bleaker St.", "Apt 722", "New York", "NY", "10503-04855", "212-111-1234", "", "", "*****@*****.**" ); newProfile = new PatientProfile(organizationName, endPoint, testPatient, "Return", DateTime.UtcNow.AddMinutes(-15)); newList.Add(newProfile); testPatient = FHIRUtilities.CreateTestFHIRPatientProfile ( organizationName, Guid.NewGuid().ToString(), "", "English", "2001-03-21", "M", "No", "Brian", "H", "O'Donald", "212 Cremont", "", "New Jersey", "NJ", "14235", "", "212-555-1234", "", "*****@*****.**" ); newProfile = new PatientProfile(organizationName, endPoint, testPatient, "New", DateTime.UtcNow.AddMinutes(-32)); newList.Add(newProfile); testPatient = FHIRUtilities.CreateTestFHIRPatientProfile ( organizationName, Guid.NewGuid().ToString(), "", "English", "1999-09-02", "F", "No", "Jonie", "M", "Smith", "", "", "", "", "", "", "", "", "" ); newProfile = new PatientProfile(organizationName, endPoint, testPatient, "Return", DateTime.UtcNow.AddMinutes(-41)); newList.Add(newProfile); return(newList); }