예제 #1
0
        // GET: Report
        public ActionResult Index(string key = "", int currentPage = 1)
        {
            int cacheTime = (24 - DateTime.Now.Hour) * 60;

            ReportItemModel model = XmlReader.DeserializeXMLFileToObject <ReportItemModel>(Server.MapPath("/Files/Xml/" + key + ".xml"));

            model.data = CachingHelper.GetObjectFromCache <DataTable>(key.Replace("-", "_") + "_" + SEmployee.EmployeeCode, cacheTime);
            if (model.data == null)
            {
                model.data = CachingHelper.SetObjectFromCache <DataTable>(key.Replace("-", "_") + "_" + SEmployee.EmployeeCode, cacheTime, DataFunction.GetDataReportFromService(ServiceUrl, "", MapFilterParams(model.filter), "RPT1902-00001"));
            }
            return(View(model));
        }
예제 #2
0
 public async Task <ActionResult <ReportItemModel[]> > Post(ReportItemModel model)
 {
     try
     {
         // Create the Camp
         var report = _mapper.Map <ReportItem>(model);
         _repository.Add(report);
         if (await _repository.SaveChangesAsync())
         {
             return(Created("", _mapper.Map <ReportItemModel>(report)));
         }
         else
         {
             return(StatusCode(StatusCodes.Status500InternalServerError));
         }
     }
     catch (Exception)
     {
         return(BadRequest("Couldn't get reports."));
     }
 }
예제 #3
0
 //通用报告项数据填充
 private void FillReportItem(ReportItemModel rim, DataRow dr, ReportFormModel rfm)
 {
     dr["ReceiveDate"] = rfm.ReceiveDate;
     dr["SectionNo"]   = rfm.SectionNo;
     dr["TestTypeNo"]  = rfm.TestTypeNo;
     dr["SampleNo"]    = rfm.SampleNo;
     dr["ItemNo"]      = rim.ItemNo;
     dr["DispNo"]      = rim.DispNo;
     dr["ItemName"]    = rim.ItemName;
     if (rim.Precision > 0)
     {
         double temp, temp1;
         bool   r  = double.TryParse(rim.ItemResult, out temp);
         bool   r1 = double.TryParse(rim.ItemEName, out temp1);
         if (r == true)
         {
             dr["ItemResult"] = temp.ToString(NumberFormatString(rim.Precision));
         }
         else
         {
             dr["ItemResult"] = rim.ItemResult;
         }
         if (r1 == true)
         {
             dr["ItemEName"] = temp1.ToString(NumberFormatString(rim.Precision));
         }
         else
         {
             dr["ItemEName"] = rim.ItemEName;
         }
     }
     else
     {
         dr["ItemEName"]  = rim.ItemEName;
         dr["ItemResult"] = rim.ItemResult;
     }
     dr["ResultStatus"] = rim.ResultStatus;
     dr["ItemUnit"]     = rim.ItemUnit;
     dr["RefRange"]     = rim.RefRange;
 }
예제 #4
0
        public ActionResult PatientSummary(long id)
        {
            _model = new PreScreenModel();
            SetContextLists();
            PopulateAccordions(_model);
            PopulateItems(_model);
            var preScreen = _dataContext.PreScreens.Find(id);

            ApplyFilter(preScreen.PreScreenType.Name);

            ReportModel model = new ReportModel();

            var section = new ReportSectionModel()
            {
                Label = "Patient Demographics"
            };

            model.Sections.Add(section);

            var modelSections = GetSections();

            var patientId = _dataContext.PreScreens.Find(id).PatientId;

            foreach (var item in _dataContext.PatientData.Where(p => p.PatientId == patientId && p.Deleted == false && p.SectionCode == "demographics.general").OrderBy(p => p.PatientDataId).ToList())
            {
                section.Items.Add(new ReportItemModel()
                {
                    Label = item.Label, Value = item.Value
                });
            }


            Dictionary <string, string> sections = new Dictionary <string, string>();

            sections.Add("psstatus.preadmission", "PS Pt. Status - Pre - Admission");
            sections.Add("psstatus.ivfluids", "PS Pt. Status - IV Fluids or IV Meds(e.g., IV Antibiotics, IV Lasix etc.) > _ 1x daily");
            sections.Add("psstatus.isolationtype", "PS Pt. Status - Isolation Type");
            sections.Add("psstatus.diet", "PS Pt. Status - Diet");
            sections.Add("psstatus.bladder", "PS Pt. Status - Bladder");

            sections.Add("pssystems.neuroassessment", "PS Pt. Systems - Neuro Assessment");
            sections.Add("pssystems.cardiovascular", "PS Pt. Systems - Cardiovascular");
            sections.Add("pssystems.gastrointestinal", "PS Pt. Systems - Gastrointestinal");
            sections.Add("pssystems.wounds", "PS Pt. Systems - Wounds");
            sections.Add("pssystems.renalfunction", "PS Pt. Systems - Renal Function");
            sections.Add("pssystems.dialysis", "PS Pt. Systems - Dialysis");

            sections.Add("psfunctions.ptotsummary", "PS Function & Equipment - PT / OT Summary");
            sections.Add("psfunctions.specialequipment", "PS Function & Equipment - Special Equipment");

            sections.Add("psrespiratory.treatments", "PS Respiratory - Treatments");
            sections.Add("psrespiratory.oxygenrequired", "PS Respiratory - Oxygen Required");
            sections.Add("psrespiratory.ventilation", "PS Respiratory - Ventilation");
            sections.Add("psrespiratory.mode2", "PS Respiratory - Mode");
            sections.Add("psrespiratory.arterialbloodgases", "PS Respiratory - Arterial Blood Gases");
            sections.Add("psrespiratory.trach", "PS Respiratory - Trach");
            sections.Add("psrespiratory.chesttube", "PS Respiratory - Chest Tube");

            sections.Add("pslabs.medicationlist", "PS Labs - Medication List");
            sections.Add("pslabs.bloodworklabs", "PS Labs - Blood Work/ Labs");

            section = new ReportSectionModel()
            {
                Label = "Key Clinical Indicators"
            };
            model.Sections.Add(section);

            foreach (var key in sections.Keys)
            {
                foreach (var item in _dataContext.PreScreenData.Where(p => p.PreScreenId == id && p.Deleted == false && p.SectionCode == key).OrderBy(p => p.PreScreenDataId).ToList())
                {
                    if (modelSections.Where(p => p.GetUniqueClientCode() == $"{_prefix}{key}").Single().Items.Where(p => p.ClientCode == item.ItemCode && p.KeyClinicalIndicator == true).Count() <= 0)
                    {
                        continue;
                    }


                    var reportItem = new ReportItemModel()
                    {
                        Label = item.Label, Value = item.Value, Type = item.Type
                    };
                    if (reportItem.Type == "Table")
                    {
                        reportItem.Table      = (TableDataModel)Common.XmlDeserialize(typeof(TableDataModel), item.Value);
                        reportItem.HeaderList = modelSections.Where(p => p.GetUniqueClientCode() == $"{_prefix}{key}").Single().Items.Where(p => p.ClientCode == item.ItemCode).Single().LabelList;
                    }
                    if (reportItem.Type == "Dropdown")
                    {
                        var value  = item.Value;
                        var values = modelSections.Where(p => p.GetUniqueClientCode() == $"{_prefix}{key}").Single().Items.Where(p => p.ClientCode == item.ItemCode).Single().ValueList.ToArray();
                        var labels = modelSections.Where(p => p.GetUniqueClientCode() == $"{_prefix}{key}").Single().Items.Where(p => p.ClientCode == item.ItemCode).Single().LabelList.ToArray();
                        var index  = Array.IndexOf(values, value);
                        reportItem.Value = labels[index];
                    }


                    var modelItem = modelSections.Where(p => p.GetUniqueClientCode() == $"{_prefix}{key}").Single().Items.Where(p => p.ClientCode == item.ItemCode).Single();

                    if (modelItem.KeyClinicalIndicatorAssertValue != null)
                    {
                        if (modelItem.KeyClinicalIndicatorAssertValue.Split('|').Contains(item.Value))
                        {
                            section.Items.Add(reportItem);
                        }
                    }
                    else
                    {
                        section.Items.Add(reportItem);
                    }
                }
            }



            //Add code for key clinical indicators.

            sections = new Dictionary <string, string>();

            sections.Add("referralsourceinfo.general", "Referral Source Info");



            foreach (var key in sections.Keys)
            {
                section = new ReportSectionModel()
                {
                    Label = sections[key]
                };
                foreach (var item in _dataContext.PreScreenData.Where(p => p.PreScreenId == id && p.Deleted == false && p.SectionCode == key).OrderBy(p => p.PreScreenDataId).ToList())
                {
                    var reportItem = new ReportItemModel()
                    {
                        Label = item.Label, Value = item.Value, Type = item.Type
                    };
                    if (reportItem.Type == "Table")
                    {
                        reportItem.Table      = (TableDataModel)Common.XmlDeserialize(typeof(TableDataModel), item.Value);
                        reportItem.HeaderList = modelSections.Where(p => p.GetUniqueClientCode() == $"{_prefix}{key}").Single().Items.Where(p => p.ClientCode == item.ItemCode).Single().LabelList;
                    }
                    if (reportItem.Type == "Dropdown")
                    {
                        var value  = item.Value;
                        var values = modelSections.Where(p => p.GetUniqueClientCode() == $"{_prefix}{key}").Single().Items.Where(p => p.ClientCode == item.ItemCode).Single().ValueList.ToArray();
                        var labels = modelSections.Where(p => p.GetUniqueClientCode() == $"{_prefix}{key}").Single().Items.Where(p => p.ClientCode == item.ItemCode).Single().LabelList.ToArray();
                        var index  = Array.IndexOf(values, value);
                        reportItem.Value = labels[index];
                    }

                    section.Items.Add(reportItem);
                }
                model.Sections.Add(section);
            }


            return(View(model));
        }
예제 #5
0
        public ActionResult IVF(long id)
        {
            _model = new PreScreenModel();
            SetContextLists();
            PopulateAccordions(_model);
            PopulateItems(_model);
            var preScreen = _dataContext.PreScreens.Find(id);

            ApplyFilter(preScreen.PreScreenType.Name);
            ReportModel model = new ReportModel();

            var section = new ReportSectionModel()
            {
                Label = "Patient Demographics", DisplaySeparate = true
            };

            model.Sections.Add(section);



            var patientId = _dataContext.PreScreens.Find(id).PatientId;

            foreach (var item in _dataContext.PatientData.Where(p => p.PatientId == patientId && p.Deleted == false && p.SectionCode == "demographics.general").OrderBy(p => p.PatientDataId).ToList())
            {
                section.Items.Add(new ReportItemModel()
                {
                    Label = item.Label, Value = item.Value
                });
            }

            Dictionary <string, string> sections = new Dictionary <string, string>();

            sections.Add("payorinfo.primary.all", "Primary Payor - All");
            sections.Add("payorinfo.primary.general", "Primary Payor - General");
            sections.Add("payorinfo.primary.medicare", "Primary Payor - Medicare");

            sections.Add("payorinfo.secondary.all", "Secondary Payor - All");
            sections.Add("payorinfo.secondary.general", "Secondary Payor - General");
            sections.Add("payorinfo.secondary.medicare", "Secondary Payor - Medicare");

            sections.Add("payorinfo.tertiary.all", "Tertiary Payor - All");
            sections.Add("payorinfo.tertiary.general", "Tertiary Payor - General");
            sections.Add("payorinfo.tertiary.medicare", "Tertiary Payor - Medicare");

            var modelSections = GetSections();

            foreach (var key in sections.Keys)
            {
                section = new ReportSectionModel()
                {
                    Label = sections[key]
                };
                foreach (var item in _dataContext.PatientData.Where(p => p.PatientId == patientId && p.Deleted == false && p.SectionCode == key).OrderBy(p => p.PatientDataId).ToList())
                {
                    if (modelSections.Where(p => p.GetUniqueClientCode() == $"{_prefix}{key}").Single().Items.Where(p => p.ClientCode == item.ItemCode && p.IsIVFField == true).Count() <= 0)
                    {
                        continue;
                    }
                    var reportItem = new ReportItemModel()
                    {
                        Label = item.Label, Value = item.Value, Type = item.Type
                    };
                    if (reportItem.Type == "Table")
                    {
                        reportItem.Table      = (TableDataModel)Common.XmlDeserialize(typeof(TableDataModel), item.Value);
                        reportItem.HeaderList = GetSections().Where(p => p.GetUniqueClientCode() == $"{_prefix}{key}").Single().Items.Where(p => p.ClientCode == item.ItemCode).Single().LabelList;
                    }
                    section.Items.Add(reportItem);
                }
                model.Sections.Add(section);
            }


            return(View(model));
        }
예제 #6
0
        //[HttpPost]

        public ActionResult Report(long id)
        {
            _model = new PreScreenModel();
            SetContextLists();
            PopulateAccordions(_model);
            PopulateItems(_model);
            var preScreen = _dataContext.PreScreens.Find(id);

            ApplyFilter(preScreen.PreScreenType.Name);
            ReportModel model = new ReportModel();

            var section = new ReportSectionModel()
            {
                Label = "Patient Demographics"
            };

            model.Sections.Add(section);

            var patientId = _dataContext.PreScreens.Find(id).PatientId;

            foreach (var item in _dataContext.PatientData.Where(p => p.PatientId == patientId && p.Deleted == false && p.SectionCode == "demographics.general").OrderBy(p => p.PatientDataId).ToList())
            {
                section.Items.Add(new ReportItemModel()
                {
                    Label = item.Label, Value = item.Value
                });
            }

            Dictionary <string, string> sections = new Dictionary <string, string>();



            sections.Add("psstatus.prehospitalliving", "PS Pt. Status - Pre - Hospital Living");
            sections.Add("psstatus.languagecommunicationneeds", "PS Pt. Status - Language Communication Needs");
            sections.Add("psstatus.preadmission", "PS Pt. Status - Pre - Admission");

            sections.Add("psstatus.listallacute", "PS Pt. Status - List All Acute Care Hospitalizations During the Last 60 Days");
            sections.Add("psstatus.surgery", "PS Pt. Status - Surgery");
            sections.Add("psstatus.socialhistory", "PS Pt. Status - Social History");
            sections.Add("psstatus.ivaccess", "PS Pt. Status -  IV Access");
            sections.Add("psstatus.ivfluids", "PS Pt. Status - IV Fluids or IV Meds(e.g., IV Antibiotics, IV Lasix etc.) > _ 1x daily");
            sections.Add("psstatus.infection", "PS Pt. Status - Infection");
            sections.Add("psstatus.isolationtype", "PS Pt. Status - Isolation Type");
            sections.Add("psstatus.diet", "PS Pt. Status - Diet");
            sections.Add("psstatus.bladder", "PS Pt. Status - Bladder");
            sections.Add("psstatus.bladderappliance", "PS Pt. Status - Bladder Appliance");
            sections.Add("psstatus.bowel", "PS Pt. Status - Bowel");
            sections.Add("psstatus.bowelappliance", "PS Pt. Status - Bowel Appliance");
            sections.Add("psstatus.vitals", "PS Pt. Status - Vitals");
            sections.Add("psstatus.painscale", "PS Pt. Status - Pain Scale");
            sections.Add("psstatus.vaccinations", "PS Pt. Status - Vaccinations");
            sections.Add("psstatus.psychsocial", "PS Pt. Status - Psych - Social");



            sections.Add("pssystems.specialprecautionsisolation", "PS Pt. Systems - Special Precautions / Isolation");
            sections.Add("pssystems.allergies", "PS Pt. Systems - Allergies");
            sections.Add("pssystems.neuroassessment", "PS Pt. Systems - Neuro Assessment");
            sections.Add("pssystems.cognitive", "PS Pt. Systems - Cognitive");
            sections.Add("pssystems.vision", "PS Pt. Systems - Vision");
            sections.Add("pssystems.hearing", "PS Pt. Systems - Hearing");
            sections.Add("pssystems.cardiovascular", "PS Pt. Systems - Cardiovascular");
            sections.Add("pssystems.gastrointestinal", "PS Pt. Systems - Gastrointestinal");
            sections.Add("pssystems.musculoskeletal", "PS Pt. Systems - Musculoskeletal");
            sections.Add("pssystems.skin", "PS Pt. Systems - Skin");
            sections.Add("pssystems.wounds", "PS Pt. Systems - Wounds");
            sections.Add("pssystems.endocrine", "PS Pt. Systems - Endocrine");
            sections.Add("pssystems.renalfunction", "PS Pt. Systems - Renal Function");
            sections.Add("pssystems.dialysis", "PS Pt. Systems - Dialysis");
            sections.Add("pssystems.dialysisaccess", "PS Pt. Systems - Dialysis Access");



            sections.Add("psfunctions.ptotsummary", "PS Function & Equipment - PT / OT Summary");
            sections.Add("psfunctions.motor", "PS Function & Equipment - Motor");
            sections.Add("psfunctions.verbal", "PS Function & Equipment - Verbal");
            sections.Add("psfunctions.safety", "PS Function & Equipment - Safety");
            sections.Add("psfunctions.restraints", "PS Function & Equipment - Restraints");
            sections.Add("psfunctions.specialequipment", "PS Function & Equipment - Special Equipment");



            sections.Add("psrespiratory.respiratorystatus", "PS Respiratory - Respiratory Status");
            sections.Add("psrespiratory.treatments", "PS Respiratory - Treatments");
            sections.Add("psrespiratory.oxygenrequired", "PS Respiratory - Oxygen Required");
            sections.Add("psrespiratory.mode", "PS Respiratory - Mode");
            sections.Add("psrespiratory.ventilation", "PS Respiratory - Ventilation");
            sections.Add("psrespiratory.frequency", "PS Respiratory - Frequency");
            sections.Add("psrespiratory.mode2", "PS Respiratory - Mode");
            sections.Add("psrespiratory.arterialbloodgases", "PS Respiratory - Arterial Blood Gases");
            sections.Add("psrespiratory.trach", "PS Respiratory - Trach");
            sections.Add("psrespiratory.ettube", "PS Respiratory - ET Tube");
            sections.Add("psrespiratory.chesttube", "PS Respiratory - Chest Tube");

            sections.Add("pslabs.medicationlist", "PS Labs - Medication List");
            sections.Add("pslabs.bloodproducts", "PS Labs - Blood/ Blood Products");
            sections.Add("pslabs.bloodworklabs", "PS Labs - Blood Work/ Labs");
            sections.Add("pslabs.microbiology", "PS Labs - Microbiology");
            sections.Add("pslabs.studies", "PS Labs - Studies");

            foreach (var key in sections.Keys)
            {
                section = new ReportSectionModel()
                {
                    Label = sections[key]
                };
                foreach (var item in _dataContext.PreScreenData.Where(p => p.PreScreenId == id && p.Deleted == false && p.SectionCode == key).OrderBy(p => p.PreScreenDataId).ToList())
                {
                    var reportItem = new ReportItemModel()
                    {
                        Label = item.Label, Value = item.Value, Type = item.Type
                    };
                    if (reportItem.Type == "Table")
                    {
                        reportItem.Table      = (TableDataModel)Common.XmlDeserialize(typeof(TableDataModel), item.Value);
                        reportItem.HeaderList = GetSections().Where(p => p.GetUniqueClientCode() == $"{_prefix}{key}").Single().Items.Where(p => p.ClientCode == item.ItemCode).Single().LabelList;
                    }
                    section.Items.Add(reportItem);
                }
                model.Sections.Add(section);
            }


            return(View(model));
        }
예제 #7
0
파일: LisReport.cs 프로젝트: XYSWLK/XYSTest
 public void AddReportItem(ReportItemModel rim)
 {
     this._reportItemList.Add(rim);
 }
예제 #8
0
 //通用报告项数据填充
 private void FillReportItem(ReportItemModel rim, DataRow dr, ReportFormModel rfm)
 {
     dr["ReceiveDate"] = rfm.ReceiveDate;
     dr["SectionNo"] = rfm.SectionNo;
     dr["TestTypeNo"] = rfm.TestTypeNo;
     dr["SampleNo"] = rfm.SampleNo;
     dr["ItemNo"] = rim.ItemNo;
     dr["DispNo"] = rim.DispNo;
     dr["ItemName"] = rim.ItemName;
     if (rim.Precision > 0)
     {
         double temp, temp1;
         bool r = double.TryParse(rim.ItemResult, out temp);
         bool r1 = double.TryParse(rim.ItemEName, out  temp1);
         if (r == true)
         {
             dr["ItemResult"] = temp.ToString(NumberFormatString(rim.Precision));
         }
         else
         {
             dr["ItemResult"] = rim.ItemResult;
         }
         if (r1 == true)
         {
             dr["ItemEName"] = temp1.ToString(NumberFormatString(rim.Precision));
         }
         else
         {
             dr["ItemEName"] = rim.ItemEName;
         }
     }
     else
     {
         dr["ItemEName"] = rim.ItemEName;
         dr["ItemResult"] = rim.ItemResult;
     }
     dr["ResultStatus"] = rim.ResultStatus;
     dr["ItemUnit"] = rim.ItemUnit;
     dr["RefRange"] = rim.RefRange;
 }
예제 #9
0
파일: LisReport.cs 프로젝트: zhng66/XYSTest
 public void AddReportItem(ReportItemModel rim)
 {
     this._reportItemList.Add(rim);
 }