ncats / CTSA-Metrics

17 stars 16 forks source link

Uses temp tables, patient_dimension, updated paths #21

Closed jklann closed 2 years ago

jklann commented 3 years ago

Hello, I made some optimizations to the MSSQL CLICMetric. It is much faster at our site (Mass General Brigham), though my code modifications could also use a little cleanup. Feel free to use any of this code!

Mainly I changed it to use temp tables instead of CTEs, because this is much faster in MSSQL. I also created a version of the code that pulls demographics from patient_dimension instead of the fact table, which is needed in our configuration. Finally, I modified a couple of the high-level paths to match what we have in our installation. I think my changes match the latest ontology, but it also could be an anomaly, so you'd definitely want to check that before you accept the pull request.