thomas-rasmussen / sas_macros

SAS macros
Creative Commons Zero v1.0 Universal
5 stars 4 forks source link

calculate_cci: modify regular expression determining code type #47

Closed thomas-rasmussen closed 2 years ago

thomas-rasmussen commented 2 years ago

https://github.com/thomas-rasmussen/sas_macros/blob/33000784a6990ba8f1756efc66d9926f12dc06ac/calculate_cci.sas#L695-L708

The regular expression works fine for the standard CCI definitions, but if a definition uses ICD-8 codes with letters, eg Yxxx codes, or ICD-10 (Danish extension of ICD-10) codes the regular expressions will fail. The regular expressions should be modified so that this edge case would not cause problems

thomas-rasmussen commented 2 years ago

This is actually a real problem when using standard DNPR diagnosis data, since the registry uses an augmented version of the ICD-10 codes with possible letter suffixes on the codes, which can't be handled correctly by the current regular expressions. This can easily be fixed by dropping removing the "$" part of the regular expressions?

thomas-rasmussen commented 2 years ago

There should also be some option to toggle on that basically says "ignore erroneous codes", so that data does not have to be pre-cleaned because of a few errors in the data?