thomas-rasmussen / sas_macros

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

calculate_cci: can grouping of codes be optimized? #57

Closed thomas-rasmussen closed 1 year ago

thomas-rasmussen commented 2 years ago

This does not seem efficient

https://github.com/thomas-rasmussen/sas_macros/blob/e606e7baf9937bdd0684e1bc7fb4adcb98006de5/calculate_cci.sas#L690-L699

Usually, CCI definitions does not have overlap in codes, so this could be done much more efficient using if-else statements. Even if the standard CCI definition has been overwritten with something where the are overlap in codes, this could be detected and the if-else statement altered to account for this?

thomas-rasmussen commented 2 years ago

Hmm could be optimized as described, but it is probably not going to lead to any notable improvement in performance in general, since most codes in diagnosis data on patients are not included in the CCI, ie we would have to go through all the if-else statements anyway. Unless the data has been precleaned, but the whole purpose of the macro is to avoid having to do stuff like that. Should maybe try to implement it anyways, it wouldn't hurt.

thomas-rasmussen commented 1 year ago

The amount of code that would have to be added to the macro to ensure that there is no overlap in codes, does not justify the potential of maybe gaining a little efficiency in uncommon scenarios.