Beispiel #1
0
 private static Referral GetFromList(long referralNum)
 {
     //No need to check RemotingRole; no call to db.
     for (int i = 0; i < List.Length; i++)
     {
         if (List[i].ReferralNum == referralNum)
         {
             return(List[i]);
         }
     }
     //couldn't find it, so refresh list and try again
     Referrals.RefreshCache();
     for (int i = 0; i < List.Length; i++)
     {
         if (List[i].ReferralNum == referralNum)
         {
             return(List[i]);
         }
     }
     return(null);
 }
Beispiel #2
0
        ///<summary>Replaces all patient's referral "From" and "IsDoctor" fields in the given message.  Returns the resulting string.
        ///Replaces: [ReferredFromProvInitialReferralNum], [ReferredFromProvInitialNameF],etc.</summary>
        public static string ReplaceRefProvider(string message, Patient pat)
        {
            if (pat == null)
            {
                return(message);
            }
            List <Referral> listRefFrom = Referrals.GetIsDoctorReferralsForPat(pat.PatNum);

            if (listRefFrom.Count == 0)
            {
                return(message);
            }
            string retVal = message;
            //The oldest referral 'From".
            Referral refOldest = listRefFrom.FirstOrDefault();

            retVal = retVal.Replace("[ReferredFromProvInitialReferralNum]", refOldest.ReferralNum.ToString());
            retVal = retVal.Replace("[ReferredFromProvInitialNameF]", refOldest.FName);
            retVal = retVal.Replace("[ReferredFromProvInitialNameL]", refOldest.LName);
            retVal = retVal.Replace("[ReferredFromProvInitialPhone]", refOldest.Telephone);
            retVal = retVal.Replace("[ReferredFromProvInitialAddress]", refOldest.Address);
            retVal = retVal.Replace("[ReferredFromProvInitialAddress2]", refOldest.Address2);
            retVal = retVal.Replace("[ReferredFromProvInitialCity]", refOldest.City);
            retVal = retVal.Replace("[ReferredFromProvInitialState]", refOldest.ST);
            retVal = retVal.Replace("[ReferredFromProvInitialZip]", refOldest.Zip);
            //The most recent referral "From".
            Referral refNewest = listRefFrom.LastOrDefault();

            retVal = retVal.Replace("[ReferredFromProvMostRecentReferralNum]", refNewest.ReferralNum.ToString());
            retVal = retVal.Replace("[ReferredFromProvMostRecentNameF]", refNewest.FName);
            retVal = retVal.Replace("[ReferredFromProvMostRecentNameL]", refNewest.LName);
            retVal = retVal.Replace("[ReferredFromProvMostRecentPhone]", refNewest.Telephone);
            retVal = retVal.Replace("[ReferredFromProvMostRecentAddress]", refNewest.Address);
            retVal = retVal.Replace("[ReferredFromProvMostRecentAddress2]", refNewest.Address2);
            retVal = retVal.Replace("[ReferredFromProvMostRecentCity]", refNewest.City);
            retVal = retVal.Replace("[ReferredFromProvMostRecentState]", refNewest.ST);
            retVal = retVal.Replace("[ReferredFromProvMostRecentZip]", refNewest.Zip);
            return(retVal);
        }
Beispiel #3
0
 protected override void FillCacheIfNeeded()
 {
     Referrals.GetTableFromCache(false);
 }