You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Canonically ICD-10 and OPCS-4 codes are written with a dot between the 3rd and 4th characters e.g. A01.1.
However, in the data we currently have these dots are omitted and the equivalent code is written A011. (For example, see the apcs.all_procedures field.)
Our syntactic validation for these codes currently requires them in dotless format:
But it would be nicer if we accepted strings either with or without the dot and converted them to the dotless format at the point we cast them to a code type.
If ever we end up having data with the codes in the dotted format then we can make a new type which does the reverse (i.e. converts dotless to dotted). This would allow us to use the existing codelists with the new field without having to worry about arbitrary syntactic variation.
Canonically ICD-10 and OPCS-4 codes are written with a dot between the 3rd and 4th characters e.g.
A01.1
.However, in the data we currently have these dots are omitted and the equivalent code is written
A011
. (For example, see theapcs.all_procedures
field.)Our syntactic validation for these codes currently requires them in dotless format:
ehrql/ehrql/codes.py
Lines 91 to 111 in 784d011
But it would be nicer if we accepted strings either with or without the dot and converted them to the dotless format at the point we cast them to a code type.
If ever we end up having data with the codes in the dotted format then we can make a new type which does the reverse (i.e. converts dotless to dotted). This would allow us to use the existing codelists with the new field without having to worry about arbitrary syntactic variation.
Slack thread:
https://bennettoxford.slack.com/archives/C069YDR4NCA/p1734627474856169
The text was updated successfully, but these errors were encountered: