public async Task <IActionResult> DosageSchemeMed(string id,
                                                          string currentFilter = null,
                                                          string searchString  = null,
                                                          int?page             = null)
        {
            if (searchString != null)
            {
                page = 1;
            }
            else
            {
                searchString = currentFilter;
            }
            ViewData["CurrentFilter"] = searchString;
            persons.SearchString      = searchString;
            persons.PageIndex         = page ?? 1;
            persons.PageSize          = 1000000;
            var pers = new PersonViewModelsList(null);
            var l    = await persons.GetObjectsList();

            if (!string.IsNullOrWhiteSpace(searchString))
            {
                pers = new PersonViewModelsList(l);
            }
            var dosagesSch = SuggestionViewModelFactory.Create(id);

            await SetPropertiesPerson(id);

            ViewBag.AfterError = false;
            return(View(dosagesSch));
        }
        public async Task <IActionResult> DosageScheme(string id,
                                                       string currentFilter = null,
                                                       string searchString  = null,
                                                       int?page             = null,
                                                       string medId         = null)
        {
            if (searchString != null)
            {
                page = 1;
            }
            else
            {
                searchString = currentFilter;
            }
            ViewData["CurrentFilter"] = searchString;
            medicines.SearchString    = searchString;
            medicines.PageIndex       = page ?? 1;
            //var meds = new MedicineViewModelsList(null);
            //if (!string.IsNullOrWhiteSpace(searchString))
            //    meds = new MedicineViewModelsList(await medicines.GetObjectsList());

            //if (medId != null)
            //{
            //    dosagesSch.UsedMedicine = MedicineViewModelFactory.Create(await medicines.GetObject(medId));
            //    meds.RemoveAll(x => x.ID == medId);
            //    dosagesSch.MedicineID = medId;
            //}
            var dosagesSch = SuggestionViewModelFactory.Create(id);

            await SetPropertiesMedicine(id);

            ViewBag.AfterError = false;
            return(View(dosagesSch));
        }
 public void SetupViewModels()
 {
     suggestionViewModel = SuggestionViewModelFactory.Create(patient.ID);
 }