예제 #1
0
 public ActionResult ViewBills(int billid, DateTime billdate)
 {
     if (billid > 0)
     {
         string str = PrintGenerator.GenerateBillPDF(billid, Convert.ToInt32(Session["patientid"].ToString()), Convert.ToInt32(Session["hospital"].ToString()), billdate);
         TempData["Print"] = str;
         return(RedirectToAction("Print", "Shared"));
     }
     else
     {
         return(View());
     }
 }
예제 #2
0
        public ActionResult GenerateCard(string jql)
        {
            //var cards = @"C:\Work\PrintJiraCards\PrintJiraCards\bin\cards.json".ReadFrom<List<Card>>();

            var pg = new PrintGenerator();

            Session["prevJql"] = jql;

            var tasks = pg.GetCards(jql);
            var cards = pg.GenerateCards(tasks);

            return(View(cards));
        }
 public ActionResult ViewBills(int billid)
 {
     if (billid > 0)
     {
         Session["billid"] = billid;
         string str = PrintGenerator.GenerateOTBillPDF();
         TempData["Print"] = str;
         return(RedirectToAction("Print", "Shared"));
     }
     else
     {
         return(RedirectToAction("Bill", "OT"));
     }
 }
예제 #4
0
 public ActionResult PrintTreatment(int treatmentid)
 {
     if (treatmentid > 0)
     {
         Session["treatmentid"] = treatmentid;
         string str = PrintGenerator.GenerateTreatmentPDF();
         TempData["Print"] = str;
         return(RedirectToAction("Print", "Shared"));
     }
     else
     {
         return(RedirectToAction("Treatment", "Patient"));
     }
 }
예제 #5
0
 public ActionResult PrintConsent(int consentid)
 {
     if (consentid > 0)
     {
         Session["consentid"] = consentid;
         string str = PrintGenerator.GenerateConsentPDF();
         TempData["Print"] = str;
         return(RedirectToAction("Print", "Shared"));
     }
     else
     {
         return(RedirectToAction("ConsentForm", "Patient"));
     }
 }
예제 #6
0
 public ActionResult PrintDischarge(int dischargeid)
 {
     if (dischargeid > 0)
     {
         Session["dischargeid"] = dischargeid;
         string str = PrintGenerator.GenerateDischargePDF();
         TempData["Print"] = str;
         return(RedirectToAction("Print", "Shared"));
     }
     else
     {
         return(RedirectToAction("Discharge", "Patient"));
     }
 }
        public ActionResult Checkout(FormCollection form, string SubmitBtn)
        {
            try
            {
                List <BillParticulars> par = new List <BillParticulars>();
                if (Session["OTBillParticulars"] != null)
                {
                    PatientBill pb = new PatientBill();
                    if (SubmitBtn == "Checkout")
                    {
                        pb.CMD = "Save";
                    }
                    else
                    {
                        pb.CMD = SubmitBtn;
                    }

                    pb.parlist     = par = (List <BillParticulars>)Session["OTBillParticulars"];
                    pb.totalamount = par.Select(q => q.total).Sum();
                    pb.patientid   = Convert.ToInt32(Session["patientid"] == null ? '0' : Session["patientid"]);
                    pb.hid         = Convert.ToInt32(Session["hospital"] == null ? '0' : Session["hospital"]);
                    string billid = pb.PerformAction();
                    string str    = PrintGenerator.GenerateBillPDF(Convert.ToInt32(billid.ToString()), pb.patientid, pb.hid, DateTime.Now);
                    TempData["Print"] = str;
                    return(RedirectToAction("Print", "Shared"));
                }
                else
                {
                    return(RedirectToAction("Bill", "OT"));
                }
            }
            catch (Exception)
            {
                return(RedirectToAction("Bill", "OT"));
            }
        }
예제 #8
0
        public ActionResult Treatment(FormCollection form, Treatment obj, string SubmitBtn, int tabindex)
        {
            try
            {
                ViewBag.tabindex = tabindex;
                int resetflag = 0;
                obj.CMD = SubmitBtn;

                obj.hid       = Convert.ToInt32(Session["hospital"]);
                obj.patientid = Convert.ToInt32(Session["PatientId"]);

                var doctorarr = form["doctor"].ToString().Split(':');
                obj.dfname = doctorarr[1];
                obj.dlname = doctorarr[2];



                //Medicines
                List <TreatmentMedicine> tm = new List <TreatmentMedicine>();
                if (Session["TreatmentMedicine"] != null)
                {
                    tm = (List <TreatmentMedicine>)Session["TreatmentMedicine"];
                }
                else
                {
                    tm = new List <TreatmentMedicine>();
                }

                //Complents
                List <TreatmentComplents> tc = new List <TreatmentComplents>();
                if (Session["TreatmentComplents"] != null)
                {
                    tc = (List <TreatmentComplents>)Session["TreatmentComplents"];
                }
                else
                {
                    tc = new List <TreatmentComplents>();
                }

                //Diagnosis
                List <TreatmentDiagnosis> td = new List <TreatmentDiagnosis>();
                if (Session["TreatmentDiagnosis"] != null)
                {
                    td = (List <TreatmentDiagnosis>)Session["TreatmentDiagnosis"];
                }
                else
                {
                    td = new List <TreatmentDiagnosis>();
                }

                //History
                List <TreatmentHistory> th = new List <TreatmentHistory>();
                if (Session["TreatmentHistory"] != null)
                {
                    th = (List <TreatmentHistory>)Session["TreatmentHistory"];
                }
                else
                {
                    th = new List <TreatmentHistory>();
                }

                //Checkup
                List <TreatmentCheckups> tch = new List <TreatmentCheckups>();
                if (Session["TreatmentCheckups"] != null)
                {
                    tch = (List <TreatmentCheckups>)Session["TreatmentCheckups"];
                }
                else
                {
                    tch = new List <TreatmentCheckups>();
                }

                //Fundus
                List <TreatmentFundus> tf = new List <TreatmentFundus>();
                if (Session["TreatmentFundus"] != null)
                {
                    tf = (List <TreatmentFundus>)Session["TreatmentFundus"];
                }
                else
                {
                    tf = new List <TreatmentFundus>();
                }

                //Advice
                List <TreatmentAdvice> ta = new List <TreatmentAdvice>();
                if (Session["TreatmentAdvice"] != null)
                {
                    ta = (List <TreatmentAdvice>)Session["TreatmentAdvice"];
                }
                else
                {
                    ta = new List <TreatmentAdvice>();
                }


                switch (SubmitBtn)
                {
                case "Continue":
                    TempData["CMD"] = SubmitBtn; return(RedirectToAction("Treatment", obj));

                case "addmedicine":
                    //Medicines
                    TreatmentMedicine t = new TreatmentMedicine();
                    t.a = obj.TreatMedicine.aischecked == true ? "A" : "";
                    t.m = obj.TreatMedicine.mischecked == true ? "M" : "";
                    t.e = obj.TreatMedicine.eischecked == true ? "E" : "";
                    t.n = obj.TreatMedicine.nischecked == true ? "N" : "";
                    var arr = form["particular"].ToString().Split(':');
                    t.medicineid = Convert.ToInt32(arr[0]);
                    t.particular = arr[1];
                    t.qty        = obj.TreatMedicine.qty;
                    t.srno       = obj.srno;
                    if (tm.Where(q => q.particular == t.particular).Count() >= 1)
                    {
                        ViewBag.msg = "Particular already added.";
                    }
                    else
                    {
                        tm.Add(t);
                    }
                    obj.TreatMedicineList        = tm;
                    Session["TreatmentMedicine"] = tm;

                    break;

                case "addcomplent":
                    //Complents
                    TreatmentComplents tcmp = new TreatmentComplents();
                    var complentarr         = form["complents"].ToString().Split(':');
                    tcmp.complentid   = Convert.ToInt32(complentarr[0]);
                    tcmp.complentname = complentarr[1];
                    tcmp.srno         = obj.srno;
                    if (tc.Where(q => q.complentname == tcmp.complentname).Count() >= 1)
                    {
                        ViewBag.complentmsg = "Complent already added.";
                    }
                    else
                    {
                        tc.Add(tcmp);
                    }

                    obj.TreatComplentsList        = tc;
                    Session["TreatmentComplents"] = tc;
                    ViewBag.tab = "tab1";
                    break;

                case "adddiagnosis":
                    //Diagnosis
                    TreatmentDiagnosis tdig = new TreatmentDiagnosis();
                    var diagnosisarr        = form["diagnosis"].ToString().Split(':');
                    tdig.diagnosisid   = Convert.ToInt32(diagnosisarr[0]);
                    tdig.diagnosisname = diagnosisarr[1];
                    tdig.srno          = obj.srno;
                    if (td.Where(q => q.diagnosisname == tdig.diagnosisname).Count() >= 1)
                    {
                        ViewBag.diagnosismsg = "Diagnosis already added.";
                    }
                    else
                    {
                        td.Add(tdig);
                    }

                    obj.TreatDiagnosisList        = td;
                    Session["TreatmentDiagnosis"] = td;
                    break;

                case "addhistory":
                    //Diagnosis
                    TreatmentHistory thistory = new TreatmentHistory();
                    var historyarr            = form["history"].ToString().Split(':');
                    thistory.historyid   = Convert.ToInt32(historyarr[0]);
                    thistory.historyname = historyarr[1];
                    thistory.from_dt     = obj.from_dt;
                    thistory.to_dt       = obj.to_dt;
                    thistory.srno        = obj.srno;
                    if (th.Where(q => q.historyname == thistory.historyname).Count() >= 1)
                    {
                        ViewBag.historymsg = "Disease already added.";
                    }
                    else
                    {
                        th.Add(thistory);
                    }

                    obj.TreatHistoryList        = th;
                    Session["TreatmentHistory"] = th;
                    ViewBag.tab = "tab2";
                    break;

                case "addcheckups":
                    //Diagnosis
                    TreatmentCheckups tcheckup = new TreatmentCheckups();
                    var checkuparr             = form["checkups"].ToString().Split(':');
                    tcheckup.checkupid   = Convert.ToInt32(checkuparr[0]);
                    tcheckup.checkupname = checkuparr[1];
                    tcheckup.srno        = obj.srno;
                    if (tch.Where(q => q.checkupname == tcheckup.checkupname).Count() >= 1)
                    {
                        ViewBag.checkupmsg = "Checkup already added.";
                    }
                    else
                    {
                        tch.Add(tcheckup);
                    }

                    obj.TreatCheckupList         = tch;
                    Session["TreatmentCheckups"] = tch;
                    break;

                case "addfundus":
                    //Diagnosis
                    TreatmentFundus tfundus   = new TreatmentFundus();
                    var             fundusarr = form["fundus"].ToString().Split(':');
                    tfundus.fundusid   = Convert.ToInt32(fundusarr[0]);
                    tfundus.fundusname = fundusarr[1];
                    tfundus.srno       = obj.srno;
                    if (tch.Where(q => q.checkupname == tfundus.fundusname).Count() >= 1)
                    {
                        ViewBag.fundusmsg = "Fundus already added.";
                    }
                    else
                    {
                        tf.Add(tfundus);
                    }

                    obj.TreatFundusList        = tf;
                    Session["TreatmentFundus"] = tf;
                    break;

                case "addadvice":
                    //Diagnosis
                    TreatmentAdvice tad   = new TreatmentAdvice();
                    var             adarr = form["advice"].ToString().Split(':');
                    tad.adviceid   = Convert.ToInt32(adarr[0]);
                    tad.advicename = adarr[1];
                    tad.srno       = obj.srno;
                    if (ta.Where(q => q.advicename == tad.advicename).Count() >= 1)
                    {
                        ViewBag.fundusmsg = "Advice already added.";
                    }
                    else
                    {
                        ta.Add(tad);
                    }
                    obj.TreatAdviceList        = ta;
                    Session["TreatmentAdvice"] = ta;
                    break;

                case "Delete":
                    //Medicines
                    int index = Convert.ToInt32(form["medicinesrno"]);
                    tm.RemoveAt(index);
                    Session["TreatmentMedicine"] = obj.TreatMedicineList = tm;
                    break;

                case "DeleteComplent":
                    //Complents
                    int complentsrno = Convert.ToInt32(form["complentsrno"]);
                    tc.RemoveAt(complentsrno);
                    Session["TreatmentComplents"] = obj.TreatComplentsList = tc;
                    break;

                case "DeleteDiagnosis":
                    //Diagnosis
                    int diagnosissrno = Convert.ToInt32(form["diagsrno"]);
                    td.RemoveAt(diagnosissrno);
                    Session["TreatmentDiagnosis"] = obj.TreatDiagnosisList = td;
                    break;

                case "DeleteHistory":
                    //History
                    int historysrno = Convert.ToInt32(form["historysrno"]);
                    th.RemoveAt(historysrno);
                    Session["TreatmentHistory"] = obj.TreatHistoryList = th;
                    break;

                case "DeleteCheckup":
                    //History
                    int checkupsrno = Convert.ToInt32(form["checkupsrno"]);
                    tch.RemoveAt(checkupsrno);
                    Session["TreatmentCheckup"] = obj.TreatCheckupList = tch;
                    break;

                case "DeleteFundus":
                    //History
                    int fundussrno = Convert.ToInt32(form["fundussrno"]);
                    tf.RemoveAt(fundussrno);
                    Session["TreatmentFundus"] = obj.TreatFundusList = tf;
                    break;

                case "DeleteAdvice":
                    //History
                    int advicesrno = Convert.ToInt32(form["advicesrno"]);
                    ta.RemoveAt(advicesrno);
                    Session["TreatmentAdvice"] = obj.TreatAdviceList = ta;
                    break;

                case "Reset":
                    resetflag = 1;
                    break;

                case "Save":

                    Session["TreatmentMedicine"]  = obj.TreatMedicineList = tm;
                    Session["TreatmentComplents"] = obj.TreatComplentsList = tc;
                    Session["TreatmentDiagnosis"] = obj.TreatDiagnosisList = td;
                    Session["TreatmentHistory"]   = obj.TreatHistoryList = th;
                    Session["TreatmentCheckups"]  = obj.TreatCheckupList = tch;
                    Session["TreatmentFundus"]    = obj.TreatFundusList = tf;
                    Session["treatmentAdvice"]    = obj.TreatAdviceList = ta;
                    string treatmentid = obj.PerformAction();
                    Session["treatmentid"] = treatmentid;
                    string str = PrintGenerator.GenerateTreatmentPDF();
                    TempData["Print"] = str;
                    return(RedirectToAction("Print", "Shared"));

                case "Update":
                    Session["TreatmentMedicine"]  = obj.TreatMedicineList = tm;
                    Session["TreatmentComplents"] = obj.TreatComplentsList = tc;
                    Session["TreatmentDiagnosis"] = obj.TreatDiagnosisList = td;
                    Session["TreatmentHistory"]   = obj.TreatHistoryList = th;
                    Session["TreatmentCheckups"]  = obj.TreatCheckupList = tch;
                    Session["TreatmentFundus"]    = obj.TreatFundusList = tf;
                    Session["treatmentAdvice"]    = obj.TreatAdviceList = ta;
                    string treatid = obj.PerformAction();
                    Session["treatmentid"] = treatid;
                    string str1 = PrintGenerator.GenerateTreatmentPDF();
                    TempData["Print"] = str1;
                    return(RedirectToAction("Print", "Shared"));
                }

                if (resetflag == 1)
                {
                    return(Redirect("/Patient/Treatment"));
                }


                if (obj.TreatInvestigationList != null)
                {
                    Session["TreatInvestigationList"] = obj.TreatInvestigationList;
                }
                else
                {
                    obj.TreatInvestigationList = (List <TreatmentInvestigation>)Session["TreatInvestigationList"];
                }
            }
            catch (Exception e)
            {
                string[] arr = new string[2] {
                    "danger", "Something Went Wrong! Try later." + e.Message
                };

                ViewBag.msgarr = arr;
            }

            return(View(obj));
        }