public void AgingData_GetAgingList_ExcludeNoTruthInLending() { PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, false, PatientStatus.Patient, StatementMode.Mail, false, 50); //No Signed Truth in Lending PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, false, PatientStatus.Patient, StatementMode.Mail, true, 50); //Signed Truth in Lending List <Def> listBillTypeDef = Defs.GetDefsForCategory(DefCat.BillingTypes, true); List <long> listBillTypeDefNum = listBillTypeDef.Select(x => x.DefNum).ToList(); List <PatAging> listPatAging = Patients.GetAgingList("", DateTime.Today, listBillTypeDefNum, false, false, 0 , false, false, new List <long>(), false, false, new List <long>(), new List <long>(), new SerializableDictionary <long, List <PatAgingTransaction> >(), true, false, true); Assert.AreNotEqual(listPatAging.Count, 0); listPatAging.ForEach(x => Assert.IsTrue(x.HasSignedTil)); }
public void AgingData_GetAgingList_ExcludeInactiveFamilies() { PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, false, PatientStatus.Inactive, StatementMode.Mail, false, 50); //Inactive patient PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, false, PatientStatus.Patient, StatementMode.Mail, false, 50); //Non-inactive patient List <Def> listBillTypeDef = Defs.GetDefsForCategory(DefCat.BillingTypes, true); List <long> listBillTypeDefNum = listBillTypeDef.Select(x => x.DefNum).ToList(); List <PatAging> listPatAging = Patients.GetAgingList("", DateTime.Today, listBillTypeDefNum, false, false, 0 , true, false, new List <long>(), false, false, new List <long>(), new List <long>(), new SerializableDictionary <long, List <PatAgingTransaction> >(), false, false, true); Assert.AreEqual(listPatAging.Count, 1); Assert.IsTrue(listPatAging[0].PatStatus != PatientStatus.Inactive); }
public void AgingData_GetAgingList_ExcludeBadAddress() { PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, false, PatientStatus.Patient, StatementMode.Mail, false, 50); //Bad Address (no zip code) PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, true, PatientStatus.Patient, StatementMode.Mail, false, 50); //Valid Address List <Def> listBillTypeDef = Defs.GetDefsForCategory(DefCat.BillingTypes, true); List <long> listBillTypeDefNum = listBillTypeDef.Select(x => x.DefNum).ToList(); List <PatAging> listPatAging = Patients.GetAgingList("", DateTime.Today, listBillTypeDefNum, true, false, 0 , false, false, new List <long>(), false, false, new List <long>(), new List <long>(), new SerializableDictionary <long, List <PatAgingTransaction> >(), false, false, true); Assert.AreEqual(listPatAging.Count, 1); Assert.IsTrue(listPatAging[0].Zip != ""); }
public void AgingData_GetAgingList_ExcludeBalLessThan() { double balMin = 50; PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, false, PatientStatus.Patient, StatementMode.Mail, false, balMin - 1); //Less than Balance PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, false, PatientStatus.Patient, StatementMode.Mail, false, balMin); //Equal to Balance PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, false, PatientStatus.Patient, StatementMode.Mail, false, balMin + 1); //Greater than Balance List <Def> listBillTypeDef = Defs.GetDefsForCategory(DefCat.BillingTypes, true); List <long> listBillTypeDefNum = listBillTypeDef.Select(x => x.DefNum).ToList(); List <PatAging> listPatAging = Patients.GetAgingList("", DateTime.Today, listBillTypeDefNum, false, false, balMin, false, false, new List <long>() , false, false, new List <long>(), new List <long>(), new SerializableDictionary <long, List <PatAgingTransaction> >(), false, false, true); Assert.AreEqual(listPatAging.Count, 2); Assert.IsTrue(listPatAging[0].BalTotal >= balMin); Assert.IsTrue(listPatAging[1].BalTotal >= balMin); }
public void AgingData_GetAgingList_FilterAccountsNotBilledSince() { DateTime dateTimeSinceDate = DateTime.Today; //Create dummy Patients with sent dates from today and the last two days PatientT.CreatePatWithProcAndStatement(1, dateTimeSinceDate.AddDays(-1), false, PatientStatus.Patient, StatementMode.Mail, false, 50); PatientT.CreatePatWithProcAndStatement(1, dateTimeSinceDate, false, PatientStatus.Patient, StatementMode.Mail, false, 50); PatientT.CreatePatWithProcAndStatement(1, dateTimeSinceDate.AddDays(1), false, PatientStatus.Patient, StatementMode.Mail, false, 50); List <Def> listBillTypeDef = Defs.GetDefsForCategory(DefCat.BillingTypes, true); List <long> listBillTypeDefNum = listBillTypeDef.Select(x => x.DefNum).ToList(); List <PatAging> listPatAging = Patients.GetAgingList("", dateTimeSinceDate, listBillTypeDefNum, false, false, 0 , false, false, new List <long>(), false, false, new List <long>(), new List <long>(), new SerializableDictionary <long, List <PatAgingTransaction> >(), false, true, true); Assert.AreEqual(listPatAging.Count, 2); Assert.IsTrue(listPatAging[0].DateLastStatement >= dateTimeSinceDate); Assert.IsTrue(listPatAging[1].DateLastStatement >= dateTimeSinceDate); }
public void AgingData_GetAgingList_ExcludeInPersonStatements() { PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, false, PatientStatus.Patient, StatementMode.InPerson, false, 50); //In Person Statement PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, false, PatientStatus.Patient, StatementMode.Mail, false, 50); //Mail Statement List <Def> listBillTypeDef = Defs.GetDefsForCategory(DefCat.BillingTypes, true); List <long> listBillTypeDefNum = listBillTypeDef.Select(x => x.DefNum).ToList(); List <PatAging> listPatAging = Patients.GetAgingList("", DateTime.Today, listBillTypeDefNum, false, false, 0 , false, false, new List <long>(), false, false, new List <long>(), new List <long>(), new SerializableDictionary <long, List <PatAgingTransaction> >(), false, true, true); Assert.AreEqual(listPatAging.Count, 2); listPatAging = Patients.GetAgingList("", DateTime.Today, listBillTypeDefNum, false, false, 0 , false, true, new List <long>(), false, false, new List <long>(), new List <long>(), new SerializableDictionary <long, List <PatAgingTransaction> >(), false, true, true); Assert.AreEqual(listPatAging.Count, 1); Statement statement = StatementT.GetStatementsForPat(listPatAging[0].PatNum).First(); Assert.IsTrue(statement.Mode_ != StatementMode.InPerson); }
public void AgingData_GetAgingList_GetAgingListSimple_Compare() { PatientT.CreatePatWithProcAndStatement(2, DateTime.Today, false, PatientStatus.Patient, StatementMode.Mail, false, 50); List <Def> listBillTypeDef = Defs.GetDefsForCategory(DefCat.BillingTypes, true); List <long> listBillTypeDefNum = listBillTypeDef.Select(x => x.DefNum).ToList(); //Compare the results of GetAgingList() and GetAgingListSimple() methods (output should be identical) List <PatAging> listPatAging = Patients.GetAgingList("", DateTime.Today, listBillTypeDefNum, false, false, 0, false, false, new List <long>(), false, false , new List <long>(), new List <long>(), new SerializableDictionary <long, List <PatAgingTransaction> >(), false, false, true); List <PatAging> listPatAgingSimple = Patients.GetAgingListSimple(listBillTypeDefNum, new List <long> { }); //Ordered by PatNum, for thread concurrency Assert.IsTrue(listPatAging.Count != 0); Assert.IsTrue(listPatAgingSimple.Count != 0); Assert.AreEqual(listPatAging.Count, listPatAgingSimple.Count); //Ensure both methods return the exact same patients. for (int i = 0; i < listPatAging.Count; i++) { Assert.AreEqual(listPatAging[i].PatNum, listPatAgingSimple[i].PatNum); } }
public void AgingData_GetAgingList_ExcludeInsPending() { PatientT.CreatePatWithProcAndStatement(2, DateTime.Today, false, PatientStatus.Patient, StatementMode.Mail, false, 50); SerializableDictionary <long, PatAgingData> dictPatAgingData = AgingData.GetAgingData(false, true, true, false, false, new List <long>()); dictPatAgingData.ToList()[0].Value.HasPendingIns = true; //Set the first Aging Patient to have pending insurance List <long> listPendingInsPatNums = new List <long>(); foreach (KeyValuePair <long, PatAgingData> kvp in dictPatAgingData) //Grab the patnum since GetAgingList() requires a list of patnums { if (kvp.Value.HasPendingIns) { listPendingInsPatNums.Add(kvp.Key); } } List <Def> listBillTypeDef = Defs.GetDefsForCategory(DefCat.BillingTypes, true); List <long> listBillTypeDefNum = listBillTypeDef.Select(x => x.DefNum).ToList(); List <PatAging> listPatAging = Patients.GetAgingList("", DateTime.Today, listBillTypeDefNum, false, false, 0 , true, false, new List <long>(), false, false, listPendingInsPatNums, new List <long>(), new SerializableDictionary <long, List <PatAgingTransaction> >(), false, false, true); Assert.AreEqual(listPatAging.Count, 1); Assert.IsTrue(listPatAging[0].HasInsPending == false); }