The formal IMQ Grammar can be accessed in ABNF form at https://github.com/endeavourhealth-discovery/IMDirectory/blob/develop/im_library/src/antlr4/grammars/ECL.g4
Boolean operators
The boolean operators 'and' , 'or' and 'not' can operate in either the from or where clause, using the "bool" predicate. 'and' is the same as an intersection (all must be true), or is a union (at least one true) and 'not' is a union (Any may be true). Further nesting can resolve boolean combinations (e.g. not/and)
Example boolean operators. Select Expand to show:
{"where" : {
"bool" : "and",
"where" : [ { "id" : "age",
"operator" : ">=",
"value" : 18,
"unit" : "year"},
{"id" : "statedGender",
"in" : [ {"@id" : "im:905031000252103",
"name" : "Male (stated gender)" } ] } ] }