Ejemplo n.º 1
0
        private void SetDependentFields(PatientDataModel model)
        {
            string sectionCode = model.SectionCode;

            if (!sectionCode.StartsWith(_prefix))
            {
                sectionCode = $"{_prefix}{sectionCode}";
            }

            _model = new PreScreenModel();
            PopulateAccordions(_model);
            PopulateItems(_model);
            var preScreen = _dataContext.PreScreens.Find(model.PreScreenId);

            ApplyFilter(preScreen.PreScreenType.Name);

            var sections = GetSections();
            var section  = sections.Where(p => p.GetUniqueClientCode() == sectionCode).Single();

            var dependentItems = section.Items.Where(p => p.DependsOnCode != null).ToList();

            foreach (var item in dependentItems)
            {
                var dependentValue = item.DependsOnAssertValue;
                var dependentCode  = item.DependsOnCode;

                if (model.Items.Where(p => p.Key == dependentCode).Single().Value != dependentValue)
                {
                    var dependent = model.Items.Where(p => p.Key == item.ClientCode).Single();
                    dependent.Value = null;
                    item.Required   = false;
                }
            }
        }
Ejemplo n.º 2
0
        private List <KeyValuePairModel> ValidatePreScreen(long id)
        {
            _model = new PreScreenModel();

            PopulateAccordions(_model);
            SetContextLists();

            PopulateItems(_model);

            var preScreen = _dataContext.PreScreens.Find(id);

            ApplyFilter(preScreen.PreScreenType.Name);

            Dictionary <string, bool> results = new Dictionary <string, bool>();

            foreach (var tab in _model.Tabs)
            {
                var validationItems = ValidateTab(id, tab);
                results.Add(tab.ClientCode, validationItems.Count() <= 0);
            }

            List <KeyValuePairModel> items = new List <KeyValuePairModel>();

            foreach (var key in results.Keys)
            {
                items.Add(new KeyValuePairModel()
                {
                    Key = key, Value = results[key].ToString()
                });
            }

            return(items);
        }
Ejemplo n.º 3
0
        public ActionResult Edit(long?id)
        {
            if (id == null || id == 0)
            {
                return(Json(new { Status = Constant.RESPONSE_ERROR, Description = "Invalid ID Specification." }));
            }


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

            if (preScreen.Status == "Created")
            {
                preScreen.Status = "Pre-Screen In Progress";
                _dataContext.AddPreScreenStatusLog(preScreen.PreScreenId, "Pre-Screen In Progress", _dataContext.UserId.Value);
            }

            _dataContext.SaveChanges();

            ViewBag.PatientId = patientId;
            _preScreenId      = id.Value;
            _model            = new PreScreenModel();

            SetContextLists();
            PopulateAccordions(_model);
            PopulateItems(_model);

            ApplyFilter(preScreen.PreScreenType.Name);

            var task = (from t in _dataContext.UserTasks join p in _dataContext.UserTaskParameters on t.UserTaskId equals p.UserTaskId where t.Deleted == false && p.Deleted == false && p.Key == "PRE_SCREEN_ID" && t.UserId == _dataContext.UserId.Value && t.Status == "Created" && p.Value == id.Value.ToString()  select t).Distinct().OrderByDescending(p => p.UserTaskId).Take(1).SingleOrDefault();

            if (task != null)
            {
                _model.PendingTaskId = task.UserTaskId;

                switch (task.TaskType)
                {
                case "Pre-Screen Approval":
                    _model.ResolveLocation = "ResolvePreScreenApproval";
                    break;

                case "Pre-Screen SCA Requested":
                    _model.ResolveLocation = "ResolveSCARequested";
                    break;
                }
            }

            _model.AdmissionStatus = preScreen.AdmissionStatus;
            return(View(_model));
        }
Ejemplo n.º 4
0
        public JsonResult ValidationResult(long id)
        {
            _model = new PreScreenModel();

            PopulateAccordions(_model);
            SetContextLists();

            PopulateItems(_model);

            var preScreen = _dataContext.PreScreens.Find(id);

            ApplyFilter(preScreen.PreScreenType.Name);

            List <ValidationModel> items = new List <ValidationModel>();

            foreach (var tab in _model.Tabs)
            {
                var validationItems = ValidateTab(id, tab);
                items.AddRange(validationItems);
            }

            return(Json(items, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 5
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));
        }
Ejemplo n.º 6
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));
        }
Ejemplo n.º 7
0
        public ActionResult Acuity(long id)
        {
            _model = new PreScreenModel();
            SetContextLists();
            PopulateAccordions(_model);
            PopulateItems(_model);
            var preScreen = _dataContext.PreScreens.Find(id);

            ApplyFilter(preScreen.PreScreenType.Name);

            AcuityReportModel model = new AcuityReportModel();

            var sections = GetSections();

            foreach (var section in sections)
            {
                foreach (var item in section.Items)
                {
                    if (item.AcuityICU)
                    {
                        model.Items.Add(new AcuityReportItemModel()
                        {
                            Category     = "ICU",
                            ItemCode     = item.ClientCode,
                            Label        = item.Label,
                            Section      = section.GetUniqueClientCode(),
                            AssertValue  = item.AcuityAsserValue,
                            SectionLabel = section.Label
                        });
                    }

                    if (item.AcuityINT)
                    {
                        model.Items.Add(new AcuityReportItemModel()
                        {
                            Category     = "INT",
                            ItemCode     = item.ClientCode,
                            Label        = item.Label,
                            Section      = section.GetUniqueClientCode(),
                            AssertValue  = item.AcuityAsserValue,
                            SectionLabel = section.Label
                        });
                    }

                    if (item.AcuityMed)
                    {
                        model.Items.Add(new AcuityReportItemModel()
                        {
                            Category     = "MED",
                            ItemCode     = item.ClientCode,
                            Label        = item.Label,
                            Section      = section.GetUniqueClientCode(),
                            AssertValue  = item.AcuityAsserValue,
                            SectionLabel = section.Label
                        });
                    }
                }
            }

            var preScreenData = _dataContext.PreScreenData.Where(p => p.PreScreenId == id && p.Deleted == false).OrderBy(p => p.PreScreenDataId).ToList();

            foreach (var acuityItem in model.Items)
            {
                var item = preScreenData.Where(p => $"{_prefix}{p.SectionCode}" == acuityItem.Section && p.ItemCode == acuityItem.ItemCode).Take(1).SingleOrDefault();
                if (item != null)
                {
                    acuityItem.Value = item.Value;
                    if (acuityItem.AssertValue == item.Value)
                    {
                        acuityItem.Positive = true;
                    }
                }
            }

            return(View(model));
        }
Ejemplo n.º 8
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));
        }
Ejemplo n.º 9
0
        private void SavePatientData(PatientDataModel model)
        {
            _model = new PreScreenModel();

            SetContextLists();
            PopulateAccordions(_model);
            PopulateItems(_model);

            var preScreen = _dataContext.PreScreens.Find(model.PreScreenId);

            ApplyFilter(preScreen.PreScreenType.Name);

            List <PatientData>   lstPatientData;
            List <PreScreenData> lstPreScreenData;

            lstPatientData   = _dataContext.PatientData.Where(p => p.PatientId == model.ContextId && p.SectionCode == model.SectionCode && p.Deleted == false).ToList();
            lstPreScreenData = _dataContext.PreScreenData.Where(p => p.PreScreenId == model.ContextId && p.SectionCode == model.SectionCode && p.Deleted == false).ToList();

            if (model.Items != null)
            {
                foreach (var item in model.Items)
                {
                    CommonPatientData data;

                    switch (model.Context)
                    {
                    case "Patient":
                        data = lstPatientData.Where(p => p.ItemCode == item.Key).SingleOrDefault();

                        if (data == null)
                        {
                            data = new PatientData()
                            {
                                PatientId = model.ContextId
                            };
                            _dataContext.PatientData.Add((PatientData)data);
                        }

                        break;

                    case "PreScreen":
                        data = lstPreScreenData.Where(p => p.ItemCode == item.Key).SingleOrDefault();

                        if (data == null)
                        {
                            data = new PreScreenData()
                            {
                                PreScreenId = model.ContextId
                            };
                            _dataContext.PreScreenData.Add((PreScreenData)data);
                        }

                        break;

                    default:
                        throw new NotImplementedException();
                    }


                    var section = GetSections().Where(p => p.GetUniqueClientCode() == (_prefix + model.SectionCode)).Single();

                    data.ItemCode             = item.Key;
                    data.SectionCode          = model.SectionCode;
                    data.Label                = section.Items.Where(p => p.ClientCode == item.Key).Single().Label;
                    data.Value                = item.Value;
                    data.Type                 = section.Items.Where(p => p.ClientCode == item.Key).Single().ItemType;
                    data.DependsOnCode        = section.Items.Where(p => p.ClientCode == item.Key).Single().DependsOnCode;
                    data.DependsOnAssertValue = section.Items.Where(p => p.ClientCode == item.Key).Single().DependsOnAssertValue;
                }
            }


            if (model.Tables != null)
            {
                foreach (var table in model.Tables)
                {
                    CommonPatientData data;

                    switch (model.Context)
                    {
                    case "Patient":
                        data = lstPatientData.Where(p => p.ItemCode == table.ClientCode).SingleOrDefault();

                        if (data == null)
                        {
                            data = new PatientData()
                            {
                                PatientId = model.ContextId
                            };
                            _dataContext.PatientData.Add((PatientData)data);
                        }

                        break;

                    case "PreScreen":
                        data = lstPreScreenData.Where(p => p.ItemCode == table.ClientCode).SingleOrDefault();

                        if (data == null)
                        {
                            data = new PreScreenData()
                            {
                                PreScreenId = model.ContextId
                            };
                            _dataContext.PreScreenData.Add((PreScreenData)data);
                        }

                        break;

                    default:
                        throw new NotImplementedException();
                    }


                    var section = GetSections().Where(p => p.GetUniqueClientCode() == (_prefix + model.SectionCode)).Single();

                    data.ItemCode             = table.ClientCode;
                    data.SectionCode          = model.SectionCode;
                    data.Label                = section.Items.Where(p => p.ClientCode == table.ClientCode).Single().Label;
                    data.Value                = Common.XmlSerializeType(table.GetType(), table);
                    data.Type                 = section.Items.Where(p => p.ClientCode == table.ClientCode).Single().ItemType;
                    data.DependsOnCode        = section.Items.Where(p => p.ClientCode == table.ClientCode).Single().DependsOnCode;
                    data.DependsOnAssertValue = section.Items.Where(p => p.ClientCode == table.ClientCode).Single().DependsOnAssertValue;
                }
            }
        }
Ejemplo n.º 10
0
        private void PopulateAccordions(PreScreenModel model)
        {
            _patientTabs = new TabModel()
            {
                ClientId = "tab_payorinfo", ParentClientCode = "model.data", ClientCode = "payorinfo", Label = "Payor Info", Active = true
            };
            model.Tabs.Add(_patientTabs);
            var accordion = new AccordionModel()
            {
                ClientId = "acc_payorinfo"
            };

            _patientTabs.Accordions.Add(accordion);
            accordion.Sections.Add(new SectionModel()
            {
                Context = "Patient", ClientId = $"{accordion.ClientId}_primary", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "primary", ParentClientId = accordion.ClientId, Label = "Primary", Active = true
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "Patient", ClientId = $"{accordion.ClientId}_secondary", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "secondary", ParentClientId = accordion.ClientId, Label = "Secondary"
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "Patient", ClientId = $"{accordion.ClientId}_tertiary", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "tertiary", ParentClientId = accordion.ClientId, Label = "Tertiary"
            });

            SectionModel primary;
            SectionModel secondary;
            SectionModel tertiary;

            primary   = accordion.Sections.Where(p => p.Label == "Primary").SingleOrDefault();
            secondary = accordion.Sections.Where(p => p.Label == "Secondary").SingleOrDefault();
            tertiary  = accordion.Sections.Where(p => p.Label == "Tertiary").SingleOrDefault();


            accordion = new AccordionModel()
            {
                ClientId = $"acc_{primary.ClientId}"
            };
            primary.Accordions.Add(accordion);
            accordion.Sections.Add(new SectionModel()
            {
                Context = "Patient", ClientId = $"{accordion.ClientId}_all", ParentClientCode = primary.GetUniqueClientCode(), ClientCode = "all", ParentClientId = accordion.ClientId, Label = "All", Active = true
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "Patient", ClientId = $"{accordion.ClientId}_medicare", ParentClientCode = primary.GetUniqueClientCode(), ClientCode = "medicare", ParentClientId = accordion.ClientId, Label = "Medicare", Active = false, ClientCallBack = "setMedicareDaysLeft()"
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "Patient", ClientId = $"{accordion.ClientId}_general", ParentClientCode = primary.GetUniqueClientCode(), ClientCode = "general", ParentClientId = accordion.ClientId, Label = "General", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "Patient", ClientId = $"{accordion.ClientId}_sca", ParentClientCode = primary.GetUniqueClientCode(), ClientCode = "sca", ParentClientId = accordion.ClientId, Label = "SCA", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "Patient", ClientId = $"{accordion.ClientId}_peer_to_peer", ParentClientCode = primary.GetUniqueClientCode(), ClientCode = "peertopeer", ParentClientId = accordion.ClientId, Label = "Peer-to-Peer", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "Patient", ClientId = $"{accordion.ClientId}_expedited_appeal", ParentClientCode = primary.GetUniqueClientCode(), ClientCode = "expeditedappeal", ParentClientId = accordion.ClientId, Label = "Expedited Appeal", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "Patient", ClientId = $"{accordion.ClientId}_disposition", ParentClientCode = primary.GetUniqueClientCode(), ClientCode = "disposition", ParentClientId = accordion.ClientId, Label = "Disposition", Active = false
            });



            accordion = new AccordionModel()
            {
                ClientId = $"acc_{secondary.ClientId}"
            };
            secondary.Accordions.Add(accordion);
            accordion.Sections.Add(new SectionModel()
            {
                Context = "Patient", ClientId = $"{accordion.ClientId}_all", ParentClientCode = secondary.GetUniqueClientCode(), ClientCode = "all", ParentClientId = accordion.ClientId, Label = "All", Active = true
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "Patient", ClientId = $"{accordion.ClientId}_medicare", ParentClientCode = secondary.GetUniqueClientCode(), ClientCode = "medicare", ParentClientId = accordion.ClientId, Label = "Medicare", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "Patient", ClientId = $"{accordion.ClientId}_general", ParentClientCode = secondary.GetUniqueClientCode(), ClientCode = "general", ParentClientId = accordion.ClientId, Label = "General", Active = false
            });

            accordion = new AccordionModel()
            {
                ClientId = $"acc_{tertiary.ClientId}"
            };
            tertiary.Accordions.Add(accordion);
            accordion.Sections.Add(new SectionModel()
            {
                Context = "Patient", ClientId = $"{accordion.ClientId}_all", ParentClientCode = tertiary.GetUniqueClientCode(), ClientCode = "all", ParentClientId = accordion.ClientId, Label = "All", Active = true
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "Patient", ClientId = $"{accordion.ClientId}_medicare", ParentClientCode = tertiary.GetUniqueClientCode(), ClientCode = "medicare", ParentClientId = accordion.ClientId, Label = "Medicare", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "Patient", ClientId = $"{accordion.ClientId}_general", ParentClientCode = tertiary.GetUniqueClientCode(), ClientCode = "general", ParentClientId = accordion.ClientId, Label = "General", Active = false
            });


            primary.SaveButtonVisible   = false;
            secondary.SaveButtonVisible = false;
            tertiary.SaveButtonVisible  = false;

            _patientTabs = new TabModel()
            {
                ClientId = "tab_admissioninfo", ParentClientCode = "model.data", ClientCode = "admissioninfo", Label = "Admission Info"
            };
            model.Tabs.Add(_patientTabs);
            accordion = new AccordionModel()
            {
                ClientId = "acc_admissioninfo"
            };
            _patientTabs.Accordions.Add(accordion);

            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_general", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "general", ParentClientId = accordion.ClientId, Label = "General", Active = true
            });


            _patientTabs = new TabModel()
            {
                ClientId = "tab_referralsourceinfo", ParentClientCode = "model.data", ClientCode = "referralsourceinfo", Label = "PS Referral Source Info"
            };
            model.Tabs.Add(_patientTabs);
            accordion = new AccordionModel()
            {
                ClientId = "acc_referralsourceinfo"
            };
            _patientTabs.Accordions.Add(accordion);

            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_general", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "general", ParentClientId = accordion.ClientId, Label = "General", Active = true
            });


            _patientTabs = new TabModel()
            {
                ClientId = "tab_demographics", ParentClientCode = "model.data", ClientCode = "demographics", Label = "PS Demographics"
            };
            model.Tabs.Add(_patientTabs);
            accordion = new AccordionModel()
            {
                ClientId = "acc_demographics"
            };
            _patientTabs.Accordions.Add(accordion);
            accordion.Sections.Add(new SectionModel()
            {
                Context = "Patient", ClientId = $"{accordion.ClientId}_general", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "general", ParentClientId = accordion.ClientId, Label = "General", Active = true
            });


            _patientTabs = new TabModel()
            {
                ClientId = "tab_status", ParentClientCode = "model.data", ClientCode = "psstatus", Label = "PS Pt. Status"
            };
            model.Tabs.Add(_patientTabs);
            accordion = new AccordionModel()
            {
                ClientId = "acc_status"
            };
            _patientTabs.Accordions.Add(accordion);

            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_prehospitalliving", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "prehospitalliving", ParentClientId = accordion.ClientId, Label = "Pre-Hospital Living", Active = true
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_languagecommunicationneeds", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "languagecommunicationneeds", ParentClientId = accordion.ClientId, Label = "Language Communication Needs", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_preadmission", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "preadmission", ParentClientId = accordion.ClientId, Label = "Pre-Admission", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_listallacute", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "listallacute", ParentClientId = accordion.ClientId, Label = "List All Acute Care Hospitalizations During the Last 60 Days", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_surgery", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "surgery", ParentClientId = accordion.ClientId, Label = "Surgery", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_socialhistory", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "socialhistory", ParentClientId = accordion.ClientId, Label = "Social History", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_ivaccess", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "ivaccess", ParentClientId = accordion.ClientId, Label = "IV Access", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_ivfluids", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "ivfluids", ParentClientId = accordion.ClientId, Label = "IV Fluids or IV Meds(e.g., IV Antibiotics, IV Lasix etc.) > _ 1x daily", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_infection", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "infection", ParentClientId = accordion.ClientId, Label = "Infection", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_isolationtype", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "isolationtype", ParentClientId = accordion.ClientId, Label = "Isolation Type", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_diet", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "diet", ParentClientId = accordion.ClientId, Label = "Diet", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_bladder", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "bladder", ParentClientId = accordion.ClientId, Label = "Bladder", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_bladderappliance", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "bladderappliance", ParentClientId = accordion.ClientId, Label = "Bladder Appliance", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_bowel", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "bowel", ParentClientId = accordion.ClientId, Label = "Bowel", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_bowelappliance", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "bowelappliance", ParentClientId = accordion.ClientId, Label = "Bowel Appliance", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_vitals", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "vitals", ParentClientId = accordion.ClientId, Label = "Vitals", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_painscale", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "painscale", ParentClientId = accordion.ClientId, Label = "Pain Scale", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_vaccinations", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "vaccinations", ParentClientId = accordion.ClientId, Label = "Vaccinations", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_psychsocial", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "psychsocial", ParentClientId = accordion.ClientId, Label = "Psych-Social", Active = false
            });


            _patientTabs = new TabModel()
            {
                ClientId = "tab_systems", ParentClientCode = "model.data", ClientCode = "pssystems", Label = "PS Pt. Systems"
            };
            model.Tabs.Add(_patientTabs);
            accordion = new AccordionModel()
            {
                ClientId = "acc_systems"
            };
            _patientTabs.Accordions.Add(accordion);
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_specialprecautionsisolation", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "specialprecautionsisolation", ParentClientId = accordion.ClientId, Label = "Special Precautions / Isolation", Active = true
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_allergies", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "allergies", ParentClientId = accordion.ClientId, Label = "Allergies", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_neuroassessment", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "neuroassessment", ParentClientId = accordion.ClientId, Label = "Neuro Assessment", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_cognitive", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "cognitive", ParentClientId = accordion.ClientId, Label = "Cognitive", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_vision", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "vision", ParentClientId = accordion.ClientId, Label = "Vision", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_hearing", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "hearing", ParentClientId = accordion.ClientId, Label = "Hearing", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_cardiovascular", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "cardiovascular", ParentClientId = accordion.ClientId, Label = "Cardiovascular", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_gastrointestinal", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "gastrointestinal", ParentClientId = accordion.ClientId, Label = "Gastrointestinal", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_musculoskeletal", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "musculoskeletal", ParentClientId = accordion.ClientId, Label = "Musculoskeletal", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_skin", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "skin", ParentClientId = accordion.ClientId, Label = "Skin", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_wounds", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "wounds", ParentClientId = accordion.ClientId, Label = "Wounds", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_endocrine", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "endocrine", ParentClientId = accordion.ClientId, Label = "Endocrine", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_renalfunction", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "renalfunction", ParentClientId = accordion.ClientId, Label = "Renal Function", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_dialysis", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "dialysis", ParentClientId = accordion.ClientId, Label = "Dialysis", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_dialysisaccess", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "dialysisaccess", ParentClientId = accordion.ClientId, Label = "Dialysis Access", Active = false
            });

            _patientTabs = new TabModel()
            {
                ClientId = "tab_functionequip", ParentClientCode = "model.data", ClientCode = "psfunctions", Label = "PS Pt. Function & Equip."
            };
            model.Tabs.Add(_patientTabs);
            accordion = new AccordionModel()
            {
                ClientId = "acc_functionequip"
            };
            _patientTabs.Accordions.Add(accordion);
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_ptotsummary", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "ptotsummary", ParentClientId = accordion.ClientId, Label = "PT / OT Summary", Active = true
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_motor", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "motor", ParentClientId = accordion.ClientId, Label = "Motor", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_verbal", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "verbal", ParentClientId = accordion.ClientId, Label = "Verbal", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_safety", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "safety", ParentClientId = accordion.ClientId, Label = "Safety", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_restraints", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "restraints", ParentClientId = accordion.ClientId, Label = "Restraints", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_specialequipment", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "specialequipment", ParentClientId = accordion.ClientId, Label = "Special Equipment", Active = false
            });



            _patientTabs = new TabModel()
            {
                ClientId = "tab_respiratory", ParentClientCode = "model.data", ClientCode = "psrespiratory", Label = "PS Respiratory"
            };
            model.Tabs.Add(_patientTabs);
            accordion = new AccordionModel()
            {
                ClientId = "acc_respiratory"
            };
            _patientTabs.Accordions.Add(accordion);
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_respiratorystatus", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "respiratorystatus", ParentClientId = accordion.ClientId, Label = "Respiratory Status", Active = true
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_treatments", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "treatments", ParentClientId = accordion.ClientId, Label = "Treatments", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_oxygenrequired", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "oxygenrequired", ParentClientId = accordion.ClientId, Label = "Oxygen Required", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_mode", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "mode", ParentClientId = accordion.ClientId, Label = "Mode", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_ventilation", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "ventilation", ParentClientId = accordion.ClientId, Label = "Ventilation", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_frequency", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "frequency", ParentClientId = accordion.ClientId, Label = "Frequency", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_mode2", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "mode2", ParentClientId = accordion.ClientId, Label = "Mode", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_arterialbloodgases", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "arterialbloodgases", ParentClientId = accordion.ClientId, Label = "Arterial Blood Gases", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_trach", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "trach", ParentClientId = accordion.ClientId, Label = "Trach", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_ettube", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "ettube", ParentClientId = accordion.ClientId, Label = "ET Tube", Active = false
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_chesttube", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "chesttube", ParentClientId = accordion.ClientId, Label = "Chest Tube", Active = false
            });


            _patientTabs = new TabModel()
            {
                ClientId = "tab_labs", ParentClientCode = "model.data", ClientCode = "pslabs", Label = "PS Labs"
            };
            model.Tabs.Add(_patientTabs);
            accordion = new AccordionModel()
            {
                ClientId = "acc_labs"
            };
            _patientTabs.Accordions.Add(accordion);
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_medicationlist", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "medicationlist", ParentClientId = accordion.ClientId, Label = "Medication List", Active = true
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_bloodproducts", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "bloodproducts", ParentClientId = accordion.ClientId, Label = "Blood / Blood Products"
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_bloodworklabs", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "bloodworklabs", ParentClientId = accordion.ClientId, Label = "Blood Work / Labs"
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_microbiology", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "microbiology", ParentClientId = accordion.ClientId, Label = "Microbiology"
            });
            accordion.Sections.Add(new SectionModel()
            {
                Context = "PreScreen", ClientId = $"{accordion.ClientId}_studies", ParentClientCode = _patientTabs.GetUniqueClientCode(), ClientCode = "studies", ParentClientId = accordion.ClientId, Label = "Studies"
            });
        }