The QueryMaster holds the master information about the query like the query name, query_definition, user_id, and group_id.
The query_defintion element in the QueryMaster holds the xml representation of the query constraint; its details are described below.
The run information of the query is recorded in the QueryInstance and is created whenever the query is executed.
QueryResult typically holds the result information of the query, such as the id and the set size of the patient set, as well as the result status.
There can be multiple QueryInstances for one QueryMaster and one QueryInstance can have multiple QueryResults.