|
a |
|
b/docs/reference/features.md |
|
|
1 |
This reference is structured as a series of examples. |
|
|
2 |
|
|
|
3 |
The intended audience is primarily: |
|
|
4 |
|
|
|
5 |
* researchers |
|
|
6 |
* software developers |
|
|
7 |
|
|
|
8 |
that already have some understanding of how the ehrQL works. |
|
|
9 |
|
|
|
10 |
!!! info |
|
|
11 |
Please refer to the introduction and tutorial documentation sections |
|
|
12 |
if you need more explanation of the underlying concepts behind ehrQL. |
|
|
13 |
|
|
|
14 |
## How the examples work |
|
|
15 |
|
|
|
16 |
Each individual example demonstrates a specific ehrQL feature in isolation. |
|
|
17 |
|
|
|
18 |
Every example here consists of: |
|
|
19 |
|
|
|
20 |
1. Headings and subheadings that summarise the feature being demonstrated. |
|
|
21 |
2. A small example data input table containing entirely fictitious variables and values. |
|
|
22 |
* The table has a single-letter name referred to throughout the example |
|
|
23 |
* `e` for event-level table |
|
|
24 |
* `p` for patient-level table. |
|
|
25 |
* The columns of input tables use a name constructed from a single letter with a number |
|
|
26 |
to create an identifier — for example, `i1`. |
|
|
27 |
The single letter in the identifier refers to the column's data type: |
|
|
28 |
* a `b` column contains Boolean values |
|
|
29 |
* a `c` column contains electronic health record codes |
|
|
30 |
(the codes used in this reference are fictitious, for example: `abc`) |
|
|
31 |
* a `d` column contains dates |
|
|
32 |
* an `i` column contains integers |
|
|
33 |
* an `s` column contains strings |
|
|
34 |
* Both table and column names are written with code formatting throughout this reference. |
|
|
35 |
3. An ehrQL query that extracts some data from the example table. |
|
|
36 |
Like the table names, ehrQL queries are displayed here with code formatting. |
|
|
37 |
4. The resulting output from the ehrQL query, |
|
|
38 |
displayed as another table, |
|
|
39 |
to demonstrate the query's effect |
|
|
40 |
|
|
|
41 |
!!! note |
|
|
42 |
The examples here are automatically generated from [ehrQL's specification tests](https://github.com/opensafely-core/ehrql/tree/main/tests/spec). |
|
|
43 |
|
|
|
44 |
---8<-- 'includes/generated_docs/specs.md' |
|
|
45 |
|
|
|
46 |
!!! parent_snippet:'includes/glossary.md' |