Examples¶
Worked examples — end-to-end walkthroughs that take a real dataset and follow it from source files all the way to a populated OMOP CDM. The examples are deliberately the same shape: introduce the dataset, map one table at a time, accumulate techniques, then end with a "useful patterns" page that shows the corners of the language.
Examples are open-ended — this section is meant to grow over time as new mapping patterns prove worth writing up.
Currently in this section¶
Patterns¶
Self-contained recipes for the engine's flow-control features —
multi-result mappings, conditionals (If/Else/Switch), fallback
chains (||), and parallel collection (++). One feature per page;
each example is lifted from a real test in the repo's test suite.
Synthmas¶
A synthetic Massachusetts patient dataset (CSV files generated by Synthea). The Synthmas walkthrough is inherited from the v1.3 PDF and was the original "let's actually explain how to use the engine" content.
It walks through:
- Overview — the source schema, the target CDM, and the mapping plan.
- The location table — table mapping, multiple sources, normalisation, type mismatches, padding, and hard-coded fields.
- The person table — vocabulary maps with default-and-assert, date deconstruction, ID generation, and cross-table lookups.
- Useful patterns — vocabulary lookups, Usagi maps, conditional chaining.
Adding new examples¶
The Synthmas walkthrough is a template, not a ceiling. New examples
should follow the same structure — an index.md introducing the
dataset and the mapping plan, one page per CDM table that benefits
from a walkthrough, and a closing page on patterns that emerged.
When in doubt, mirror the Synthmas overview.