Exemplo n.º 1
0
        public async Task <ActionResult> getgenerateschedulelist(int id = 0)
        {
            List <tbSchedule> result = await DoctorApiRequestHelper.getgenerateschedulelist(id);

            return(PartialView("_docScheduleTemplate", result));
            // return Json(result,JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 2
0
        public async Task <ActionResult> getdoctorlistbyhospital(int hospitalID = 0)
        {
            hospitalID = CookieHelper.getstaffHospitalID();
            List <tbDoctorHospital> result = await DoctorApiRequestHelper.getdoctorlistbyhospital(hospitalID);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
        public async Task <ActionResult> _doctorScheduleList(string doctorname = null, string hospitalname = null, int pagesize = 10, int page = 1, int doctorid = 0, int specialtyid = 0, int hospitalid = 0)
        {
            string specialties = null;

            hospitalid = CookieHelper.getstaffHospitalID();
            PagedListClient <DoctorHospitalViewModel> result = await DoctorApiRequestHelper.GetDoctorWithPaging(doctorname, hospitalname, pagesize, page, doctorid, specialtyid, specialties, hospitalid);

            return(PartialView("_doctorScheduleList", result));
        }
        public async Task <ActionResult> _scheduleListbyDoctorID(int doctorid = 0, string doctorname = null, int hospitalid = 0, string hospitalname = null)
        {
            List <tbSchedule> result = await DoctorApiRequestHelper.scheduleListbyDoctorID(doctorid);

            ViewBag.hosname = hospitalname;
            ViewBag.hosid   = hospitalid;
            ViewBag.docid   = doctorid;
            ViewBag.docname = doctorname;
            return(PartialView("_scheduleListbyDoctor", result));
        }
        public async Task <ActionResult> scheduledelete(int ID = 0)
        {
            tbSchedule result = await DoctorApiRequestHelper.scheduledelete(ID);

            if (result != null)
            {
                return(Json("Success", JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json("Fail", JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 6
0
        public async Task <ActionResult> UpSertSchedule(tbScheduleData schedule)
        {
            tbScheduleData result = await DoctorApiRequestHelper.UpSertSchedule(schedule);

            if (result != null)
            {
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json("Fail", JsonRequestBehavior.AllowGet));
            }
        }
        public async Task <ActionResult> doctordelete(int ID = 0)
        {
            int hospitalID = CookieHelper.getstaffHospitalID();
            DoctorHospitalViewModel result = await DoctorApiRequestHelper.doctordelete(ID, hospitalID);

            if (result != null)
            {
                return(Json("Success", JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json("Fail", JsonRequestBehavior.AllowGet));
            }
        }
        public async Task <ActionResult> UpsertDoctor(DoctorSpecialityViewModel dhvm)
        {
            dhvm.hospitalid   = CookieHelper.getstaffHospitalID();
            dhvm.hospitalname = CookieHelper.getstaffHospitalName();
            DoctorSpecialityViewModel result = await DoctorApiRequestHelper.UpSertDoctor(dhvm);

            if (result != null)
            {
                return(Json("Success", JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json("Fail", JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 9
0
        public async Task <ActionResult> UpSertGenerateSchedule(DateTime?fromdatepicker = null, DateTime?todatepicker = null, int doctorid = 0)
        {
            int    hospitalid   = CookieHelper.getstaffHospitalID();
            string hospitalname = CookieHelper.getstaffHospitalName();

            ViewBag.hospitalid   = hospitalid;   // CareMeClient.Helper.CookieHelper.getstaffHospitalID();
            ViewBag.hospitalname = hospitalname; // CareMeClient.Helper.CookieHelper.getstaffHospitalName();

            tbScheduleData result = await DoctorApiRequestHelper.UpSertGenerateSchedule(fromdatepicker, todatepicker, doctorid, hospitalid, hospitalname);

            if (result == null)
            {
                return(Json("Success", JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json("Fail", JsonRequestBehavior.AllowGet));
            }
        }
        public async Task <ActionResult> _ScheduleForm2(string FormType, int ID, string docname = null, string hosname = null, int docid = 0, int hosid = 0)
        {
            tbSchedule schedule = new tbSchedule();

            schedule.DoctorName   = docname;
            schedule.HospitalName = hosname;
            schedule.DoctorID     = docid;
            schedule.HospitalID   = hosid;
            if (FormType == "Add")
            {
                return(PartialView("_ScheduleForm2", schedule));
            }
            else
            {
                tbSchedule result = await DoctorApiRequestHelper.GetScheduleByID(ID);

                return(PartialView("_ScheduleForm2", result));
            }
        }
        public async Task <ActionResult> _DoctorForm(string FormType, int ID)
        {
            DoctorSpecialityViewModel dsvm = new DoctorSpecialityViewModel();

            dsvm.doctor    = new tbDoctor();
            dsvm.specialty = new tbSpecialty();
            if (FormType == "Add")
            {
                return(PartialView("_doctorForm", dsvm));
            }
            else
            {
                DoctorSpecialityViewModel result = await DoctorApiRequestHelper.GetDoctorById(ID);

                result.hospitalid   = CookieHelper.getstaffHospitalID();
                result.hospitalname = CookieHelper.getstaffHospitalName();
                return(PartialView("_doctorForm", result));
                // return null;
            }
        }
        public async Task <ActionResult> UpSertSchedule2(tbSchedule schedule)
        {
            //  tbSchedule schedule = new tbSchedule();
            //schedule.DoctorID = doctorid;
            //schedule.DoctorName = doctorname;
            //schedule.HospitalID = hospitalid;
            //schedule.HospitalName = hospitalname;
            //schedule.Fromtime = timepicker1;
            //schedule.Totime = timepicker2;
            tbSchedule result = await DoctorApiRequestHelper.UpSertSchedule2(schedule);

            if (result != null)
            {
                //  return Json(result, JsonRequestBehavior.AllowGet);
                return(PartialView("_schedule", result));
            }
            else
            {
                return(Json("Fail", JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 13
0
        public async Task <ActionResult> UpsertPatient(tbPatient patient, int doctorid = 0, string doctorname = null,
                                                       DateTime?appdate = null, DateTime?fromtime             = null, DateTime?totime = null, int scheduleid = 0, int hospitalID = 0)
        {
            PatientAppointmentViewModel shvm = new PatientAppointmentViewModel();

            shvm.appointment            = new tbAppointment();
            shvm.appointment.DoctorId   = doctorid;
            shvm.appointment.DoctorName = doctorname;
            string date            = appdate.Value.ToShortDateString();
            string fromtimedate    = fromtime.Value.ToShortTimeString();
            string appointmentdate = date + " " + fromtimedate;

            shvm.appointment.ScheduleDataID      = scheduleid;
            shvm.appointment.AppointmentDateTime = DateTime.Parse(appointmentdate);
            shvm.appointment.HospitalId          = hospitalID; //CareMeClient.Helper.CookieHelper.getstaffHospitalID();
            //      shvm.appointment.HospitalName = CareMeClient.Helper.CookieHelper.getstaffHospitalName();

            shvm.patient = patient;
            PatientAppointmentViewModel result = await BookingApiRequestHelper.UpsertPatient(shvm);

            if (result != null)
            {
                BookingSuccessModel bsm = new BookingSuccessModel();
                bsm.doctor = await DoctorApiRequestHelper.GetDoctorById(result.appointment.DoctorId ?? 0);

                bsm.hospital = await HospitalApiRequestHelper.GetHospitalById(result.appointment.HospitalId ?? 0);

                bsm.scheduleData = await ScheduleApiRequestHelper.getScheduleDetail(result.appointment.ScheduleDataID ?? 0);

                bsm.pavm = result;
                return(PartialView("_bookingSuccess", bsm));
            }
            else
            {
                return(Json("Fail", JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 14
0
        public async Task <ActionResult> getSpecialityList()
        {
            List <tbSpecialty> result = await DoctorApiRequestHelper.getSpecialityList();

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 15
0
        public static IForm <EngFormFlowDialog> BuildForm()
        {
            return(new FormBuilder <EngFormFlowDialog>()
                   .Message("Welcome! I am a bot and I keep learning to improve myself. Anyway I will help you for your problem. I think I can give you good suggestion to show with appropriate doctors. You can exit or stop the conversation at anytime by entering 'exit' or 'stop'")
                   .Field(nameof(Name),
                          validate: async(state, response) =>
            {
                var result = new ValidateResult {
                    IsValid = true, Value = response
                };
                var name = (response as string).Trim();
                if (name == null || name.Length < 0)
                {
                    result.Feedback = "There should be your name for successful order.";
                    result.IsValid = false;
                }
                return result;
            })

                   .Field(nameof(PhoneNumber), "Let me know your phone number 🤙🏻?",
                          validate: async(state, response) =>
            {
                var result = new ValidateResult {
                    IsValid = true, Value = response
                };
                var value = (response as string).Trim();
                if (value.Length > 0 && (value[0] < '0' || value[0] > '9'))
                {
                    result.Feedback = "Phone must start with a number.";
                    result.IsValid = false;
                }
                return result;
            })
                   .Field(nameof(Age))
                   .Field(new FieldReflector <EngFormFlowDialog>(nameof(BodyPart))
                          .SetType(null)
                          .SetActive((state) => (state.Age != null ? true : false))
                          .SetDefine(async(state, field) =>
            {
                if (state.Age != null)
                {
                    var objs = _bodyParts.Select(a => a.BodyPart).Distinct().OrderBy(a => a).ToList();
                    foreach (var item in objs)
                    {
                        field
                        .AddDescription(item, item)
                        .AddTerms(item, item);
                    }
                }
                return true;
            }))
                   .Field(new FieldReflector <EngFormFlowDialog>(nameof(Symptom1))
                          .SetType(null)
                          .SetActive((state) => (state.BodyPart != null ? true : false))
                          .SetDefine(async(state, field) =>
            {
                if (state.BodyPart != null)
                {
                    var objs = _bodyParts.Where(a => a.BodyPart.StartsWith(state.BodyPart)).Select(a => a.Symptom_English).OrderBy(a => a).ToList();
                    foreach (var item in objs)
                    {
                        field
                        .AddDescription(item, item)
                        .AddTerms(item, item);
                    }
                }
                return true;
            }))
                   .Field(nameof(Severity1))
                   .Field(new FieldReflector <EngFormFlowDialog>(nameof(Symptom2))
                          .SetType(null)
                          .SetActive((state) => (state.BodyPart != null ? true : false))
                          .SetDefine(async(state, field) =>
            {
                if (state.BodyPart != null)
                {
                    var objs = _bodyParts.Where(a => a.BodyPart.StartsWith(state.BodyPart)).Select(a => a.Symptom_English).OrderBy(a => a).ToList();
                    objs.Insert(0, "No other symptoms");
                    foreach (var item in objs)
                    {
                        field
                        .AddDescription(item, item)
                        .AddTerms(item, item);
                    }
                }
                return true;
            }))
                   //.Field(new FieldReflector<EngFormFlowDialog>(nameof(Severity2))
                   //    .SetType(null)
                   //    .SetActive((state) => state.Symptom2 != "No other symptoms" ? true : false))
                   .Field(nameof(Severity2), active: (state) => (state.Symptom2 != "No other symptoms" ? true : false))
                   .Field(new FieldReflector <EngFormFlowDialog>(nameof(Hospital))
                          .SetType(null)
                          .SetActive((state) => (state.BodyPart != null && state.Symptom1 != null ? true : false))
                          .SetDefine(async(state, field) =>
            {
                if (state.Severity1 != null && state.Symptom2 != null)
                {
                    _specialties = string.Join(",", _bodyParts.Where(a => a.Symptom_English.ToLower().Contains(state.Symptom1.ToLower()) || a.Symptom_English.ToLower().Contains(state.Symptom2.ToLower()))
                                               .Select(a => a.Specialty).ToList()).Split(',').Distinct().ToList();

                    if (state.Age == AgeOptions.Under10 || state.Age == AgeOptions.Between1021)
                    {
                        _specialties.Insert(0, "Paediatrician");
                    }
                    var predicate = PredicateBuilder.New <tbHospital>();
                    if (state.BodyPart != null)
                    {
                        foreach (var info in _specialties)
                        {
                            predicate = predicate.Or(b => (b.Specialty ?? string.Empty).ToLower().Contains((info ?? string.Empty).ToLower()));
                        }
                        var objs = _hospitals.Where(predicate).OrderBy(a => a.Name).Take(10).ToList();
                        foreach (var item in objs)
                        {
                            field
                            .AddDescription(item.Name, item.Name, item.PhotoUrl, $"{item.ID}_{item.Township}")
                            .AddTerms(item.Name, item.Name);
                        }
                    }
                }
                return true;
            }))
                   .Field(new FieldReflector <EngFormFlowDialog>(nameof(Doctor))
                          .SetType(null)
                          .SetActive((state) => (state.Hospital != null ? true : false))
                          .SetDefine(async(state, field) =>
            {
                if (state.Hospital != null)
                {
                    var objs = await DoctorApiRequestHelper.Get(hospitalname: state.Hospital, specialties: string.Join("_", _specialties));

                    if (objs != null)
                    {
                        foreach (var item in objs.Results)
                        {
                            field
                            .AddDescription(item.Name, item.Name, item.PhotoUrl, $"{item.ID}_{item.Qualification}")
                            .AddTerms(item.Name, item.Name);
                        }
                    }
                }
                return true;
            })
                          .SetNext((value, state) =>
            {
                return new NextStep(StepDirection.Complete);
            }))

                   .OnCompletion(async(context, state) =>
            {
                await context.PostAsync("Thanks. See you again.");
            })
                   .Prompter(async(context, prompt, state, field) =>
            {
                var message = context.Activity as Activity;
                IMessageActivity promptMessage = context.MakeMessage();
                // Handle buttons as quick replies when possible (FB only renders 11 quick replies)
                if (field != null)
                {
                    if (prompt.Buttons.Count > 0)           // && prompt.Buttons.Count <= 11)
                    {
                        if (field.Name == nameof(Hospital)) // && prompt.Buttons.Count <= 11)
                        {
                            // Build a standard prompt with suggested actions.

                            promptMessage.AttachmentLayout = AttachmentLayoutTypes.Carousel;
                            promptMessage.Attachments = prompt.Buttons.Select(a => new HeroCard
                            {
                                Title = a.Description,
                                Subtitle = a.Message.Split('_')[1],
                                Images = new List <CardImage> {
                                    new CardImage(a.Image)
                                },
                                Buttons = new List <CardAction>
                                {
                                    new CardAction(ActionTypes.ImBack, "🤤 View doctor", null, a.Description)
                                }
                            }).ToList().Select(a => a.ToAttachment()).ToList();
                        }
                        else if (field.Name == nameof(Doctor))
                        {
                            promptMessage.AttachmentLayout = AttachmentLayoutTypes.Carousel;
                            promptMessage.Attachments = prompt.Buttons.Select(a => new HeroCard
                            {
                                Title = a.Description,
                                Subtitle = a.Message.Split('_')[1],
                                Images = new List <CardImage> {
                                    new CardImage(a.Image)
                                },
                                Buttons = new List <CardAction>
                                {
                                    new CardAction(ActionTypes.OpenUrl, "🤤 Get appointment ", null, value: $"http://caremebotclient.azurewebsites.net/appointment/index?doctorid={a.Message.Split('_')[0]}&msgrid=123123&msgrname={state.Name}")
                                }
                            }).ToList().Select(a => a.ToAttachment()).ToList();
                        }
                        else
                        {
                            var actions = prompt.Buttons.Select(button => new CardAction
                            {
                                Type = ActionTypes.ImBack,
                                Title = button.Description,
                                Value = button.Description
                            }).ToList();
                            promptMessage.SuggestedActions = new SuggestedActions(actions: actions);
                        }
                    }

                    else if (prompt.Description != null)
                    {
                        var preamble = context.MakeMessage();
                        if (prompt.GenerateMessages(preamble, promptMessage))
                        {
                            await context.PostAsync(preamble);
                        }
                    }
                }
                if (prompt != null)
                {
                    promptMessage.Text = prompt.Prompt ?? default(string);
                }

                await context.PostAsync(promptMessage);
                return prompt;
            })
                   .Build());
        }
Exemplo n.º 16
0
        //Get Doctor Speciality List for Drop Down
        public async Task <ActionResult> Index()
        {
            DoctorSpecialitiesViewModel result = await DoctorApiRequestHelper.GetDocSpecialtyListFilter();

            return(View(result));
        }
Exemplo n.º 17
0
        public async Task <ActionResult> _doctor(int doctorID)
        {
            DoctorSpecialityViewModel doctor = await DoctorApiRequestHelper.GetDoctorById(doctorID);

            return(PartialView("_doctor", doctor));
        }