# The Query Builder

The Query Builder is a user interface to build complex queries.

Examples of possible complex queries:

* I want all patients that are 20-50 years old, went to ICU, had a road accident, had either a treatment of medicine X or have the name of the medicine X in their documents
* I want all patients that are feminine, had a breast cancer, and receive a chemotherapy treatment
* I want all patient that have documents that contains matches to the following regex :

```
\bdiabet[^o](.*?insulino.?(dep|req))?
```

## Demo

{% embed url="<https://www.youtube.com/watch?v=-UjXIK4Svb4>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cohort360.org/take-a-tour/the-query-builder.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
