Exemple #1
0
        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;
            }
        }
Exemple #2
0
 public bool SendDemographicFHIRSearch(Uri endpoint, Authentication auth, Patient patient = null)
 {
     try
     {
         _responseText = "";
         WebSend clientWebSend = new WebSend(endpoint, auth, patient);
         _responseText = clientWebSend.PostHttpWebRequest();
     }
     catch (Exception ex)
     {
         _exception = new Exception("DataTransport::SendDemographicFHIRSearch() failed to send to FHIR server: " + ex.Message);
         return(false);
     }
     return(true);
 }
Exemple #3
0
 public string SendIdentityChallenge(Uri endpoint, Authentication auth, string localNoID, string confirmFieldName, string confirmReponse, string computerName, string clinicArea)
 {
     try
     {
         _responseText = "";
         WebSend clientWebSend = new WebSend(endpoint, auth);
         _responseText = clientWebSend.SendIdentityChallenge(localNoID, confirmFieldName, confirmReponse, clinicArea);
     }
     catch (Exception ex)
     {
         _responseText = "Error in DataTransport::SendIdentityChallenge() failed to send to FHIR server: " + ex.Message;
         _exception    = new Exception(_responseText);
     }
     return(_responseText);
 }
Exemple #4
0
 public bool SendFHIRMediaProfile(Uri endpoint, Authentication auth, Media media = null)
 {
     try
     {
         _responseText = "";
         WebSend clientWebSend = new WebSend(endpoint, auth, media);
         _responseText = clientWebSend.PostHttpWebRequest();
     }
     catch (Exception ex)
     {
         _responseText = "Error in DataTransport::SendFHIRMediaProfile() failed to send to FHIR server: " + ex.Message;
         _exception    = new Exception(_responseText);
         return(false);
     }
     return(true);
 }
Exemple #5
0
        public string UpdatePendingStatus(Uri endpoint, Authentication auth, string sessionID, string action, string computerName, string userName)
        {
            string response = "";

            try
            {
                WebSend clientWebSend = new WebSend(endpoint, auth);
                response = clientWebSend.SavePendingStatus(sessionID, action, computerName, userName);
            }
            catch (Exception ex)
            {
                _responseText = "DataTransport::RequestPendingQueue() failed to get pending patients: " + ex.Message;
                _exception    = new Exception(_responseText);
            }
            return(response);
        }
Exemple #6
0
        public IList <PatientProfile> RequestPendingQueue(Uri endpoint, Authentication auth, Patient patient = null)
        {
            IList <PatientProfile> pendingProfiles = null;

            try
            {
                string  pendingPatientJSON = null;
                WebSend clientWebSend      = new WebSend(endpoint, auth);
                pendingPatientJSON = clientWebSend.GetPatientList("pending");
                pendingProfiles    = JsonConvert.DeserializeObject <IList <PatientProfile> >(pendingPatientJSON);
            }
            catch (Exception ex)
            {
                _responseText = "DataTransport::RequestPendingQueue() failed to get pending patients: " + ex.Message;
                _exception    = new Exception(_responseText);
            }
            return(pendingProfiles);
        }
Exemple #7
0
        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);
            }
        }