public IActionResult PatientData(Guid id, Guid patientId, Guid schedId)
        {
            var patientData = patientDataService.GetById(id);

            if (patientData.ScheduleId == Guid.Empty)
            {
                patientData.ScheduleId = schedId;
            }
            if (patientData.PatientId == Guid.Empty)
            {
                patientData.PatientId = patientId;
            }
            var props     = patientDataService.GetProps();
            var viewModel = new DoctorDateViewModel()
            {
                Patient = patientData.PatientId != Guid.Empty ?
                          patientService.GetPatient(patientData.PatientId)
                    : patientService.GetPatient(patientId),
                DoctorDatas = patientData,
                Properties  = props.Select(x => new SelectListItem()
                {
                    Text     = x.Name,
                    Value    = x.Id.ToString(),
                    Selected = x.Name == patientData.PropName
                }).ToList()
            };

            return(View(viewModel));
        }
        public IActionResult GetById(int id)
        {
            var result = _patientDataService.GetById(id);

            if (result.Success)
            {
                return(Ok(result.Data));
            }

            return(BadRequest());
        }
        public IActionResult OnGet(int patientId)
        {
            Patient = _patientDataService.GetById(patientId);

            if (Patient == null)
            {
                return(RedirectToPage("./NotFound"));
            }

            return(Page());
        }
Exemple #4
0
        public IActionResult OnGet(int patientId)
        {
            Patient = _patientDataService.GetById(patientId);
            Genders = _htmlHelper.GetEnumSelectList <Gender>();

            if (Patient == null)
            {
                return(RedirectToPage("./NotFound"));
            }

            return(Page());
        }