///<summary></summary> public static string ReplaceTemplateFields(string templateText,Patient pat,Appointment aptNext,Clinic clinic) { //patient information templateText=Patients.ReplacePatient(templateText,pat); //Guarantor Information templateText=Patients.ReplaceGuarantor(templateText,pat); //Family Information templateText=Family.ReplaceFamily(templateText,pat); //Next Scheduled Appointment Information templateText=Appointments.ReplaceAppointment(templateText,aptNext); //handles null nextApts. //Currently Logged in User Information templateText=FormMessageReplacements.ReplaceUser(templateText,Security.CurUser); //Clinic Information templateText=Clinics.ReplaceOffice(templateText,clinic); //Misc Information templateText=FormMessageReplacements.ReplaceMisc(templateText); //Referral Information templateText=Referrals.ReplaceRefProvider(templateText,pat); //Recall Information return Recalls.ReplaceRecall(templateText,pat); }
public void LoadTemplate(string subject, string bodyText, List <EmailAttach> attachments) { List <Appointment> listApts = Appointments.GetFutureSchedApts(PatNum); Appointment aptNext = null; if (listApts.Count > 0) { aptNext = listApts[0]; //next sched appt. If none, null. } Clinic clinic = Clinics.GetClinic(ClinicNum); Subject = subject; //patient information Subject = Patients.ReplacePatient(Subject, _patCur); //Next Scheduled Appointment Information Subject = Appointments.ReplaceAppointment(Subject, aptNext); //handles null nextApts. //Currently Logged in User Information Subject = FormMessageReplacements.ReplaceUser(Subject, Security.CurUser); //Clinic Information Subject = Clinics.ReplaceOffice(Subject, clinic); //Misc Information Subject = FormMessageReplacements.ReplaceMisc(Subject); BodyText = bodyText; //patient information BodyText = Patients.ReplacePatient(BodyText, _patCur); //Next Scheduled Appointment Information BodyText = Appointments.ReplaceAppointment(BodyText, aptNext); //handles null nextApts. //Currently Logged in User Information BodyText = FormMessageReplacements.ReplaceUser(BodyText, Security.CurUser); //Clinic Information BodyText = Clinics.ReplaceOffice(BodyText, clinic); //Misc Information BodyText = FormMessageReplacements.ReplaceMisc(BodyText); _emailMessage.Attachments.AddRange(attachments); FillAttachments(); _hasMessageChanged = false; }