Variables from codes - too many codes #701
-
I want to create variables from a codelist using the loop_over_codes function (https://docs.opensafely.org/study-def-tricks/#create-a-variable-for-each-code-in-a-codelist) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello @AlexOrlek, thanks for your question. You could use "parent" codes, as you describe in your question, which would require a hierarchical codelist. I'm not an expert in codelists, but are you comfortable converting between codelists of different types? Alternatively, you could split the codes across multiple study definitions. The study definitions would be similar; you could share common variables between them, to reduce error. When splitting the codes, you could group by "parent" codes, which would require a hierarchical codelist. Alternatively, you could create groups of arbitrary size (e.g. 100 codes). |
Beta Was this translation helpful? Give feedback.
Hello @AlexOrlek, thanks for your question.
You could use "parent" codes, as you describe in your question, which would require a hierarchical codelist. I'm not an expert in codelists, but are you comfortable converting between codelists of different types?
Alternatively, you could split the codes across multiple study definitions. The study definitions would be similar; you could share common variables between them, to reduce error. When splitting the codes, you could group by "parent" codes, which would require a hierarchical codelist. Alternatively, you could create groups of arbitrary size (e.g. 100 codes).