private void openExcelStripMenuItem_Click_1(object sender, EventArgs e) { addressofexcelfile = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\cases" + DateTime.Now.ToShortDateString().Replace("/", "_") + ".xlsx"; if (!File.Exists(addressofexcelfile)) { excelfile myexcelfile2 = new excelfile(addressofexcelfile); // totalnumberofcases = myexcelfile2.getlastrow(); myexcelfile2.savefile(); myexcelfile2.closefile(); } else { excelfile myexcelfile2 = new excelfile(addressofexcelfile); totalnumberofcases = myexcelfile2.getlastrow(); label1.Text = "Total number of Cases: " + totalnumberofcases.ToString(); label1.Visible = true; // myexcelfile2.savefile(); myexcelfile2.closefile(); } }
private void getCPTsToolStripMenuItem_Click(object sender, EventArgs e) { myexcelfile1 = new excelfile(addressofexcelfile); int l = 1; while (l <= myexcelfile1.getlastrow()) { string orcode = myexcelfile1.GetCellValue(string.Concat("h", l)); { string cptcode = ""; switch (orcode) { case ("1670"): cptcode = "61140"; break; case ("1134"): cptcode = "61313"; break; case ("1133"): cptcode = "62140"; break; case ("1132"): cptcode = "61697"; //this is Leurssen, Bollo not available break; case ("1022"): cptcode = "61312"; break; case ("1346"): cptcode = "61510"; break; case ("1200"): cptcode = "63081"; break; case ("1775"): cptcode = "22548"; break; case ("1469"): cptcode = "22600"; break; case ("1202"): cptcode = "61548"; break; case ("1279"): cptcode = "61885"; break; case ("1163"): cptcode = "63001"; break; case ("1434"): cptcode = "22808"; break; case ("2008"): cptcode = "22612"; break; case ("1199"): cptcode = "63005"; break; case ("1501"): cptcode = "62161"; break; case ("1164"): cptcode = "62223"; break; case ("1402"): cptcode = "61312"; break; case ("1158"): cptcode = "31600"; break; case ("1165"): cptcode = "62200"; break; } myexcelfile1.WriteCell(string.Concat("j", l), cptcode); l++; } } myexcelfile1.closefile(); MessageBox.Show("CPT Codes updated"); }
private void convertXPSToolStripMenuItem_Click(object sender, EventArgs e) { openXPSFileDialog.ShowDialog(); string filename = openXPSFileDialog.FileName; xpsparser myparserx = new xpsparser(filename); myexcelfile = new excelfile(addressofexcelfile); string outputstring = myparserx.extracttext(); int startofdata = outputstring.IndexOf("In") + 2; outputstring = outputstring.Substring(startofdata); string[] stringSeparators = new string[] { "Conf" }; string[] lines = outputstring.Split(stringSeparators, StringSplitOptions.None); int i = 0; int excelindex = 0; string proceduredate; string age; string sex; string mrn; string procedurename; string procedurecode; string attending; string lastname; string firstname; while (i < lines.Length) { string temp = lines[i].Replace(" ", ""); if (temp.Contains("Printed")) { int indexofpage = temp.IndexOf("Page"); int indexofend = temp.LastIndexOf(":") + 5; temp = temp.Remove(indexofpage, indexofend - indexofpage); } if (temp.Contains(residentname)) { excelindex = excelindex + 1; // int endofdate = temp.LastIndexOf("/")+5; int endofdate = temp.IndexOf("/", 3) + 5; int endofage = temp.IndexOf("y.o."); proceduredate = temp.Substring(0, endofdate); age = temp.Substring(endofdate, endofage - endofdate); sex = temp.Substring(endofage + 4, 1); attending = ""; int endnameindex = temp.IndexOf("<"); int endmrnindex = temp.IndexOf(">"); int endprocedureinex = temp.IndexOf("]") + 1; int begprocedurecode = temp.IndexOf("["); int indexofcomma = temp.IndexOf(","); lastname = temp.Substring(endofage + 5, indexofcomma - endofage - 5); firstname = temp.Substring(indexofcomma + 1, endnameindex - indexofcomma - 1); mrn = temp.Substring(endnameindex + 4, endmrnindex - endnameindex - 4); procedurename = temp.Substring(endmrnindex + 4, endprocedureinex - endmrnindex - 4); procedurecode = temp.Substring(begprocedurecode + 1, endprocedureinex - begprocedurecode - 2); if (temp.Contains("Ehni")) { attending = "Ehni"; } else if (temp.Contains("Ropper")) { attending = "Ropper"; } else if (temp.Contains("Fuentes")) { attending = "Fuentes"; } else if (temp.Contains("Patel")) { attending = "Patel"; } else if (temp.Contains("Omeis")) { attending = "Omeis"; } else if (temp.Contains("Duckworth")) { attending = "Duckworth"; } else { attending = "Gopinath"; } myexcelfile.WriteCell("a" + excelindex.ToString(), proceduredate); myexcelfile.WriteCell("b" + excelindex.ToString(), lastname); myexcelfile.WriteCell("c" + excelindex.ToString(), firstname); myexcelfile.WriteCell("d" + excelindex.ToString(), mrn); myexcelfile.WriteCell("e" + excelindex.ToString(), age); myexcelfile.WriteCell("f" + excelindex.ToString(), sex); myexcelfile.WriteCell("g" + excelindex.ToString(), procedurename); myexcelfile.WriteCell("h" + excelindex.ToString(), procedurecode); myexcelfile.WriteCell("i" + excelindex.ToString(), attending); totalnumberofcases = totalnumberofcases + 1; } i++; } label1.Visible = true; label1.Text = "Total number of Cases: " + totalnumberofcases.ToString(); // myexcelfile.savefile(); myexcelfile.closefile(); }
private void submitToolStripMenuItem_Click(object sender, EventArgs e) { // HtmlDocument acgmedocument = acgmeWebBrowser.Document; // HtmlElement submitbutton = acgmedocument.GetElementById("submitButton"); if (j == 0) { myexcelfile2 = new excelfile(addressofexcelfile); } else if (j == totalnumberofcases) { myexcelfile2.closefile(); MessageBox.Show("Done"); return; } j = j + 1; // submitbutton.InvokeMember("click"); label1.Visible = true; label1.Text = j + " / " + totalnumberofcases.ToString(); HtmlDocument acgmedocument = acgmeWebBrowser.Document; HtmlElement institution = acgmedocument.GetElementById("Institutions"); HtmlElement attending = acgmedocument.GetElementById("Attendings"); HtmlElement adultorped = acgmedocument.GetElementById("PatientTypes"); HtmlElement gender = acgmedocument.GetElementById("Genders"); HtmlElement date = acgmedocument.GetElementById("ProcedureDate"); HtmlElement residentroles = acgmedocument.GetElementById("ResidentRoles"); HtmlElement comments = acgmedocument.GetElementById("Comments"); HtmlElement patientid = acgmedocument.GetElementById("PatientId"); HtmlElement residentyear = acgmedocument.GetElementById("ProcedureYear"); HtmlElement cptid = acgmedocument.GetElementById("Code"); institution.SetAttribute("value", "13233"); // attending.SetAttribute("value", "26518"); adultorped.SetAttribute("value", "69"); residentyear.SetAttribute("value", residentpgyyear); residentroles.SetAttribute("value", residentrole); double d_date = double.Parse(myexcelfile2.GetCellValue("a" + j.ToString())); DateTime conv = DateTime.FromOADate(d_date); date.SetAttribute("value", conv.ToShortDateString()); gender.SetAttribute("value", myexcelfile2.GetCellValue("f" + j.ToString())); comments.SetAttribute("value", myexcelfile2.GetCellValue("g" + j.ToString())); patientid.SetAttribute("value", myexcelfile2.GetCellValue("d" + j.ToString())); cptid.SetAttribute("value", myexcelfile2.GetCellValue("j" + j.ToString())); string attendingsurgeon = myexcelfile2.GetCellValue("i" + j.ToString()); string attendingcode = "26518"; switch (attendingsurgeon) { case ("Jea"): attendingcode = "6149"; break; case ("Dauser"): attendingcode = "49221"; break; case ("Whitehead"): attendingcode = "28279"; break; case ("Bollo"): attendingcode = "165100"; //this is Leurssen, Bollo not available break; case ("Curry"): attendingcode = "19065"; break; case ("Yoshor"): attendingcode = "17692"; break; case ("Ehni"): attendingcode = "60345"; break; case ("Gopinath"): attendingcode = "26518"; break; case ("Patel"): attendingcode = "359394"; break; case ("Fuentes"): attendingcode = "353465"; break; case ("Ropper"): attendingcode = "385016"; break; } attending.SetAttribute("value", attendingcode); cptid.SetAttribute("value", myexcelfile2.GetCellValue("j" + j.ToString())); acgmedocument.GetElementById("searchByCodeButton").InvokeMember("click"); findelementbytextname("Code", acgmedocument).InvokeMember("click"); //Sen Mode Activated if (issenmodeactivated) { whereami = "addingcptcode"; newtimer = new System.Windows.Forms.Timer(); newtimer.Interval = 1000; newtimer.Start(); newtimer.Tick += new EventHandler(newtimer_Tick); } }