Use Case_ Run a query from Panel Definition
Validate the user by calling the Project Management cell.
Select a data mart based on the combination of domain_id, project_id, and user_id.
Call the Ontology cell with the item key and determine the dimension table to join with the fact table.
Save the query panel definition and the generated SQL statements.
Generate the list of output like the patient count, patient gender count, patient set, etc.
To scale the application and to support long running SQL, the execution of SQL is handled inside a set of queues. At first the query SQL statements will be executed inside a small job queue. If it doesn't complete within a certain time period then the jobs will be transferred to a mid-size job queue and then to a large size job queue.
If the SQL execution completes before the "result_waittime_ms" which is specified in the request, then the query results are passed in the response message. Otherwise the status of the query is passed in the response message.