Exemple #1
0
        ///<summary>Replaces variable tags with the information from the patient passed in.</summary>
        public static string ReplaceVarsForSms(string smsTemplate, Patient pat, Statement stmt)
        {
            //No need to check RemotingRole; no call to db.
            StringBuilder retVal = new StringBuilder();

            retVal.Append(smsTemplate);
            if (smsTemplate.Contains("[monthlyCardsOnFile]"))
            {
                retVal.RegReplace("\\[monthlyCardsOnFile]", CreditCards.GetMonthlyCardsOnFile(pat.PatNum));
            }
            retVal.RegReplace("\\[nameF]", pat.GetNameFirst());
            retVal.RegReplace("\\[namePref]", pat.Preferred);
            retVal.RegReplace("\\[PatNum]", pat.PatNum.ToString());
            retVal.RegReplace("\\[currentMonth]", DateTime.Now.ToString("MMMM"));
            Clinic clinic      = Clinics.GetClinic(pat.ClinicNum) ?? Clinics.GetPracticeAsClinicZero();
            string officePhone = clinic.Phone;

            if (string.IsNullOrEmpty(officePhone))
            {
                officePhone = PrefC.GetString(PrefName.PracticePhone);
            }
            retVal.RegReplace("\\[OfficePhone]", TelephoneNumbers.ReFormat(officePhone));
            string officeName = clinic.Description;

            if (string.IsNullOrEmpty(officeName))
            {
                officeName = PrefC.GetString(PrefName.PracticeTitle);
            }
            retVal.RegReplace("\\[OfficeName]", officeName);
            retVal.RegReplace("\\[StatementURL]", stmt.StatementURL);
            retVal.RegReplace("\\[StatementShortURL]", stmt.StatementShortURL);
            return(retVal.ToString());
        }
Exemple #2
0
 ///<summary>Email statements allow variables to be present in the message body and subject, this method replaces those variables with the information from the patient passed in.  Simply pass in the string for the subject or body and the corresponding patient.</summary>
 private static string ReplaceVarsForEmail(string str, Patient pat)
 {
     //No need to check RemotingRole; no call to db.
     str = str.Replace("[monthlyCardsOnFile]", CreditCards.GetMonthlyCardsOnFile(pat.PatNum));
     str = str.Replace("[nameF]", pat.GetNameFirst());
     str = str.Replace("[nameFL]", pat.GetNameFL());
     str = str.Replace("[nameFLnoPref]", pat.GetNameFLnoPref());
     str = str.Replace("[namePref]", pat.Preferred);
     str = str.Replace("[PatNum]", pat.PatNum.ToString());
     str = str.Replace("[currentMonth]", DateTime.Now.ToString("MMMM"));
     return(str);
 }
		///<summary>Email statements allow variables to be present in the message body and subject, this method replaces those variables with the information from the patient passed in.  Simply pass in the string for the subject or body and the corresponding patient.</summary>
		private static string ReplaceVarsForEmail(string str,Patient pat) {
			//No need to check RemotingRole; no call to db.
			str=str.Replace("[monthlyCardsOnFile]",CreditCards.GetMonthlyCardsOnFile(pat.PatNum));
			str=str.Replace("[nameF]",pat.GetNameFirst());
			str=str.Replace("[nameFL]",pat.GetNameFL());
			str=str.Replace("[nameFLnoPref]",pat.GetNameFLnoPref());
			str=str.Replace("[namePref]",pat.Preferred);
			str=str.Replace("[PatNum]",pat.PatNum.ToString());
			str=str.Replace("[currentMonth]",DateTime.Now.ToString("MMMM"));
			return str;
		}