Following #2003 we now have a copy of the data dictionary included in the test suite. We should come up with some scheme for either automatically generating, or at least automatically checking, these CASE expressions against the contents of the dictionary.
There are various places in the TPP backend where we map internal codes to meaningful labels. For example: https://github.com/opensafely-core/ehrql/blob/dea0c837e57063f2e633aae0d36309a2eebef1ce/ehrql/backends/tpp.py#L234-L250
Following #2003 we now have a copy of the data dictionary included in the test suite. We should come up with some scheme for either automatically generating, or at least automatically checking, these CASE expressions against the contents of the dictionary.