opensafely-core / ehrql

ehrQL: the electronic health record query language for OpenSAFELY
https://docs.opensafely.org/ehrql/
Other
7 stars 3 forks source link

Automatically link from each table's reference docs to example docs for that table #2210

Open evansd opened 2 weeks ago

evansd commented 2 weeks ago

This would require adding some more structure to our documented examples so that we can automatically determine which examples use which tables. We've already talked about breaking up the examples page in some fashion anyway.

@rw251 has pointed out that, as a new ehrQL user, it's possible to find your way to the docs for a particular table and then get stuck because you don't know what sort of things you can do with that table. The existing examples are helpful, but only if know where to go looking for them. Adding direct breadcrumbs from the table docs to the examples for that table would not only prevent this dead end, but would also help surface the existence of the examples more generally.

This is an interesting "regression" from Cohort Extractor in that because Cohort Extractor was so limited and non-composable, each table's documentation came bundled with a fixed set of "things you can do with this table". Possibly this accounts for the impression we've sometimes seen that ehrQL is less approachable than Cohort Extractor.

It also occurs to me that it might be good to separate out examples of general query patterns in ehrQL (which apply to any table) from examples specific to a give table (or tables). At the top of each section of table-specific examples we could link to the more general examples.

madwort commented 1 week ago

after discussing with @inglesp , decided to try adding manual links from the table reference pages to the examples - we have automated link checking that should check if they go stale. also, the examples page has not substantially changed in the last year & I don't think we expect it to the change in the coming year.