コード例 #1
0
        public JsonResult NewChart()
        {
            List <object> data = new List <object>();
            DataTable     dt   = new DataTable();

            dt.Columns.Add("Value", System.Type.GetType("System.Double"));
            dt.Columns.Add("Data", System.Type.GetType("System.String"));
            DataRow dr;

            var dataTest = TestTable.GetDataByPatientId(Properties.UserId);

            foreach (var test in dataTest)
            {
                var dataResult = ResultTable.GetDataByTestIdAndName(test.Id, nameOfTest);
                if (dataResult.Count != 0)
                {
                    for (int i = 0; i < dataResult.Count(); i++)
                    {
                        dr          = dt.NewRow();
                        dr["Value"] = dataResult[i].Value;
                        dr["Data"]  = test.Date.ToString("dd.MM.yyyy");
                        dt.Rows.Add(dr);
                    }
                }
            }

            foreach (DataColumn dc in dt.Columns)
            {
                List <object> x = new List <object>();
                x = (from DataRow drr in dt.Rows select drr[dc.ColumnName]).ToList();
                data.Add(x);
            }

            return(Json(data));
        }
コード例 #2
0
        public IActionResult DoctorView(Patient patient)
        {
            patientId          = patient.Id;
            Properties.patient = patient;

            var doctorSpecialization = DoctorTable.GetSpecializationById(Properties.UserId);

            if (patient.Name == null)
            {
                patient.Id = 100;
            }

            List <Visit>              visits        = VisitTable.GetDataByPatientIdAndSpecialization(patient.Id, doctorSpecialization[0].Specialization);
            List <Prescription>       prescriptions = PrescriptionTable.GetDataByPatientId(patient.Id);
            List <Test>               tests         = TestTable.GetDataByPatientId(patient.Id);
            List <Documentation>      docs          = DocumentationTable.GetDataByPatientId(patient.Id);
            List <MedicalDescription> list          = MedicalDescriptionTable.GetDataByPatientId(patient.Id);

            ViewData["data"]      = patient;
            ViewData["docs"]      = docs;
            ViewData["visits"]    = visits;
            ViewData["prescript"] = prescriptions;
            ViewData["tests"]     = tests;
            ViewData["medicalDescriptionData"] = list;
            return(View());
        }
コード例 #3
0
        public ActionResult PatientTests(int id)
        {
            ViewBag.var = id;

            var data = TestTable.GetDataByPatientId(id);

            return(View(data[0]));
        }
コード例 #4
0
        public ActionResult Course(int id)
        {
            List <Visit> visitList = new List <Visit>();
            List <Test>  testList  = new List <Test>();
            List <Visit> tmpV      = new List <Visit>();
            List <Test>  tmpT      = new List <Test>();

            visitList.AddRange(VisitTable.GetDataByPatientId(Properties.UserId));
            testList.AddRange(TestTable.GetDataByPatientId(Properties.UserId));
            dynamic output = new ExpandoObject();

            id--;
            Visit currentVisit = new Visit();

            currentVisit = visitList[id];
            visitList.RemoveRange(0, id);


            foreach (Visit v in visitList)
            {
                if (currentVisit.DoctorName == v.DoctorName && DateTime.Compare(currentVisit.Date, v.Date) <= 0)
                {
                    try
                    {
                        foreach (Test t in testList)
                        {
                            if (currentVisit.DoctorName == t.DoctorName && DateTime.Compare(currentVisit.Date, t.Date) <= 0)
                            {
                                tmpT.Add(t);
                                testList.Remove(t);
                                break;
                            }
                        }
                    }
                    catch { }
                    currentVisit = v;
                    tmpV.Add(v);
                }
            }
            output.Visit = tmpV;
            output.Test  = tmpT;
            return(View(output));
        }