示例#1
0
        private void downloadAndSetEligibilty(PatientDiscriptor patient, String predictedFileName)
        {
            // enter HICN
            driver.FindElement(By.XPath("/html/body/form[@id='form1']/div[6]/div[@id='pngHeaderContainer']/div[@id='EligibilityPanel']/table[@class='tblElig']/tbody/tr[2]/td/input[@id='txtClaimNumber']")).Clear();
            driver.FindElement(By.XPath("/html/body/form[@id='form1']/div[6]/div[@id='pngHeaderContainer']/div[@id='EligibilityPanel']/table[@class='tblElig']/tbody/tr[2]/td/input[@id='txtClaimNumber']")).SendKeys(patient.HICN);
            // enter last name
            driver.FindElement(By.XPath("/html/body/form[@id='form1']/div[6]/div[@id='pngHeaderContainer']/div[@id='EligibilityPanel']/table[@class='tblElig']/tbody/tr[5]/td[1]/input[@id='txtLName']")).Clear();
            driver.FindElement(By.XPath("/html/body/form[@id='form1']/div[6]/div[@id='pngHeaderContainer']/div[@id='EligibilityPanel']/table[@class='tblElig']/tbody/tr[5]/td[1]/input[@id='txtLName']")).SendKeys(patient.surname);
            // enter first name
            driver.FindElement(By.XPath("/html/body/form[@id='form1']/div[6]/div[@id='pngHeaderContainer']/div[@id='EligibilityPanel']/table[@class='tblElig']/tbody/tr[5]/td[2]/input[@id='txtFName']")).Clear();
            driver.FindElement(By.XPath("/html/body/form[@id='form1']/div[6]/div[@id='pngHeaderContainer']/div[@id='EligibilityPanel']/table[@class='tblElig']/tbody/tr[5]/td[2]/input[@id='txtFName']")).SendKeys(patient.name);
            // enter dob
            driver.FindElement(By.XPath("/html/body/form[@id='form1']/div[6]/div[@id='pngHeaderContainer']/div[@id='EligibilityPanel']/table[@class='tblElig']/tbody/tr[5]/td[3]/input[@id='txtDOB']")).Clear();
            driver.FindElement(By.XPath("/html/body/form[@id='form1']/div[6]/div[@id='pngHeaderContainer']/div[@id='EligibilityPanel']/table[@class='tblElig']/tbody/tr[5]/td[3]/input[@id='txtDOB']")).SendKeys(patient.dateOfBirth);

            // click continue
            IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
            int count = 0;

            while (driver.WindowHandles.Count < 2 && count < 10)
            {
                js.ExecuteScript("arguments[0].click();", driver.FindElement(By.XPath("/html/body/form[@id='form1']/div[6]/div[@id='pngHeaderContainer']/div[@id='EligibilityPanel']/table[@class='tblElig']/tbody/tr[8]/td/input[@id='btnSave']")));
                count++;
                if (count == 10)
                {
                    patient.elligibiltyState = PatientDiscriptor.ElligibiltyState.NotValid;
                    return;
                }
            }
            // switch tabs
            System.Threading.Thread.Sleep(1000);
            List <string> tabs = new List <string>(driver.WindowHandles);

            driver.SwitchTo().Window(tabs[1]);

            // click download
            driver.FindElement(By.XPath("/html/body/form[@id='form1']/div[@class='btnContainer']/input[@id='btnSaveAsPDF']")).Click();
            System.Threading.Thread.Sleep(1000);
            patient.eligibilityForm = GlobalData.downloadLocation + "\\" + predictedFileName;

            // close current tab and switch to original
            driver.Close();
            driver.SwitchTo().Window(tabs[0]);

            //set patients eligibility
            try
            {
                SetEligibilty(patient);
            }
            catch (Exception e) {
                patient.elligibiltyState = PatientDiscriptor.ElligibiltyState.FailedToRead;
            }
        }
示例#2
0
        private void SetEligibilty(PatientDiscriptor patient)
        {
            PdfReader pdf = new PdfReader(patient.eligibilityForm);

            if (pdf.NumberOfPages < 2)
            {
                patient.elligibiltyState = PatientDiscriptor.ElligibiltyState.NotEligible;
            }
            else
            {
                String txt    = PatientCreator.ReadPdfFile(patient.eligibilityForm);
                var    result = Regex.Split(txt, "\r\n|\r|\n");
                int    x;
                for (x = 0; x < result.Length; x++)
                {
                    if (result[x].IndexOf("Medical Plan") == 0)
                    {
                        break;
                    }
                }
                foreach (String t in result)
                {
                    Console.WriteLine(t);
                }
                if (result[x + 1].IndexOf("No") == 0)
                {
                    patient.elligibiltyState = PatientDiscriptor.ElligibiltyState.Medicare;
                    return;
                }


                for (x = 0; x < result.Length; x++)
                {
                    if (result[x].IndexOf("Enrollment Date:") == 0)
                    {
                        break;
                    }
                }
                if (result[x][((result[x].Length) - 1)] == ':')
                {
                    patient.elligibiltyState = PatientDiscriptor.ElligibiltyState.HMO;
                }
                else
                {
                    patient.elligibiltyState = PatientDiscriptor.ElligibiltyState.Medicare;
                }
            }
        }
示例#3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new DirectorySelect());

            PatientDiscriptor patient = new PatientDiscriptor();

            patient.name        = "Jason";
            patient.surname     = "Krentsel";
            patient.dateOfBirth = "birthday";
            patient.HICN        = "1234567890";

            Application.Run(new DirectorySelect());
            //Application.Run(new PatientViewer(patient));
        }
        public PatientBox(PatientDiscriptor patient)
        {
            patientData      = patient;
            isGood           = new CheckBox();
            isGood.IsChecked = true;
            isGood.Content   = "Data is Correct";
            this.Header      = "";
            StackPanel mainPanel = new StackPanel();

            mainPanel.Children.Add(isGood);

            Label info = new Label();

            info.Content = "Name: " + patient.name + "     Surname: " + patient.surname + "     Birth Date: " + patient.dateOfBirth + "     HICN: " + patient.HICN;

            mainPanel.Children.Add(info);
            this.AddChild(mainPanel);
        }
        /*
         * Output folder Select
         */



        private void aButtonContinue_Click(object sender, EventArgs e)
        {
            if (enteredDownloadFolder && enteredOrderForms && enteredOutputFolder)
            {
                //PatientCreator.GetPatientData(fileNames[0]);
                PatientDiscriptor[] patients = new PatientDiscriptor[fileNames.Length];
                for (int x = 0; x < fileNames.Length; x++)
                {
                    patients[x] = PatientCreator.GetPatientData(fileNames[x]);
                }
                PatientViewer pv = new PatientViewer(patients);
                pv.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("ERROR\n    One or more of the fields have been entered incorrectly or not at all");
            }
        }
        static public PatientDiscriptor GetPatientData(String fileDirectory)
        {
            PatientDiscriptor patient = new PatientDiscriptor();

            patient.superBill = fileDirectory;

            String text = ReadPdfFile(fileDirectory);

            try
            {
                patient.name        = getName(text).Trim();
                patient.surname     = getSurName(text).Trim();
                patient.dateOfBirth = getDateOfBirth(text).Trim();
                patient.HICN        = getHICN(text).Trim();
                patient.serviceDate = getServiceDate(text).Trim();
            }
            catch (Exception ex)
            {
                Console.WriteLine(fileDirectory);
                Console.WriteLine(patient.ToString());
            }

            return(patient);
        }