Skip to content

Commit

Permalink
Merge pull request #2316 from opensafely-core/more-tutorial-tweaks
Browse files Browse the repository at this point in the history
More tutorial tweaks
  • Loading branch information
inglesp authored Dec 12, 2024
2 parents 675bcd7 + 997c5d0 commit c338f46
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/tutorial/building-a-dataset/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ show(dataset)

Note that it is essential that the dataset you create is given the name `dataset`.

> Question: what's the relationship between the number of rows in the dataset and the `on_register` series?
>
> Question: what happens if you try to set the dataset's population to something that is not a boolean patient series?
>
> Question: what happens if you try to set a dataset column to something that is not a patient series?
Expand Down
2 changes: 2 additions & 0 deletions docs/tutorial/using-ehrql-as-part-of-a-study/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ opensafely exec ehrql:v1 generate-dataset dataset_definition.py --dummy-tables d
You should see the terminal fill with a table of data in CSV format.
Scroll up to see the column headers, and notice the two columns from your dataset definition (`prt_or_mal` and `ace_or_arb`).

![A screenshot of the terminal in a Codespace](terminal.png)

> Question: what happens if you rename the `dataset` variable and run the `opensafely exec` command again?
??? tip "The anatomy of an OpenSAFELY command"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/tutorial/working-with-data-with-ehrql/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ This line opens the new window and shows you the contents of the patients table:
show(patients)
```

Notice that there is one row per patient, and each value in the `patient_id` column is unique.

> Question: What happens if you add `show(clinical_events)`?
Your task, when writing ehrQL, is to transform the data in these tables into a dataset.
Expand All @@ -45,6 +47,8 @@ A frame consists of multiple series of data.
Each series has a label and, depending on which frame the series was derived from, will be a _patient series_ or an _event series_.
For instance, a patient series is a column of a patient frame.

All frames have a `patient_id` series, and for a patient frame the values in this column will be unique.

All the values in a series must be of the same type (or null).
We call a series containing boolean (true or false) values a _boolean series_.

Expand Down

0 comments on commit c338f46

Please sign in to comment.