예제 #1
0
 public IActionResult New()
 {
     _listResolver.PopulateDiagnosisCategoriesDropDownList();
     _listResolver.PopulateDiagnosisTypeDropDownList();
     _listResolver.PopulatePatientStatusesDropdownList();
     ViewBag.SmokingStatusId = _listResolver.PopulateSmokingStatusesDropdownList();
     ViewBag.CaseReportForms = _caseReportFormListResolver
                               .PopulateCRFGroupedCategoriesDropdownList();
     return(PartialView());
 }
        public IActionResult Edit(int patientId)
        {
            var patient = _context.Patients
                          .Where(p => p.ID == patientId)
                          .Include(p => p.PatientSmokingDrinkingStatus)
                          .FirstOrDefault();
            PatientSmokingDrinkingStatus smokingStatus;

            smokingStatus = patient.PatientSmokingDrinkingStatus;

            if (smokingStatus == null)
            {
                smokingStatus = new PatientSmokingDrinkingStatus()
                {
                    PatientId = patient.ID
                };
                ViewBag.SmokingStatusId = _listResolver.PopulateSmokingStatusesDropdownList();
            }
            else
            {
                ViewBag.SmokingStatusId = _listResolver.PopulateSmokingStatusesDropdownList(smokingStatus.SmokingStatusId);
            }
            return(PartialView("~/Views/Patients/SmokingStatuses/_Edit.cshtml", smokingStatus));
        }
예제 #3
0
        public IActionResult SearchSelectPartial()
        {
            ViewBag.renderGroupedSelect = false;
            string searchIfGreaterThan = _configuration.GetSection("turnNativeDropdownSelectIntoSearchableWhenMoreThanItems").Value;

            ViewBag.TurnIntoSearchableSelect = Int32.Parse(searchIfGreaterThan);
            string klass = Request.Query["klass"];

            ViewBag.Index = (string)Request.Query["index"];
            string field          = Request.Query["field"];
            var    groupedSelects = new string[] { "AllergyIntoleranceItemId" };

            if (groupedSelects.Contains(klass))
            {
                ViewBag.renderGroupedSelect = true;
            }
            switch (klass)
            {
            case "DrugId":
                ViewBag.SearchSelect = ViewBag.DrugId = _listResolver.DrugsDropDownList();
                break;

            case "DiagnosisTypeId":
                _listResolver.PopulateDiagnosisTypeDropDownList();
                break;

            case "DiagnosisCategoryId":
                _listResolver.PopulateDiagnosisCategoriesDropDownList();
                break;

            case "PatientStatusId":
                _listResolver.PopulatePatientStatusesDropDownList();
                break;

            case "GradeId":
            case "TreatmentResponseId":
            case "ChestLocationId":
            case "ChestDistributionId":
            case "RadiologyTypeId":
            case "FindingId":
                var radiologyCollection = klass.Replace("Id", String.Empty);
                ViewBag.SearchSelect = _listResolver.PopulateRadiologyDropdownList(radiologyCollection);
                break;

            case "MedicalTrialId":
                ViewBag.SearchSelect = _listResolver.PouplateMedicalTrialsDropdownList();
                break;

            case "PatientMedicalTrialStatusId":
                ViewBag.SearchSelect = _listResolver.PopulatePatientMedicalTrialsStatusesDropdownList();
                break;

            case "SurgeryId":
                ViewBag.SearchSelect = _listResolver.PopulateSurgeryDropdownList();
                break;

            case "Severity":
                ViewBag.SearchSelect = new SelectList(PatientAllergicIntoleranceItem.Severities());
                break;

            case "AllergyIntoleranceItemId":
                ViewBag.SearchSelect = _listResolver.GroupedSelectForIntolerances();
                break;

            case "SmokingStatusId":
                ViewBag.SearchSelect = _listResolver.PopulateSmokingStatusesDropdownList();
                break;
            }
            return(PartialView());
        }