public static Statement CreateStatement(long patNum, StatementMode mode_ = StatementMode.InPerson, bool isSent = false, DateTime dateSent = default) { Statement statement = new Statement() { PatNum = patNum, Mode_ = mode_, IsSent = isSent, DateSent = dateSent, }; Statements.Insert(statement); return(statement); }
/// <summary>Creates patient objects corresponding to the totalPat parameter. Each patient has a procedure /// and statement created on the specified date. Aging is run for each patient.</summary> public static void CreatePatWithProcAndStatement(int totalPat, DateTime dateTimeSentStmt = default(DateTime), bool hasPortalAccessInfo = false, PatientStatus patStatus = PatientStatus.Patient, StatementMode stmtMode = StatementMode.Mail, bool hasSignedTil = false, double procFee = 0) { for (int i = 0; i < totalPat; i++) { Patient patient = CreatePatient("", 0, 0, "", "", ContactMethod.Email, "", "", "", default(DateTime), 0, 0, hasPortalAccessInfo, patStatus, hasSignedTil); DateTime dateProc = DateTime.Today.AddDays(-1); //Create a completed procedure that was completed the day before the first payplan charge date AND before the payment plan creation date. ProcedureT.CreateProcedure(patient, "D1100", ProcStat.C, "", procFee, dateProc); //Run Ledgers to update the patient balance from the procedure fee Ledgers.ComputeAging(patient.PatNum, dateTimeSentStmt); //Insert a statement that was sent during the "bill in advance days" for the payment plan charge AND before the payment plan creation date. StatementT.CreateStatement(patient.PatNum, mode_: stmtMode, isSent: true, dateSent: dateTimeSentStmt); } }