///<summary>Returns the time pattern for the specified appointment type (time pattern returned will always be in 5 min increments). ///If the Pattern variable is not set on the appointment type object then the pattern will be dynamically calculated. ///Optionally pass in provider information in order to use specific provider time patterns.</summary> public static string GetTimePatternForAppointmentType(AppointmentType appointmentType, long provNumDentist = 0, long provNumHyg = 0) { //No need to check RemotingRole; no call to db. string timePattern = ""; if (string.IsNullOrEmpty(appointmentType.Pattern)) { //Dynamically calculate the timePattern from the procedure codes associated to the appointment type passed in. List <string> listProcCodeStrings = appointmentType.CodeStr.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList(); List <ProcedureCode> listProcCodes = ProcedureCodes.GetProcCodes(listProcCodeStrings); timePattern = OpenDentBusiness.Appointments.CalculatePattern(provNumDentist, provNumHyg, listProcCodes.Select(x => x.CodeNum).ToList(), true); } else { timePattern = appointmentType.Pattern; //Already in 5 minute increment so no conversion required. } return(timePattern); }