Example #1
0
        public static string GetUrlBasedNodeTypeForFilter(string url,CalendarFilterProxy calendarFilter,AppEnum.CalendarFilterTypes calendarFilterType,AppEnum.ProviderType provider)
        {
            //string urlFilter = String.Empty;
            AppEnum.CalendarViewTypes calendarViewTypes = (AppEnum.CalendarViewTypes)Enum.Parse(typeof(AppEnum.CalendarViewTypes), calendarFilter.CalendarView, true);
            switch (calendarViewTypes)
            {
                //For Single Providers   --> "SimApp/Courses/CID/ROLE/UID/Assignments/SID/Appointments/Type/PatientVisit/SingleProvider/{0}/{1}/{2}/{3}/{4}"
                // Example                  --> "SimApp/Courses/CID/ROLE/UID/Assignments/SID/Appointments/Type/PatientVisit/SingleProvider/{YYYYMM}/{WeekOfYear}/{Day}/{ProviderId}/{DictionaryOfAppointments}"

                //For Multiple Providers --> "SimApp/Courses/CID/ROLE/UID/Assignments/SID/Appointments/Type/PatientVisit/SingleProvider/{0}/{1}/{2}/{3}"
                // Example                   --> "SimApp/Courses/CID/ROLE/UID/Assignments/SID/Appointments/Type/PatientVisit/MultipleProviders/{YYYYMM}/{WeekOfYear}/{Day}/{DictionaryOfAppointments}"
                case AppEnum.CalendarViewTypes.month:
                    url= url.Remove(url.IndexOf("/{1}"));
                    return url= string.Format(url, AppCommon.GetMonthNode(calendarFilter.StartDate));
                case AppEnum.CalendarViewTypes.resourceDay:
                case AppEnum.CalendarViewTypes.agendaDay:
                    if (calendarFilterType.Equals(AppEnum.CalendarFilterTypes.Provider) &&
                        provider == AppEnum.ProviderType.SingleProvider)
                    {
                        url = url.Remove(url.IndexOf("/{4}"));
                        url = string.Format(url, AppCommon.GetMonthNode(calendarFilter.StartDate), AppCommon.GetWeekNode(calendarFilter.StartDate),AppCommon.GetDayNode(calendarFilter.StartDate),calendarFilter.ProviderId);
                    }else{
                        url = url.Remove(url.IndexOf("/{3}"));
                         url = string.Format(url, AppCommon.GetMonthNode(calendarFilter.StartDate), AppCommon.GetWeekNode(calendarFilter.StartDate), AppCommon.GetDayNode(calendarFilter.StartDate));
                    }
                    break;
                case AppEnum.CalendarViewTypes.agendaWeek:
                    url = url.Remove(url.IndexOf("/{2}"));
                    if(calendarFilter.StartDate.Month!= calendarFilter.EndDate.Month)
                    {
                        url = string.Format(url, AppCommon.GetMonthNode(calendarFilter.StartDate), AppCommon.GetWeekNode(calendarFilter.StartDate))
                                + AppCommon.DataDelimiter + string.Format(url, AppCommon.GetMonthNode(calendarFilter.EndDate), AppCommon.GetWeekNode(calendarFilter.StartDate));
                    } else
                    {
                        url = string.Format(url, AppCommon.GetMonthNode(calendarFilter.StartDate),
                                      AppCommon.GetWeekNode(calendarFilter.StartDate));
                    }
                    break;
                case AppEnum.CalendarViewTypes.None:
                    url = url.Remove(url.IndexOf("/{0}"));
                    break;
            }
            return url;
        }
Example #2
0
 public bool IsAppointmentExists(DateTime appointmentStartTime, IList<int> providerId, DropBoxLink dropBoxLink)
 {
     CalendarFilterProxy calendarFilterObject = new CalendarFilterProxy
                                                    {
                                                        CalendarView =
                                                            AppEnum.CalendarViewTypes.agendaDay.ToString(),
                                                        StartDate = appointmentStartTime,
                                                        EndDate = appointmentStartTime,
                                                        ScenarioId =
                                                            (dropBoxLink != null) ? dropBoxLink.Sid : "SID",
                                                        CourseId =
                                                            (dropBoxLink != null) ? dropBoxLink.Cid : "Course",
                                                        UserId = (dropBoxLink != null) ? dropBoxLink.Uid : "UID",
                                                        Role = AppEnum.ApplicationRole.Student
                                                    };
     IList<Appointment> appointmentsList = _appointmentDocument.GetAppointments(calendarFilterObject, AppEnum.CalendarFilterTypes.None);
     appointmentsList =
         (from appointment in appointmentsList
          where appointment.StartDateTime == appointmentStartTime
          select appointment).ToList();
     //appointmentsList =
     //    (from appointment in appointmentsList
     //     where appointment.ProviderId[0] == providerId[0]
     //     select appointment).ToList();
     for (int iCount = 0; iCount < providerId.Count(); iCount++)
     {
         IList<Appointment> tempAppointmentList =
             (from appointment in appointmentsList
              where appointment.ProviderId.Contains(providerId[iCount])
              select appointment).ToList();
         if (tempAppointmentList.Count > 0)
         {
             return true;
         }
     }
     return false;
 }
Example #3
0
 /// <summary>
 /// Get exam room view values for calendar
 /// </summary>
 /// <param name="calendarFilterObject"></param>
 /// <returns></returns>
 public IList<CalendarEventProxy> GetExamRoomViewFilter(CalendarFilterProxy calendarFilterObject)
 {
     IList<CalendarEventProxy> calendarEvents = new List<CalendarEventProxy>();
     calendarFilterObject.CalendarView = AppEnum.CalendarViewTypes.agendaDay.ToString();
     IList<Appointment> appointmentsList = _appointmentDocument.GetPatientVisitAppointments(calendarFilterObject, AppEnum.CalendarFilterTypes.None);
     foreach (var item in appointmentsList)
     {
         CalendarEventProxy calenderEvent = new CalendarEventProxy
                                                {
                                                    title = GetCalendarTitleForAppointmentType(item, AppEnum.CalendarViewTypes.resourceDay.ToString()),
                                                    tooltip = GetCalendarTooltipForAppointmentType(item),
                                                    className = GetCalendarClassForAppointmentType(item),
                                                    isRecurrence = CheckIfRecurrenceExists(item),
                                                    editable = false,
                                                    start = item.StartDateTime.ToString(),
                                                    end = item.EndDateTime.ToString(),
                                                    allDay = false,
                                                    Url = item.Url,
                                                    PatientName = AppCommon.GetPatientName(item.FirstName, item.LastName, item.MiddleInitial),
                                                    AppointmentType = GetAppointmentType(item),
                                                    resourceId = item.ExamRoomIdentifier,
                                                    IsViewMode=true
                                                };
         calendarEvents.Add(calenderEvent);
     }
     return calendarEvents;
 }
Example #4
0
 /// <summary>
 /// Get appointment list for a perticular patient
 /// </summary>
 /// <param name="calendarFilter"></param>
 /// <param name="sortColumnIndex"></param>
 /// <param name="sortColumnOrder"></param>
 /// <returns></returns>
 public IList<Appointment> GetAppointmentsForPatientSearch(CalendarFilterProxy calendarFilter, int sortColumnIndex, string sortColumnOrder)
 {
     IList<Appointment> appointments = _appointmentDocument.GetAppointments(calendarFilter, AppEnum.CalendarFilterTypes.Patient);
     string sortColumnName = AppCommon.GridColumnForAppointmentPatientList[sortColumnIndex - 1];
     var sortablePatientList = appointments.AsQueryable();
     appointments = sortablePatientList.OrderBy(sortColumnName, sortColumnOrder).ToList();
     return appointments;
 }
Example #5
0
 /// <summary>
 /// Get appointments for calendar filter
 /// </summary>
 /// <param name="calendarFilterObject"></param>
 /// <param name="filterType"></param>
 /// <returns></returns>
 public IList<CalendarEventProxy> GetAppointmentsForCalendar(CalendarFilterProxy calendarFilterObject, AppEnum.CalendarFilterTypes filterType)
 {
     IList<Appointment> appointmentsList = _appointmentDocument.GetAppointments(calendarFilterObject, filterType);
     IList<CalendarEventProxy> calendarEvents = GetAppointmentsForCalendar(appointmentsList.ToList(), calendarFilterObject.CalendarView);
     return calendarEvents;
 }