public void SetupTest() { PatientT.ClearPatientTable(); AppointmentT.ClearAppointmentTable(); ReactivationT.ClearReactivationTable(); ClinicT.ClearClinicTable(); }
public void Fees_GetListFromObjects_AppointmentProviderSecondary() { string suffix = MethodBase.GetCurrentMethod().Name; ProcedureCode procedureCode = ProcedureCodeT.CreateProcCode("D1110"); Fee fee = CreateSingleFee(suffix, (_defaultFeeAmt * _rand.NextDouble()), hasProv: true, codeNum: procedureCode.CodeNum); //Update our new provider so that they are associated to the new fee schedule that was just created. Provider prov = Providers.GetProv(fee.ProvNum); prov.FeeSched = fee.FeeSched; ProviderT.Update(prov); //Make an appointment that has the new provider set as the secondary provider. Appointment appt = AppointmentT.CreateAppointment(0, DateTime.Now, 0, 0, provHyg: prov.ProvNum); //The fees associated to the fee schedule of the appointment's secondary provider should be returned by GetListFromObjects(). List <Fee> listFees = Fees.GetListFromObjects(new List <ProcedureCode>() { procedureCode }, null, null, 0, 0, 0, null, null, new List <Appointment>() { appt }, null, 0); Assert.IsTrue(listFees.Exists(x => x.FeeNum == fee.FeeNum)); }
///<summary>Creates an Appointment Task and a Patient Task using pat and clinic, and adds them to _listTasks.</summary> private void CreateTasks(string suffix, Patient pat, Userod user, long taskListNum, bool isRepeating = false) { Appointment appt = AppointmentT.CreateAppointment(pat.PatNum, DateTime.Today, 0, 0, clinicNum: pat.ClinicNum); Task taskAppt = TaskT.CreateTask(taskListNum, appt.AptNum, suffix, isRepeating: isRepeating, dateType: TaskDateType.None, objectType: TaskObjectType.Appointment, userNum: user.UserNum); Task taskPat = TaskT.CreateTask(taskListNum, pat.PatNum, suffix, isRepeating: isRepeating, dateType: TaskDateType.None, objectType: TaskObjectType.Patient, userNum: user.UserNum); Task taskNone = TaskT.CreateTask(taskListNum, 0, suffix, isRepeating: isRepeating, dateType: TaskDateType.None, objectType: TaskObjectType.None, userNum: user.UserNum); //Manage test lists of "subscribed" tasks so we don't have to do database logic to determine if a user is subscribed to a task. if (OpenDental.UserControlTasks.GetSubscribedTaskLists(_userA.UserNum).Exists(x => x.TaskListNum == taskListNum)) { TaskUnreads.SetUnread(_userA.UserNum, taskAppt); TaskUnreads.SetUnread(_userA.UserNum, taskPat); TaskUnreads.SetUnread(_userA.UserNum, taskNone); } if (OpenDental.UserControlTasks.GetSubscribedTaskLists(_userNW.UserNum).Exists(x => x.TaskListNum == taskListNum)) { TaskUnreads.SetUnread(_userNW.UserNum, taskAppt); TaskUnreads.SetUnread(_userNW.UserNum, taskPat); TaskUnreads.SetUnread(_userNW.UserNum, taskNone); } }
public void Reactivations_GetReactivationList_DaysPastHasFutureAppt() { string name = MethodBase.GetCurrentMethod().Name; Clinic clinic = ClinicT.CreateClinic(name); long provNum = ProviderT.CreateProvider(name); Operatory op = OperatoryT.CreateOperatory(name, provDentist: provNum, clinicNum: clinic.ClinicNum); Patient pat = PatientT.CreatePatient(name, provNum, clinic.ClinicNum, TestEmaiAddress, TestPatPhone, ContactMethod.Mail); //Patient has not been seen since further in the past than the ReactivationDaysPast preference. Procedure proc = ProcedureT.CreateProcedure(pat, "D0120", ProcStat.C, "", 50, procDate: DateTime.Now.AddYears(-3), provNum: provNum); //3 year old proc //Patient has been contacted, and the ReactivationContactInterval has elapsed. Commlog comm = new Commlog() { PatNum = pat.PatNum, CommDateTime = DateTime.Now.AddYears(-1), CommType = _reactivationCommLogType, Mode_ = CommItemMode.Email, SentOrReceived = CommSentOrReceived.Sent, CommSource = CommItemSource.ApptReminder, }; comm.CommlogNum = Commlogs.Insert(comm); //Patient has not been marked "Do Not Contact" Reactivations.Insert(new Reactivation() { PatNum = pat.PatNum, DoNotContact = false, }); //Patient has a future appointment scheduled. AppointmentT.CreateAppointment(pat.PatNum, DateTime.Today.AddDays(1), op.OperatoryNum, provNum); DateTime dateSince = DateTime.Today.AddDays(-PrefC.GetInt(PrefName.ReactivationDaysPast)); DateTime dateStop = dateSince.AddMonths(-36); //Confirm that the patient does not in the Reactivation List DataTable tbl = Reactivations.GetReactivationList(dateSince, dateStop, false, false, true, provNum, clinic.ClinicNum, 0, 0 , ReactivationListSort.LastContacted, RecallListShowNumberReminders.One); //No patients in the list Assert.AreEqual(0, tbl.Rows.Count); }