// GET: Tab_Precreption


        public ActionResult ViewPreription()
        {
            Bal_Precription   bp             = new Bal_Precription();
            PatientAllDetails patientDETAILS = (PatientAllDetails)Session["patientDetails"];
            Medication        MD             = new Medication();
            //Load lime always null not requird get data'
            Precription pd = new Precription();

            pd = bp.ViewPricripion(patientDETAILS.QueueId, patientDETAILS.CasePapaerNo);

            return(View("Examination", pd));
        }
Example #2
0
        public ActionResult OpdExamination()
        {
            Bal_Precription   bp             = new Bal_Precription();
            PatientAllDetails patientDETAILS = (PatientAllDetails)Session["patientDetails"];
            Precription       pd             = new Precription();

            pd = bp.ViewPricripion(patientDETAILS.QueueId, patientDETAILS.CasePapaerNo);
            var Advice          = "";
            var Complaints      = "";
            var Diagnosis       = "";
            var TestBeforeVisit = "";
            var NextVisit       = "";

            if (pd.clist.Count > 0)
            {
                foreach (var item in pd.clist)
                {
                    if (item.AddAdvice != "" && item.AddAdvice != null)
                    {
                        Advice = Advice + item.AddAdvice + "," + "  ";
                    }
                }
            }
            if (pd.clist.Count > 0)
            {
                foreach (var item in pd.olist)
                {
                    if (item.Complaints != "" && item.Complaints != null)
                    {
                        Complaints = Complaints + item.Complaints + "," + "  ";
                    }

                    if (item.Diagnosis != "" && item.Diagnosis != null)
                    {
                        Diagnosis = Diagnosis + item.Diagnosis + "," + "  ";
                    }
                }
            }
            if (pd.clist.Count > 0)
            {
                foreach (var item in pd.NextListlst)
                {
                    if (item.NestVisitDate != "" && item.NestVisitDate != null)
                    {
                        NextVisit = NextVisit + Convert.ToDateTime(item.NestVisitDate).Date.ToString("dd/MM/yyyy") + "," + "  ";
                    }
                }
            }
            if (pd.clist.Count > 0)
            {
                foreach (var item in pd.clist)
                {
                    if (item.InvSelectTests != "" && item.InvSelectTests != null)
                    {
                        TestBeforeVisit = TestBeforeVisit + item.InvSelectTests + "," + "  ";
                    }
                }
            }
            pd.HospClinicNumber = pd.HospClinicNumber + " ,+91 " + pd.OtherNumber;
            pd.HospClinicNumber = pd.HospClinicNumber.TrimEnd(',');
            pd.TestBeforeVisit  = TestBeforeVisit.TrimEnd(',');
            pd.NextVisit        = NextVisit.TrimEnd(',');

            pd.AdviceNote = Advice.TrimEnd(',');

            pd.Complaints = Complaints.TrimEnd(',');
            pd.Diagnosis  = Diagnosis.TrimEnd(',');
            return(View("Examination", pd));
        }
        public Precription ViewPricripion(int QueueId, string CPno)
        {
            try
            {
                SqlParameter[] sqlparam;
                sqlparam    = new SqlParameter[3];
                sqlparam[0] = new SqlParameter("@flag", "7");
                sqlparam[1] = new SqlParameter("@QueueId", QueueId);
                sqlparam[2] = new SqlParameter("@CPno", CPno);
                DataSet     ds = CommonFunction.GetDataSet("USP_Get_Precription", sqlparam, "");
                Precription p  = new Precription();
                if (ds != null && ds.Tables[7].Rows.Count > 0)
                {
                    DataTable dt = ds.Tables[7];
                    foreach (DataRow dr in dt.Rows)
                    {
                        CommonFunction.ReflectSingleData(p, dr);
                    }
                }

                List <Observation> olst = new List <Observation>();
                if (ds != null && ds.Tables[3].Rows.Count > 0)
                {
                    DataTable dt = ds.Tables[3];
                    foreach (DataRow dr in dt.Rows)
                    {
                        Observation Model = new Observation();
                        CommonFunction.ReflectSingleData(Model, dr);

                        olst.Add(Model);
                    }
                }
                List <Medication> mlst = new List <Medication>();
                if (ds != null && ds.Tables[4].Rows.Count > 0)
                {
                    DataTable dt = ds.Tables[4];
                    foreach (DataRow dr in dt.Rows)
                    {
                        Medication Model = new Medication();
                        CommonFunction.ReflectSingleData(Model, dr);

                        mlst.Add(Model);
                    }
                }
                List <Common> clst = new List <Common>();

                if (ds != null && ds.Tables[5].Rows.Count > 0)
                {
                    DataTable dt = ds.Tables[5];
                    foreach (DataRow dr in dt.Rows)
                    {
                        Common Model = new Common();
                        CommonFunction.ReflectSingleData(Model, dr);

                        clst.Add(Model);
                    }
                }
                List <Common> NextList = new List <Common>();
                if (ds != null && ds.Tables[6].Rows.Count > 0)
                {
                    DataTable dt = ds.Tables[6];
                    foreach (DataRow dr in dt.Rows)
                    {
                        Common Model1 = new Common();
                        CommonFunction.ReflectSingleData(Model1, dr);

                        NextList.Add(Model1);
                    }
                }
                List <NestVisitlst> NextListlst = new List <NestVisitlst>();
                if (ds != null && ds.Tables[6].Rows.Count > 0)
                {
                    DataTable dt = ds.Tables[6];
                    foreach (DataRow dr in dt.Rows)
                    {
                        NestVisitlst Model1 = new NestVisitlst();
                        CommonFunction.ReflectSingleData(Model1, dr);

                        NextListlst.Add(Model1);
                    }
                }
                //List<VitalInformation> vlst = new List<VitalInformation>();
                //if (ds != null && ds.Tables[3].Rows.Count > 0)
                //{
                //    DataTable dt = ds.Tables[3];
                //    foreach (DataRow dr in dt.Rows)
                //    {
                //        VitalInformation Model = new VitalInformation();
                //        CommonFunction.ReflectSingleData(Model, dr);

                //        vlst.Add(Model);
                //    }
                //}
                List <VitalInformation> VList = new List <VitalInformation>();
                if (ds != null && ds.Tables[2].Rows.Count > 0)
                {
                    DataTable dt = ds.Tables[2];
                    foreach (DataRow dr in dt.Rows)
                    {
                        VitalInformation Model1 = new VitalInformation();
                        CommonFunction.ReflectSingleData(Model1, dr);

                        VList.Add(Model1);
                    }
                }

                p.vlist       = VList;
                p.olist       = olst;
                p.mlist       = mlst;
                p.clist       = clst;
                p.NextList    = NextList;
                p.NextListlst = NextListlst;


                return(p);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }