Example #1
0
        ///<summary>Returns text used in WHERE clause of query for tempehrlist.</summary>
        private static string GetFilteringText(EhrPatListElement element)
        {
            string filter  = "";
            string compStr = POut.String(element.CompareString);
            string labStr  = POut.String(element.LabValue);

            switch (element.Restriction)
            {
            case EhrRestrictionType.Birthdate:
                filter = "DATE_SUB(CURDATE(),INTERVAL " + compStr + " YEAR)" + GetOperandText(element.Operand) + "Birthdate ";
                break;

            case EhrRestrictionType.Problem:
                filter = "`" + compStr + "`" + " IS NOT NULL ";                //Has the disease.
                break;

            case EhrRestrictionType.LabResult:
                filter = "`" + compStr + "`" + GetOperandText(element.Operand) + labStr + " ";
                break;

            case EhrRestrictionType.Medication:
                filter = "`" + compStr + "`" + ">0 ";                //Count greater than 0 (is taking the med).
                break;

            case EhrRestrictionType.Gender:
                filter = "Gender>-1 ";                      //Just so WHERE clause won't fail.
                break;
            }
            return(filter);
        }
Example #2
0
 ///<summary>Returns text used in WHERE clause of query for tempehrlist.</summary>
 private static string GetFilteringText(EhrPatListElement element)
 {
     string filter="";
     string compStr=POut.String(element.CompareString);
     string labStr=POut.String(element.LabValue);
     switch(element.Restriction) {
         case EhrRestrictionType.Birthdate:
             filter="DATE_SUB(CURDATE(),INTERVAL "+compStr+" YEAR)"+GetOperandText(element.Operand)+"Birthdate ";
             break;
         case EhrRestrictionType.Problem:
             filter="`"+compStr+"`"+" IS NOT NULL ";//Has the disease.
             break;
         case EhrRestrictionType.LabResult:
             filter="`"+compStr+"`"+GetOperandText(element.Operand)+labStr+" ";
             break;
         case EhrRestrictionType.Medication:
             filter="`"+compStr+"`"+">0 ";//Count greater than 0 (is taking the med).
             break;
         case EhrRestrictionType.Gender:
             filter="Gender>-1 ";//Just so WHERE clause won't fail.
             break;
     }
     return filter;
 }