da1b387e79dbd23e9f6d4a289095dea1396262db
jcasper
  Wed Feb 17 13:38:35 2016 -0800
Filtering in OMIM tracks wasn't properly interacting with cart variables, refs #13349, #8377

diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c
index 8eb7c37..0b0cc8a 100644
--- src/hg/hgTracks/simpleTracks.c
+++ src/hg/hgTracks/simpleTracks.c
@@ -12448,72 +12448,72 @@
         result = 0;
 	}
     }
 else
     result = targetClass;
 hFreeConn(&conn);
 return(result);
 }
 
 boolean doThisOmimEntry(struct track *tg, char *omimId)
 /* check if the specific class of this OMIM entry is selected by the user */
 {
 boolean doIt;
 boolean gotClassLabel;
 char labelName[255];
-boolean doClass1 = FALSE;
-boolean doClass2 = FALSE;
-boolean doClass3 = FALSE;
-boolean doClass4 = FALSE;
-boolean doOthers = FALSE;
+boolean doClass1 = TRUE;
+boolean doClass2 = TRUE;
+boolean doClass3 = TRUE;
+boolean doClass4 = TRUE;
+boolean doOthers = TRUE;
 
 struct hashEl *omimLocationLabels;
 struct hashEl *label;
 
 safef(labelName, sizeof(labelName), "%s.label", tg->table);
 omimLocationLabels = cartFindPrefix(cart, labelName);
 
 gotClassLabel = FALSE;
 for (label = omimLocationLabels; label != NULL; label = label->next)
 	{
 	if (strstr(label->name, "class") != NULL) gotClassLabel = TRUE;
 	}
 /* if user has not made selection(s) from the phenotype class filter, enable every item */
 if (!gotClassLabel) return(TRUE);
 
 /* check which classes have been selected */
 for (label = omimLocationLabels; label != NULL; label = label->next)
     {
-    if (endsWith(label->name, "class1") && differentString(label->val, "0"))
+    if (endsWith(label->name, "class1") && sameString(label->val, "0"))
 	{
-	doClass1 = TRUE;
+	doClass1 = FALSE;
 	}
-    if (endsWith(label->name, "class2") && differentString(label->val, "0"))
+    if (endsWith(label->name, "class2") && sameString(label->val, "0"))
 	{
-	doClass2 = TRUE;
+	doClass2 = FALSE;
 	}
-    if (endsWith(label->name, "class3") && differentString(label->val, "0"))
+    if (endsWith(label->name, "class3") && sameString(label->val, "0"))
 	{
-	doClass3 = TRUE;
+	doClass3 = FALSE;
 	}
-    if (endsWith(label->name, "class4") && differentString(label->val, "0"))
+    if (endsWith(label->name, "class4") && sameString(label->val, "0"))
 	{
-	doClass4 = TRUE;
+	doClass4 = FALSE;
 	}
-    if (endsWith(label->name, "others") && differentString(label->val, "0"))
+    if (endsWith(label->name, "others") && sameString(label->val, "0"))
 	{
-	doOthers = TRUE;
+	doOthers = FALSE;
 	}
     }
 
 doIt = FALSE;
 
 /* process regular class 1-4 first */
 doIt = doIt || (doClass1 && (hasOmimPhenotypeClass(omimId, 1) == 1));
 doIt = doIt || (doClass2 && (hasOmimPhenotypeClass(omimId, 2) == 2));
 doIt = doIt || (doClass3 && (hasOmimPhenotypeClass(omimId, 3) == 3));
 doIt = doIt || (doClass4 && (hasOmimPhenotypeClass(omimId, 4) == 4));
 
 // if this is a regular (1-4) class and the result is to do it, return TRUE now
 if (doIt) return(doIt);
 
 /* process the tricky "Other" class here */