├── CC_Package_27v0 ├── Preparation Checklist - Chronic Conditions Package.docx ├── User Guide - Chronic Conditions Package.docx ├── csv_input │ ├── CC_Codes.csv │ ├── CC_Desc.csv │ └── CC_Exclude.csv ├── data │ ├── cc_codes_original.sas7bdat │ ├── cc_desc_original.sas7bdat │ └── cc_exclude_original.sas7bdat ├── documentation │ ├── README.txt │ ├── ccw_conditioncategories2010.pdf │ ├── ccw_conditioncategories2012.pdf │ └── ccw_conditioncategories2017.pdf └── programs │ ├── contenr.sas │ ├── idcond.sas │ ├── identify_conditions.sas │ ├── input_program.sas │ └── readin_input_files.sas ├── CC_Package_27v1 ├── Preparation Checklist - Chronic Conditions Package.docx ├── User Guide - Chronic Conditions Package.docx ├── csv_input │ ├── CC_Codes.csv │ ├── CC_Desc.csv │ └── CC_Exclude.csv ├── data │ ├── cc_codes_original.sas7bdat │ ├── cc_desc_original.sas7bdat │ └── cc_exclude_original.sas7bdat ├── documentation │ ├── README.txt │ ├── ccw_conditioncategories2010.pdf │ ├── ccw_conditioncategories2012.pdf │ ├── ccw_conditioncategories2017.pdf │ └── chr-chronic-condition-algorithms2022.pdf └── programs │ ├── contenr.sas │ ├── idcond.sas │ ├── identify_conditions.sas │ ├── input_program.sas │ └── readin_input_files.sas ├── CC_Package_30v0 ├── Preparation Checklist - Chronic Conditions Package.docx ├── User Guide - Chronic Conditions Package.docx ├── csv_input │ ├── CC_Codes.csv │ ├── CC_Desc.csv │ └── CC_Exclude.csv ├── data │ ├── cc_codes_original.sas7bdat │ ├── cc_desc_original.sas7bdat │ └── cc_exclude_original.sas7bdat ├── documentation │ ├── README.txt │ ├── ccw_27conditioncategories2010.pdf │ ├── ccw_27conditioncategories2012.pdf │ ├── ccw_27conditioncategories2017.pdf │ └── ccw_27conditioncategories2022.pdf └── programs │ ├── contenr.sas │ ├── idcond.sas │ ├── identify_conditions.sas │ ├── input_program.sas │ └── readin_input_files.sas └── README.md /CC_Package_27v0/Preparation Checklist - Chronic Conditions Package.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_27v0/Preparation Checklist - Chronic Conditions Package.docx -------------------------------------------------------------------------------- /CC_Package_27v0/User Guide - Chronic Conditions Package.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_27v0/User Guide - Chronic Conditions Package.docx -------------------------------------------------------------------------------- /CC_Package_27v0/csv_input/CC_Desc.csv: -------------------------------------------------------------------------------- 1 | Condition,Condition_long,Claim_type1,Num_dx1,Claim_type2,Num_dx2,Min_Days_Apart,Max_Days_apart,Ref_months,Source 2 | HYPOTH,Acquired Hypothyroidism,"IP,SNF,HHA",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 3 | ALZH,Alzheimer's Disease,"IP,SNF,HHA,OP,CAR",1,,,1,,36,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 4 | ALZHDMT,Alzheimer's Disease and Related Disorders or Senile Dementia,"IP,SNF,HHA,OP,CAR",1,,,1,,36,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 5 | ATRIALF,Atrial Fibrillation,IP,1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 6 | AMI,Acute Myocardial Infarction,IP,1,,,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 7 | ASTHMA,Asthma,"IP,SNF,HHA",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 8 | CNCRBRST,Female Breast Cancer,"IP,SNF",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 9 | CATARACT,Cataract,"OP,CAR",1,,,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 10 | CHRNKDN,Chronic Kidney Disease,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 11 | COPD,Chronic Obstructive Pulmonary Disease,"IP,SNF,HHA",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 12 | CNCRCLR,Colorectal Cancer,"IP,SNF",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 13 | DEPRESSN,Depression,"IP,SNF,HHA,OP,CAR",1,,,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 14 | DIABETES,Diabetes,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 15 | CNCREND,Endometrial Cancer,"IP,SNF",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 16 | GLAUCOMA,Glaucoma,CAR,1,,,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 17 | CHF,Heart Failure,"IP,OP,CAR",1,,,1,,24,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 18 | HIPFRAC,Hip/Pelvic Fracture,"IP,SNF",1,,,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 19 | HYPERL,Hyperlipedemia,"IP,SNF,HHA",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 20 | HYPERT,Hypertension,"IP,SNF,HHA",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 21 | ISCHMCHT,Ischemic Heart Disease,"IP,SNF,HHA,OP,CAR",1,,,1,,24,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 22 | CNCRLNG,Lung Cancer,"IP,SNF",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 23 | OSTEOPRS,Osteoporosis,"IP,SNF,HHA",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 24 | CNCRPRST,Prostate Cancer,"IP,SNF",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 25 | RAOA,Rheumatoid Arthritis/Osteoarthritis,"IP,SNF,HHA,OP,CAR",2,,,1,,24,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 26 | STRKETIA,Stroke/Transient Ischemic Attack,IP,1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 27 | ANEMIA,Anemia,"IP,SNF,HHA,OP,CAR",1,,,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 28 | HYPERP,Benign Prostatic Hyperplasia,"IP,SNF,HHA",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Aug. 2017) 29 | -------------------------------------------------------------------------------- /CC_Package_27v0/csv_input/CC_Exclude.csv: -------------------------------------------------------------------------------- 1 | Condition,CodeType,DxCode,DxCodeLocation 2 | STRKETIA,ICD9DX,800,ANY 3 | STRKETIA,ICD9DX,800.1,ANY 4 | STRKETIA,ICD9DX,800.2,ANY 5 | STRKETIA,ICD9DX,800.3,ANY 6 | STRKETIA,ICD9DX,800.4,ANY 7 | STRKETIA,ICD9DX,800.5,ANY 8 | STRKETIA,ICD9DX,800.6,ANY 9 | STRKETIA,ICD9DX,800.7,ANY 10 | STRKETIA,ICD9DX,800.8,ANY 11 | STRKETIA,ICD9DX,800.9,ANY 12 | STRKETIA,ICD9DX,801,ANY 13 | STRKETIA,ICD9DX,801,ANY 14 | STRKETIA,ICD9DX,801.1,ANY 15 | STRKETIA,ICD9DX,801.2,ANY 16 | STRKETIA,ICD9DX,801.3,ANY 17 | STRKETIA,ICD9DX,801.4,ANY 18 | STRKETIA,ICD9DX,801.5,ANY 19 | STRKETIA,ICD9DX,801.6,ANY 20 | STRKETIA,ICD9DX,801.7,ANY 21 | STRKETIA,ICD9DX,801.8,ANY 22 | STRKETIA,ICD9DX,801.9,ANY 23 | STRKETIA,ICD9DX,802,ANY 24 | STRKETIA,ICD9DX,802,ANY 25 | STRKETIA,ICD9DX,802.1,ANY 26 | STRKETIA,ICD9DX,802.2,ANY 27 | STRKETIA,ICD9DX,802.2,ANY 28 | STRKETIA,ICD9DX,802.21,ANY 29 | STRKETIA,ICD9DX,802.23,ANY 30 | STRKETIA,ICD9DX,802.24,ANY 31 | STRKETIA,ICD9DX,802.25,ANY 32 | STRKETIA,ICD9DX,802.26,ANY 33 | STRKETIA,ICD9DX,802.27,ANY 34 | STRKETIA,ICD9DX,802.28,ANY 35 | STRKETIA,ICD9DX,802.29,ANY 36 | STRKETIA,ICD9DX,802.3,ANY 37 | STRKETIA,ICD9DX,802.3,ANY 38 | STRKETIA,ICD9DX,802.31,ANY 39 | STRKETIA,ICD9DX,802.32,ANY 40 | STRKETIA,ICD9DX,802.33,ANY 41 | STRKETIA,ICD9DX,802.34,ANY 42 | STRKETIA,ICD9DX,802.35,ANY 43 | STRKETIA,ICD9DX,802.36,ANY 44 | STRKETIA,ICD9DX,802.37,ANY 45 | STRKETIA,ICD9DX,802.38,ANY 46 | STRKETIA,ICD9DX,802.39,ANY 47 | STRKETIA,ICD9DX,802.4,ANY 48 | STRKETIA,ICD9DX,802.5,ANY 49 | STRKETIA,ICD9DX,802.6,ANY 50 | STRKETIA,ICD9DX,802.7,ANY 51 | STRKETIA,ICD9DX,802.8,ANY 52 | STRKETIA,ICD9DX,803,ANY 53 | STRKETIA,ICD9DX,803,ANY 54 | STRKETIA,ICD9DX,803.1,ANY 55 | STRKETIA,ICD9DX,803.2,ANY 56 | STRKETIA,ICD9DX,803.3,ANY 57 | STRKETIA,ICD9DX,803.4,ANY 58 | STRKETIA,ICD9DX,803.5,ANY 59 | STRKETIA,ICD9DX,803.6,ANY 60 | STRKETIA,ICD9DX,803.7,ANY 61 | STRKETIA,ICD9DX,803.8,ANY 62 | STRKETIA,ICD9DX,803.9,ANY 63 | STRKETIA,ICD9DX,804,ANY 64 | STRKETIA,ICD9DX,804,ANY 65 | STRKETIA,ICD9DX,804.1,ANY 66 | STRKETIA,ICD9DX,804.2,ANY 67 | STRKETIA,ICD9DX,804.3,ANY 68 | STRKETIA,ICD9DX,804.4,ANY 69 | STRKETIA,ICD9DX,804.5,ANY 70 | STRKETIA,ICD9DX,804.6,ANY 71 | STRKETIA,ICD9DX,804.7,ANY 72 | STRKETIA,ICD9DX,804.8,ANY 73 | STRKETIA,ICD9DX,804.9,ANY 74 | STRKETIA,ICD9DX,V57,DX1 75 | STRKETIA,ICD9DX,V57.0,DX1 76 | STRKETIA,ICD9DX,V57.1,DX1 77 | STRKETIA,ICD9DX,V57.2,DX1 78 | STRKETIA,ICD9DX,V57.3,DX1 79 | STRKETIA,ICD9DX,V57.4,DX1 80 | STRKETIA,ICD9DX,V57.9,DX1 81 | STRKETIA,ICD9DX,V57.9,DX1 82 | STRKETIA,ICD9DX,850,ANY 83 | STRKETIA,ICD9DX,850,ANY 84 | STRKETIA,ICD9DX,850.1,ANY 85 | STRKETIA,ICD9DX,850.2,ANY 86 | STRKETIA,ICD9DX,850.3,ANY 87 | STRKETIA,ICD9DX,850.4,ANY 88 | STRKETIA,ICD9DX,850.5,ANY 89 | STRKETIA,ICD9DX,850.9,ANY 90 | STRKETIA,ICD9DX,851,ANY 91 | STRKETIA,ICD9DX,851,ANY 92 | STRKETIA,ICD9DX,851.1,ANY 93 | STRKETIA,ICD9DX,851.2,ANY 94 | STRKETIA,ICD9DX,851.3,ANY 95 | STRKETIA,ICD9DX,851.4,ANY 96 | STRKETIA,ICD9DX,851.5,ANY 97 | STRKETIA,ICD9DX,851.6,ANY 98 | STRKETIA,ICD9DX,851.7,ANY 99 | STRKETIA,ICD9DX,851.8,ANY 100 | STRKETIA,ICD9DX,851.9,ANY 101 | STRKETIA,ICD9DX,852,ANY 102 | STRKETIA,ICD9DX,852,ANY 103 | STRKETIA,ICD9DX,852.1,ANY 104 | STRKETIA,ICD9DX,852.2,ANY 105 | STRKETIA,ICD9DX,852.3,ANY 106 | STRKETIA,ICD9DX,852.4,ANY 107 | STRKETIA,ICD9DX,852.5,ANY 108 | STRKETIA,ICD9DX,853,ANY 109 | STRKETIA,ICD9DX,853,ANY 110 | STRKETIA,ICD9DX,853.1,ANY 111 | STRKETIA,ICD9DX,854,ANY 112 | STRKETIA,ICD9DX,854,ANY 113 | STRKETIA,ICD9DX,854.1,ANY 114 | HYPERP,ICD9DX,222.2,ANY 115 | HYPERP,ICD10DX,D29.1,ANY 116 | STRKETIA,ICD10DX,S02.0XXA,ANY 117 | STRKETIA,ICD10DX,S02.0XXB,ANY 118 | STRKETIA,ICD10DX,S02.10XA,ANY 119 | STRKETIA,ICD10DX,S02.10XB,ANY 120 | STRKETIA,ICD10DX,S02.110A,ANY 121 | STRKETIA,ICD10DX,S02.111A,ANY 122 | STRKETIA,ICD10DX,S02.112A,ANY 123 | STRKETIA,ICD10DX,S02.113A,ANY 124 | STRKETIA,ICD10DX,S02.110B,ANY 125 | STRKETIA,ICD10DX,S02.110D,ANY 126 | STRKETIA,ICD10DX,S02.110G,ANY 127 | STRKETIA,ICD10DX,S02.110K,ANY 128 | STRKETIA,ICD10DX,S02.110S,ANY 129 | STRKETIA,ICD10DX,S02.111A,ANY 130 | STRKETIA,ICD10DX,S02.111B,ANY 131 | STRKETIA,ICD10DX,S02.112B,ANY 132 | STRKETIA,ICD10DX,S02.113B,ANY 133 | STRKETIA,ICD10DX,S02.118A,ANY 134 | STRKETIA,ICD10DX,S02.118B,ANY 135 | STRKETIA,ICD10DX,S02.119A,ANY 136 | STRKETIA,ICD10DX,S02.119B,ANY 137 | STRKETIA,ICD10DX,S02.19XA,ANY 138 | STRKETIA,ICD10DX,S02.19XB,ANY 139 | STRKETIA,ICD10DX,S02.2XXA,ANY 140 | STRKETIA,ICD10DX,S02.2XXB,ANY 141 | STRKETIA,ICD10DX,S02.3XXA,ANY 142 | STRKETIA,ICD10DX,S02.3XXB,ANY 143 | STRKETIA,ICD10DX,S02.400A,ANY 144 | STRKETIA,ICD10DX,S02.401A,ANY 145 | STRKETIA,ICD10DX,S02.402A,ANY 146 | STRKETIA,ICD10DX,S02.400B,ANY 147 | STRKETIA,ICD10DX,S02.401B,ANY 148 | STRKETIA,ICD10DX,S02.402B,ANY 149 | STRKETIA,ICD10DX,S02.411A,ANY 150 | STRKETIA,ICD10DX,S02.412A,ANY 151 | STRKETIA,ICD10DX,S02.413A,ANY 152 | STRKETIA,ICD10DX,S02.411B,ANY 153 | STRKETIA,ICD10DX,S02.412B,ANY 154 | STRKETIA,ICD10DX,S02.413B,ANY 155 | STRKETIA,ICD10DX,S02.42XA,ANY 156 | STRKETIA,ICD10DX,S02.42XB,ANY 157 | STRKETIA,ICD10DX,S02.600A,ANY 158 | STRKETIA,ICD10DX,S02.600B,ANY 159 | STRKETIA,ICD10DX,S02.609A,ANY 160 | STRKETIA,ICD10DX,S02.609B,ANY 161 | STRKETIA,ICD10DX,S02.61XA,ANY 162 | STRKETIA,ICD10DX,S02.62XA,ANY 163 | STRKETIA,ICD10DX,S02.63XA,ANY 164 | STRKETIA,ICD10DX,S02.64XA,ANY 165 | STRKETIA,ICD10DX,S02.65XA,ANY 166 | STRKETIA,ICD10DX,S02.66XA,ANY 167 | STRKETIA,ICD10DX,S02.67XA,ANY 168 | STRKETIA,ICD10DX,S02.69XA,ANY 169 | STRKETIA,ICD10DX,S02.61XB,ANY 170 | STRKETIA,ICD10DX,S02.62XA,ANY 171 | STRKETIA,ICD10DX,S02.63XA,ANY 172 | STRKETIA,ICD10DX,S02.64XA,ANY 173 | STRKETIA,ICD10DX,S02.65XA,ANY 174 | STRKETIA,ICD10DX,S02.66XA,ANY 175 | STRKETIA,ICD10DX,S02.67XB,ANY 176 | STRKETIA,ICD10DX,S02.69XB,ANY 177 | STRKETIA,ICD10DX,S02.8XXA,ANY 178 | STRKETIA,ICD10DX,S02.8XXB,ANY 179 | STRKETIA,ICD10DX,S02.91XA,ANY 180 | STRKETIA,ICD10DX,S02.91XB,ANY 181 | STRKETIA,ICD10DX,S02.92XA,ANY 182 | STRKETIA,ICD10DX,S02.92XB,ANY 183 | STRKETIA,ICD10DX,S06.0X0A,ANY 184 | STRKETIA,ICD10DX,S06.0X1A,ANY 185 | STRKETIA,ICD10DX,S06.0X2A,ANY 186 | STRKETIA,ICD10DX,S06.0X3A,ANY 187 | STRKETIA,ICD10DX,S06.0X4A,ANY 188 | STRKETIA,ICD10DX,S06.0X5A,ANY 189 | STRKETIA,ICD10DX,S06.0X6A,ANY 190 | STRKETIA,ICD10DX,S06.0X7A,ANY 191 | STRKETIA,ICD10DX,S06.0X8A,ANY 192 | STRKETIA,ICD10DX,S06.0X9A,ANY 193 | STRKETIA,ICD10DX,S06.1X0A,ANY 194 | STRKETIA,ICD10DX,S06.1X1A,ANY 195 | STRKETIA,ICD10DX,S06.1X2A,ANY 196 | STRKETIA,ICD10DX,S06.1X3A,ANY 197 | STRKETIA,ICD10DX,S06.1X4A,ANY 198 | STRKETIA,ICD10DX,S06.1X5A,ANY 199 | STRKETIA,ICD10DX,S06.1X6A,ANY 200 | STRKETIA,ICD10DX,S06.1X7A,ANY 201 | STRKETIA,ICD10DX,S06.1X8A,ANY 202 | STRKETIA,ICD10DX,S06.1X9A,ANY 203 | STRKETIA,ICD10DX,S06.2X0A,ANY 204 | STRKETIA,ICD10DX,S06.2X1A,ANY 205 | STRKETIA,ICD10DX,S06.2X2A,ANY 206 | STRKETIA,ICD10DX,S06.2X3A,ANY 207 | STRKETIA,ICD10DX,S06.2X4A,ANY 208 | STRKETIA,ICD10DX,S06.2X5A,ANY 209 | STRKETIA,ICD10DX,S06.2X6A,ANY 210 | STRKETIA,ICD10DX,S06.2X7A,ANY 211 | STRKETIA,ICD10DX,S06.2X8A,ANY 212 | STRKETIA,ICD10DX,S06.2X9A,ANY 213 | STRKETIA,ICD10DX,S06.2X0B,ANY 214 | STRKETIA,ICD10DX,S06.2X1B,ANY 215 | STRKETIA,ICD10DX,S06.2X2B,ANY 216 | STRKETIA,ICD10DX,S06.2X3B,ANY 217 | STRKETIA,ICD10DX,S06.2X4B,ANY 218 | STRKETIA,ICD10DX,S06.2X5B,ANY 219 | STRKETIA,ICD10DX,S06.2X6B,ANY 220 | STRKETIA,ICD10DX,S06.2X7B,ANY 221 | STRKETIA,ICD10DX,S06.2X8B,ANY 222 | STRKETIA,ICD10DX,S06.2X9B,ANY 223 | STRKETIA,ICD10DX,S06.300A,ANY 224 | STRKETIA,ICD10DX,S06.301A,ANY 225 | STRKETIA,ICD10DX,S06.302A,ANY 226 | STRKETIA,ICD10DX,S06.303A,ANY 227 | STRKETIA,ICD10DX,S06.304A,ANY 228 | STRKETIA,ICD10DX,S06.305A,ANY 229 | STRKETIA,ICD10DX,S06.306A,ANY 230 | STRKETIA,ICD10DX,S06.307A,ANY 231 | STRKETIA,ICD10DX,S06.308A,ANY 232 | STRKETIA,ICD10DX,S06.309A,ANY 233 | STRKETIA,ICD10DX,S06.310A,ANY 234 | STRKETIA,ICD10DX,S06.311A,ANY 235 | STRKETIA,ICD10DX,S06.312A,ANY 236 | STRKETIA,ICD10DX,S06.313A,ANY 237 | STRKETIA,ICD10DX,S06.314A,ANY 238 | STRKETIA,ICD10DX,S06.315A,ANY 239 | STRKETIA,ICD10DX,S06.316A,ANY 240 | STRKETIA,ICD10DX,S06.317A,ANY 241 | STRKETIA,ICD10DX,S06.318A,ANY 242 | STRKETIA,ICD10DX,S06.319A,ANY 243 | STRKETIA,ICD10DX,S06.320A,ANY 244 | STRKETIA,ICD10DX,S06.321A,ANY 245 | STRKETIA,ICD10DX,S06.322A,ANY 246 | STRKETIA,ICD10DX,S06.323A,ANY 247 | STRKETIA,ICD10DX,S06.324A,ANY 248 | STRKETIA,ICD10DX,S06.325A,ANY 249 | STRKETIA,ICD10DX,S06.326A,ANY 250 | STRKETIA,ICD10DX,S06.327A,ANY 251 | STRKETIA,ICD10DX,S06.328A,ANY 252 | STRKETIA,ICD10DX,S06.329A,ANY 253 | STRKETIA,ICD10DX,S06.330A,ANY 254 | STRKETIA,ICD10DX,S06.331A,ANY 255 | STRKETIA,ICD10DX,S06.332A,ANY 256 | STRKETIA,ICD10DX,S06.333A,ANY 257 | STRKETIA,ICD10DX,S06.334A,ANY 258 | STRKETIA,ICD10DX,S06.335A,ANY 259 | STRKETIA,ICD10DX,S06.336A,ANY 260 | STRKETIA,ICD10DX,S06.337A,ANY 261 | STRKETIA,ICD10DX,S06.338A,ANY 262 | STRKETIA,ICD10DX,S06.339A,ANY 263 | STRKETIA,ICD10DX,S06.340A,ANY 264 | STRKETIA,ICD10DX,S06.341A,ANY 265 | STRKETIA,ICD10DX,S06.342A,ANY 266 | STRKETIA,ICD10DX,S06.343A,ANY 267 | STRKETIA,ICD10DX,S06.344A,ANY 268 | STRKETIA,ICD10DX,S06.345A,ANY 269 | STRKETIA,ICD10DX,S06.346A,ANY 270 | STRKETIA,ICD10DX,S06.347A,ANY 271 | STRKETIA,ICD10DX,S06.348A,ANY 272 | STRKETIA,ICD10DX,S06.349A,ANY 273 | STRKETIA,ICD10DX,S06.350A,ANY 274 | STRKETIA,ICD10DX,S06.351A,ANY 275 | STRKETIA,ICD10DX,S06.352A,ANY 276 | STRKETIA,ICD10DX,S06.353A,ANY 277 | STRKETIA,ICD10DX,S06.354A,ANY 278 | STRKETIA,ICD10DX,S06.355A,ANY 279 | STRKETIA,ICD10DX,S06.356A,ANY 280 | STRKETIA,ICD10DX,S06.357A,ANY 281 | STRKETIA,ICD10DX,S06.358A,ANY 282 | STRKETIA,ICD10DX,S06.359A,ANY 283 | STRKETIA,ICD10DX,S06.360A,ANY 284 | STRKETIA,ICD10DX,S06.361A,ANY 285 | STRKETIA,ICD10DX,S06.362A,ANY 286 | STRKETIA,ICD10DX,S06.363A,ANY 287 | STRKETIA,ICD10DX,S06.364A,ANY 288 | STRKETIA,ICD10DX,S06.365A,ANY 289 | STRKETIA,ICD10DX,S06.366A,ANY 290 | STRKETIA,ICD10DX,S06.367A,ANY 291 | STRKETIA,ICD10DX,S06.368A,ANY 292 | STRKETIA,ICD10DX,S06.369A,ANY 293 | STRKETIA,ICD10DX,S06.370A,ANY 294 | STRKETIA,ICD10DX,S06.371A,ANY 295 | STRKETIA,ICD10DX,S06.372A,ANY 296 | STRKETIA,ICD10DX,S06.373A,ANY 297 | STRKETIA,ICD10DX,S06.374A,ANY 298 | STRKETIA,ICD10DX,S06.375A,ANY 299 | STRKETIA,ICD10DX,S06.376A,ANY 300 | STRKETIA,ICD10DX,S06.377A,ANY 301 | STRKETIA,ICD10DX,S06.378A,ANY 302 | STRKETIA,ICD10DX,S06.379A,ANY 303 | STRKETIA,ICD10DX,S06.380A,ANY 304 | STRKETIA,ICD10DX,S06.381A,ANY 305 | STRKETIA,ICD10DX,S06.382A,ANY 306 | STRKETIA,ICD10DX,S06.383A,ANY 307 | STRKETIA,ICD10DX,S06.384A,ANY 308 | STRKETIA,ICD10DX,S06.385A,ANY 309 | STRKETIA,ICD10DX,S06.386A,ANY 310 | STRKETIA,ICD10DX,S06.387A,ANY 311 | STRKETIA,ICD10DX,S06.388A,ANY 312 | STRKETIA,ICD10DX,S06.389A,ANY 313 | STRKETIA,ICD10DX,S06.4X0A,ANY 314 | STRKETIA,ICD10DX,S06.4X1A,ANY 315 | STRKETIA,ICD10DX,S06.4X2A,ANY 316 | STRKETIA,ICD10DX,S06.4X3A,ANY 317 | STRKETIA,ICD10DX,S06.4X4A,ANY 318 | STRKETIA,ICD10DX,S06.4X5A,ANY 319 | STRKETIA,ICD10DX,S06.4X6A,ANY 320 | STRKETIA,ICD10DX,S06.4X7A,ANY 321 | STRKETIA,ICD10DX,S06.4X8A,ANY 322 | STRKETIA,ICD10DX,S06.4X9A,ANY 323 | STRKETIA,ICD10DX,S06.5X0A,ANY 324 | STRKETIA,ICD10DX,S06.5X1A,ANY 325 | STRKETIA,ICD10DX,S06.5X2A,ANY 326 | STRKETIA,ICD10DX,S06.5X3A,ANY 327 | STRKETIA,ICD10DX,S06.5X4A,ANY 328 | STRKETIA,ICD10DX,S06.5X5A,ANY 329 | STRKETIA,ICD10DX,S06.5X6A,ANY 330 | STRKETIA,ICD10DX,S06.5X7A,ANY 331 | STRKETIA,ICD10DX,S06.5X8A,ANY 332 | STRKETIA,ICD10DX,S06.5X9A,ANY 333 | STRKETIA,ICD10DX,S06.6X0A,ANY 334 | STRKETIA,ICD10DX,S06.6X1A,ANY 335 | STRKETIA,ICD10DX,S06.6X2A,ANY 336 | STRKETIA,ICD10DX,S06.6X3A,ANY 337 | STRKETIA,ICD10DX,S06.6X4A,ANY 338 | STRKETIA,ICD10DX,S06.6X5A,ANY 339 | STRKETIA,ICD10DX,S06.6X6A,ANY 340 | STRKETIA,ICD10DX,S06.6X7A,ANY 341 | STRKETIA,ICD10DX,S06.6X8A,ANY 342 | STRKETIA,ICD10DX,S06.6X9A,ANY 343 | STRKETIA,ICD10DX,S06.810A,ANY 344 | STRKETIA,ICD10DX,S06.811A,ANY 345 | STRKETIA,ICD10DX,S06.812A,ANY 346 | STRKETIA,ICD10DX,S06.813A,ANY 347 | STRKETIA,ICD10DX,S06.814A,ANY 348 | STRKETIA,ICD10DX,S06.815A,ANY 349 | STRKETIA,ICD10DX,S06.816A,ANY 350 | STRKETIA,ICD10DX,S06.817A,ANY 351 | STRKETIA,ICD10DX,S06.818A,ANY 352 | STRKETIA,ICD10DX,S06.819A,ANY 353 | STRKETIA,ICD10DX,S06.820A,ANY 354 | STRKETIA,ICD10DX,S06.821A,ANY 355 | STRKETIA,ICD10DX,S06.822A,ANY 356 | STRKETIA,ICD10DX,S06.823A,ANY 357 | STRKETIA,ICD10DX,S06.824A,ANY 358 | STRKETIA,ICD10DX,S06.825A,ANY 359 | STRKETIA,ICD10DX,S06.826A,ANY 360 | STRKETIA,ICD10DX,S06.827A,ANY 361 | STRKETIA,ICD10DX,S06.828A,ANY 362 | STRKETIA,ICD10DX,S06.829A,ANY 363 | STRKETIA,ICD10DX,S06.890A,ANY 364 | STRKETIA,ICD10DX,S06.891A,ANY 365 | STRKETIA,ICD10DX,S06.892A,ANY 366 | STRKETIA,ICD10DX,S06.893A,ANY 367 | STRKETIA,ICD10DX,S06.894A,ANY 368 | STRKETIA,ICD10DX,S06.895A,ANY 369 | STRKETIA,ICD10DX,S06.896A,ANY 370 | STRKETIA,ICD10DX,S06.897A,ANY 371 | STRKETIA,ICD10DX,S06.898A,ANY 372 | STRKETIA,ICD10DX,S06.899A,ANY 373 | STRKETIA,ICD10DX,S06.9X0A,ANY 374 | STRKETIA,ICD10DX,S06.9X1A,ANY 375 | STRKETIA,ICD10DX,S06.9X2A,ANY 376 | STRKETIA,ICD10DX,S06.9X3A,ANY 377 | STRKETIA,ICD10DX,S06.9X4A,ANY 378 | STRKETIA,ICD10DX,S06.9X5A,ANY 379 | STRKETIA,ICD10DX,S06.9X6A,ANY 380 | STRKETIA,ICD10DX,S06.9X7A,ANY 381 | STRKETIA,ICD10DX,S06.9X8A,ANY 382 | STRKETIA,ICD10DX,S06.9X9A,ANY 383 | STRKETIA,ICD10DX,Z51.89,DX1 384 | -------------------------------------------------------------------------------- /CC_Package_27v0/data/cc_codes_original.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_27v0/data/cc_codes_original.sas7bdat -------------------------------------------------------------------------------- /CC_Package_27v0/data/cc_desc_original.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_27v0/data/cc_desc_original.sas7bdat -------------------------------------------------------------------------------- /CC_Package_27v0/data/cc_exclude_original.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_27v0/data/cc_exclude_original.sas7bdat -------------------------------------------------------------------------------- /CC_Package_27v0/documentation/README.txt: -------------------------------------------------------------------------------- 1 | These are archived versions of the CCW condition categories. The algorithm is based off of the codes in the most recent version from 2017. -------------------------------------------------------------------------------- /CC_Package_27v0/documentation/ccw_conditioncategories2010.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_27v0/documentation/ccw_conditioncategories2010.pdf -------------------------------------------------------------------------------- /CC_Package_27v0/documentation/ccw_conditioncategories2012.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_27v0/documentation/ccw_conditioncategories2012.pdf -------------------------------------------------------------------------------- /CC_Package_27v0/documentation/ccw_conditioncategories2017.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_27v0/documentation/ccw_conditioncategories2017.pdf -------------------------------------------------------------------------------- /CC_Package_27v0/programs/contenr.sas: -------------------------------------------------------------------------------- 1 | /************************************************************************************************************************* 2 | ***** MACRO: contenr 3 | 4 | ***** DESCRIPTION: This macro identifies length of continous enrollment (in months) for all beneficiaries included in an input dateset 5 | at any point in time. The macro generates a set of yearly files with one entry for each beneficiary and 24 columns, 6 | two for each month, identifying number of months of continous enrolment from one particular month on, and up to a 7 | particular month (including the reference month). 8 | 9 | ***** ARGUMENTS 10 | 11 | - begyr: first year of data, to begin the enrollment count 12 | - endyr: last year of data, to end the enrollment count 13 | - shape: Shape of the source data. The macro allows for two different type of source data, A (annual files) and P (period file). 14 | See below for description of input files. 15 | - filein: Root name of the source file in the case of the annual files (A) or the full name for the period file (P) 16 | (E.g. if shape=A and filein=enr, the actual files are enrYYYY or enrQQYYYY or enrMMYYYY. 17 | If the file is permanently stored, the libname can be included - libname.enr). 18 | - fileout: Root name for the output file that will be generated by the macro - one file per year 19 | - id: Beneficiary identification number. 20 | - var: In the case of the annual files (A), this is the name of the flag identifying the type of enrollment we want to count (e.g. ffs, PDP). 21 | In the case of the period files (P) it can be any string. 22 | The string passed under var is used to name the set of variables counting months of continous enrollment. 23 | 24 | 25 | **** Source file description - there are two possible formats for the input dataset, annual files with monthly entries (A), single period file 26 | with beneficiary entries per each unique period of continous enrollment (P). Note that multipe entries per beneficiary are allowed in P. 27 | Type A file variables: 28 | - id, with the beneficiary unique identification number (any name) 29 | - "date", with the current month in SAS date format (set to the first day of the month) 30 | - var, an indicator (0/1) variable, with a flag for enrollment 31 | 32 | Type B file variables: 33 | - id, with the beneficiary unique identification number (any name) 34 | - "begdt", with the starting month of current enrollment period in SAS date format (set to the first day of the month) 35 | - "enddt", with the ending month of current enrollment period in SAS date format (set to the first day of the month) 36 | 37 | **** Output file description: There is one file per year, with one entry for each beneficiary in the source file that was enrolled in the 38 | plan at least one month within the year. 39 | 40 | **** NEED TO ADD THE DESCRIPTION OF THE FILE **** 41 | 42 | *************************************************************************************************************************/ 43 | 44 | 45 | %macro contenr(begyr,endyr,shape, filein, fileout, id, var); 46 | 47 | ****************************************************************; 48 | ****** Shape long monthly enrollment file as a period file; 49 | %if &shape=A %then %do; 50 | %do yr=&begyr %to &endyr; 51 | %if &yr>&begyr %then %do; 52 | proc sql; 53 | create table _file3 as 54 | select &id, per, begdt as date format=mmddyy8. 55 | from _cont_enrl_per_&var 56 | union 57 | select &id, per, enddt as date format=mmddyy8. 58 | from _cont_enrl_per_&var 59 | union 60 | select &id, . as per,date format=mmddyy8. 61 | from &filein.&yr.(where=(&var.=1)) 62 | order by &id, date; 63 | quit; 64 | %end; 65 | %if &yr=&begyr %then %do; 66 | proc sql; 67 | create table _file3 as 68 | select * 69 | from &filein.&yr. 70 | where &var=1 71 | order by &id., date; 72 | quit; 73 | %end; 74 | data _file1; 75 | set _file3; 76 | by &id. date; 77 | format per 2.0 date ldt mmddyy8.; 78 | retain per2 ldt; 79 | if first.&id then do; 80 | if per=. then per2=1; 81 | ldt=date; 82 | end; 83 | if per^=. then per2=per; 84 | else if per=. & intck('MONTH',ldt,date,'D')>1 then per2+1; 85 | ldt=date; 86 | per=per2; 87 | run; 88 | proc means data=_file1 noprint; 89 | by &id per; 90 | output out=_cont_enrl_per_&var(drop=_freq_ _type_) min(date)=begdt max(date)=enddt; 91 | run; 92 | %end; 93 | %end; 94 | ****************************************************************************************************************; 95 | ****** Compute continous enrollment as of a particular month; 96 | data 97 | %do yr=&begyr %to &endyr; 98 | _enrl_cum_&var._&yr %end;; 99 | %if &shape=A %then set _cont_enrl_per_&var;; 100 | %if &shape=P %then set &filein;; 101 | 102 | array monfl(12) &var._pre_01 - &var._pre_12; 103 | cnt=0; 104 | %do yr=&begyr %to &endyr; 105 | posmon=0; 106 | %do mon=1 %to 12; 107 | if begdt<=mdy(&mon,1,&yr) & enddt>=mdy(&mon,1,&yr) then do; 108 | cnt+1; 109 | posmon=1; 110 | end; 111 | else cnt=0; 112 | year=&yr; 113 | monfl[&mon]=cnt; 114 | %end; 115 | if posmon>0 then output _enrl_cum_&var._&yr; 116 | %end; 117 | run; 118 | 119 | ****************************************************************************************************************; 120 | ****** Compute continous enrollment after a particular month; 121 | 122 | data 123 | %do yr=&begyr %to &endyr; 124 | _enrl_cum2_&var._&yr %end;; 125 | %if &shape=A %then set _cont_enrl_per_&var;; 126 | %if &shape=P %then set &filein;; 127 | 128 | array monpst(12) &var._post_01 - &var._post_12; 129 | cnt=0; 130 | %do yr=&endyr %to &begyr %by -1; 131 | posmon=0; 132 | %do mon=12 %to 1 %by -1; 133 | if begdt<=mdy(&mon,1,&yr) & enddt>=mdy(&mon,1,&yr) then do; 134 | cnt+1; 135 | posmon=1; 136 | end; 137 | else cnt=0; 138 | year=&yr; 139 | monpst[&mon]=cnt; 140 | %end; 141 | if posmon>0 then output _enrl_cum2_&var._&yr; 142 | %end; 143 | run; 144 | 145 | ****************************************************************************************************************; 146 | ****** Aggregate the monthly counts - up to this point, multiple separate enrollment periods within a year will 147 | ****** appear as different lines; 148 | 149 | %do yr=&begyr %to &endyr; 150 | proc means data=_enrl_cum_&var._&yr noprint; 151 | by &id year; 152 | output out=fileout1(drop=_type_ _freq_) max(&var._pre_01-&var._pre_12)=; 153 | run; 154 | proc means data=_enrl_cum2_&var._&yr noprint; 155 | by &id year; 156 | output out=fileout2(drop=_type_ _freq_) max(&var._post_01-&var._post_12)=; 157 | run; 158 | 159 | ****************************************************************************************************************; 160 | ****** Combine pre and post counts and save in the same file; 161 | 162 | data &fileout.&yr; 163 | merge fileout1 fileout2; 164 | by &id year; 165 | label &var._post_01="Number of continous enrollment months from January &yr (includes current month)" 166 | &var._post_02="Number of continous enrollment months from February &yr (includes current month)" 167 | &var._post_03="Number of continous enrollment months from March &yr (includes current month)" 168 | &var._post_04="Number of continous enrollment months from April &yr (includes current month)" 169 | &var._post_05="Number of continous enrollment months from May &yr (includes current month)" 170 | &var._post_06="Number of continous enrollment months from June &yr (includes current month)" 171 | &var._post_07="Number of continous enrollment months from July &yr (includes current month)" 172 | &var._post_08="Number of continous enrollment months from August &yr (includes current month)" 173 | &var._post_09="Number of continous enrollment months from September &yr (includes current month)" 174 | &var._post_10="Number of continous enrollment months from October &yr (includes current month)" 175 | &var._post_11="Number of continous enrollment months from November &yr (includes current month)" 176 | &var._post_12="Number of continous enrollment months from December &yr (includes current month)"; 177 | run; 178 | %end; 179 | 180 | 181 | %mend; 182 | -------------------------------------------------------------------------------- /CC_Package_27v0/programs/idcond.sas: -------------------------------------------------------------------------------- 1 | /*********************************************************************************************/ 2 | TITLE1 'Chronic Conditions Macro'; 3 | 4 | * AUTHOR: Patricia Ferido; 5 | 6 | * DATE: 12/8/2020; 7 | 8 | * PURPOSE: Establish project folders and macro variables for project, all variables following the 9 | %let statements below need to be changed; 10 | 11 | options compress=yes nocenter ls=150 ps=200 errors=5 errorabend errorcheck=strict mprint merror 12 | mergenoby=warn varlenchk=error dkricond=error dkrocond=error msglevel=i; 13 | /*********************************************************************************************/ 14 | 15 | ***** Run all the macro programs based on macro function inputs; 16 | 17 | %macro idcond(projhome=,id=,minyear=,maxyear=,claims_data=,create_enr=,create_enr_shape=,create_enr_filein=,enr_prefix=,enr_var=,claims_out_prefix=, 18 | custom_algorithm=N,custom_suffix=_custom,custom_cond=); 19 | 20 | * Macro variable checks; 21 | data _null_; 22 | if "&projhome"="" then do; 23 | put "ERROR: PUT THE PROJECT FILEPATH WHERE THE MACRO IS BEING RUN. CANNOT BE SOURCE FOLDER"; 24 | abort; 25 | end; 26 | if "&claims_data"="" then do; 27 | put "ERROR: PUT THE NAME OF THE CLAIMS DATA SET ABOVE"; 28 | abort; 29 | end; 30 | if "&id"="" then do; 31 | put "ERROR: PUT THE NAME OF THE UNIQUE PATIENT IDENTIFIER"; 32 | abort; 33 | end; 34 | if "&minyear"="" then do; 35 | put "ERROR: PUT MIN YEAR"; 36 | end; 37 | if "&maxyear"="" then do; 38 | put "ERROR: PUT MAX YEAR"; 39 | end; 40 | if "&create_enr" not in("Y","N") then do; 41 | put "ERROR: INVALID VALUE FOR CREATE_ENR"; 42 | abort; 43 | end; 44 | if "&create_enr_shape" not in("","A","P") then do; 45 | put "ERROR: INVALID VALUE FOR CREATE_ENR_SHAPE"; 46 | abort; 47 | end; 48 | if "&enr_prefix"="" then do; 49 | put "ERROR: PUT THE PREFIX FOR THE ENROLLMENT FILES IN ENR_PREFIX ABOVE"; 50 | abort; 51 | end; 52 | if "&enr_var"="" then do; 53 | put "ERROR: PUT THE ENROLLMENT VARIABLE IN THE ENROLLMENT FILES IN ENR ABOVE"; 54 | abort; 55 | end; 56 | if "&claims_out_prefix"="" then do; 57 | put "ERROR: PUT CLAIMS_OUT_PREFIX"; 58 | abort; 59 | end; 60 | IF "&custom_algorithm" not in("Y","N") then do; 61 | put "ERROR: INVALID VALUE FOR CUSTOM_ALGORITHM"; 62 | abort; 63 | end; 64 | run; 65 | 66 | * checking for libref in data set names; 67 | data _null_; 68 | if find("&claims_data",".")=0 then do; 69 | put "WARNING: NO LIBREF FOR CLAIMS INPUT DATA"; 70 | end; 71 | if find("&claims_out_prefix",".")=0 then do; 72 | put "WARNING: NO LIBREF FOR CLAIMS OUTPUT DATA"; 73 | end; 74 | if find("&enr_prefix",".")=0 then do; 75 | put "WARNING: NO LIBREF FOR ENROLLMENT INPUT DATA"; 76 | end; 77 | run; 78 | 79 | libname _ccproj "&projhome.//data";; 80 | 81 | %if "&CUSTOM_ALGORITHM."="Y" %then %do; 82 | 83 | %include "readin_input_files.sas"; 84 | 85 | * create temporary data to be used in the rest of the program and to check against the custom condition list; 86 | data cc_codes; 87 | set _ccproj.cc_codes&custom_suffix.; 88 | run; 89 | 90 | data cc_exclude; 91 | set _ccproj.cc_exclude&custom_suffix.; 92 | run; 93 | 94 | data cc_desc; 95 | set _ccproj.cc_desc&custom_suffix.; 96 | run; 97 | %end; 98 | 99 | %if "&CUSTOM_ALGORITHM."="N" %then %do; 100 | 101 | * create temporary data to be used in the rest of the program and to check against the custom condition list; 102 | data cc_codes; 103 | set _ccproj.cc_codes_original; 104 | run; 105 | 106 | data cc_exclude; 107 | set _ccproj.cc_exclude_original; 108 | run; 109 | 110 | data cc_desc; 111 | set _ccproj.cc_desc_original; 112 | run; 113 | 114 | %end; 115 | 116 | * checking against the list of custom conditions; 117 | %if "&custom_cond" ne "" %then %do; 118 | data customcond; 119 | format condition $10.; 120 | condlist="&custom_cond."; 121 | ncond=countw(condlist); 122 | do i=1 to ncond; 123 | condition=scan(condlist,i," "); 124 | output; 125 | end; 126 | run; 127 | 128 | proc sort data=customcond; by condition; run; 129 | 130 | proc sort data=cc_desc; by condition; run; 131 | 132 | data custom_cond_ck; 133 | merge cc_desc (in=a keep=condition) customcond (in=b); 134 | by condition; 135 | if b=1 and a=0 then do; 136 | put "ERROR: THERE ARE CONDITIONS LISTED IN COND THAT ARE NOT SPECIFIED IN ALGORITHM e.g. " condition=/; 137 | abort abend; 138 | end; 139 | run; 140 | 141 | * if no errors then limiting to conditions in the list; 142 | proc sort data=cc_exclude; by condition; run; 143 | proc sort data=cc_codes; by condition; run; 144 | 145 | data cc_desc; 146 | merge cc_desc (in=a) customcond (in=b keep=condition); 147 | by condition; 148 | if a and b; 149 | run; 150 | 151 | data cc_exclude; 152 | merge cc_exclude (in=a) customcond (in=b keep=condition); 153 | by condition; 154 | if a and b; 155 | run; 156 | 157 | data cc_codes; 158 | merge cc_codes (in=a) customcond (in=b keep=condition); 159 | by condition; 160 | if a and b; 161 | run; 162 | 163 | %end; 164 | 165 | ***** Check Input Claims Data Sets; 166 | %macro ckinputclms; 167 | 168 | %let v=1; 169 | %let clms=%scan("&claims_data",&v," "); 170 | 171 | %do %while (%length(&clms)>0); 172 | proc contents data=&clms out=contents_claim noprint; run; 173 | 174 | * Check that there is a claim date variables and claim type variable 175 | Check that all the diagnosis codes are named 176 | Check that all other variables are dropped; 177 | 178 | data contents_claim1; 179 | set contents_claim end=_end; 180 | if upcase(name)=upcase("&id") then do; id=1; id1+1; end; 181 | else if name="claim_dt" then do; 182 | clmdt=1; 183 | clmdt1+1; 184 | if type=2 then do; put "ERROR: CONVERT CLAIM_DT TO DATE VARIABLE"; abort; end; 185 | end; 186 | else if name="claim_type" then do; clmtype=1; clmtype1+1; end; 187 | else if find(name,"icd9dx") then do; icd9dx=1; icd9dx1+1; end; 188 | else if find(name,"icd10dx") then do; icd10dx=1; icd10dx1+1; end; 189 | else if find(name,"hcpcs") then do; hcpcs=1; hcpcs1+1; end; 190 | else if find(name,"icd9prcdr") then do; icd9prcdr=1; icd9prcdr1+1; end; 191 | else if find(name,"icd10prcdr") then do; icd10prcdr=1; icd10prcdr1+1; end; 192 | else do; 193 | put "ERROR: POTENTIALLY EXTRANEOUS OR MISSPELLED VARIABLE. NEEDS REVIEW " name=/; 194 | abort; 195 | end; 196 | 197 | if _end then do; 198 | if id1=0 then do; put "ERROR: NO ID VARIABLE"; abort abend; end; 199 | if clmdt1=0 then do; put "ERROR: NO CLAIM DATE VARIABLE"; abort abend; end; 200 | if clmtype1=0 then do; put "ERROR: NO CLAIM TYPE VARIABLE"; abort abend; end; 201 | if max(icd9dx1,icd10dx1,hcpcs1,icd9prcdr1,icd10prcdr1) in(0,.) then do; put "ERROR: NO DIAGNOSIS OR PROCEDURE CODE VARIABLES"; abort abend; end; 202 | end; 203 | run; 204 | 205 | %let v=%eval(&v+1); 206 | %let clms=%scan("&claims_data",&v," "); 207 | 208 | %end; 209 | 210 | ***** Check and run enrollment files; 211 | %if "&CREATE_ENR"="Y" %then %do; 212 | 213 | data _null_; 214 | if "&create_enr_shape" not in("A","P") then do; 215 | put "ERROR: CREATE ENROLLMENT FILES MARKED AS Y, BUT INVALID CREATE_ENR_SHAPE VALUE. MUST BE 'A' OR 'P'"; 216 | abort abend; 217 | end; 218 | if "&create_enr_filein"="" then do; 219 | put "ERROR: CREATE ENROLLMENT FILES MARKED AS Y, BUT NO CREATE_ENR_FILEIN SPECIFIED"; 220 | abort abend; 221 | end; 222 | run; 223 | 224 | %include "contenr.sas"; 225 | 226 | %contenr(begyr=&minyear.,endyr=&maxyear.,shape=&create_enr_shape,filein=&create_enr_filein.,fileout=&enr_prefix,id=&id,var=&enr_var.); 227 | 228 | %end; 229 | 230 | %mend; 231 | 232 | %ckinputclms; 233 | 234 | * Check that all the claim types match the claim types CC_desc; 235 | data claim_types; 236 | set cc_desc; 237 | array clmtyp [*] claim_type:; 238 | do i=1 to dim(clmtyp); 239 | if clmtyp[i] ne "" then do; 240 | claim_type=clmtyp[i]; 241 | output; 242 | end; 243 | end; 244 | countw=countw(claim_type); 245 | run; 246 | 247 | proc sql noprint; 248 | select max(countw) 249 | into :type_max 250 | from claim_types; 251 | quit; 252 | 253 | data claim_types1; 254 | set claim_types; 255 | do i=1 to countw(claim_type); 256 | type=scan(claim_type,i); 257 | output; 258 | end; 259 | run; 260 | 261 | proc freq data=claim_types1 noprint; 262 | table type / out=cc_desc_clmtyps; 263 | run; 264 | 265 | %macro ckclmtypes; 266 | 267 | %let v=1; 268 | %let clms=%scan("&claims_data",&v," "); 269 | 270 | %do %while (%length(&clms)>0); 271 | 272 | proc freq data=&clms noprint; 273 | table claim_type / out=clms_data_clmtyps (rename=claim_type=type); 274 | run; 275 | 276 | data clm_ck; 277 | merge cc_desc_clmtyps (in=a) clms_data_clmtyps (in=b); 278 | by type; 279 | desc=a; 280 | clms=b; 281 | run; 282 | 283 | data _null_; 284 | set clm_ck; 285 | if clms=1 and desc=0 then do; 286 | put "ERROR: CLAIM TYPE IN &CLMS NOT IN CC_DESC" type=/; 287 | abort abend; 288 | end; 289 | if desc=1 and clms=0 then do; 290 | put "WARNING: CLAIM TYPE IN CC_DESC NOT FOUND IN &CLMS" type=/; 291 | end; 292 | run; 293 | 294 | %let v=%eval(&v+1); 295 | %let clms=%scan("&claims_data",&v," "); 296 | 297 | %end; 298 | 299 | %mend; 300 | 301 | %ckclmtypes; 302 | 303 | %put "SUCCESSFUL RUN. AFTER LOG IS CLEARED OF WARNINGS AND ERRORS, READY FOR 3_IDENTIFY_CONDITIONS.SAS"; 304 | 305 | %include "identify_conditions.sas"; 306 | 307 | 308 | %mend; 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | -------------------------------------------------------------------------------- /CC_Package_27v0/programs/identify_conditions.sas: -------------------------------------------------------------------------------- 1 | /*********************************************************************************************/ 2 | TITLE1 'Chronic Conditions Macro'; 3 | 4 | * AUTHOR: Patricia Ferido; 5 | 6 | * DATE: 3/26/2018; 7 | 8 | * PURPOSE: Identify all the codes in the prepared claims data sets; 9 | 10 | * INPUT: Claims data sets; 11 | * OUTPUT: - Claims data sets with diagnosis flags 12 | - Yearly beneficiary level files with monthly condition flags; 13 | 14 | options compress=yes nocenter ls=150 ps=200 errors=5 errorabend errorcheck=strict mprint merror 15 | mergenoby=warn varlenchk=error dkricond=error dkrocond=error msglevel=i; 16 | /*********************************************************************************************/ 17 | 18 | ***** First getting full month length of analytical period for use later and first/last years of data; 19 | %macro datayears; 20 | %let filecnt=1; 21 | %let claimsfile=%scan("&claims_data",&filecnt," "); 22 | 23 | %do %while(%length(&claimsfile)>0); 24 | 25 | data clmyr; 26 | set &claimsfile.; 27 | yr=year(claim_dt); 28 | run; 29 | 30 | proc freq data=clmyr noprint; 31 | table yr / out=yr_&filecnt; 32 | run; 33 | 34 | %let filecnt=%eval(&filecnt+1); 35 | %let claimsfile=%scan("&claims_data",&filecnt," "); 36 | 37 | %end; 38 | 39 | %mend; 40 | 41 | %datayears; 42 | 43 | data yr; 44 | set yr_:; 45 | run; 46 | 47 | proc sql noprint; 48 | select min(yr) into :mindatayear 49 | from yr; 50 | 51 | select max(yr) into :maxdatayear 52 | from yr; 53 | quit; 54 | 55 | %put &mindatayear; 56 | %put &maxdatayear; 57 | 58 | * Checking that years of data and years specified in macro line up - issuing warnings if not; 59 | data _null_; 60 | if &minyear.<&mindatayear. then do; 61 | put "WARNING: MINIMUM YEAR REQUESTED IS EARLIER THAN YEAR PROVIDED IN DATA, REQUESTED YEARS OUTSIDE OF PROVIDED YEARS WILL NOT BE OUTPUT"; 62 | end; 63 | if &maxyear.>&maxdatayear. then do; 64 | put "WARNING: MAXIMUM YEAR REQUESTED IS LATER THAN YEAR PROVIDED IN DATA, REQUESTED YEARS OUTSIDE OF PROVIDED YEARS WILL NOT BE OUTPUT"; 65 | end; 66 | run; 67 | 68 | * In case output years and data years do not line up, then creating values that will always ensure 69 | that only years are output that overlap between the two; 70 | %let maxofminyears=%sysfunc(max(&mindatayear,&minyear)); 71 | %let minofmaxyears=%sysfunc(min(&maxdatayear,&maxyear)); 72 | 73 | data _null_; 74 | mo=intck("month",mdy(1,1,&mindatayear),mdy(1,1,&maxdatayear+1)); 75 | call symputx("total_mo",mo); 76 | run; 77 | 78 | %put &total_mo; 79 | 80 | ***** Macro that sets up conditions to list; 81 | 82 | %macro overcond; 83 | 84 | ***** 1) Getting all relevant condition information into macro variables for later use; 85 | * This macro gets all the relevant information for the condition including: 86 | - List of all relevant codes 87 | - List of all locations to find codes (primary diagnosis only, all diagnoses, etc.) 88 | - List of all reference periods 89 | - List of all min days apart and max days apart requirement; 90 | %getcodes; 91 | 92 | * This portion of code gets the total number of qualifying claim groups and qualifying number of claims by condtion; 93 | proc sql noprint; 94 | %do i=1 %to &nclmgrps; 95 | 96 | select claim_type&i into :qualclmgrps&i separated by ' | ' 97 | from cc_desc 98 | order by condition; 99 | 100 | select num_dx&i into :qualnumdx&i separated by '|' 101 | from cc_desc 102 | order by condition; 103 | 104 | %end; 105 | quit; 106 | 107 | %put &qualclmgrps1; 108 | %put &&qualclmgrps&nclmgrps; 109 | %put &qualnumdx1; 110 | %put &&qualnumdx&nclmgrps; 111 | 112 | ***** 2) Cycle through all claims data sets and separating out each claim by presence of condition. 113 | Creates stacked data sets of all the claims by condition. For example, a data set called ALZHE will be 114 | created containing all the alzheimer claims from the input data sets; 115 | 116 | %let filecnt=1; 117 | %let claimsfile=%scan("&claims_data",&filecnt," "); 118 | 119 | %do %while(%length(&claimsfile)>0); 120 | 121 | * Macro for finding claims by condition; 122 | %tagcond; 123 | 124 | %let filecnt=%eval(&filecnt+1); 125 | %let claimsfile=%scan("&claims_data",&filecnt," "); 126 | 127 | %end; 128 | 129 | * appending all the conditions together pulled from each file; 130 | %let filecnt=%eval(&filecnt-1); * subtracting 1 to get true file count value; 131 | %do p=1 %to &ncondlist; 132 | %let condname=%scan(&condlist,&p,'|'); 133 | %if &filecnt.=1 %then %do; 134 | proc datasets library=work noprint; 135 | change claims_&condname.1=&condname; 136 | run; 137 | %end; 138 | %else %if &filecnt.>1 %then %do; 139 | data &condname.; 140 | set claims_&condname.1-claims_&condname.&filecnt.; 141 | by &id. claim_dt; 142 | run; 143 | %end; 144 | %end; 145 | 146 | ***** 3) Cycle through all conditions and check against algorithm requirements 147 | Output a yearly beneficiary file with 1/0 flags for each month if beneficiary meets requirements; 148 | %do p=1 %to &Ncondlist; 149 | 150 | %cc_flags; 151 | 152 | %end; 153 | 154 | ***** 4) Merges to enrollment data and creates final flag with 5 variables: 155 | .I - incomplete years of data, if reference period is 3 years and data starts in 2002, then 2002-2004 will have .I 156 | 0 - no qualifying coverage and claims 157 | 1 - qualifying claims but no qualifying coverage 158 | 2 - qualifying coverage but no qualifying claims 159 | 3 - qualifying claims and qualifying coverage; 160 | %enrollment; 161 | 162 | %mend; 163 | 164 | ***** 1) Macro that creates all condition information macro variables to be used in other programs; 165 | %macro getcodes; 166 | 167 | proc contents data=cc_desc out=contents_cc_desc noprint; run; 168 | 169 | %global nclmgrps condlist ncondlist refperiod mindaysapart maxdaysapart; 170 | 171 | * Counting the number of claim types there are in CC_Desc; 172 | proc sql noprint; 173 | 174 | select count(name) into :nclmgrps trimmed 175 | from contents_cc_desc 176 | where find(upcase(name),"CLAIM_TYPE"); 177 | 178 | quit; 179 | 180 | proc sort data=cc_desc out=cc_desc; by condition; run; 181 | 182 | proc sql noprint; 183 | 184 | * Put all conditions into a list; 185 | select distinct condition into :CondList separated by '|' 186 | from cc_desc 187 | order by condition; 188 | 189 | * Counting total number of conditions; 190 | select count(condition) into :NCondList 191 | from cc_desc; 192 | 193 | * Putting all reference periods into a list; 194 | select ref_months into :refperiod separated by '|' 195 | from cc_desc 196 | order by condition; 197 | 198 | * Putting all minimum days apart into a list; 199 | select min_days_apart into :mindaysapart separated by '|' 200 | from cc_desc 201 | order by condition; 202 | 203 | * Putting all maximum days apart into a list; 204 | select max_days_apart into :maxdaysapart separated by '|' 205 | from cc_desc 206 | order by condition; 207 | 208 | quit; 209 | 210 | title1 "LIST OF CONDITIONS TO PROCESS"; 211 | %put &CondList; 212 | %put &NCondList; 213 | %put &refperiod; 214 | %put &mindaysapart; 215 | %put &maxdaysapart; 216 | 217 | %global icd9dx icd9dxloc icd9ndx icd9dxexcl icd9dxexclloc icd9ndxexcl 218 | icd10dx icd10dxloc icd10ndx icd10dxexcl icd10dxexclloc icd10ndxexcl 219 | hcpcs hcpcsloc hcpcsn hcpcsexcl hcpcsexclloc hcpcsnexcl 220 | icd9prcdr icd9prcdrloc icd9nprcdr icd9prcdrexcl icd9prcdrexclloc icd9nprcdrexcl 221 | icd10prcdr icd10prcdrloc icd10nprcdr icd10prcdrexcl icd10prcdrexclloc icd10nprcdrexcl 222 | codename; 223 | 224 | /* The section of code below puts all the codes into lists by code type. Not all of the 225 | code types may be used in each analysis (e.g. analysis is before September 2015 and only uses 226 | ICD-9 Codes). The lists created below are dependent on all the information ordered by condition 227 | and separated by '|'. If any information is not present for a condition, the 228 | data set 'cc_desc1' below is created to fill in the gaps and put in a black place-holder. 229 | The code also assumes that each condition looks at the same diagnoses location for 230 | every code. (e.g. all codes for atrial fibrillation must be the first or second dx 231 | on claim). */ 232 | 233 | data cc_desc1; 234 | format codetype $10.; 235 | set cc_desc (keep=condition in=a) 236 | cc_desc (keep=condition in=b) 237 | cc_desc (keep=condition in=c) 238 | cc_desc (keep=condition in=d) 239 | cc_desc (keep=condition in=e); 240 | if a then codetype="ICD9DX"; 241 | if b then codetype="ICD10DX"; 242 | if c then codetype="ICD9PRCDR"; 243 | if d then codetype="ICD10PRCDR"; 244 | if e then codetype="HCPCS"; 245 | run; 246 | 247 | proc sort data=cc_desc1; by condition codetype; run; 248 | 249 | proc sort data=cc_codes out=condcodes; by condition codetype; run; 250 | 251 | data condcodes1; 252 | merge condcodes cc_desc1; 253 | by condition codetype; 254 | format dxcode2 $8.; 255 | period=index(trim(left(dxcode)),"."); 256 | dxcode2=upcase(trim(left(compress(dxcode,".")))); 257 | * Adjusting to compensate for any incorrectly formatted numeric codes due to CSV format; 258 | if length(trim(left(dxcode2)))=4 & CodeType="ICD9DX" & period=4 then dxcode2=trim(left(dxcode2))||"0"; 259 | if length(trim(left(dxcode2)))=3 & CodeType="ICD9DX" & period=4 then dxcode2=trim(left(dxcode2))||"00"; 260 | if length(trim(left(dxcode2)))=3 & CodeType="ICD9DX" & period=2 then dxcode2="0"||trim(left(dxcode2))||"0"; 261 | if length(trim(left(dxcode2)))=3 & CodeType="ICD9DX" & period=0 then dxcode2=trim(left(dxcode2))||"00"; 262 | if length(trim(left(dxcode2)))=2 & CodeType="ICD9DX" & period=0 then dxcode2="0"||trim(left(dxcode2))||"00"; 263 | if length(trim(left(dxcode2)))=3 & CodeType="ICD9PRCDR" & period=2 then dxcode2="0"||trim(left(dxcode2)); 264 | if length(trim(left(dxcode2)))=3 & CodeType="ICD9PRCDR" & period=3 then dxcode2=trim(left(dxcode2))||"0"; 265 | if codetype="HCPCS" and dxcode ne "" then do; 266 | if length(dxcode2)=1 then dxcode2="0000"||dxcode2; 267 | if length(dxcode2)=2 then dxcode2="000"||dxcode2; 268 | if length(dxcode2)=3 then dxcode2="00"||dxcode2; 269 | if length(dxcode2)=4 then dxcode2="0"||dxcode2; 270 | end; 271 | last=last.codetype; 272 | run; 273 | 274 | /* To create macro with code lists 275 | - Loop through each codetype - initialize macro variable 276 | - Loop through each condition - create list of codes separated by comma 277 | - Concatenate new codes to old codes using | */ 278 | 279 | %let sep=%nrstr( | ); 280 | proc sql noprint; 281 | 282 | %do i=1 %to &Ncondlist; 283 | %let cond=%scan(&condlist,&i,"|"); 284 | 285 | * Pulls all codes and locations for ICD9 DX; 286 | select dxcode2 into:icd9dx_temp separated by '","' 287 | from condcodes1 288 | where CodeType="ICD9DX" and condition="&cond"; 289 | 290 | %if &i=1 %then %let icd9dx=&icd9dx_temp.; 291 | %else %let icd9dx=&icd9dx.&sep.&icd9dx_temp.; 292 | 293 | select dxcodelocation into:icd9dxloc_temp separated by '","' 294 | from condcodes1 295 | where CodeType="ICD9DX" and condition="&cond" and last; 296 | 297 | %if &i=1 %then %let icd9dxloc=&icd9dxloc_temp.; 298 | %else %let icd9dxloc=&icd9dxloc.&sep.&icd9dxloc_temp.; 299 | 300 | * Pulls all codes and locations for ICD10 DX; 301 | title2 "List of ICD10DX Codes and Count"; 302 | select dxcode2 into:icd10dx_temp separated by '","' 303 | from condcodes1 304 | where CodeType="ICD10DX" and condition="&cond"; 305 | 306 | %if &i=1 %then %let icd10dx=&icd10dx_temp.; 307 | %else %let icd10dx=&icd10dx.&sep.&icd10dx_temp.; 308 | 309 | select dxcodelocation into:icd10dxloc_temp separated by '","' 310 | from condcodes1 311 | where CodeType="ICD10DX" and condition="&cond" and last; 312 | 313 | %if &i=1 %then %let icd10dxloc=&icd10dxloc_temp.; 314 | %else %let icd10dxloc=&icd10dxloc.&sep.&icd10dxloc_temp.; 315 | 316 | * Pulls all codes and locations for HCPCS; 317 | title2 "List of HCPCS Procedure Codes and Count"; 318 | select dxcode2 into:hcpcs_temp separated by '","' 319 | from condcodes1 320 | where CodeType="HCPCS" and condition="&cond"; 321 | 322 | %if &i=1 %then %let hcpcs=&hcpcs_temp.; 323 | %else %let hcpcs=&hcpcs.&sep.&hcpcs_temp.; 324 | 325 | select dxcodelocation into: hcpcsloc_temp separated by '","' 326 | from condcodes1 327 | where CodeType="HCPCS" and condition="&cond" and last; 328 | 329 | %if &i=1 %then %let hcpcsloc=&hcpcsloc_temp.; 330 | %else %let hcpcsloc=&hcpcsloc.&sep.&hcpcsloc_temp.; 331 | 332 | * Pulls all codes and locations for ICD9 Procedure Codes; 333 | title2 "List of ICD 9 Procedure Codes and Count"; 334 | select dxcode2 into:ICD9PRCDR_temp separated by '","' 335 | from condcodes1 336 | where CodeType="ICD9PRCDR" and condition="&cond"; 337 | 338 | %if &i=1 %then %let icd9prcdr=&icd9prcdr_temp.; 339 | %else %let icd9prcdr=&icd9prcdr.&sep.&icd9prcdr_temp.; 340 | 341 | select dxcodelocation into: ICD9PRCDRloc_temp separated by '","' 342 | from condcodes1 343 | where CodeType="ICD9PRCDR" and condition="&cond" and last; 344 | 345 | %if &i=1 %then %let icd9prcdrloc=&icd9prcdrloc_temp.; 346 | %else %let icd9prcdrloc=&icd9prcdrloc.&sep.&icd9prcdrloc_temp.; 347 | 348 | * Pulls all codes and locations for ICD10 Procedure Codes; 349 | title2 "List of ICD 10 Procedure Codes and Count"; 350 | select dxcode2 into:icd10prcdr_temp separated by '","' 351 | from condcodes1 352 | where CodeType="ICD10PRCDR" and condition="&cond"; 353 | 354 | %if &i=1 %then %let icd10prcdr=&icd10prcdr_temp.; 355 | %else %let icd10prcdr=&icd10prcdr.&sep.&icd10prcdr_temp.; 356 | 357 | select dxcodelocation into: ICD10PRCDRloc_temp separated by '","' 358 | from condcodes1 359 | where CodeType="ICD10PRCDR" and condition="&cond" and last; 360 | 361 | %if &i=1 %then %let icd10prcdrloc=&icd10prcdrloc_temp.; 362 | %else %let icd10prcdrloc=&icd10prcdrloc.&sep.&icd10prcdrloc_temp.; 363 | 364 | %end; 365 | 366 | quit; 367 | 368 | * Codes to exclude; 369 | proc sort data=cc_exclude out=exclude; by condition codetype; run; 370 | 371 | data exclude1; 372 | merge exclude cc_desc1; 373 | by condition codetype; 374 | format dxcode2 $8.; 375 | period=index(trim(left(dxcode)),"."); 376 | dxcode2=upcase(trim(left(compress(dxcode,".")))); 377 | * Adjusting to compensate for any incorrectly formatted numeric codes due to CSV format; 378 | if length(trim(left(dxcode2)))=4 & CodeType="ICD9DX" & period=4 then dxcode2=trim(left(dxcode2))||"0"; 379 | if length(trim(left(dxcode2)))=3 & CodeType="ICD9DX" & period=4 then dxcode2=trim(left(dxcode2))||"00"; 380 | if length(trim(left(dxcode2)))=3 & CodeType="ICD9DX" & period=2 then dxcode2="0"||trim(left(dxcode2))||"0"; 381 | if length(trim(left(dxcode2)))=3 & CodeType="ICD9DX" & period=0 then dxcode2=trim(left(dxcode2))||"00"; 382 | if length(trim(left(dxcode2)))=2 & CodeType="ICD9DX" & period=0 then dxcode2="0"||trim(left(dxcode2))||"00"; 383 | if length(trim(left(dxcode2)))=3 & CodeType="ICD9PRCDR" & period=2 then dxcode2="0"||trim(left(dxcode2)); 384 | if length(trim(left(dxcode2)))=3 & CodeType="ICD9PRCDR" & period=3 then dxcode2=trim(left(dxcode2))||"0"; 385 | if codetype="HCPCS" and dxcode2 ne "" then do; 386 | if length(dxcode2)=1 then dxcode2="0000"||dxcode2; 387 | if length(dxcode2)=2 then dxcode2="000"||dxcode2; 388 | if length(dxcode2)=3 then dxcode2="00"||dxcode2; 389 | if length(dxcode2)=4 then dxcode2="0"||dxcode2; 390 | end; 391 | last=last.codetype; 392 | run; 393 | 394 | proc sql noprint; 395 | 396 | %do i=1 %to &Ncondlist; 397 | %let cond=%scan(&condlist,&i,"|"); 398 | 399 | * Pulls all codes and locations for ICD9 dxexcl; 400 | title2 "List of ICD9dxexcl Codes and Count"; 401 | select dxcode2 into:icd9dxexcl_temp separated by '","' 402 | from exclude1 403 | where CodeType="ICD9DX" and condition="&cond."; 404 | 405 | %if &i=1 %then %let icd9dxexcl=&icd9dxexcl_temp.; 406 | %else %let icd9dxexcl=&icd9dxexcl.&sep.&icd9dxexcl_temp.; 407 | 408 | select dxcodelocation into:icd9dxexclloc_temp separated by '","' 409 | from exclude1 410 | where CodeType="ICD9DX" and condition="&cond." and last; 411 | 412 | %if &i=1 %then %let icd9dxexclloc=&icd9dxexclloc_temp.; 413 | %else %let icd9dxexclloc=&icd9dxexclloc.&sep.&icd9dxexclloc_temp.; 414 | 415 | * Pulls all codes and locations for ICD10 dxexcl; 416 | title2 "List of ICD10dxexcl Codes and Count"; 417 | select dxcode2 into:icd10dxexcl_temp separated by '","' 418 | from exclude1 419 | where CodeType="ICD10DX" and condition="&cond."; 420 | 421 | %if &i=1 %then %let icd10dxexcl=&icd10dxexcl_temp.; 422 | %else %let icd10dxexcl=&icd10dxexcl.&sep.&icd10dxexcl_temp.; 423 | 424 | select dxcodelocation into:icd10dxexclloc_temp separated by '","' 425 | from exclude1 426 | where CodeType="ICD10DX" and condition="&cond." and last; 427 | 428 | %if &i=1 %then %let icd10dxexclloc=&icd10dxexclloc_temp.; 429 | %else %let icd10dxexclloc=&icd10dxexclloc.&sep.&icd10dxexclloc_temp.; 430 | 431 | * Pulls all codes and locations for HCPCS; 432 | title2 "List of HCPCS Procedure Codes and Count"; 433 | select dxcode2 into:hcpcsexcl_temp separated by '","' 434 | from exclude1 435 | where CodeType="HCPCS" and condition="&cond."; 436 | 437 | %if &i=1 %then %let hcpcsexcl=&hcpcsexcl_temp.; 438 | %else %let hcpcsexcl=&hcpcsexcl.&sep.&hcpcsexcl_temp.; 439 | 440 | select dxcodelocation into:hcpcsexclloc_temp separated by '","' 441 | from exclude1 442 | where CodeType="HCPCS" and condition="&cond." and last; 443 | 444 | %if &i=1 %then %let hcpcsexclloc=&hcpcsexclloc_temp.; 445 | %else %let hcpcsexclloc=&hcpcsexclloc.&sep.&hcpcsexclloc_temp.; 446 | 447 | * Pulls all codes and locations for ICD9 Procedure Codes; 448 | title2 "List of ICD 9 Procedure Codes and Count"; 449 | select dxcode2 into:icd9prcdrexcl_temp separated by '","' 450 | from exclude1 451 | where CodeType="ICD9PRCDR" and condition="&cond."; 452 | 453 | %if &i=1 %then %let icd9prcdrexcl=&icd9prcdrexcl_temp.; 454 | %else %let icd9prcdrexcl=&icd9prcdrexcl.&sep.&icd9prcdrexcl_temp.; 455 | 456 | select dxcodelocation into:icd9prcdrexclloc_temp separated by '","' 457 | from exclude1 458 | where CodeType="ICD9PRCDR" and condition="&cond." and last; 459 | 460 | %if &i=1 %then %let icd9prcdrexclloc=&icd9prcdrexclloc_temp.; 461 | %else %let icd9prcdrexclloc=&icd9prcdrexclloc.&sep.&icd9prcdrexclloc_temp.; 462 | 463 | * Pulls all codes and locations for ICD10 Procedure Codes; 464 | title2 "List of ICD 10 Procedure Codes and Count"; 465 | select dxcode2 into:icd10prcdrexcl_temp separated by '","' 466 | from exclude1 467 | where CodeType="ICD10PRCDR" and condition="&cond."; 468 | 469 | %if &i=1 %then %let icd10prcdrexcl=&icd10prcdrexcl_temp.; 470 | %else %let icd10prcdrexcl=&icd10prcdrexcl.&sep.&icd10prcdrexcl_temp.; 471 | 472 | select dxcodelocation into:icd10prcdrexclloc_temp separated by '","' 473 | from exclude1 474 | where CodeType="ICD10PRCDR" and condition="&cond." and last; 475 | 476 | %if &i=1 %then %let icd10prcdrexclloc=&icd10prcdrexclloc_temp.; 477 | %else %let icd10prcdrexclloc=&icd10prcdrexclloc.&sep.&icd10prcdrexclloc_temp.; 478 | 479 | %end; 480 | 481 | quit; 482 | 483 | %mend; 484 | 485 | %getcodes; 486 | 487 | ***** 2) Identify Condition dx in the medical claims data ; 488 | %macro tagcond; 489 | 490 | * Check what kinds of diagnosis/procedure codes exist in claims data set and will only 491 | check for kinds of diagnosis codes that exist in the data set. If there are no HCPCS codes, 492 | will not cycle through the HCPCS array; 493 | proc contents data=&claimsfile. out=contents_claims noprint; run; 494 | 495 | proc sql noprint; 496 | 497 | select name 498 | into :clmvars 499 | separated by '|' 500 | from contents_claims; 501 | 502 | quit; 503 | 504 | %put &icd9ndx &icd10ndx &hcpcsn &icd9nprcdr &icd10nprcdr; 505 | 506 | * Sort by id and claim_dt; 507 | proc sort data=&claimsfile. out=claims_s; by &id claim_dt; run; 508 | 509 | * The following data step cycles through all the conditions and outputs a data set for condition 510 | only keeping the id, the claim date and the claim type; 511 | 512 | data 513 | %do p=1 %to &Ncondlist; 514 | %let condname=%scan(&condlist,&p,'|'); 515 | 516 | claims_&condname.&filecnt. (keep=&id claim_dt claim_type) 517 | 518 | %end;; 519 | 520 | set claims_s; 521 | by &id claim_dt ; 522 | 523 | %do p=1 %to &Ncondlist; 524 | %let condname=%scan(&condlist,&p,'|'); 525 | 526 | * setting condition diagnosis flag to 0 and condition exclude flag to 0; 527 | &condname.dx=0; 528 | &condname.excl=0; 529 | 530 | %end; 531 | 532 | * Setting up arrays based on what diagnosis & procedure codes exist in the claims data; 533 | 534 | /************************************* ICD 9 DX **************************************/ 535 | %if %index(&clmvars,icd9dx) %then %do; 536 | 537 | array icd9dx_ [*] $ icd9dx:; 538 | 539 | * Cycling through all codes for the condition and flagging if find diagnosis; 540 | do i=1 to dim(icd9dx_); 541 | 542 | * Format - removing period and left adjusting; 543 | icd9dx_[i]=trim(left(compress(icd9dx_[i],"."))); 544 | if length(icd9dx_[i])=3 then icd9dx_[i]=cats(icd9dx_[i],"00"); 545 | if length(icd9dx_[i])=4 then icd9dx_[i]=cats(icd9dx_[i],"0"); 546 | 547 | %do p=1 %to &ncondlist; 548 | %let condname=%scan(&condlist,&p,'|'); 549 | %let ccode=%scan(%bquote(&icd9dx),&p,'|'); 550 | %let ccodeloc=%scan(%bquote(&icd9dxloc),&p,'|'); 551 | 552 | %if "&ccodeloc"="ANY" %then %do; 553 | if icd9dx_[i] in("&ccode") and &condname.dx in(0,.) then &condname.dx=1; 554 | %end; 555 | %else %if "&ccodeloc"="DX1" %then %do; 556 | if i=1 and icd9dx_[i] in("&ccode") and &condname.dx in(0,.) then &condname.dx=1; 557 | %end; 558 | %else %if "&ccodeloc"="DX1 DX2" %then %do; 559 | if i in(1,2) and icd9dx_[i] in("&ccode") and &condname.dx in(0,.) then &condname.dx=1; 560 | %end; 561 | 562 | * Cycling through exclusion variables; 563 | %let excode=%scan(%bquote(&icd9dxexcl),&p,'|'); 564 | %let excodeloc=%scan(%bquote(&icd9dxexclloc),&p,'|'); 565 | 566 | %if "&excodeloc"="ANY" %then %do; 567 | if icd9dx_[i] in("&excode") and &condname.excl in(0,.) then &condname.excl=1; 568 | %end; 569 | %else %if "&excodeloc"="DX1" %then %do; 570 | if i=1 and icd9dx_[i] in("&excode") and &condname.excl in(0,.) then &condname.excl=1; 571 | %end; 572 | %else %if "&excodeloc"="DX1 DX2" %then %do; 573 | if i in(1,2) and icd9dx_[i] in("&excode") and &condname.excl in(0,.) then &condname.excl=1; 574 | %end; 575 | 576 | %end; 577 | 578 | end; 579 | 580 | %end; 581 | 582 | /************************************* ICD 10 DX **************************************/ 583 | %if %index(&clmvars,icd10dx) %then %do; 584 | 585 | array icd10dx_ [*] $ icd10dx:; 586 | 587 | * Cycling through all codes for the condition and flagging if find diagnosis; 588 | do i=1 to dim(icd10dx_); 589 | 590 | * Format - removing period and left adjusting; 591 | icd10dx_[i]=upcase(trim(left(compress(icd10dx_[i],".")))); 592 | 593 | %do p=1 %to &ncondlist; 594 | %let condname=%scan(&condlist,&p,'|'); 595 | %let ccode=%scan(%bquote(&icd10dx),&p,'|'); 596 | %let ccodeloc=%scan(%bquote(&icd10dxloc),&p,'|'); 597 | 598 | %if "&ccodeloc"="ANY" %then %do; 599 | if icd10dx_[i] in("&ccode") and &condname.dx in(0,.) then &condname.dx=1; 600 | %end; 601 | %else %if "&ccodeloc"="DX1" %then %do; 602 | if i=1 and icd10dx_[i] in("&ccode") and &condname.dx in(0,.) then &condname.dx=1; 603 | %end; 604 | %else %if "&ccodeloc"="DX1 DX2" %then %do; 605 | if i in(1,2) and icd10dx_[i] in("&ccode") and &condname.dx in(0,.) then &condname.dx=1; 606 | %end; 607 | 608 | * Cycling through exclusion variables; 609 | %let excode=%scan(%bquote(&icd10dxexcl),&p,'|'); 610 | %let excodeloc=%scan(%bquote(&icd10dxexclloc),&p,'|'); 611 | 612 | %if "&excodeloc"="ANY" %then %do; 613 | if icd10dx_[i] in("&excode") and &condname.excl in(0,.) then &condname.excl=1; 614 | %end; 615 | %else %if "&excodeloc"="DX1" %then %do; 616 | if i=1 and icd10dx_[i] in("&excode") and &condname.excl in(0,.) then &condname.excl=1; 617 | %end; 618 | %else %if "&excodeloc"="DX1 DX2" %then %do; 619 | if i in(1,2) and icd10dx_[i] in("&excode") and &condname.excl in(0,.) then &condname.excl=1; 620 | %end; 621 | 622 | %end; 623 | 624 | end; 625 | 626 | %end; 627 | 628 | /************************************* HCPCS **************************************/ 629 | %if %index(&clmvars,hcpcs) %then %do; 630 | 631 | array hcpcs_ [*] $ hcpcs:; 632 | 633 | * Cycling through all codes for the condition and flagging if find diagnosis; 634 | do i=1 to dim(hcpcs_); 635 | 636 | * Format - upcasing; 637 | hcpcs_[i]=upcase(hcpcs_[i]); 638 | 639 | %do p=1 %to &ncondlist; 640 | %let condname=%scan(&condlist,&p,'|'); 641 | %let ccode=%scan(%bquote(&hcpcs),&p,'|'); 642 | %let ccodeloc=%scan(%bquote(&hcpcsloc),&p,'|'); 643 | 644 | %if "&ccodeloc"="ANY" %then %do; 645 | if hcpcs_[i] in("&ccode") and &condname.dx in(0,.) then &condname.dx=1; 646 | %end; 647 | %else %if "&ccodeloc"="DX1" %then %do; 648 | if i=1 and hcpcs_[i] in("&ccode") and &condname.dx in(0,.) then &condname.dx=1; 649 | %end; 650 | %else %if "&ccodeloc"="DX1 DX2" %then %do; 651 | if i in(1,2) and hcpcs_[i] in("&ccode") and &condname.dx in(0,.) then &condname.dx=1; 652 | %end; 653 | 654 | * Cycling through exclusion variables; 655 | %let excode=%scan(%bquote(&hcpcsexcl),&p,'|'); 656 | %let excodeloc=%scan(%bquote(&hcpcsexclloc),&p,'|'); 657 | 658 | %if "&excodeloc"="ANY" %then %do; 659 | if hcpcs_[i] in("&excode") and &condname.excl in(0,.) then &condname.excl=1; 660 | %end; 661 | %else %if "&excodeloc"="DX1" %then %do; 662 | if i=1 and hcpcs_[i] in("&excode") and &condname.excl in(0,.) then &condname.excl=1; 663 | %end; 664 | %else %if "&excodeloc"="DX1 DX2" %then %do; 665 | if i in(1,2) and hcpcs_[i] in("&excode") and &condname.excl in(0,.) then &condname.excl=1; 666 | %end; 667 | 668 | %end; 669 | 670 | end; 671 | 672 | %end; 673 | 674 | /*************************** ICD 9 PROCEDURE CODES ********************************/ 675 | %if %index(&clmvars,icd9prcdr) %then %do; 676 | 677 | array icd9prcdr_ [*] $ icd9prcdr:; 678 | 679 | * Cycling through all codes for the condition and flagging if find diagnosis; 680 | do i=1 to dim(icd9prcdr_); 681 | 682 | * Format - removing period and left adjusting; 683 | icd9prcdr_[i]=trim(left(compress(icd9prcdr_[i],"."))); 684 | if length(icd9prcdr_[i])=3 then icd9prcdr_[i]=cats(icd9prcdr_[i],"0"); 685 | 686 | %do p=1 %to &ncondlist; 687 | %let condname=%scan(&condlist,&p,'|'); 688 | %let ccode=%scan(%bquote(&icd9prcdr),&p,'|'); 689 | %let ccodeloc=%scan(%bquote(&icd9prcdrloc),&p,'|'); 690 | 691 | %if "&ccodeloc"="ANY" %then %do; 692 | if icd9prcdr_[i] in("&ccode") and &condname.dx in(0,.) then &condname.dx=1; 693 | %end; 694 | %else %if "&ccodeloc"="DX1" %then %do; 695 | if i=1 and icd9prcdr_[i] in("&ccode") and &condname.dx in(0,.) then &condname.dx=1; 696 | %end; 697 | %else %if "&ccodeloc"="DX1 DX2" %then %do; 698 | if i in(1,2) and icd9prcdr_[i] in("&ccode") and &condname.dx in(0,.) then &condname.dx=1; 699 | %end; 700 | 701 | * Cycling through exclusion variables; 702 | %let excode=%scan(%bquote(&icd9prcdrexcl),&p,'|'); 703 | %let excodeloc=%scan(%bquote(&icd9prcdrexclloc),&p,'|'); 704 | 705 | %if "&excodeloc"="ANY" %then %do; 706 | if icd9prcdr_[i] in("&excode") and &condname.excl in(0,.) then &condname.excl=1; 707 | %end; 708 | %else %if "&excodeloc"="DX1" %then %do; 709 | if i=1 and icd9prcdr_[i] in("&excode") and &condname.excl in(0,.) then &condname.excl=1; 710 | %end; 711 | %else %if "&excodeloc"="DX1 DX2" %then %do; 712 | if i in(1,2) and icd9prcdr_[i] in("&excode") and &condname.excl in(0,.) then &condname.excl=1; 713 | %end; 714 | 715 | %end; 716 | 717 | end; 718 | 719 | %end; 720 | 721 | 722 | /*************************** ICD 10 PROCEDURE CODES ********************************/ 723 | %if %index(&clmvars,icd10prcdr) %then %do; 724 | 725 | array icd10prcdr_ [*] $ icd10prcdr:; 726 | 727 | * Cycling through all codes for the condition and flagging if find diagnosis; 728 | do i=1 to dim(icd10prcdr_); 729 | 730 | * Format - removing period and left adjusting; 731 | icd10prcdr_[i]=upcase(icd10prcdr_[i]); 732 | 733 | %do p=1 %to &ncondlist; 734 | %let condname=%scan(&condlist,&p,'|'); 735 | %let ccode=%scan(%bquote(&icd10prcdr),&p,'|'); 736 | %let ccodeloc=%scan(%bquote(&icd10prcdrloc),&p,'|'); 737 | 738 | %if "&ccodeloc"="ANY" %then %do; 739 | if icd10prcdr_[i] in("&ccode") and &condname.dx in(0,.) then &condname.dx=1; 740 | %end; 741 | %else %if "&ccodeloc"="DX1" %then %do; 742 | if i=1 and icd10prcdr_[i] in("&ccode") and &condname.dx in(0,.) then &condname.dx=1; 743 | %end; 744 | %else %if "&ccodeloc"="DX1 DX2" %then %do; 745 | if i in(1,2) and icd10prcdr_[i] in("&ccode") and &condname.dx in(0,.) then &condname.dx=1; 746 | %end; 747 | 748 | * Cycling through exclusion variables; 749 | %let excode=%scan(%bquote(&icd10prcdrexcl),&p,'|'); 750 | %let excodeloc=%scan(%bquote(&icd10prcdrexclloc),&p,'|'); 751 | 752 | %if "&excodeloc"="ANY" %then %do; 753 | if icd10prcdr_[i] in("&excode") and &condname.excl in(0,.) then &condname.excl=1; 754 | %end; 755 | %else %if "&excodeloc"="DX1" %then %do; 756 | if i=1 and icd10prcdr_[i] in("&excode") and &condname.excl in(0,.) then &condname.excl=1; 757 | %end; 758 | %else %if "&excodeloc"="DX1 DX2" %then %do; 759 | if i in(1,2) and icd10prcdr_[i] in("&excode") and &condname.excl in(0,.) then &condname.excl=1; 760 | %end; 761 | 762 | %end; 763 | 764 | end; 765 | 766 | %end; 767 | 768 | 769 | /*************************** Cancelling out claims if exclusion code exists ********************************/ 770 | %do p=1 %to &Ncondlist; 771 | %let condname=%scan(&condlist,&p,'|'); 772 | 773 | %do i=1 %to &nclmgrps; 774 | %let qualclms&i=%scan("&&qualclmgrps&i",&p,"|"); 775 | %let qualnum&i=%scan(&&qualnumdx&i,&p,"|"); 776 | %end; 777 | 778 | %do m=1 %to &nclmgrps; 779 | %if "&&qualclms&m" ne "" %then %let max=&m; 780 | %end; 781 | 782 | if &condname.excl=1 then &condname.dx=0; 783 | 784 | * Only outputting claims with diagnoses and claim types of interest; 785 | if &condname.dx=1 and ( 786 | %do z=1 %to %eval(&max-1); 787 | find("&&qualclms&z",strip(claim_type)) or 788 | %end; 789 | find("&&qualclms&max",strip(claim_type)))then output claims_&condname.&filecnt.; 790 | 791 | %end; 792 | 793 | run; 794 | 795 | %mend; 796 | 797 | ***** 3) The following macro then cycles through all of the condition data sets and loops through each month of the year, 798 | taking a running count of each diagnosis if it falls in the reference period and the rules for min and max days apart. 799 | The final counts will be compared against the rules stated in CC_desc defining how many of each type of claim 800 | qualifies for that person having the chronic condition in that month. If they meet the criteria, they are flagged with a 1.; 801 | 802 | %macro cc_flags; 803 | 804 | * Getting information for each specific condition from the macro variable list; 805 | %let condname=%scan(&condlist,&p,"|"); 806 | %let refmo=%scan(&refperiod,&p,"|"); 807 | %let mindays=%scan(&mindaysapart,&p,"|"); 808 | %let maxdays=%scan(&maxdaysapart,&p,"|"); 809 | %do i=1 %to &nclmgrps; 810 | %let qualclms&i=%scan("&&qualclmgrps&i",&p,"|"); 811 | %let qualnum&i=%scan(&&qualnumdx&i,&p,"|"); 812 | %end; 813 | %put &condname; 814 | %put &refmo &mindays &maxdays; 815 | %put &&qualclmgrps&nclmgrps &&qualclms&nclmgrps &&qualnum&nclmgrps; 816 | 817 | * Counting the number of observations in the final condition data sets. If there are no observations, 818 | then creating a data set with placeholder blanks for all the necessary monthly flags; 819 | %let dsid=%sysfunc(open(&condname)); 820 | %put &dsid; 821 | %if &dsid %then %do; 822 | %let nobs=%sysfunc(attrn(&dsid,nobs)); 823 | %let rc=%sysfunc(close(&dsid)); 824 | %end; 825 | %put &nobs; 826 | 827 | %if &nobs>0 %then %do; 828 | 829 | * Getting all the claim types in the condition, e.g. IP, SNF, HHA; 830 | proc freq data=&condname. noprint; 831 | table claim_type / out=clmtypes (drop=count percent); 832 | run; 833 | 834 | data _null_; 835 | set clmtypes nobs=obs; 836 | do i=1 to obs; 837 | if _n_=i then call symputx(compress("clmtyp"||i),claim_type); 838 | end; 839 | if _n_=obs then call symputx("max_clmtyp",obs); 840 | run; 841 | 842 | %put &clmtyp1 &&clmtyp&max_clmtyp; 843 | 844 | data &condname.1; 845 | set &condname.; 846 | by &id claim_dt ; 847 | 848 | if first.&id then do; 849 | lag_&condname.dt=.; 850 | first_&condname.dx=.; 851 | end; 852 | format lag_&condname.dt first_&condname.dx mmddyy10.; 853 | retain lag_&condname.dt first_&condname.dx; 854 | 855 | * Creating a temporary array for every condition claim type month between the min and max years; 856 | %do t=1 %to &max_clmtyp; 857 | array &&clmtyp&t.._&condname. [&total_mo] _temporary_; 858 | %end; 859 | 860 | * Creating an array for every condition month; 861 | array &condname._mo [*] 862 | %do year=&mindatayear %to &maxdatayear; 863 | &condname._&year._1-&condname._&year._12 864 | %end;; 865 | 866 | * Restting at 0 for the first record of every beneficiary; 867 | if first.&id then do; 868 | %do t=1 %to &max_clmtyp; 869 | do i=1 to &total_mo; 870 | &&clmtyp&t.._&condname.[i]=0; 871 | &&clmtyp&t.=.; 872 | end; 873 | %end; 874 | end; 875 | 876 | /* The following piece of code will look at each claim date and first identify the reference period 877 | months for which the claim might qualify for the algorithm. If a claim is in 1/1/2011 and the 878 | reference period is 1 year, then the claim will start to contribute to the 12 months between 879 | January 2011 and December 2011. January 2011 will be used as the start of every loop and December 2011 880 | will be used as the end of every loop for which this claim will then be tested for the other 881 | requirements; the claim must be greater than specified min days apart from previous claim, 882 | the claim must be less than specified max days apart from previous claim, and claim must be 883 | of specific claim type. Running counts will be taken and algorithm will produce a 1 flag 884 | for when the required number of claims are found */ 885 | 886 | * First getting difference between date and start of analytical period; 887 | diff=intck("month",mdy(1,1,&mindatayear),claim_dt); 888 | 889 | * Then finding the start for when this claim would fit the reference period, have to add 1 to compensate for diff; 890 | * Maxes with 1 so that the array will not go out of range if period start is before start of analytical period; 891 | start=max(1,diff+1); 892 | 893 | * Then finding end of reference period, which is either the difference between 894 | the date and the start of analytical period or the max reference period so that 895 | the array does not go out of range; 896 | end=min(diff+&refmo,&total_mo); 897 | 898 | * Then in order to count, checking that the claim qualifies min and max days apart scenarios; 899 | if ((claim_dt-lag_&condname.dt)>=&mindays or claim_dt-lag_&condname.dt=.) then do; 900 | 901 | * Looping through each claim type; 902 | %do t=1 %to &max_clmtyp; 903 | 904 | /* Since we are using the lag of a claim to check for maximum days apart, a claim will not 905 | be counted until if finds the second claim. If this is the first time a claim is found, 906 | or if there have been a series of non-qualifying claims before this one, then the first 907 | claim will not be flagged. To compensate for these scenarios, the claims described 908 | above will contribute two to count for both that claim and the one prior. */ 909 | %if &maxdays>0 %then %do; 910 | if claim_dt-lag_&condname.dt>&maxdays then add2=1; 911 | lagadd2=lag(add2); 912 | if first.&id then lagadd2=.; 913 | if lagadd2=1 and .<(claim_dt-lag_&condname.dt)<=&maxdays then do mo=start to end; 914 | if claim_type="&&clmtyp&t" then &&clmtyp&t.._&condname.[mo]+2; 915 | end; 916 | else if .<(claim_dt-lag_&condname.dt)<=&maxdays then do mo=start to end; 917 | if claim_type="&&clmtyp&t" then &&clmtyp&t.._&condname.[mo]+1; 918 | end; 919 | %end; 920 | %else %do; 921 | do mo=start to end; 922 | if claim_type="&&clmtyp&t" then &&clmtyp&t.._&condname.[mo]+1; 923 | end; 924 | %end; 925 | %end; 926 | 927 | * Creating lag of claim for comparison to previous claim; 928 | lag_&condname.dt=claim_dt; 929 | 930 | end; 931 | 932 | ***** Check to see if the person qualifies for condition in that month; 933 | 934 | /* Loop through each month and pull information from temporary array about number of 935 | claims by claim type. For understanding, below code outside of macro may look like 936 | this: 937 | * Macro variables set: 938 | max=2; 939 | qualclms1=IP,SNF,HHA 940 | qualnum1=1 941 | qualclms2=OP,CAR 942 | qualnum2=2; 943 | 944 | do mo=1 to 144; 945 | IP=IP_ATF[mo]; 946 | OP=OP_ATF[mo]; 947 | SNF=SNF_ATF[mo]; 948 | HHA=HHA_ATF[mo]; 949 | CAR=CAR_ATF[mo]; 950 | 951 | if sum(IP,SNF,HHA)>=1 or sum(OP,CAR)>=2 then do; 952 | ATF_mo[mo]=1; 953 | if first_ATFdx=1 then first_ATFdx=claim_dt; 954 | end; 955 | end; */ 956 | 957 | do mo=1 to &total_mo; 958 | %do t=1 %to &max_clmtyp; 959 | &&clmtyp&t=&&clmtyp&t.._&condname.[mo]; 960 | %end; 961 | 962 | %do m=1 %to &nclmgrps; 963 | %if "&&qualclms&m" ne "" %then %let max=&m; 964 | %end; 965 | 966 | if 967 | %do z=1 %to %eval(&max-1); 968 | sum(&&qualclms&z)>=&&qualnum&z or 969 | %end; 970 | sum(&&qualclms&max)>=&&qualnum&max then do; 971 | &condname._mo[mo]=1; 972 | if first_&condname.dx=. then first_&condname.dx=claim_dt; 973 | end; 974 | end; 975 | 976 | ***** Keeping last record for each patient; 977 | if last.&id; 978 | 979 | keep &id. first_&condname.dx %do yr=&maxofminyears. %to &minofmaxyears.; &condname._&yr.: %end;; 980 | 981 | 982 | run; 983 | 984 | %end; 985 | %else %do; 986 | data &condname.1; 987 | set &condname; 988 | first_&condname.dx=.; 989 | %do yr=&maxofminyears. %to &minofmaxyears.; 990 | %do mo=1 %to 12; 991 | &condname._&yr._&mo=0; 992 | %end; 993 | %end; 994 | 995 | keep &id. first_&condname.dx %do yr=&maxofminyears. %to &minofmaxyears.; &condname._&yr.: %end;; 996 | 997 | run; 998 | %end; 999 | %mend; 1000 | 1001 | ***** 4) Merge to enrollment; 1002 | %macro enrollment; 1003 | 1004 | ***** Merging together all of the condition data sets and splitting it out into yearly data sets, 1005 | keeping only monthly variables for that year; 1006 | data 1007 | %do yr=&maxofminyears. %to &minofmaxyears.; 1008 | chronic_conditions_&yr (keep=&id year 1009 | 1010 | %do i=1 %to &ncondlist; 1011 | %let condname=%scan(&condlist,&i,'|'); 1012 | 1013 | first_&condname.dx 1014 | &condname._&yr: 1015 | 1016 | %end; 1017 | 1018 | rename=( 1019 | %do i=1 %to &ncondlist; 1020 | %let condname=%scan(&condlist,&i,'|'); 1021 | 1022 | %do j=1 %to 12; 1023 | &condname._&yr._&j=a_&condname._mo&j 1024 | %end; 1025 | 1026 | %end;) 1027 | 1028 | ) 1029 | %end;; 1030 | 1031 | format &id year; 1032 | 1033 | merge 1034 | %do i=1 %to &ncondlist; 1035 | %let condname=%scan(&condlist,&i,'|'); 1036 | &condname.1 1037 | %end;; 1038 | 1039 | by &id; 1040 | 1041 | %do yr=&maxofminyears. %to &minofmaxyears.; 1042 | year=&yr; 1043 | output chronic_conditions_&yr; 1044 | %end; 1045 | 1046 | run; 1047 | 1048 | %do yr=&maxofminyears. %to &minofmaxyears.; 1049 | 1050 | data &claims_out_prefix.&yr; 1051 | merge chronic_conditions_&yr (in=a) &enr_prefix.&yr (in=b); 1052 | by &id; 1053 | if b; 1054 | 1055 | * Only creating flag for periods where we have full data. E.g. if the reference period 1056 | is 3 years, then we only start to have the full enrollment period in 2005; 1057 | 1058 | %do i=1 %to &ncondlist; 1059 | %let condname=%scan(&condlist,&i,'|'); 1060 | %let refmonth=%scan(&refperiod,&i,'|'); 1061 | 1062 | %do j=1 %to 9; 1063 | if intnx('month',mdy(&j,1,year),-&refmonth+1)=&refmonth then &condname._mo&j=3; 1065 | else if &enr_var._pre_0&j>=&refmonth then &condname._mo&j=2; 1066 | else if a_&condname._mo&j=1 then &condname._mo&j=1; 1067 | else &condname._mo&j=0; 1068 | %end; 1069 | %do j=10 %to 12; 1070 | if intnx('month',mdy(&j,1,year),-&refmonth+1)=&refmonth then &condname._mo&j=3; 1072 | else if &enr_var._pre_&j>=&refmonth then &condname._mo&j=2; 1073 | else if a_&condname._mo&j=1 then &condname._mo&j=1; 1074 | else &condname._mo&j=0; 1075 | %end; 1076 | 1077 | %end; 1078 | 1079 | drop a_:; 1080 | 1081 | run; 1082 | 1083 | %end; 1084 | 1085 | %mend; 1086 | 1087 | %overcond; 1088 | 1089 | 1090 | 1091 | 1092 | 1093 | -------------------------------------------------------------------------------- /CC_Package_27v0/programs/input_program.sas: -------------------------------------------------------------------------------- 1 | /*********************************************************************************************/ 2 | TITLE1 'Chronic Conditions Macro'; 3 | 4 | * AUTHOR: Patricia Ferido; 5 | 6 | * DATE: 3/26/2018; 7 | 8 | * PURPOSE: Run all programs related to Chronic Conditions Package; 9 | 10 | options compress=yes nocenter ls=150 ps=200 errors=5 errorabend errorcheck=strict mprint merror 11 | mergenoby=warn varlenchk=error dkricond=error dkrocond=error msglevel=i; 12 | /*********************************************************************************************/ 13 | 14 | ****** Set up libnames - optional; 15 | 16 | /******************************************************************************************************************** 17 | Macro Variables - Information needed for macro below; 18 | * PROJHOME: project filepath to the Chronic_Conditions_Package folder; 19 | * ID: Name of unique patient ID variable in claims data; 20 | * MINYEAR First year of data that you want to process; 21 | * MAXYEAR: Last year of data that you want to process; 22 | * CLAIMS_DATA: Name of the cleaned claims data sets you want to process. If multiple, separate by a space; 23 | * CREATE_ENR: Y/N - Y if enrollment files need to be created, N - if they already exist; 24 | * If Y, then define the following variables:; 25 | * CREATE_ENR_SHAPE: two possible inputs: A - annual files with monthly entries, P - single period file with beneficiary 26 | entries per each unique period of continous enrollment (P). Note that multipe entries per beneficiary are allowed in P; 27 | * CREATE_ENR_FILEIN: provide input files of beneficiary enrollment information with libref; 28 | * ENR_PREFIX: name of the enrollment files you want to create with libref, yearly suffix will be added automatically; 29 | * ENR_VAR: name of enrollment variable you want to use (e.g. MA, FFS, enr), monthly suffix will be added automatically; 30 | * If N, then define the following variables:; 31 | * CREATE_ENR_SHAPE: leave blank; 32 | * CREATE_ENR_FILEIN: leave blank; 33 | * ENR_PREFIX: name of enrollment files with libref and without yearly suffix; 34 | * ENR_VAR: prefix of monthly enrollment variable in provided enrollment files; 35 | * CLAIMS_OUT_PREFIX: Prefix for yearly output data sets, suffix will automatically be year. Don't forget to include libref if creating permanent; 36 | * CUSTOM_ALGORITHM: Y/N - Y if input excel sheets have been modified and should be used, N if default chronic conditions should be used. Default is N; 37 | * CUSTOM_SUFFIX: If Y is specified above, then this suffix will be added to specify your custom algorithms. Default is _custom; 38 | * CUSTOM_COND: List of shorthand conditions to identify, default if left blank is all 27 original CCW conditions; 39 | *******************************************************************************************************************/ 40 | 41 | ****** Wrapper macro; 42 | %include "idcond.sas"; 43 | 44 | ****** Macro Function; 45 | %idcond(projhome=, 46 | id=, 47 | minyear=, 48 | maxyear=, 49 | claims_data=, 50 | create_enr=, 51 | create_enr_shape=, 52 | create_enr_filein=, 53 | enr_prefix=, 54 | enr_var=, 55 | claims_out_prefix=, 56 | custom_algorithm=, 57 | custom_suffix=, 58 | custom_cond=); 59 | 60 | 61 | ****** Example; 62 | /*%idcond(projhome=/disk/agedisk3/medicare.work/goldman-DUA51866/ferido-dua51866/CCW package/Chronic_Conditions_Package_5pct/, 63 | id=bene_id, 64 | minyear=2004, 65 | minyear=2016, 66 | claims_data=_ccproj.claims_test2002 _ccproj.claims_test2003 _ccproj.claims_test2004 _ccproj.claims_test2005 _ccproj.claims_test2006 _ccproj.claims_test2007 _ccproj.claims_test2008 _ccproj.claims_test2009 _ccproj.claims_test2010 _ccproj.claims_test2011 _ccproj.claims_test2012 _ccproj.claims_test2013 67 | _ccproj.claims_test2014 _ccproj.claims_test2015 _ccproj.claims_test2016, 68 | create_enr=N, 69 | create_enr_shape=, 70 | create_enr_filein=, 71 | enr_prefix=enr.enrffs_, 72 | enr_var=ffsab, 73 | claims_out_prefix=_ccproj.chronic_conditions_, 74 | custom_algorithm=Y, 75 | custom_suffix=_T2DIAB, 76 | cond=T2DIAB); */ 77 | 78 | -------------------------------------------------------------------------------- /CC_Package_27v0/programs/readin_input_files.sas: -------------------------------------------------------------------------------- 1 | /*********************************************************************************************/ 2 | TITLE1 'Chronic Conditions Macro'; 3 | 4 | * AUTHOR: Patricia Ferido; 5 | 6 | * DATE: 3/26/2018; 7 | 8 | * PURPOSE: - Read In Customized CSV Input files that determine conditions and algorithms, and list 9 | all codes of interest 10 | - Check that all input files and claims data are formatted correctly 11 | - Please see document titled "For Users - Chronic Conditions Macro Documentation" 12 | before running any programs; 13 | 14 | * INPUT: Claims Data, CSV files CC_codes, CC_desc, CC_exclude; 15 | * OUTPUT: SAS files CC_codes, CC_desc, CC_exclude; 16 | 17 | options compress=yes nocenter ls=150 ps=200 errors=5 errorabend errorcheck=strict mprint merror 18 | mergenoby=warn varlenchk=error dkricond=error dkrocond=error msglevel=i; 19 | /*********************************************************************************************/ 20 | 21 | ***** Read in Input CSV Files ; 22 | 23 | * CC Codes; 24 | data cc_codes; 25 | infile "&projhome./csv_input/CC_Codes.csv" dlm="2c"x dsd lrecl=32767 missover firstobs=2; 26 | informat 27 | Condition $10. 28 | CodeType $10. 29 | DxCodeLocation $8. 30 | DxCode $10.; 31 | format 32 | Condition $10. 33 | CodeType $10. 34 | DxCodeLocation $8. 35 | DxCode $10.; 36 | input 37 | Condition $ 38 | CodeType $ 39 | DxCodeLocation $ 40 | DxCode $; 41 | run; 42 | 43 | * CC Desc; 44 | proc import datafile="&projhome./csv_input/CC_Desc.csv" out=cc_desc dbms=dlm; 45 | delimiter=","; 46 | getnames=yes; 47 | guessingrows=max; 48 | run; 49 | 50 | * CC Exclude; 51 | data cc_exclude; 52 | infile "&projhome./csv_input/CC_Exclude.csv" dlm="2c"x dsd lrecl=32767 missover firstobs=2; 53 | informat 54 | Condition $10. 55 | CodeType $10. 56 | DxCode $10. 57 | DxCodeLocation $8.; 58 | format 59 | Condition $10. 60 | CodeType $10. 61 | DxCode $10. 62 | DxCodeLocation $8.; 63 | input 64 | Condition $ 65 | CodeType $ 66 | DxCode $ 67 | DxCodeLocation $; 68 | run; 69 | 70 | ***** Get contents; 71 | 72 | proc contents data=cc_codes out=contents_cc_codes noprint; run; 73 | proc contents data=cc_desc out=contents_cc_desc noprint; run; 74 | proc contents data=cc_exclude out=contents_cc_exclude noprint; run; 75 | 76 | ***** Standardize and check for values that shouldn't be there, if there are errors, the errors 77 | will print to log and the program will terminate; 78 | 79 | * Standardizing CC_Codes and checking for valid inputs; 80 | data cc_codes; 81 | set cc_codes; 82 | condition=upcase(condition); 83 | codetype=upcase(codetype); 84 | dxcodelocation=upcase(dxcodelocation); 85 | if codetype not in("ICD9DX","ICD10DX","ICD9PRCDR","ICD10PRCDR","HCPCS") then do; 86 | put "ERROR: INVALID CC_Codes Codetype " codetype=/; 87 | abort abend; 88 | end; 89 | if dxcodelocation not in("ANY","DX1","DX1 DX2") then do; 90 | put "ERROR: INVALID CC_Codes DxCodeLocation " dxcodelocation=/; 91 | abort abend; 92 | end; 93 | if codetype="ICD10PRCDR" and length(dxcode) ne 7 then do; 94 | put "ERROR: INVALID ICD10PRCDR CODE " dxcode=/; 95 | abort abend; 96 | end; 97 | if codetype="HCPCS" and length(dxcode) ne 5 then do; 98 | put "ERROR: INVALID HCPCS CODE " dxcode=/; 99 | abort abend; 100 | end; 101 | run; 102 | 103 | * Standardizing CC_Exclude and checking for valid inputs; 104 | data cc_exclude; 105 | set cc_exclude; 106 | condition=upcase(condition); 107 | codetype=upcase(codetype); 108 | dxcodelocation=upcase(dxcodelocation); 109 | if codetype not in("ICD9DX","ICD10DX","ICD9PRCDR","ICD10PRCDR","HCPCS") then do; 110 | put "ERROR: INVALID CC_Codes Codetype " codetype=/; 111 | abort abend; 112 | end; 113 | if dxcodelocation not in("ANY","DX1","DX1 DX2") then do; 114 | put "ERROR: INVALID CC_Codes DxCodeLocation " dxcodelocation=/; 115 | abort abend; 116 | end; 117 | if codetype="ICD10PRCDR" and length(dxcode) ne 7 then do; 118 | put "ERROR: INVALID ICD10PRCDR CODE " dxcode=/; 119 | abort abend; 120 | end; 121 | if codetype="HCPCS" and length(dxcode) ne 5 then do; 122 | put "ERROR: INVALID HCPCS CODE " dxcode=/; 123 | abort abend; 124 | end; 125 | run; 126 | 127 | * Standardizing CC_Desc and checking for valid inputs; 128 | data _null_; 129 | set contents_cc_desc; 130 | if name="ref_months" and type=2 then do; 131 | put "ERROR: ALPHABETIC VALUE IN ref_months FOR CC_Desc"; 132 | abort abend; 133 | end; 134 | if find(name,'num_dx') and type=2 then do; 135 | put "ERROR: ALPHABETIC VALUE IN num_dx FOR CC_Desc"; 136 | abort abend; 137 | end; 138 | if name="min_days_apart" and type=2 then do; 139 | put "ERROR: ALPHABETIC VALUE IN min_days_apart FOR CC_Desc"; 140 | abort abend; 141 | end; 142 | run; 143 | 144 | data cc_desc; 145 | set cc_desc; 146 | condition=upcase(condition); 147 | 148 | * Making max_days_apart numeric if it isn't already; 149 | max_days_apart1=max_days_apart*1; 150 | 151 | array claim_type [*] claim_type:; 152 | array num_dx [*] num_dx:; 153 | 154 | * Upcasing claim_type; 155 | do i=1 to dim(claim_type); 156 | claim_type[i]=upcase(claim_type[i]); 157 | end; 158 | 159 | * Checks; 160 | do i=1 to dim(claim_type); 161 | if claim_type[i] ne "" and num_dx[i]=. then do; 162 | put "ERROR: MISSING num_dx FOR CC_Desc"; 163 | abort abend; 164 | end; 165 | if claim_type[i]="" and num_dx[i] ne . then do; 166 | put "ERROR: MISSING claim_type FOR CC_Desc"; 167 | abort abend; 168 | end; 169 | end; 170 | if min_days_apart<=0 then do; 171 | put "ERROR: MISSING or NEGATIVE min_days_apart in CC_Desc"; 172 | abort abend; 173 | end; 174 | if ref_months<=0 then do; 175 | put "ERROR: MISSING or NEGATIVE ref_months in CC_Desc"; 176 | abort abend; 177 | end; 178 | drop max_days_apart; 179 | rename max_days_apart1=max_days_apart; 180 | run; 181 | 182 | * Checking that all condition codes are the same between the three input files; 183 | proc freq data=cc_codes noprint; 184 | table condition / out=condition_codes; 185 | run; 186 | 187 | proc freq data=cc_desc noprint; 188 | table condition / out=condition_desc; 189 | run; 190 | 191 | proc freq data=cc_exclude noprint; 192 | table condition / out=condition_exclude; 193 | run; 194 | 195 | data condition_ck; 196 | length condition $10.; 197 | merge condition_desc (in=a) condition_codes (in=b) condition_exclude (in=c); 198 | by condition; 199 | desc=a; 200 | codes=b; 201 | exclude=c; 202 | run; 203 | 204 | proc freq data=condition_ck noprint; 205 | table desc*codes*exclude / out=freq_condition_ck; 206 | run; 207 | 208 | data _null_; 209 | set freq_condition_ck; 210 | 211 | if desc=1 and codes=0 then do; 212 | put "ERROR: THERE ARE CONDITIONS IN CC_Desc BUT NOT IN CC_Codes"; 213 | abort abend; 214 | end; 215 | if codes=1 and desc=0 then do; 216 | put "ERROR: THERER ARE CONDITIONS IN CC_Codes BUT NOT IN CC_Desc"; 217 | abort abend; 218 | end; 219 | if exclude=1 and max(desc,codes) ne 1 then do; 220 | put "ERROR: THERE ARE CONDITIONS IN CC_Exclude not in CC_Desc or CC_Codes"; 221 | abort abend; 222 | end; 223 | 224 | run; 225 | 226 | ***** Create permanents - will only get to this step if there were no errors above; 227 | data _ccproj.cc_codes&custom_suffix.; 228 | set cc_codes; 229 | run; 230 | 231 | data _ccproj.cc_desc&custom_suffix.; 232 | set cc_desc; 233 | run; 234 | 235 | data _ccproj.cc_exclude&custom_suffix.; 236 | set cc_exclude; 237 | run; -------------------------------------------------------------------------------- /CC_Package_27v1/Preparation Checklist - Chronic Conditions Package.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_27v1/Preparation Checklist - Chronic Conditions Package.docx -------------------------------------------------------------------------------- /CC_Package_27v1/User Guide - Chronic Conditions Package.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_27v1/User Guide - Chronic Conditions Package.docx -------------------------------------------------------------------------------- /CC_Package_27v1/csv_input/CC_Desc.csv: -------------------------------------------------------------------------------- 1 | Condition,Condition_long,Claim_type1,Num_dx1,Claim_type2,Num_dx2,Min_Days_Apart,Max_Days_apart,Ref_months,Source 2 | HYPOTH,Hypothyroidism,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 3 | AMI,Acute Myocardial Infarction,IP,1,,,1,,12,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 4 | ALZH,Alzheimer's Disease,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 5 | NONADDEM,Non-Alzheimer's Dementia,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 6 | ANEMIA,Anemia,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 7 | ASTHMA,Asthma,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 8 | ATRIALF,Atrial Fibrillation and Flutter,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 9 | HYPERP,Benign Prostatic Hyperplasia,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 10 | CATARACT,Cataract,"OP,CAR",1,,,1,,12,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 11 | CKD,Chronic Kidney Disease,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 12 | COPD,Chronic Obstructive Pulmonary Disease,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 13 | CNCRCLR,"Cancer, Colorectal","IP,SNF",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 14 | DEPRESSN,"Depression, Bipolar, or Other Depressive Mood Disorters","IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 15 | DIABETES,Diabetes,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 16 | CNCREND,"Cancer, Endometrial","IP,SNF",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 17 | CNCRBRST,"Cancer, Breast","IP,SNF",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 18 | GLAUCOMA,Glaucoma,"OP,CAR",1,,,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 19 | CHF,Heart Failure and Non-Ischemic Heart Disease,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 20 | HIPFRAC,Hip/Pelvic Fracture,"IP,SNF,OP,CAR",1,,,1,,12,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 21 | HYPERL,Hyperlipedemia,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 22 | HYPERT,Hypertension,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 23 | ISCHMCHT,Ischemic Heart Disease,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 24 | CNCRLNG,"Cancer, Lung","IP,SNF",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 25 | OSTEOPRS,Osteoporosis With or Without Pathological Fracture,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 26 | CNCRPRST,"Cancer, Prostate","IP,SNF",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 27 | RAOA,Rheumatoid Arthritis/Osteoarthritis,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 28 | STRKETIA,Stroke/Transient Ischemic Attack,"IP,OP,CAR",1,,,1,,12,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 29 | CNCRURO,"Cancer, Urologic (Kidney, Renal Pelvis, and Ureter)","IP,SNF",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 30 | PARKINSN,Parkinson's Disease and Secondary Parkinsonism,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 31 | PNEUM,"Pneumonia, all-cause","IP,SNF,HHA",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition 30 Categories (Feb. 2022) 32 | -------------------------------------------------------------------------------- /CC_Package_27v1/csv_input/CC_Exclude.csv: -------------------------------------------------------------------------------- 1 | Condition,CodeType,DxCode,DxCodeLocation 2 | HYPERP,ICD10DX,D29.1,ANY 3 | STRKETIA,ICD10DX,S02.0XXA,ANY 4 | STRKETIA,ICD10DX,S02.10XA,ANY 5 | STRKETIA,ICD10DX,S02.10XB,ANY 6 | STRKETIA,ICD10DX,S02.110A,ANY 7 | STRKETIA,ICD10DX,S02.111A,ANY 8 | STRKETIA,ICD10DX,S02.112A,ANY 9 | STRKETIA,ICD10DX,S02.113A,ANY 10 | STRKETIA,ICD10DX,S02.110B,ANY 11 | STRKETIA,ICD10DX,S02.110D,ANY 12 | STRKETIA,ICD10DX,S02.110G,ANY 13 | STRKETIA,ICD10DX,S02.110K,ANY 14 | STRKETIA,ICD10DX,S02.110S,ANY 15 | STRKETIA,ICD10DX,S02.111A,ANY 16 | STRKETIA,ICD10DX,S02.111B,ANY 17 | STRKETIA,ICD10DX,S02.112B,ANY 18 | STRKETIA,ICD10DX,S02.113B,ANY 19 | STRKETIA,ICD10DX,S02.118A,ANY 20 | STRKETIA,ICD10DX,S02.118B,ANY 21 | STRKETIA,ICD10DX,S02.119A,ANY 22 | STRKETIA,ICD10DX,S02.119B,ANY 23 | STRKETIA,ICD10DX,S02.19XA,ANY 24 | STRKETIA,ICD10DX,S02.19XB,ANY 25 | STRKETIA,ICD10DX,S02.2XXA,ANY 26 | STRKETIA,ICD10DX,S02.2XXB,ANY 27 | STRKETIA,ICD10DX,S02.3XXA,ANY 28 | STRKETIA,ICD10DX,S02.3XXB,ANY 29 | STRKETIA,ICD10DX,S02.400A,ANY 30 | STRKETIA,ICD10DX,S02.401A,ANY 31 | STRKETIA,ICD10DX,S02.402A,ANY 32 | STRKETIA,ICD10DX,S02.400B,ANY 33 | STRKETIA,ICD10DX,S02.401B,ANY 34 | STRKETIA,ICD10DX,S02.402B,ANY 35 | STRKETIA,ICD10DX,S02.411A,ANY 36 | STRKETIA,ICD10DX,S02.412A,ANY 37 | STRKETIA,ICD10DX,S02.413A,ANY 38 | STRKETIA,ICD10DX,S02.411B,ANY 39 | STRKETIA,ICD10DX,S02.412B,ANY 40 | STRKETIA,ICD10DX,S02.413B,ANY 41 | STRKETIA,ICD10DX,S02.42XA,ANY 42 | STRKETIA,ICD10DX,S02.42XB,ANY 43 | STRKETIA,ICD10DX,S02.600A,ANY 44 | STRKETIA,ICD10DX,S02.600B,ANY 45 | STRKETIA,ICD10DX,S02.609A,ANY 46 | STRKETIA,ICD10DX,S02.609B,ANY 47 | STRKETIA,ICD10DX,S02.61XA,ANY 48 | STRKETIA,ICD10DX,S02.62XA,ANY 49 | STRKETIA,ICD10DX,S02.63XA,ANY 50 | STRKETIA,ICD10DX,S02.64XA,ANY 51 | STRKETIA,ICD10DX,S02.65XA,ANY 52 | STRKETIA,ICD10DX,S02.66XA,ANY 53 | STRKETIA,ICD10DX,S02.67XA,ANY 54 | STRKETIA,ICD10DX,S02.69XA,ANY 55 | STRKETIA,ICD10DX,S02.61XB,ANY 56 | STRKETIA,ICD10DX,S02.62XA,ANY 57 | STRKETIA,ICD10DX,S02.63XA,ANY 58 | STRKETIA,ICD10DX,S02.64XA,ANY 59 | STRKETIA,ICD10DX,S02.65XA,ANY 60 | STRKETIA,ICD10DX,S02.66XA,ANY 61 | STRKETIA,ICD10DX,S02.67XB,ANY 62 | STRKETIA,ICD10DX,S02.69XB,ANY 63 | STRKETIA,ICD10DX,S02.8XXA,ANY 64 | STRKETIA,ICD10DX,S02.8XXB,ANY 65 | STRKETIA,ICD10DX,S02.91XA,ANY 66 | STRKETIA,ICD10DX,S02.91XB,ANY 67 | STRKETIA,ICD10DX,S02.92XA,ANY 68 | STRKETIA,ICD10DX,S02.92XB,ANY 69 | STRKETIA,ICD10DX,S06.0X0A,ANY 70 | STRKETIA,ICD10DX,S06.0X1A,ANY 71 | STRKETIA,ICD10DX,S06.0X2A,ANY 72 | STRKETIA,ICD10DX,S06.0X3A,ANY 73 | STRKETIA,ICD10DX,S06.0X4A,ANY 74 | STRKETIA,ICD10DX,S06.0X5A,ANY 75 | STRKETIA,ICD10DX,S06.0X6A,ANY 76 | STRKETIA,ICD10DX,S06.0X7A,ANY 77 | STRKETIA,ICD10DX,S06.0X8A,ANY 78 | STRKETIA,ICD10DX,S06.0X9A,ANY 79 | STRKETIA,ICD10DX,S06.1X0A,ANY 80 | STRKETIA,ICD10DX,S06.1X1A,ANY 81 | STRKETIA,ICD10DX,S06.1X2A,ANY 82 | STRKETIA,ICD10DX,S06.1X3A,ANY 83 | STRKETIA,ICD10DX,S06.1X4A,ANY 84 | STRKETIA,ICD10DX,S06.1X5A,ANY 85 | STRKETIA,ICD10DX,S06.1X6A,ANY 86 | STRKETIA,ICD10DX,S06.1X7A,ANY 87 | STRKETIA,ICD10DX,S06.1X8A,ANY 88 | STRKETIA,ICD10DX,S06.1X9A,ANY 89 | STRKETIA,ICD10DX,S06.2X0A,ANY 90 | STRKETIA,ICD10DX,S06.2X1A,ANY 91 | STRKETIA,ICD10DX,S06.2X2A,ANY 92 | STRKETIA,ICD10DX,S06.2X3A,ANY 93 | STRKETIA,ICD10DX,S06.2X4A,ANY 94 | STRKETIA,ICD10DX,S06.2X5A,ANY 95 | STRKETIA,ICD10DX,S06.2X6A,ANY 96 | STRKETIA,ICD10DX,S06.2X7A,ANY 97 | STRKETIA,ICD10DX,S06.2X8A,ANY 98 | STRKETIA,ICD10DX,S06.2X9A,ANY 99 | STRKETIA,ICD10DX,S06.2X0B,ANY 100 | STRKETIA,ICD10DX,S06.2X1B,ANY 101 | STRKETIA,ICD10DX,S06.2X2B,ANY 102 | STRKETIA,ICD10DX,S06.2X3B,ANY 103 | STRKETIA,ICD10DX,S06.2X4B,ANY 104 | STRKETIA,ICD10DX,S06.2X5B,ANY 105 | STRKETIA,ICD10DX,S06.2X6B,ANY 106 | STRKETIA,ICD10DX,S06.2X7B,ANY 107 | STRKETIA,ICD10DX,S06.2X8B,ANY 108 | STRKETIA,ICD10DX,S06.2X9B,ANY 109 | STRKETIA,ICD10DX,S06.300A,ANY 110 | STRKETIA,ICD10DX,S06.301A,ANY 111 | STRKETIA,ICD10DX,S06.302A,ANY 112 | STRKETIA,ICD10DX,S06.303A,ANY 113 | STRKETIA,ICD10DX,S06.304A,ANY 114 | STRKETIA,ICD10DX,S06.305A,ANY 115 | STRKETIA,ICD10DX,S06.306A,ANY 116 | STRKETIA,ICD10DX,S06.307A,ANY 117 | STRKETIA,ICD10DX,S06.308A,ANY 118 | STRKETIA,ICD10DX,S06.309A,ANY 119 | STRKETIA,ICD10DX,S06.310A,ANY 120 | STRKETIA,ICD10DX,S06.311A,ANY 121 | STRKETIA,ICD10DX,S06.312A,ANY 122 | STRKETIA,ICD10DX,S06.313A,ANY 123 | STRKETIA,ICD10DX,S06.314A,ANY 124 | STRKETIA,ICD10DX,S06.315A,ANY 125 | STRKETIA,ICD10DX,S06.316A,ANY 126 | STRKETIA,ICD10DX,S06.317A,ANY 127 | STRKETIA,ICD10DX,S06.318A,ANY 128 | STRKETIA,ICD10DX,S06.319A,ANY 129 | STRKETIA,ICD10DX,S06.320A,ANY 130 | STRKETIA,ICD10DX,S06.321A,ANY 131 | STRKETIA,ICD10DX,S06.322A,ANY 132 | STRKETIA,ICD10DX,S06.323A,ANY 133 | STRKETIA,ICD10DX,S06.324A,ANY 134 | STRKETIA,ICD10DX,S06.325A,ANY 135 | STRKETIA,ICD10DX,S06.326A,ANY 136 | STRKETIA,ICD10DX,S06.327A,ANY 137 | STRKETIA,ICD10DX,S06.328A,ANY 138 | STRKETIA,ICD10DX,S06.329A,ANY 139 | STRKETIA,ICD10DX,S06.330A,ANY 140 | STRKETIA,ICD10DX,S06.331A,ANY 141 | STRKETIA,ICD10DX,S06.332A,ANY 142 | STRKETIA,ICD10DX,S06.333A,ANY 143 | STRKETIA,ICD10DX,S06.334A,ANY 144 | STRKETIA,ICD10DX,S06.335A,ANY 145 | STRKETIA,ICD10DX,S06.336A,ANY 146 | STRKETIA,ICD10DX,S06.337A,ANY 147 | STRKETIA,ICD10DX,S06.338A,ANY 148 | STRKETIA,ICD10DX,S06.339A,ANY 149 | STRKETIA,ICD10DX,S06.340A,ANY 150 | STRKETIA,ICD10DX,S06.341A,ANY 151 | STRKETIA,ICD10DX,S06.342A,ANY 152 | STRKETIA,ICD10DX,S06.343A,ANY 153 | STRKETIA,ICD10DX,S06.344A,ANY 154 | STRKETIA,ICD10DX,S06.345A,ANY 155 | STRKETIA,ICD10DX,S06.346A,ANY 156 | STRKETIA,ICD10DX,S06.347A,ANY 157 | STRKETIA,ICD10DX,S06.348A,ANY 158 | STRKETIA,ICD10DX,S06.349A,ANY 159 | STRKETIA,ICD10DX,S06.350A,ANY 160 | STRKETIA,ICD10DX,S06.351A,ANY 161 | STRKETIA,ICD10DX,S06.352A,ANY 162 | STRKETIA,ICD10DX,S06.353A,ANY 163 | STRKETIA,ICD10DX,S06.354A,ANY 164 | STRKETIA,ICD10DX,S06.355A,ANY 165 | STRKETIA,ICD10DX,S06.356A,ANY 166 | STRKETIA,ICD10DX,S06.357A,ANY 167 | STRKETIA,ICD10DX,S06.358A,ANY 168 | STRKETIA,ICD10DX,S06.359A,ANY 169 | STRKETIA,ICD10DX,S06.360A,ANY 170 | STRKETIA,ICD10DX,S06.361A,ANY 171 | STRKETIA,ICD10DX,S06.362A,ANY 172 | STRKETIA,ICD10DX,S06.363A,ANY 173 | STRKETIA,ICD10DX,S06.364A,ANY 174 | STRKETIA,ICD10DX,S06.365A,ANY 175 | STRKETIA,ICD10DX,S06.366A,ANY 176 | STRKETIA,ICD10DX,S06.367A,ANY 177 | STRKETIA,ICD10DX,S06.368A,ANY 178 | STRKETIA,ICD10DX,S06.369A,ANY 179 | STRKETIA,ICD10DX,S06.370A,ANY 180 | STRKETIA,ICD10DX,S06.371A,ANY 181 | STRKETIA,ICD10DX,S06.372A,ANY 182 | STRKETIA,ICD10DX,S06.373A,ANY 183 | STRKETIA,ICD10DX,S06.374A,ANY 184 | STRKETIA,ICD10DX,S06.375A,ANY 185 | STRKETIA,ICD10DX,S06.376A,ANY 186 | STRKETIA,ICD10DX,S06.377A,ANY 187 | STRKETIA,ICD10DX,S06.378A,ANY 188 | STRKETIA,ICD10DX,S06.379A,ANY 189 | STRKETIA,ICD10DX,S06.380A,ANY 190 | STRKETIA,ICD10DX,S06.381A,ANY 191 | STRKETIA,ICD10DX,S06.382A,ANY 192 | STRKETIA,ICD10DX,S06.383A,ANY 193 | STRKETIA,ICD10DX,S06.384A,ANY 194 | STRKETIA,ICD10DX,S06.385A,ANY 195 | STRKETIA,ICD10DX,S06.386A,ANY 196 | STRKETIA,ICD10DX,S06.387A,ANY 197 | STRKETIA,ICD10DX,S06.388A,ANY 198 | STRKETIA,ICD10DX,S06.389A,ANY 199 | STRKETIA,ICD10DX,S06.4X1A,ANY 200 | STRKETIA,ICD10DX,S06.4X2A,ANY 201 | STRKETIA,ICD10DX,S06.4X3A,ANY 202 | STRKETIA,ICD10DX,S06.4X4A,ANY 203 | STRKETIA,ICD10DX,S06.4X5A,ANY 204 | STRKETIA,ICD10DX,S06.4X6A,ANY 205 | STRKETIA,ICD10DX,S06.4X7A,ANY 206 | STRKETIA,ICD10DX,S06.4X8A,ANY 207 | STRKETIA,ICD10DX,S06.4X9A,ANY 208 | STRKETIA,ICD10DX,S06.5X0A,ANY 209 | STRKETIA,ICD10DX,S06.5X1A,ANY 210 | STRKETIA,ICD10DX,S06.5X2A,ANY 211 | STRKETIA,ICD10DX,S06.5X3A,ANY 212 | STRKETIA,ICD10DX,S06.5X4A,ANY 213 | STRKETIA,ICD10DX,S06.5X5A,ANY 214 | STRKETIA,ICD10DX,S06.5X6A,ANY 215 | STRKETIA,ICD10DX,S06.5X7A,ANY 216 | STRKETIA,ICD10DX,S06.5X8A,ANY 217 | STRKETIA,ICD10DX,S06.5X9A,ANY 218 | STRKETIA,ICD10DX,S06.6X0A,ANY 219 | STRKETIA,ICD10DX,S06.6X1A,ANY 220 | STRKETIA,ICD10DX,S06.6X2A,ANY 221 | STRKETIA,ICD10DX,S06.6X3A,ANY 222 | STRKETIA,ICD10DX,S06.6X4A,ANY 223 | STRKETIA,ICD10DX,S06.6X5A,ANY 224 | STRKETIA,ICD10DX,S06.6X6A,ANY 225 | STRKETIA,ICD10DX,S06.6X7A,ANY 226 | STRKETIA,ICD10DX,S06.6X8A,ANY 227 | STRKETIA,ICD10DX,S06.6X9A,ANY 228 | STRKETIA,ICD10DX,S06.810A,ANY 229 | STRKETIA,ICD10DX,S06.811A,ANY 230 | STRKETIA,ICD10DX,S06.812A,ANY 231 | STRKETIA,ICD10DX,S06.813A,ANY 232 | STRKETIA,ICD10DX,S06.814A,ANY 233 | STRKETIA,ICD10DX,S06.815A,ANY 234 | STRKETIA,ICD10DX,S06.816A,ANY 235 | STRKETIA,ICD10DX,S06.817A,ANY 236 | STRKETIA,ICD10DX,S06.818A,ANY 237 | STRKETIA,ICD10DX,S06.819A,ANY 238 | STRKETIA,ICD10DX,S06.820A,ANY 239 | STRKETIA,ICD10DX,S06.821A,ANY 240 | STRKETIA,ICD10DX,S06.822A,ANY 241 | STRKETIA,ICD10DX,S06.823A,ANY 242 | STRKETIA,ICD10DX,S06.824A,ANY 243 | STRKETIA,ICD10DX,S06.825A,ANY 244 | STRKETIA,ICD10DX,S06.826A,ANY 245 | STRKETIA,ICD10DX,S06.827A,ANY 246 | STRKETIA,ICD10DX,S06.828A,ANY 247 | STRKETIA,ICD10DX,S06.829A,ANY 248 | STRKETIA,ICD10DX,S06.890A,ANY 249 | STRKETIA,ICD10DX,S06.891A,ANY 250 | STRKETIA,ICD10DX,S06.892A,ANY 251 | STRKETIA,ICD10DX,S06.893A,ANY 252 | STRKETIA,ICD10DX,S06.894A,ANY 253 | STRKETIA,ICD10DX,S06.895A,ANY 254 | STRKETIA,ICD10DX,S06.896A,ANY 255 | STRKETIA,ICD10DX,S06.897A,ANY 256 | STRKETIA,ICD10DX,S06.898A,ANY 257 | STRKETIA,ICD10DX,S06.899A,ANY 258 | STRKETIA,ICD10DX,S06.9X0A,ANY 259 | STRKETIA,ICD10DX,S06.9X1A,ANY 260 | STRKETIA,ICD10DX,S06.9X2A,ANY 261 | STRKETIA,ICD10DX,S06.9X3A,ANY 262 | STRKETIA,ICD10DX,S06.9X4A,ANY 263 | STRKETIA,ICD10DX,S06.9X5A,ANY 264 | STRKETIA,ICD10DX,S06.9X6A,ANY 265 | STRKETIA,ICD10DX,S06.9X7A,ANY 266 | STRKETIA,ICD10DX,S06.9X8A,ANY 267 | STRKETIA,ICD10DX,S06.9X9A,ANY 268 | STRKETIA,ICD10DX,S06.A0XA,ANY 269 | STRKETIA,ICD10DX,S06.A1XA,ANY 270 | -------------------------------------------------------------------------------- /CC_Package_27v1/data/cc_codes_original.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_27v1/data/cc_codes_original.sas7bdat -------------------------------------------------------------------------------- /CC_Package_27v1/data/cc_desc_original.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_27v1/data/cc_desc_original.sas7bdat -------------------------------------------------------------------------------- /CC_Package_27v1/data/cc_exclude_original.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_27v1/data/cc_exclude_original.sas7bdat -------------------------------------------------------------------------------- /CC_Package_27v1/documentation/README.txt: -------------------------------------------------------------------------------- 1 | These are archived versions of the CCW condition categories. The algorithm is based off of the codes in the version of the 30 chronic conditions from Feb 2022. 2 | . -------------------------------------------------------------------------------- /CC_Package_27v1/documentation/ccw_conditioncategories2010.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_27v1/documentation/ccw_conditioncategories2010.pdf -------------------------------------------------------------------------------- /CC_Package_27v1/documentation/ccw_conditioncategories2012.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_27v1/documentation/ccw_conditioncategories2012.pdf -------------------------------------------------------------------------------- /CC_Package_27v1/documentation/ccw_conditioncategories2017.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_27v1/documentation/ccw_conditioncategories2017.pdf -------------------------------------------------------------------------------- /CC_Package_27v1/documentation/chr-chronic-condition-algorithms2022.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_27v1/documentation/chr-chronic-condition-algorithms2022.pdf -------------------------------------------------------------------------------- /CC_Package_27v1/programs/contenr.sas: -------------------------------------------------------------------------------- 1 | /************************************************************************************************************************* 2 | ***** MACRO: contenr 3 | 4 | ***** DESCRIPTION: This macro identifies length of continous enrollment (in months) for all beneficiaries included in an input dateset 5 | at any point in time. The macro generates a set of yearly files with one entry for each beneficiary and 24 columns, 6 | two for each month, identifying number of months of continous enrolment from one particular month on, and up to a 7 | particular month (including the reference month). 8 | 9 | ***** ARGUMENTS 10 | 11 | - begyr: first year of data, to begin the enrollment count 12 | - endyr: last year of data, to end the enrollment count 13 | - shape: Shape of the source data. The macro allows for two different type of source data, A (annual files) and P (period file). 14 | See below for description of input files. 15 | - filein: Root name of the source file in the case of the annual files (A) or the full name for the period file (P) 16 | (E.g. if shape=A and filein=enr, the actual files are enrYYYY or enrQQYYYY or enrMMYYYY. 17 | If the file is permanently stored, the libname can be included - libname.enr). 18 | - fileout: Root name for the output file that will be generated by the macro - one file per year 19 | - id: Beneficiary identification number. 20 | - var: In the case of the annual files (A), this is the name of the flag identifying the type of enrollment we want to count (e.g. ffs, PDP). 21 | In the case of the period files (P) it can be any string. 22 | The string passed under var is used to name the set of variables counting months of continous enrollment. 23 | 24 | 25 | **** Source file description - there are two possible formats for the input dataset, annual files with monthly entries (A), single period file 26 | with beneficiary entries per each unique period of continous enrollment (P). Note that multipe entries per beneficiary are allowed in P. 27 | Type A file variables: 28 | - id, with the beneficiary unique identification number (any name) 29 | - "date", with the current month in SAS date format (set to the first day of the month) 30 | - var, an indicator (0/1) variable, with a flag for enrollment 31 | 32 | Type B file variables: 33 | - id, with the beneficiary unique identification number (any name) 34 | - "begdt", with the starting month of current enrollment period in SAS date format (set to the first day of the month) 35 | - "enddt", with the ending month of current enrollment period in SAS date format (set to the first day of the month) 36 | 37 | **** Output file description: There is one file per year, with one entry for each beneficiary in the source file that was enrolled in the 38 | plan at least one month within the year. 39 | 40 | **** NEED TO ADD THE DESCRIPTION OF THE FILE **** 41 | 42 | *************************************************************************************************************************/ 43 | 44 | 45 | %macro contenr(begyr,endyr,shape, filein, fileout, id, var); 46 | 47 | ****************************************************************; 48 | ****** Shape long monthly enrollment file as a period file; 49 | %if &shape=A %then %do; 50 | %do yr=&begyr %to &endyr; 51 | %if &yr>&begyr %then %do; 52 | proc sql; 53 | create table _file3 as 54 | select &id, per, begdt as date format=mmddyy8. 55 | from _cont_enrl_per_&var 56 | union 57 | select &id, per, enddt as date format=mmddyy8. 58 | from _cont_enrl_per_&var 59 | union 60 | select &id, . as per,date format=mmddyy8. 61 | from &filein.&yr.(where=(&var.=1)) 62 | order by &id, date; 63 | quit; 64 | %end; 65 | %if &yr=&begyr %then %do; 66 | proc sql; 67 | create table _file3 as 68 | select * 69 | from &filein.&yr. 70 | where &var=1 71 | order by &id., date; 72 | quit; 73 | %end; 74 | data _file1; 75 | set _file3; 76 | by &id. date; 77 | format per 2.0 date ldt mmddyy8.; 78 | retain per2 ldt; 79 | if first.&id then do; 80 | if per=. then per2=1; 81 | ldt=date; 82 | end; 83 | if per^=. then per2=per; 84 | else if per=. & intck('MONTH',ldt,date,'D')>1 then per2+1; 85 | ldt=date; 86 | per=per2; 87 | run; 88 | proc means data=_file1 noprint; 89 | by &id per; 90 | output out=_cont_enrl_per_&var(drop=_freq_ _type_) min(date)=begdt max(date)=enddt; 91 | run; 92 | %end; 93 | %end; 94 | ****************************************************************************************************************; 95 | ****** Compute continous enrollment as of a particular month; 96 | data 97 | %do yr=&begyr %to &endyr; 98 | _enrl_cum_&var._&yr %end;; 99 | %if &shape=A %then set _cont_enrl_per_&var;; 100 | %if &shape=P %then set &filein;; 101 | 102 | array monfl(12) &var._pre_01 - &var._pre_12; 103 | cnt=0; 104 | %do yr=&begyr %to &endyr; 105 | posmon=0; 106 | %do mon=1 %to 12; 107 | if begdt<=mdy(&mon,1,&yr) & enddt>=mdy(&mon,1,&yr) then do; 108 | cnt+1; 109 | posmon=1; 110 | end; 111 | else cnt=0; 112 | year=&yr; 113 | monfl[&mon]=cnt; 114 | %end; 115 | if posmon>0 then output _enrl_cum_&var._&yr; 116 | %end; 117 | run; 118 | 119 | ****************************************************************************************************************; 120 | ****** Compute continous enrollment after a particular month; 121 | 122 | data 123 | %do yr=&begyr %to &endyr; 124 | _enrl_cum2_&var._&yr %end;; 125 | %if &shape=A %then set _cont_enrl_per_&var;; 126 | %if &shape=P %then set &filein;; 127 | 128 | array monpst(12) &var._post_01 - &var._post_12; 129 | cnt=0; 130 | %do yr=&endyr %to &begyr %by -1; 131 | posmon=0; 132 | %do mon=12 %to 1 %by -1; 133 | if begdt<=mdy(&mon,1,&yr) & enddt>=mdy(&mon,1,&yr) then do; 134 | cnt+1; 135 | posmon=1; 136 | end; 137 | else cnt=0; 138 | year=&yr; 139 | monpst[&mon]=cnt; 140 | %end; 141 | if posmon>0 then output _enrl_cum2_&var._&yr; 142 | %end; 143 | run; 144 | 145 | ****************************************************************************************************************; 146 | ****** Aggregate the monthly counts - up to this point, multiple separate enrollment periods within a year will 147 | ****** appear as different lines; 148 | 149 | %do yr=&begyr %to &endyr; 150 | proc means data=_enrl_cum_&var._&yr noprint; 151 | by &id year; 152 | output out=fileout1(drop=_type_ _freq_) max(&var._pre_01-&var._pre_12)=; 153 | run; 154 | proc means data=_enrl_cum2_&var._&yr noprint; 155 | by &id year; 156 | output out=fileout2(drop=_type_ _freq_) max(&var._post_01-&var._post_12)=; 157 | run; 158 | 159 | ****************************************************************************************************************; 160 | ****** Combine pre and post counts and save in the same file; 161 | 162 | data &fileout.&yr; 163 | merge fileout1 fileout2; 164 | by &id year; 165 | label &var._post_01="Number of continous enrollment months from January &yr (includes current month)" 166 | &var._post_02="Number of continous enrollment months from February &yr (includes current month)" 167 | &var._post_03="Number of continous enrollment months from March &yr (includes current month)" 168 | &var._post_04="Number of continous enrollment months from April &yr (includes current month)" 169 | &var._post_05="Number of continous enrollment months from May &yr (includes current month)" 170 | &var._post_06="Number of continous enrollment months from June &yr (includes current month)" 171 | &var._post_07="Number of continous enrollment months from July &yr (includes current month)" 172 | &var._post_08="Number of continous enrollment months from August &yr (includes current month)" 173 | &var._post_09="Number of continous enrollment months from September &yr (includes current month)" 174 | &var._post_10="Number of continous enrollment months from October &yr (includes current month)" 175 | &var._post_11="Number of continous enrollment months from November &yr (includes current month)" 176 | &var._post_12="Number of continous enrollment months from December &yr (includes current month)"; 177 | run; 178 | %end; 179 | 180 | 181 | %mend; 182 | -------------------------------------------------------------------------------- /CC_Package_27v1/programs/idcond.sas: -------------------------------------------------------------------------------- 1 | /*********************************************************************************************/ 2 | TITLE1 'Chronic Conditions Macro'; 3 | 4 | * AUTHOR: Patricia Ferido; 5 | 6 | * DATE: 12/8/2020; 7 | 8 | * PURPOSE: Establish project folders and macro variables for project, all variables following the 9 | %let statements below need to be changed; 10 | 11 | options compress=yes nocenter ls=150 ps=200 errors=5 errorabend errorcheck=strict mprint merror 12 | mergenoby=warn varlenchk=error dkricond=error dkrocond=error msglevel=i; 13 | /*********************************************************************************************/ 14 | 15 | ***** Run all the macro programs based on macro function inputs; 16 | 17 | %macro idcond(projhome=,id=,minyear=,maxyear=,claims_data=,create_enr=,create_enr_shape=,create_enr_filein=,enr_prefix=,enr_var=,claims_out_prefix=, 18 | custom_algorithm=N,custom_suffix=_custom,custom_cond=); 19 | 20 | * Macro variable checks; 21 | data _null_; 22 | if "&projhome"="" then do; 23 | put "ERROR: PUT THE PROJECT FILEPATH WHERE THE MACRO IS BEING RUN. CANNOT BE SOURCE FOLDER"; 24 | abort; 25 | end; 26 | if "&claims_data"="" then do; 27 | put "ERROR: PUT THE NAME OF THE CLAIMS DATA SET ABOVE"; 28 | abort; 29 | end; 30 | if "&id"="" then do; 31 | put "ERROR: PUT THE NAME OF THE UNIQUE PATIENT IDENTIFIER"; 32 | abort; 33 | end; 34 | if "&minyear"="" then do; 35 | put "ERROR: PUT MIN YEAR"; 36 | end; 37 | if "&maxyear"="" then do; 38 | put "ERROR: PUT MAX YEAR"; 39 | end; 40 | if "&create_enr" not in("Y","N") then do; 41 | put "ERROR: INVALID VALUE FOR CREATE_ENR"; 42 | abort; 43 | end; 44 | if "&create_enr_shape" not in("","A","P") then do; 45 | put "ERROR: INVALID VALUE FOR CREATE_ENR_SHAPE"; 46 | abort; 47 | end; 48 | if "&enr_prefix"="" then do; 49 | put "ERROR: PUT THE PREFIX FOR THE ENROLLMENT FILES IN ENR_PREFIX ABOVE"; 50 | abort; 51 | end; 52 | if "&enr_var"="" then do; 53 | put "ERROR: PUT THE ENROLLMENT VARIABLE IN THE ENROLLMENT FILES IN ENR ABOVE"; 54 | abort; 55 | end; 56 | if "&claims_out_prefix"="" then do; 57 | put "ERROR: PUT CLAIMS_OUT_PREFIX"; 58 | abort; 59 | end; 60 | IF "&custom_algorithm" not in("Y","N") then do; 61 | put "ERROR: INVALID VALUE FOR CUSTOM_ALGORITHM"; 62 | abort; 63 | end; 64 | run; 65 | 66 | * checking for libref in data set names; 67 | data _null_; 68 | if find("&claims_data",".")=0 then do; 69 | put "WARNING: NO LIBREF FOR CLAIMS INPUT DATA"; 70 | end; 71 | if find("&claims_out_prefix",".")=0 then do; 72 | put "WARNING: NO LIBREF FOR CLAIMS OUTPUT DATA"; 73 | end; 74 | if find("&enr_prefix",".")=0 then do; 75 | put "WARNING: NO LIBREF FOR ENROLLMENT INPUT DATA"; 76 | end; 77 | run; 78 | 79 | libname _ccproj "&projhome.//data";; 80 | 81 | %if "&CUSTOM_ALGORITHM."="Y" %then %do; 82 | 83 | %include "readin_input_files.sas"; 84 | 85 | * create temporary data to be used in the rest of the program and to check against the custom condition list; 86 | data cc_codes; 87 | set _ccproj.cc_codes&custom_suffix.; 88 | run; 89 | 90 | data cc_exclude; 91 | set _ccproj.cc_exclude&custom_suffix.; 92 | run; 93 | 94 | data cc_desc; 95 | set _ccproj.cc_desc&custom_suffix.; 96 | run; 97 | %end; 98 | 99 | %if "&CUSTOM_ALGORITHM."="N" %then %do; 100 | 101 | * create temporary data to be used in the rest of the program and to check against the custom condition list; 102 | data cc_codes; 103 | set _ccproj.cc_codes_original; 104 | run; 105 | 106 | data cc_exclude; 107 | set _ccproj.cc_exclude_original; 108 | run; 109 | 110 | data cc_desc; 111 | set _ccproj.cc_desc_original; 112 | run; 113 | 114 | %end; 115 | 116 | * checking against the list of custom conditions; 117 | %if "&custom_cond" ne "" %then %do; 118 | data customcond; 119 | format condition $10.; 120 | condlist="&custom_cond."; 121 | ncond=countw(condlist); 122 | do i=1 to ncond; 123 | condition=scan(condlist,i," "); 124 | output; 125 | end; 126 | run; 127 | 128 | proc sort data=customcond; by condition; run; 129 | 130 | proc sort data=cc_desc; by condition; run; 131 | 132 | data custom_cond_ck; 133 | merge cc_desc (in=a keep=condition) customcond (in=b); 134 | by condition; 135 | if b=1 and a=0 then do; 136 | put "ERROR: THERE ARE CONDITIONS LISTED IN COND THAT ARE NOT SPECIFIED IN ALGORITHM e.g. " condition=/; 137 | abort abend; 138 | end; 139 | run; 140 | 141 | * if no errors then limiting to conditions in the list; 142 | proc sort data=cc_exclude; by condition; run; 143 | proc sort data=cc_codes; by condition; run; 144 | 145 | data cc_desc; 146 | merge cc_desc (in=a) customcond (in=b keep=condition); 147 | by condition; 148 | if a and b; 149 | run; 150 | 151 | data cc_exclude; 152 | merge cc_exclude (in=a) customcond (in=b keep=condition); 153 | by condition; 154 | if a and b; 155 | run; 156 | 157 | data cc_codes; 158 | merge cc_codes (in=a) customcond (in=b keep=condition); 159 | by condition; 160 | if a and b; 161 | run; 162 | 163 | %end; 164 | 165 | ***** Check Input Claims Data Sets; 166 | %macro ckinputclms; 167 | 168 | %let v=1; 169 | %let clms=%scan("&claims_data",&v," "); 170 | 171 | %do %while (%length(&clms)>0); 172 | proc contents data=&clms out=contents_claim noprint; run; 173 | 174 | * Check that there is a claim date variables and claim type variable 175 | Check that all the diagnosis codes are named 176 | Check that all other variables are dropped; 177 | 178 | data contents_claim1; 179 | set contents_claim end=_end; 180 | if upcase(name)=upcase("&id") then do; id=1; id1+1; end; 181 | else if name="claim_dt" then do; 182 | clmdt=1; 183 | clmdt1+1; 184 | if type=2 then do; put "ERROR: CONVERT CLAIM_DT TO DATE VARIABLE"; abort; end; 185 | end; 186 | else if name="claim_type" then do; clmtype=1; clmtype1+1; end; 187 | else if find(name,"icd9dx") then do; icd9dx=1; icd9dx1+1; end; 188 | else if find(name,"icd10dx") then do; icd10dx=1; icd10dx1+1; end; 189 | else if find(name,"hcpcs") then do; hcpcs=1; hcpcs1+1; end; 190 | else if find(name,"icd9prcdr") then do; icd9prcdr=1; icd9prcdr1+1; end; 191 | else if find(name,"icd10prcdr") then do; icd10prcdr=1; icd10prcdr1+1; end; 192 | else do; 193 | put "ERROR: POTENTIALLY EXTRANEOUS OR MISSPELLED VARIABLE. NEEDS REVIEW " name=/; 194 | abort; 195 | end; 196 | 197 | if _end then do; 198 | if id1=0 then do; put "ERROR: NO ID VARIABLE"; abort abend; end; 199 | if clmdt1=0 then do; put "ERROR: NO CLAIM DATE VARIABLE"; abort abend; end; 200 | if clmtype1=0 then do; put "ERROR: NO CLAIM TYPE VARIABLE"; abort abend; end; 201 | if max(icd9dx1,icd10dx1,hcpcs1,icd9prcdr1,icd10prcdr1) in(0,.) then do; put "ERROR: NO DIAGNOSIS OR PROCEDURE CODE VARIABLES"; abort abend; end; 202 | end; 203 | run; 204 | 205 | %let v=%eval(&v+1); 206 | %let clms=%scan("&claims_data",&v," "); 207 | 208 | %end; 209 | 210 | ***** Check and run enrollment files; 211 | %if "&CREATE_ENR"="Y" %then %do; 212 | 213 | data _null_; 214 | if "&create_enr_shape" not in("A","P") then do; 215 | put "ERROR: CREATE ENROLLMENT FILES MARKED AS Y, BUT INVALID CREATE_ENR_SHAPE VALUE. MUST BE 'A' OR 'P'"; 216 | abort abend; 217 | end; 218 | if "&create_enr_filein"="" then do; 219 | put "ERROR: CREATE ENROLLMENT FILES MARKED AS Y, BUT NO CREATE_ENR_FILEIN SPECIFIED"; 220 | abort abend; 221 | end; 222 | run; 223 | 224 | %include "contenr.sas"; 225 | 226 | %contenr(begyr=&minyear.,endyr=&maxyear.,shape=&create_enr_shape,filein=&create_enr_filein.,fileout=&enr_prefix,id=&id,var=&enr_var.); 227 | 228 | %end; 229 | 230 | %mend; 231 | 232 | %ckinputclms; 233 | 234 | * Check that all the claim types match the claim types CC_desc; 235 | data claim_types; 236 | set cc_desc; 237 | array clmtyp [*] claim_type:; 238 | do i=1 to dim(clmtyp); 239 | if clmtyp[i] ne "" then do; 240 | claim_type=clmtyp[i]; 241 | output; 242 | end; 243 | end; 244 | countw=countw(claim_type); 245 | run; 246 | 247 | proc sql noprint; 248 | select max(countw) 249 | into :type_max 250 | from claim_types; 251 | quit; 252 | 253 | data claim_types1; 254 | set claim_types; 255 | do i=1 to countw(claim_type); 256 | type=scan(claim_type,i); 257 | output; 258 | end; 259 | run; 260 | 261 | proc freq data=claim_types1 noprint; 262 | table type / out=cc_desc_clmtyps; 263 | run; 264 | 265 | %macro ckclmtypes; 266 | 267 | %let v=1; 268 | %let clms=%scan("&claims_data",&v," "); 269 | 270 | %do %while (%length(&clms)>0); 271 | 272 | proc freq data=&clms noprint; 273 | table claim_type / out=clms_data_clmtyps (rename=claim_type=type); 274 | run; 275 | 276 | data clm_ck; 277 | merge cc_desc_clmtyps (in=a) clms_data_clmtyps (in=b); 278 | by type; 279 | desc=a; 280 | clms=b; 281 | run; 282 | 283 | data _null_; 284 | set clm_ck; 285 | if clms=1 and desc=0 then do; 286 | put "ERROR: CLAIM TYPE IN &CLMS NOT IN CC_DESC" type=/; 287 | abort abend; 288 | end; 289 | if desc=1 and clms=0 then do; 290 | put "WARNING: CLAIM TYPE IN CC_DESC NOT FOUND IN &CLMS" type=/; 291 | end; 292 | run; 293 | 294 | %let v=%eval(&v+1); 295 | %let clms=%scan("&claims_data",&v," "); 296 | 297 | %end; 298 | 299 | %mend; 300 | 301 | %ckclmtypes; 302 | 303 | %put "SUCCESSFUL RUN. AFTER LOG IS CLEARED OF WARNINGS AND ERRORS, READY FOR 3_IDENTIFY_CONDITIONS.SAS"; 304 | 305 | %include "identify_conditions.sas"; 306 | 307 | 308 | %mend; 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | -------------------------------------------------------------------------------- /CC_Package_27v1/programs/input_program.sas: -------------------------------------------------------------------------------- 1 | /*********************************************************************************************/ 2 | TITLE1 'Chronic Conditions Macro'; 3 | 4 | * AUTHOR: Patricia Ferido; 5 | 6 | * DATE: 3/26/2018; 7 | 8 | * PURPOSE: Run all programs related to Chronic Conditions Package; 9 | 10 | options compress=yes nocenter ls=150 ps=200 errors=5 errorabend errorcheck=strict mprint merror 11 | mergenoby=warn varlenchk=error dkricond=error dkrocond=error msglevel=i; 12 | /*********************************************************************************************/ 13 | 14 | ****** Set up libnames - optional; 15 | 16 | /******************************************************************************************************************** 17 | Macro Variables - Information needed for macro below; 18 | * PROJHOME: project filepath to the Chronic_Conditions_Package folder; 19 | * ID: Name of unique patient ID variable in claims data; 20 | * MINYEAR First year of data that you want to process; 21 | * MAXYEAR: Last year of data that you want to process; 22 | * CLAIMS_DATA: Name of the cleaned claims data sets you want to process. If multiple, separate by a space; 23 | * CREATE_ENR: Y/N - Y if enrollment files need to be created, N - if they already exist; 24 | * If Y, then define the following variables:; 25 | * CREATE_ENR_SHAPE: two possible inputs: A - annual files with monthly entries, P - single period file with beneficiary 26 | entries per each unique period of continous enrollment (P). Note that multipe entries per beneficiary are allowed in P; 27 | * CREATE_ENR_FILEIN: provide input files of beneficiary enrollment information with libref; 28 | * ENR_PREFIX: name of the enrollment files you want to create with libref, yearly suffix will be added automatically; 29 | * ENR_VAR: name of enrollment variable you want to use (e.g. MA, FFS, enr), monthly suffix will be added automatically; 30 | * If N, then define the following variables:; 31 | * CREATE_ENR_SHAPE: leave blank; 32 | * CREATE_ENR_FILEIN: leave blank; 33 | * ENR_PREFIX: name of enrollment files with libref and without yearly suffix; 34 | * ENR_VAR: prefix of monthly enrollment variable in provided enrollment files; 35 | * CLAIMS_OUT_PREFIX: Prefix for yearly output data sets, suffix will automatically be year. Don't forget to include libref if creating permanent; 36 | * CUSTOM_ALGORITHM: Y/N - Y if input excel sheets have been modified and should be used, N if default chronic conditions should be used. Default is N; 37 | * CUSTOM_SUFFIX: If Y is specified above, then this suffix will be added to specify your custom algorithms. Default is _custom; 38 | * CUSTOM_COND: List of shorthand conditions to identify, default if left blank is all 27 original CCW conditions; 39 | *******************************************************************************************************************/ 40 | 41 | ****** Wrapper macro; 42 | %include "idcond.sas"; 43 | 44 | ****** Macro Function; 45 | %idcond(projhome=, 46 | id=, 47 | minyear=, 48 | maxyear=, 49 | claims_data=, 50 | create_enr=, 51 | create_enr_shape=, 52 | create_enr_filein=, 53 | enr_prefix=, 54 | enr_var=, 55 | claims_out_prefix=, 56 | custom_algorithm=, 57 | custom_suffix=, 58 | custom_cond=); 59 | 60 | 61 | ****** Example; 62 | /*%idcond(projhome=/disk/agedisk3/medicare.work/goldman-DUA51866/ferido-dua51866/CCW package/Chronic_Conditions_Package_5pct/, 63 | id=bene_id, 64 | minyear=2004, 65 | minyear=2016, 66 | claims_data=_ccproj.claims_test2002 _ccproj.claims_test2003 _ccproj.claims_test2004 _ccproj.claims_test2005 _ccproj.claims_test2006 _ccproj.claims_test2007 _ccproj.claims_test2008 _ccproj.claims_test2009 _ccproj.claims_test2010 _ccproj.claims_test2011 _ccproj.claims_test2012 _ccproj.claims_test2013 67 | _ccproj.claims_test2014 _ccproj.claims_test2015 _ccproj.claims_test2016, 68 | create_enr=N, 69 | create_enr_shape=, 70 | create_enr_filein=, 71 | enr_prefix=enr.enrffs_, 72 | enr_var=ffsab, 73 | claims_out_prefix=_ccproj.chronic_conditions_, 74 | custom_algorithm=Y, 75 | custom_suffix=_T2DIAB, 76 | cond=T2DIAB); */ 77 | 78 | -------------------------------------------------------------------------------- /CC_Package_27v1/programs/readin_input_files.sas: -------------------------------------------------------------------------------- 1 | /*********************************************************************************************/ 2 | TITLE1 'Chronic Conditions Macro'; 3 | 4 | * AUTHOR: Patricia Ferido; 5 | 6 | * DATE: 3/26/2018; 7 | 8 | * PURPOSE: - Read In Customized CSV Input files that determine conditions and algorithms, and list 9 | all codes of interest 10 | - Check that all input files and claims data are formatted correctly 11 | - Please see document titled "For Users - Chronic Conditions Macro Documentation" 12 | before running any programs; 13 | 14 | * INPUT: Claims Data, CSV files CC_codes, CC_desc, CC_exclude; 15 | * OUTPUT: SAS files CC_codes, CC_desc, CC_exclude; 16 | 17 | options compress=yes nocenter ls=150 ps=200 errors=5 errorabend errorcheck=strict mprint merror 18 | mergenoby=warn varlenchk=error dkricond=error dkrocond=error msglevel=i; 19 | /*********************************************************************************************/ 20 | 21 | ***** Read in Input CSV Files ; 22 | 23 | * CC Codes; 24 | data cc_codes; 25 | infile "&projhome./csv_input/CC_Codes.csv" dlm="2c"x dsd lrecl=32767 missover firstobs=2; 26 | informat 27 | Condition $10. 28 | CodeType $10. 29 | DxCodeLocation $8. 30 | DxCode $10.; 31 | format 32 | Condition $10. 33 | CodeType $10. 34 | DxCodeLocation $8. 35 | DxCode $10.; 36 | input 37 | Condition $ 38 | CodeType $ 39 | DxCodeLocation $ 40 | DxCode $; 41 | run; 42 | 43 | * CC Desc; 44 | proc import datafile="&projhome./csv_input/CC_Desc.csv" out=cc_desc dbms=dlm; 45 | delimiter=","; 46 | getnames=yes; 47 | guessingrows=max; 48 | run; 49 | 50 | * CC Exclude; 51 | data cc_exclude; 52 | infile "&projhome./csv_input/CC_Exclude.csv" dlm="2c"x dsd lrecl=32767 missover firstobs=2; 53 | informat 54 | Condition $10. 55 | CodeType $10. 56 | DxCode $10. 57 | DxCodeLocation $8.; 58 | format 59 | Condition $10. 60 | CodeType $10. 61 | DxCode $10. 62 | DxCodeLocation $8.; 63 | input 64 | Condition $ 65 | CodeType $ 66 | DxCode $ 67 | DxCodeLocation $; 68 | run; 69 | 70 | ***** Get contents; 71 | 72 | proc contents data=cc_codes out=contents_cc_codes noprint; run; 73 | proc contents data=cc_desc out=contents_cc_desc noprint; run; 74 | proc contents data=cc_exclude out=contents_cc_exclude noprint; run; 75 | 76 | ***** Standardize and check for values that shouldn't be there, if there are errors, the errors 77 | will print to log and the program will terminate; 78 | 79 | * Standardizing CC_Codes and checking for valid inputs; 80 | data cc_codes; 81 | set cc_codes; 82 | condition=upcase(condition); 83 | codetype=upcase(codetype); 84 | dxcodelocation=upcase(dxcodelocation); 85 | if codetype not in("ICD9DX","ICD10DX","ICD9PRCDR","ICD10PRCDR","HCPCS") then do; 86 | put "ERROR: INVALID CC_Codes Codetype " codetype=/; 87 | abort abend; 88 | end; 89 | if dxcodelocation not in("ANY","DX1","DX1 DX2") then do; 90 | put "ERROR: INVALID CC_Codes DxCodeLocation " dxcodelocation=/; 91 | abort abend; 92 | end; 93 | if codetype="ICD10PRCDR" and length(dxcode) ne 7 then do; 94 | put "ERROR: INVALID ICD10PRCDR CODE " dxcode=/; 95 | abort abend; 96 | end; 97 | if codetype="HCPCS" and length(dxcode) ne 5 then do; 98 | put "ERROR: INVALID HCPCS CODE " dxcode=/; 99 | abort abend; 100 | end; 101 | run; 102 | 103 | * Standardizing CC_Exclude and checking for valid inputs; 104 | data cc_exclude; 105 | set cc_exclude; 106 | condition=upcase(condition); 107 | codetype=upcase(codetype); 108 | dxcodelocation=upcase(dxcodelocation); 109 | if codetype not in("ICD9DX","ICD10DX","ICD9PRCDR","ICD10PRCDR","HCPCS") then do; 110 | put "ERROR: INVALID CC_Codes Codetype " codetype=/; 111 | abort abend; 112 | end; 113 | if dxcodelocation not in("ANY","DX1","DX1 DX2") then do; 114 | put "ERROR: INVALID CC_Codes DxCodeLocation " dxcodelocation=/; 115 | abort abend; 116 | end; 117 | if codetype="ICD10PRCDR" and length(dxcode) ne 7 then do; 118 | put "ERROR: INVALID ICD10PRCDR CODE " dxcode=/; 119 | abort abend; 120 | end; 121 | if codetype="HCPCS" and length(dxcode) ne 5 then do; 122 | put "ERROR: INVALID HCPCS CODE " dxcode=/; 123 | abort abend; 124 | end; 125 | run; 126 | 127 | * Standardizing CC_Desc and checking for valid inputs; 128 | data _null_; 129 | set contents_cc_desc; 130 | if name="ref_months" and type=2 then do; 131 | put "ERROR: ALPHABETIC VALUE IN ref_months FOR CC_Desc"; 132 | abort abend; 133 | end; 134 | if find(name,'num_dx') and type=2 then do; 135 | put "ERROR: ALPHABETIC VALUE IN num_dx FOR CC_Desc"; 136 | abort abend; 137 | end; 138 | if name="min_days_apart" and type=2 then do; 139 | put "ERROR: ALPHABETIC VALUE IN min_days_apart FOR CC_Desc"; 140 | abort abend; 141 | end; 142 | run; 143 | 144 | data cc_desc; 145 | set cc_desc; 146 | condition=upcase(condition); 147 | 148 | * Making max_days_apart numeric if it isn't already; 149 | max_days_apart1=max_days_apart*1; 150 | 151 | array claim_type [*] claim_type:; 152 | array num_dx [*] num_dx:; 153 | 154 | * Upcasing claim_type; 155 | do i=1 to dim(claim_type); 156 | claim_type[i]=upcase(claim_type[i]); 157 | end; 158 | 159 | * Checks; 160 | do i=1 to dim(claim_type); 161 | if claim_type[i] ne "" and num_dx[i]=. then do; 162 | put "ERROR: MISSING num_dx FOR CC_Desc"; 163 | abort abend; 164 | end; 165 | if claim_type[i]="" and num_dx[i] ne . then do; 166 | put "ERROR: MISSING claim_type FOR CC_Desc"; 167 | abort abend; 168 | end; 169 | end; 170 | if min_days_apart<=0 then do; 171 | put "ERROR: MISSING or NEGATIVE min_days_apart in CC_Desc"; 172 | abort abend; 173 | end; 174 | if ref_months<=0 then do; 175 | put "ERROR: MISSING or NEGATIVE ref_months in CC_Desc"; 176 | abort abend; 177 | end; 178 | drop max_days_apart; 179 | rename max_days_apart1=max_days_apart; 180 | run; 181 | 182 | * Checking that all condition codes are the same between the three input files; 183 | proc freq data=cc_codes noprint; 184 | table condition / out=condition_codes; 185 | run; 186 | 187 | proc freq data=cc_desc noprint; 188 | table condition / out=condition_desc; 189 | run; 190 | 191 | proc freq data=cc_exclude noprint; 192 | table condition / out=condition_exclude; 193 | run; 194 | 195 | data condition_ck; 196 | length condition $10.; 197 | merge condition_desc (in=a) condition_codes (in=b) condition_exclude (in=c); 198 | by condition; 199 | desc=a; 200 | codes=b; 201 | exclude=c; 202 | run; 203 | 204 | proc freq data=condition_ck noprint; 205 | table desc*codes*exclude / out=freq_condition_ck; 206 | run; 207 | 208 | data _null_; 209 | set freq_condition_ck; 210 | 211 | if desc=1 and codes=0 then do; 212 | put "ERROR: THERE ARE CONDITIONS IN CC_Desc BUT NOT IN CC_Codes"; 213 | abort abend; 214 | end; 215 | if codes=1 and desc=0 then do; 216 | put "ERROR: THERER ARE CONDITIONS IN CC_Codes BUT NOT IN CC_Desc"; 217 | abort abend; 218 | end; 219 | if exclude=1 and max(desc,codes) ne 1 then do; 220 | put "ERROR: THERE ARE CONDITIONS IN CC_Exclude not in CC_Desc or CC_Codes"; 221 | abort abend; 222 | end; 223 | 224 | run; 225 | 226 | ***** Create permanents - will only get to this step if there were no errors above; 227 | data _ccproj.cc_codes&custom_suffix.; 228 | set cc_codes; 229 | run; 230 | 231 | data _ccproj.cc_desc&custom_suffix.; 232 | set cc_desc; 233 | run; 234 | 235 | data _ccproj.cc_exclude&custom_suffix.; 236 | set cc_exclude; 237 | run; -------------------------------------------------------------------------------- /CC_Package_30v0/Preparation Checklist - Chronic Conditions Package.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_30v0/Preparation Checklist - Chronic Conditions Package.docx -------------------------------------------------------------------------------- /CC_Package_30v0/User Guide - Chronic Conditions Package.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_30v0/User Guide - Chronic Conditions Package.docx -------------------------------------------------------------------------------- /CC_Package_30v0/csv_input/CC_Desc.csv: -------------------------------------------------------------------------------- 1 | Condition,Condition_long,Claim_type1,Num_dx1,Claim_type2,Num_dx2,Min_Days_Apart,Max_Days_apart,Ref_months,Source 2 | HYPOTH,Acquired Hypothyroidism,"IP,SNF,HHA",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 3 | ALZH,Alzheimer's Disease,"IP,SNF,HHA,OP,CAR",1,,,1,,36,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 4 | ALZHDMT,Alzheimer's Disease and Related Disorders or Senile Dementia,"IP,SNF,HHA,OP,CAR",1,,,1,,36,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 5 | ATRIALF,Atrial Fibrillation,IP,1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 6 | AMI,Acute Myocardial Infarction,IP,1,,,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 7 | ASTHMA,Asthma,"IP,SNF,HHA",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 8 | CNCRBRST,Female Breast Cancer,"IP,SNF",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 9 | CATARACT,Cataract,"OP,CAR",1,,,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 10 | CHRNKDN,Chronic Kidney Disease,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 11 | COPD,Chronic Obstructive Pulmonary Disease,"IP,SNF,HHA",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 12 | CNCRCLR,Colorectal Cancer,"IP,SNF",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 13 | DEPRESSN,Depression,"IP,SNF,HHA,OP,CAR",1,,,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 14 | DIABETES,Diabetes,"IP,SNF,HHA",1,"OP,CAR",2,1,,24,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 15 | CNCREND,Endometrial Cancer,"IP,SNF",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 16 | GLAUCOMA,Glaucoma,CAR,1,,,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 17 | CHF,Heart Failure,"IP,OP,CAR",1,,,1,,24,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 18 | HIPFRAC,Hip/Pelvic Fracture,"IP,SNF",1,,,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 19 | HYPERL,Hyperlipedemia,"IP,SNF,HHA",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 20 | HYPERT,Hypertension,"IP,SNF,HHA",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 21 | ISCHMCHT,Ischemic Heart Disease,"IP,SNF,HHA,OP,CAR",1,,,1,,24,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 22 | CNCRLNG,Lung Cancer,"IP,SNF",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 23 | OSTEOPRS,Osteoporosis,"IP,SNF,HHA",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 24 | CNCRPRST,Prostate Cancer,"IP,SNF",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 25 | RAOA,Rheumatoid Arthritis/Osteoarthritis,"IP,SNF,HHA,OP,CAR",2,,,1,,24,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 26 | STRKETIA,Stroke/Transient Ischemic Attack,IP,1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 27 | ANEMIA,Anemia,"IP,SNF,HHA,OP,CAR",1,,,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 28 | HYPERP,Benign Prostatic Hyperplasia,"IP,SNF,HHA",1,"OP,CAR",2,1,,12,CMS Chronic Condition Data Warehouse Condition Categories (Feb. 2022) 29 | -------------------------------------------------------------------------------- /CC_Package_30v0/csv_input/CC_Exclude.csv: -------------------------------------------------------------------------------- 1 | Condition,CodeType,DxCode2017,DxCodeLocation 2 | HYPERP,ICD9DX,222.2,ANY 3 | HYPERP,ICD10DX,D29.1,ANY 4 | STRKETIA,ICD9DX,800,ANY 5 | STRKETIA,ICD9DX,800.01,ANY 6 | STRKETIA,ICD9DX,800.02,ANY 7 | STRKETIA,ICD9DX,800.03,ANY 8 | STRKETIA,ICD9DX,800.04,ANY 9 | STRKETIA,ICD9DX,800.05,ANY 10 | STRKETIA,ICD9DX,800.06,ANY 11 | STRKETIA,ICD9DX,800.09,ANY 12 | STRKETIA,ICD9DX,800.1,ANY 13 | STRKETIA,ICD9DX,800.11,ANY 14 | STRKETIA,ICD9DX,800.12,ANY 15 | STRKETIA,ICD9DX,800.13,ANY 16 | STRKETIA,ICD9DX,800.14,ANY 17 | STRKETIA,ICD9DX,800.15,ANY 18 | STRKETIA,ICD9DX,800.16,ANY 19 | STRKETIA,ICD9DX,800.19,ANY 20 | STRKETIA,ICD9DX,800.2,ANY 21 | STRKETIA,ICD9DX,800.21,ANY 22 | STRKETIA,ICD9DX,800.22,ANY 23 | STRKETIA,ICD9DX,800.23,ANY 24 | STRKETIA,ICD9DX,800.24,ANY 25 | STRKETIA,ICD9DX,800.25,ANY 26 | STRKETIA,ICD9DX,800.26,ANY 27 | STRKETIA,ICD9DX,800.29,ANY 28 | STRKETIA,ICD9DX,800.3,ANY 29 | STRKETIA,ICD9DX,800.31,ANY 30 | STRKETIA,ICD9DX,800.32,ANY 31 | STRKETIA,ICD9DX,800.33,ANY 32 | STRKETIA,ICD9DX,800.34,ANY 33 | STRKETIA,ICD9DX,800.35,ANY 34 | STRKETIA,ICD9DX,800.36,ANY 35 | STRKETIA,ICD9DX,800.39,ANY 36 | STRKETIA,ICD9DX,800.4,ANY 37 | STRKETIA,ICD9DX,800.41,ANY 38 | STRKETIA,ICD9DX,800.42,ANY 39 | STRKETIA,ICD9DX,800.43,ANY 40 | STRKETIA,ICD9DX,800.44,ANY 41 | STRKETIA,ICD9DX,800.45,ANY 42 | STRKETIA,ICD9DX,800.46,ANY 43 | STRKETIA,ICD9DX,800.49,ANY 44 | STRKETIA,ICD9DX,800.5,ANY 45 | STRKETIA,ICD9DX,800.51,ANY 46 | STRKETIA,ICD9DX,800.52,ANY 47 | STRKETIA,ICD9DX,800.53,ANY 48 | STRKETIA,ICD9DX,800.54,ANY 49 | STRKETIA,ICD9DX,800.55,ANY 50 | STRKETIA,ICD9DX,800.56,ANY 51 | STRKETIA,ICD9DX,800.59,ANY 52 | STRKETIA,ICD9DX,800.6,ANY 53 | STRKETIA,ICD9DX,800.61,ANY 54 | STRKETIA,ICD9DX,800.62,ANY 55 | STRKETIA,ICD9DX,800.63,ANY 56 | STRKETIA,ICD9DX,800.64,ANY 57 | STRKETIA,ICD9DX,800.65,ANY 58 | STRKETIA,ICD9DX,800.66,ANY 59 | STRKETIA,ICD9DX,800.69,ANY 60 | STRKETIA,ICD9DX,800.7,ANY 61 | STRKETIA,ICD9DX,800.71,ANY 62 | STRKETIA,ICD9DX,800.72,ANY 63 | STRKETIA,ICD9DX,800.73,ANY 64 | STRKETIA,ICD9DX,800.74,ANY 65 | STRKETIA,ICD9DX,800.75,ANY 66 | STRKETIA,ICD9DX,800.76,ANY 67 | STRKETIA,ICD9DX,800.79,ANY 68 | STRKETIA,ICD9DX,800.8,ANY 69 | STRKETIA,ICD9DX,800.81,ANY 70 | STRKETIA,ICD9DX,800.82,ANY 71 | STRKETIA,ICD9DX,800.83,ANY 72 | STRKETIA,ICD9DX,800.84,ANY 73 | STRKETIA,ICD9DX,800.85,ANY 74 | STRKETIA,ICD9DX,800.86,ANY 75 | STRKETIA,ICD9DX,800.89,ANY 76 | STRKETIA,ICD9DX,800.9,ANY 77 | STRKETIA,ICD9DX,800.91,ANY 78 | STRKETIA,ICD9DX,800.92,ANY 79 | STRKETIA,ICD9DX,800.93,ANY 80 | STRKETIA,ICD9DX,800.94,ANY 81 | STRKETIA,ICD9DX,800.95,ANY 82 | STRKETIA,ICD9DX,800.96,ANY 83 | STRKETIA,ICD9DX,800.99,ANY 84 | STRKETIA,ICD9DX,801,ANY 85 | STRKETIA,ICD9DX,801.01,ANY 86 | STRKETIA,ICD9DX,801.02,ANY 87 | STRKETIA,ICD9DX,801.03,ANY 88 | STRKETIA,ICD9DX,801.04,ANY 89 | STRKETIA,ICD9DX,801.05,ANY 90 | STRKETIA,ICD9DX,801.06,ANY 91 | STRKETIA,ICD9DX,801.09,ANY 92 | STRKETIA,ICD9DX,801.1,ANY 93 | STRKETIA,ICD9DX,801.11,ANY 94 | STRKETIA,ICD9DX,801.12,ANY 95 | STRKETIA,ICD9DX,801.13,ANY 96 | STRKETIA,ICD9DX,801.14,ANY 97 | STRKETIA,ICD9DX,801.15,ANY 98 | STRKETIA,ICD9DX,801.16,ANY 99 | STRKETIA,ICD9DX,801.19,ANY 100 | STRKETIA,ICD9DX,801.2,ANY 101 | STRKETIA,ICD9DX,801.21,ANY 102 | STRKETIA,ICD9DX,801.22,ANY 103 | STRKETIA,ICD9DX,801.23,ANY 104 | STRKETIA,ICD9DX,801.24,ANY 105 | STRKETIA,ICD9DX,801.25,ANY 106 | STRKETIA,ICD9DX,801.26,ANY 107 | STRKETIA,ICD9DX,801.29,ANY 108 | STRKETIA,ICD9DX,801.3,ANY 109 | STRKETIA,ICD9DX,801.31,ANY 110 | STRKETIA,ICD9DX,801.32,ANY 111 | STRKETIA,ICD9DX,801.33,ANY 112 | STRKETIA,ICD9DX,801.34,ANY 113 | STRKETIA,ICD9DX,801.35,ANY 114 | STRKETIA,ICD9DX,801.36,ANY 115 | STRKETIA,ICD9DX,801.39,ANY 116 | STRKETIA,ICD9DX,801.4,ANY 117 | STRKETIA,ICD9DX,801.41,ANY 118 | STRKETIA,ICD9DX,801.42,ANY 119 | STRKETIA,ICD9DX,801.43,ANY 120 | STRKETIA,ICD9DX,801.44,ANY 121 | STRKETIA,ICD9DX,801.45,ANY 122 | STRKETIA,ICD9DX,801.46,ANY 123 | STRKETIA,ICD9DX,801.49,ANY 124 | STRKETIA,ICD9DX,801.5,ANY 125 | STRKETIA,ICD9DX,801.51,ANY 126 | STRKETIA,ICD9DX,801.52,ANY 127 | STRKETIA,ICD9DX,801.53,ANY 128 | STRKETIA,ICD9DX,801.55,ANY 129 | STRKETIA,ICD9DX,801.55,ANY 130 | STRKETIA,ICD9DX,801.56,ANY 131 | STRKETIA,ICD9DX,801.59,ANY 132 | STRKETIA,ICD9DX,801.6,ANY 133 | STRKETIA,ICD9DX,801.61,ANY 134 | STRKETIA,ICD9DX,801.62,ANY 135 | STRKETIA,ICD9DX,801.63,ANY 136 | STRKETIA,ICD9DX,801.66,ANY 137 | STRKETIA,ICD9DX,801.65,ANY 138 | STRKETIA,ICD9DX,801.66,ANY 139 | STRKETIA,ICD9DX,801.69,ANY 140 | STRKETIA,ICD9DX,801.7,ANY 141 | STRKETIA,ICD9DX,801.71,ANY 142 | STRKETIA,ICD9DX,801.72,ANY 143 | STRKETIA,ICD9DX,801.73,ANY 144 | STRKETIA,ICD9DX,801.77,ANY 145 | STRKETIA,ICD9DX,801.75,ANY 146 | STRKETIA,ICD9DX,801.76,ANY 147 | STRKETIA,ICD9DX,801.79,ANY 148 | STRKETIA,ICD9DX,801.8,ANY 149 | STRKETIA,ICD9DX,801.81,ANY 150 | STRKETIA,ICD9DX,801.82,ANY 151 | STRKETIA,ICD9DX,801.83,ANY 152 | STRKETIA,ICD9DX,801.88,ANY 153 | STRKETIA,ICD9DX,801.85,ANY 154 | STRKETIA,ICD9DX,801.86,ANY 155 | STRKETIA,ICD9DX,801.89,ANY 156 | STRKETIA,ICD9DX,801.9,ANY 157 | STRKETIA,ICD9DX,801.91,ANY 158 | STRKETIA,ICD9DX,801.92,ANY 159 | STRKETIA,ICD9DX,801.93,ANY 160 | STRKETIA,ICD9DX,801.99,ANY 161 | STRKETIA,ICD9DX,801.95,ANY 162 | STRKETIA,ICD9DX,801.96,ANY 163 | STRKETIA,ICD9DX,801.99,ANY 164 | STRKETIA,ICD9DX,802,ANY 165 | STRKETIA,ICD9DX,802.1,ANY 166 | STRKETIA,ICD9DX,802.2,ANY 167 | STRKETIA,ICD9DX,802.22,ANY 168 | STRKETIA,ICD9DX,802.21,ANY 169 | STRKETIA,ICD9DX,802.23,ANY 170 | STRKETIA,ICD9DX,802.24,ANY 171 | STRKETIA,ICD9DX,802.25,ANY 172 | STRKETIA,ICD9DX,802.26,ANY 173 | STRKETIA,ICD9DX,802.27,ANY 174 | STRKETIA,ICD9DX,802.28,ANY 175 | STRKETIA,ICD9DX,802.29,ANY 176 | STRKETIA,ICD9DX,802.3,ANY 177 | STRKETIA,ICD9DX,802.31,ANY 178 | STRKETIA,ICD9DX,802.32,ANY 179 | STRKETIA,ICD9DX,802.33,ANY 180 | STRKETIA,ICD9DX,802.34,ANY 181 | STRKETIA,ICD9DX,802.35,ANY 182 | STRKETIA,ICD9DX,802.36,ANY 183 | STRKETIA,ICD9DX,802.37,ANY 184 | STRKETIA,ICD9DX,802.38,ANY 185 | STRKETIA,ICD9DX,802.39,ANY 186 | STRKETIA,ICD9DX,802.4,ANY 187 | STRKETIA,ICD9DX,802.5,ANY 188 | STRKETIA,ICD9DX,802.6,ANY 189 | STRKETIA,ICD9DX,802.7,ANY 190 | STRKETIA,ICD9DX,802.8,ANY 191 | STRKETIA,ICD9DX,802.9,ANY 192 | STRKETIA,ICD9DX,803,ANY 193 | STRKETIA,ICD9DX,803.01,ANY 194 | STRKETIA,ICD9DX,803.02,ANY 195 | STRKETIA,ICD9DX,803.03,ANY 196 | STRKETIA,ICD9DX,803.04,ANY 197 | STRKETIA,ICD9DX,803.05,ANY 198 | STRKETIA,ICD9DX,803.06,ANY 199 | STRKETIA,ICD9DX,803.09,ANY 200 | STRKETIA,ICD9DX,803.1,ANY 201 | STRKETIA,ICD9DX,803.11,ANY 202 | STRKETIA,ICD9DX,803.12,ANY 203 | STRKETIA,ICD9DX,803.13,ANY 204 | STRKETIA,ICD9DX,803.14,ANY 205 | STRKETIA,ICD9DX,803.15,ANY 206 | STRKETIA,ICD9DX,803.16,ANY 207 | STRKETIA,ICD9DX,803.19,ANY 208 | STRKETIA,ICD9DX,803.2,ANY 209 | STRKETIA,ICD9DX,803.21,ANY 210 | STRKETIA,ICD9DX,803.22,ANY 211 | STRKETIA,ICD9DX,803.23,ANY 212 | STRKETIA,ICD9DX,803.24,ANY 213 | STRKETIA,ICD9DX,803.25,ANY 214 | STRKETIA,ICD9DX,803.26,ANY 215 | STRKETIA,ICD9DX,803.29,ANY 216 | STRKETIA,ICD9DX,803.3,ANY 217 | STRKETIA,ICD9DX,803.31,ANY 218 | STRKETIA,ICD9DX,803.32,ANY 219 | STRKETIA,ICD9DX,803.33,ANY 220 | STRKETIA,ICD9DX,803.34,ANY 221 | STRKETIA,ICD9DX,803.35,ANY 222 | STRKETIA,ICD9DX,803.36,ANY 223 | STRKETIA,ICD9DX,803.39,ANY 224 | STRKETIA,ICD9DX,803.4,ANY 225 | STRKETIA,ICD9DX,803.41,ANY 226 | STRKETIA,ICD9DX,803.42,ANY 227 | STRKETIA,ICD9DX,803.43,ANY 228 | STRKETIA,ICD9DX,803.44,ANY 229 | STRKETIA,ICD9DX,803.45,ANY 230 | STRKETIA,ICD9DX,803.46,ANY 231 | STRKETIA,ICD9DX,803.49,ANY 232 | STRKETIA,ICD9DX,803.5,ANY 233 | STRKETIA,ICD9DX,803.51,ANY 234 | STRKETIA,ICD9DX,803.52,ANY 235 | STRKETIA,ICD9DX,803.53,ANY 236 | STRKETIA,ICD9DX,803.54,ANY 237 | STRKETIA,ICD9DX,803.55,ANY 238 | STRKETIA,ICD9DX,803.56,ANY 239 | STRKETIA,ICD9DX,803.59,ANY 240 | STRKETIA,ICD9DX,803.6,ANY 241 | STRKETIA,ICD9DX,803.61,ANY 242 | STRKETIA,ICD9DX,803.62,ANY 243 | STRKETIA,ICD9DX,803.63,ANY 244 | STRKETIA,ICD9DX,803.64,ANY 245 | STRKETIA,ICD9DX,803.65,ANY 246 | STRKETIA,ICD9DX,803.66,ANY 247 | STRKETIA,ICD9DX,803.69,ANY 248 | STRKETIA,ICD9DX,803.7,ANY 249 | STRKETIA,ICD9DX,803.71,ANY 250 | STRKETIA,ICD9DX,803.72,ANY 251 | STRKETIA,ICD9DX,803.73,ANY 252 | STRKETIA,ICD9DX,803.74,ANY 253 | STRKETIA,ICD9DX,803.75,ANY 254 | STRKETIA,ICD9DX,803.76,ANY 255 | STRKETIA,ICD9DX,803.79,ANY 256 | STRKETIA,ICD9DX,803.8,ANY 257 | STRKETIA,ICD9DX,803.81,ANY 258 | STRKETIA,ICD9DX,803.82,ANY 259 | STRKETIA,ICD9DX,803.83,ANY 260 | STRKETIA,ICD9DX,803.84,ANY 261 | STRKETIA,ICD9DX,803.85,ANY 262 | STRKETIA,ICD9DX,803.86,ANY 263 | STRKETIA,ICD9DX,803.89,ANY 264 | STRKETIA,ICD9DX,803.9,ANY 265 | STRKETIA,ICD9DX,803.91,ANY 266 | STRKETIA,ICD9DX,803.92,ANY 267 | STRKETIA,ICD9DX,803.93,ANY 268 | STRKETIA,ICD9DX,803.94,ANY 269 | STRKETIA,ICD9DX,803.95,ANY 270 | STRKETIA,ICD9DX,803.96,ANY 271 | STRKETIA,ICD9DX,803.99,ANY 272 | STRKETIA,ICD9DX,804,ANY 273 | STRKETIA,ICD9DX,804.01,ANY 274 | STRKETIA,ICD9DX,804.02,ANY 275 | STRKETIA,ICD9DX,804.03,ANY 276 | STRKETIA,ICD9DX,804.04,ANY 277 | STRKETIA,ICD9DX,804.05,ANY 278 | STRKETIA,ICD9DX,804.06,ANY 279 | STRKETIA,ICD9DX,804.09,ANY 280 | STRKETIA,ICD9DX,804.1,ANY 281 | STRKETIA,ICD9DX,804.11,ANY 282 | STRKETIA,ICD9DX,804.12,ANY 283 | STRKETIA,ICD9DX,804.13,ANY 284 | STRKETIA,ICD9DX,804.14,ANY 285 | STRKETIA,ICD9DX,804.15,ANY 286 | STRKETIA,ICD9DX,804.16,ANY 287 | STRKETIA,ICD9DX,804.19,ANY 288 | STRKETIA,ICD9DX,804.2,ANY 289 | STRKETIA,ICD9DX,804.21,ANY 290 | STRKETIA,ICD9DX,804.22,ANY 291 | STRKETIA,ICD9DX,804.23,ANY 292 | STRKETIA,ICD9DX,804.24,ANY 293 | STRKETIA,ICD9DX,804.25,ANY 294 | STRKETIA,ICD9DX,804.26,ANY 295 | STRKETIA,ICD9DX,804.29,ANY 296 | STRKETIA,ICD9DX,804.3,ANY 297 | STRKETIA,ICD9DX,804.31,ANY 298 | STRKETIA,ICD9DX,804.32,ANY 299 | STRKETIA,ICD9DX,804.33,ANY 300 | STRKETIA,ICD9DX,804.34,ANY 301 | STRKETIA,ICD9DX,804.35,ANY 302 | STRKETIA,ICD9DX,804.36,ANY 303 | STRKETIA,ICD9DX,804.39,ANY 304 | STRKETIA,ICD9DX,804.4,ANY 305 | STRKETIA,ICD9DX,804.41,ANY 306 | STRKETIA,ICD9DX,804.42,ANY 307 | STRKETIA,ICD9DX,804.43,ANY 308 | STRKETIA,ICD9DX,804.44,ANY 309 | STRKETIA,ICD9DX,804.45,ANY 310 | STRKETIA,ICD9DX,804.46,ANY 311 | STRKETIA,ICD9DX,804.49,ANY 312 | STRKETIA,ICD9DX,804.5,ANY 313 | STRKETIA,ICD9DX,804.51,ANY 314 | STRKETIA,ICD9DX,804.52,ANY 315 | STRKETIA,ICD9DX,804.53,ANY 316 | STRKETIA,ICD9DX,804.54,ANY 317 | STRKETIA,ICD9DX,804.55,ANY 318 | STRKETIA,ICD9DX,804.56,ANY 319 | STRKETIA,ICD9DX,804.59,ANY 320 | STRKETIA,ICD9DX,804.6,ANY 321 | STRKETIA,ICD9DX,804.61,ANY 322 | STRKETIA,ICD9DX,804.62,ANY 323 | STRKETIA,ICD9DX,804.63,ANY 324 | STRKETIA,ICD9DX,804.64,ANY 325 | STRKETIA,ICD9DX,804.65,ANY 326 | STRKETIA,ICD9DX,804.66,ANY 327 | STRKETIA,ICD9DX,804.69,ANY 328 | STRKETIA,ICD9DX,804.7,ANY 329 | STRKETIA,ICD9DX,804.71,ANY 330 | STRKETIA,ICD9DX,804.72,ANY 331 | STRKETIA,ICD9DX,804.73,ANY 332 | STRKETIA,ICD9DX,804.74,ANY 333 | STRKETIA,ICD9DX,804.75,ANY 334 | STRKETIA,ICD9DX,804.76,ANY 335 | STRKETIA,ICD9DX,804.79,ANY 336 | STRKETIA,ICD9DX,804.8,ANY 337 | STRKETIA,ICD9DX,804.81,ANY 338 | STRKETIA,ICD9DX,804.82,ANY 339 | STRKETIA,ICD9DX,804.83,ANY 340 | STRKETIA,ICD9DX,804.84,ANY 341 | STRKETIA,ICD9DX,804.85,ANY 342 | STRKETIA,ICD9DX,804.86,ANY 343 | STRKETIA,ICD9DX,804.89,ANY 344 | STRKETIA,ICD9DX,804.9,ANY 345 | STRKETIA,ICD9DX,804.91,ANY 346 | STRKETIA,ICD9DX,804.92,ANY 347 | STRKETIA,ICD9DX,804.93,ANY 348 | STRKETIA,ICD9DX,804.94,ANY 349 | STRKETIA,ICD9DX,804.95,ANY 350 | STRKETIA,ICD9DX,804.96,ANY 351 | STRKETIA,ICD9DX,804.99,ANY 352 | STRKETIA,ICD9DX,V57,DX1 353 | STRKETIA,ICD9DX,V57.0,DX1 354 | STRKETIA,ICD9DX,V57.1,DX1 355 | STRKETIA,ICD9DX,V57.2,DX1 356 | STRKETIA,ICD9DX,V57.21,DX1 357 | STRKETIA,ICD9DX,V57.22,DX1 358 | STRKETIA,ICD9DX,V57.8,DX1 359 | STRKETIA,ICD9DX,V57.4,DX1 360 | STRKETIA,ICD9DX,V57.8,DX1 361 | STRKETIA,ICD9DX,V57.81,DX1 362 | STRKETIA,ICD9DX,V57.89,DX1 363 | STRKETIA,ICD9DX,V57.9,DX1 364 | STRKETIA,ICD9DX,850,ANY 365 | STRKETIA,ICD9DX,850.1,ANY 366 | STRKETIA,ICD9DX,850.11,ANY 367 | STRKETIA,ICD9DX,850.12,ANY 368 | STRKETIA,ICD9DX,850.2,ANY 369 | STRKETIA,ICD9DX,850.3,ANY 370 | STRKETIA,ICD9DX,850.4,ANY 371 | STRKETIA,ICD9DX,850.5,ANY 372 | STRKETIA,ICD9DX,850.9,ANY 373 | STRKETIA,ICD9DX,851,ANY 374 | STRKETIA,ICD9DX,851.01,ANY 375 | STRKETIA,ICD9DX,851.02,ANY 376 | STRKETIA,ICD9DX,851.03,ANY 377 | STRKETIA,ICD9DX,851.04,ANY 378 | STRKETIA,ICD9DX,851.05,ANY 379 | STRKETIA,ICD9DX,851.06,ANY 380 | STRKETIA,ICD9DX,851.09,ANY 381 | STRKETIA,ICD9DX,851.1,ANY 382 | STRKETIA,ICD9DX,851.11,ANY 383 | STRKETIA,ICD9DX,851.12,ANY 384 | STRKETIA,ICD9DX,851.13,ANY 385 | STRKETIA,ICD9DX,851.14,ANY 386 | STRKETIA,ICD9DX,851.15,ANY 387 | STRKETIA,ICD9DX,851.16,ANY 388 | STRKETIA,ICD9DX,851.19,ANY 389 | STRKETIA,ICD9DX,851.2,ANY 390 | STRKETIA,ICD9DX,851.21,ANY 391 | STRKETIA,ICD9DX,851.22,ANY 392 | STRKETIA,ICD9DX,851.23,ANY 393 | STRKETIA,ICD9DX,851.24,ANY 394 | STRKETIA,ICD9DX,851.25,ANY 395 | STRKETIA,ICD9DX,851.26,ANY 396 | STRKETIA,ICD9DX,851.29,ANY 397 | STRKETIA,ICD9DX,851.3,ANY 398 | STRKETIA,ICD9DX,851.31,ANY 399 | STRKETIA,ICD9DX,851.32,ANY 400 | STRKETIA,ICD9DX,851.33,ANY 401 | STRKETIA,ICD9DX,851.34,ANY 402 | STRKETIA,ICD9DX,851.35,ANY 403 | STRKETIA,ICD9DX,851.36,ANY 404 | STRKETIA,ICD9DX,851.39,ANY 405 | STRKETIA,ICD9DX,851.4,ANY 406 | STRKETIA,ICD9DX,851.41,ANY 407 | STRKETIA,ICD9DX,851.42,ANY 408 | STRKETIA,ICD9DX,851.43,ANY 409 | STRKETIA,ICD9DX,851.44,ANY 410 | STRKETIA,ICD9DX,851.45,ANY 411 | STRKETIA,ICD9DX,851.46,ANY 412 | STRKETIA,ICD9DX,851.49,ANY 413 | STRKETIA,ICD9DX,851.5,ANY 414 | STRKETIA,ICD9DX,851.51,ANY 415 | STRKETIA,ICD9DX,851.52,ANY 416 | STRKETIA,ICD9DX,851.53,ANY 417 | STRKETIA,ICD9DX,851.54,ANY 418 | STRKETIA,ICD9DX,851.55,ANY 419 | STRKETIA,ICD9DX,851.56,ANY 420 | STRKETIA,ICD9DX,851.59,ANY 421 | STRKETIA,ICD9DX,851.6,ANY 422 | STRKETIA,ICD9DX,851.61,ANY 423 | STRKETIA,ICD9DX,851.62,ANY 424 | STRKETIA,ICD9DX,851.63,ANY 425 | STRKETIA,ICD9DX,851.64,ANY 426 | STRKETIA,ICD9DX,851.65,ANY 427 | STRKETIA,ICD9DX,851.66,ANY 428 | STRKETIA,ICD9DX,851.69,ANY 429 | STRKETIA,ICD9DX,851.7,ANY 430 | STRKETIA,ICD9DX,851.71,ANY 431 | STRKETIA,ICD9DX,851.72,ANY 432 | STRKETIA,ICD9DX,851.73,ANY 433 | STRKETIA,ICD9DX,851.74,ANY 434 | STRKETIA,ICD9DX,851.75,ANY 435 | STRKETIA,ICD9DX,851.76,ANY 436 | STRKETIA,ICD9DX,851.79,ANY 437 | STRKETIA,ICD9DX,851.8,ANY 438 | STRKETIA,ICD9DX,851.81,ANY 439 | STRKETIA,ICD9DX,851.82,ANY 440 | STRKETIA,ICD9DX,851.83,ANY 441 | STRKETIA,ICD9DX,851.84,ANY 442 | STRKETIA,ICD9DX,851.85,ANY 443 | STRKETIA,ICD9DX,851.86,ANY 444 | STRKETIA,ICD9DX,851.89,ANY 445 | STRKETIA,ICD9DX,851.9,ANY 446 | STRKETIA,ICD9DX,851.91,ANY 447 | STRKETIA,ICD9DX,851.92,ANY 448 | STRKETIA,ICD9DX,851.93,ANY 449 | STRKETIA,ICD9DX,851.94,ANY 450 | STRKETIA,ICD9DX,851.95,ANY 451 | STRKETIA,ICD9DX,851.96,ANY 452 | STRKETIA,ICD9DX,851.99,ANY 453 | STRKETIA,ICD9DX,852,ANY 454 | STRKETIA,ICD9DX,852.01,ANY 455 | STRKETIA,ICD9DX,852.02,ANY 456 | STRKETIA,ICD9DX,852.03,ANY 457 | STRKETIA,ICD9DX,852.04,ANY 458 | STRKETIA,ICD9DX,852.05,ANY 459 | STRKETIA,ICD9DX,852.06,ANY 460 | STRKETIA,ICD9DX,852.09,ANY 461 | STRKETIA,ICD9DX,852.1,ANY 462 | STRKETIA,ICD9DX,852.11,ANY 463 | STRKETIA,ICD9DX,852.12,ANY 464 | STRKETIA,ICD9DX,852.13,ANY 465 | STRKETIA,ICD9DX,852.14,ANY 466 | STRKETIA,ICD9DX,852.15,ANY 467 | STRKETIA,ICD9DX,852.16,ANY 468 | STRKETIA,ICD9DX,852.19,ANY 469 | STRKETIA,ICD9DX,852.2,ANY 470 | STRKETIA,ICD9DX,852.21,ANY 471 | STRKETIA,ICD9DX,852.22,ANY 472 | STRKETIA,ICD9DX,852.23,ANY 473 | STRKETIA,ICD9DX,852.24,ANY 474 | STRKETIA,ICD9DX,852.25,ANY 475 | STRKETIA,ICD9DX,852.26,ANY 476 | STRKETIA,ICD9DX,852.29,ANY 477 | STRKETIA,ICD9DX,852.3,ANY 478 | STRKETIA,ICD9DX,852.31,ANY 479 | STRKETIA,ICD9DX,852.32,ANY 480 | STRKETIA,ICD9DX,852.33,ANY 481 | STRKETIA,ICD9DX,852.34,ANY 482 | STRKETIA,ICD9DX,852.35,ANY 483 | STRKETIA,ICD9DX,852.36,ANY 484 | STRKETIA,ICD9DX,852.39,ANY 485 | STRKETIA,ICD9DX,852.4,ANY 486 | STRKETIA,ICD9DX,852.41,ANY 487 | STRKETIA,ICD9DX,852.42,ANY 488 | STRKETIA,ICD9DX,852.43,ANY 489 | STRKETIA,ICD9DX,852.44,ANY 490 | STRKETIA,ICD9DX,852.45,ANY 491 | STRKETIA,ICD9DX,852.46,ANY 492 | STRKETIA,ICD9DX,852.49,ANY 493 | STRKETIA,ICD9DX,852.5,ANY 494 | STRKETIA,ICD9DX,852.51,ANY 495 | STRKETIA,ICD9DX,852.52,ANY 496 | STRKETIA,ICD9DX,852.53,ANY 497 | STRKETIA,ICD9DX,852.54,ANY 498 | STRKETIA,ICD9DX,852.55,ANY 499 | STRKETIA,ICD9DX,852.56,ANY 500 | STRKETIA,ICD9DX,852.59,ANY 501 | STRKETIA,ICD9DX,853,ANY 502 | STRKETIA,ICD9DX,853.01,ANY 503 | STRKETIA,ICD9DX,853.02,ANY 504 | STRKETIA,ICD9DX,853.03,ANY 505 | STRKETIA,ICD9DX,853.04,ANY 506 | STRKETIA,ICD9DX,853.05,ANY 507 | STRKETIA,ICD9DX,853.06,ANY 508 | STRKETIA,ICD9DX,853.09,ANY 509 | STRKETIA,ICD9DX,853.1,ANY 510 | STRKETIA,ICD9DX,853.11,ANY 511 | STRKETIA,ICD9DX,853.12,ANY 512 | STRKETIA,ICD9DX,853.13,ANY 513 | STRKETIA,ICD9DX,853.14,ANY 514 | STRKETIA,ICD9DX,853.15,ANY 515 | STRKETIA,ICD9DX,853.16,ANY 516 | STRKETIA,ICD9DX,853.19,ANY 517 | STRKETIA,ICD9DX,854,ANY 518 | STRKETIA,ICD9DX,854.01,ANY 519 | STRKETIA,ICD9DX,854.02,ANY 520 | STRKETIA,ICD9DX,854.03,ANY 521 | STRKETIA,ICD9DX,854.04,ANY 522 | STRKETIA,ICD9DX,854.05,ANY 523 | STRKETIA,ICD9DX,854.06,ANY 524 | STRKETIA,ICD9DX,854.09,ANY 525 | STRKETIA,ICD9DX,854.1,ANY 526 | STRKETIA,ICD9DX,854.11,ANY 527 | STRKETIA,ICD9DX,854.12,ANY 528 | STRKETIA,ICD9DX,854.13,ANY 529 | STRKETIA,ICD9DX,854.14,ANY 530 | STRKETIA,ICD9DX,854.15,ANY 531 | STRKETIA,ICD9DX,854.16,ANY 532 | STRKETIA,ICD9DX,854.19,ANY 533 | STRKETIA,ICD10DX,S01.90XA,ANY 534 | STRKETIA,ICD10DX,S02.0XXA,ANY 535 | STRKETIA,ICD10DX,S02.0XXB,ANY 536 | STRKETIA,ICD10DX,S02.101A,ANY 537 | STRKETIA,ICD10DX,S02.101B,ANY 538 | STRKETIA,ICD10DX,S02.102A,ANY 539 | STRKETIA,ICD10DX,S02.102B,ANY 540 | STRKETIA,ICD10DX,S02.109A,ANY 541 | STRKETIA,ICD10DX,S02.109B,ANY 542 | STRKETIA,ICD10DX,S02.10XA,ANY 543 | STRKETIA,ICD10DX,S02.10XB,ANY 544 | STRKETIA,ICD10DX,S02.110A,ANY 545 | STRKETIA,ICD10DX,S02.110B,ANY 546 | STRKETIA,ICD10DX,S02.111A,ANY 547 | STRKETIA,ICD10DX,S02.111B,ANY 548 | STRKETIA,ICD10DX,S02.112A,ANY 549 | STRKETIA,ICD10DX,S02.112B,ANY 550 | STRKETIA,ICD10DX,S02.113A,ANY 551 | STRKETIA,ICD10DX,S02.113B,ANY 552 | STRKETIA,ICD10DX,S02.118A,ANY 553 | STRKETIA,ICD10DX,S02.118B,ANY 554 | STRKETIA,ICD10DX,S02.119A,ANY 555 | STRKETIA,ICD10DX,S02.119B,ANY 556 | STRKETIA,ICD10DX,S02.11GA,ANY 557 | STRKETIA,ICD10DX,S02.11GB,ANY 558 | STRKETIA,ICD10DX,S02.11HA,ANY 559 | STRKETIA,ICD10DX,S02.11HB,ANY 560 | STRKETIA,ICD10DX,S02.121A,ANY 561 | STRKETIA,ICD10DX,S02.121B,ANY 562 | STRKETIA,ICD10DX,S02.121D,ANY 563 | STRKETIA,ICD10DX,S02.121G,ANY 564 | STRKETIA,ICD10DX,S02.121K,ANY 565 | STRKETIA,ICD10DX,S02.121S,ANY 566 | STRKETIA,ICD10DX,S02.122A,ANY 567 | STRKETIA,ICD10DX,S02.122B,ANY 568 | STRKETIA,ICD10DX,S02.122D,ANY 569 | STRKETIA,ICD10DX,S02.122G,ANY 570 | STRKETIA,ICD10DX,S02.122K,ANY 571 | STRKETIA,ICD10DX,S02.122S,ANY 572 | STRKETIA,ICD10DX,S02.129A,ANY 573 | STRKETIA,ICD10DX,S02.129B,ANY 574 | STRKETIA,ICD10DX,S02.129D,ANY 575 | STRKETIA,ICD10DX,S02.129G,ANY 576 | STRKETIA,ICD10DX,S02.129K,ANY 577 | STRKETIA,ICD10DX,S02.129S,ANY 578 | STRKETIA,ICD10DX,S02.19XA,ANY 579 | STRKETIA,ICD10DX,S02.19XB,ANY 580 | STRKETIA,ICD10DX,S02.2XXA,ANY 581 | STRKETIA,ICD10DX,S02.2XXB,ANY 582 | STRKETIA,ICD10DX,S02.30XA,ANY 583 | STRKETIA,ICD10DX,S02.30XB,ANY 584 | STRKETIA,ICD10DX,S02.31XA,ANY 585 | STRKETIA,ICD10DX,S02.31XB,ANY 586 | STRKETIA,ICD10DX,S02.32XA,ANY 587 | STRKETIA,ICD10DX,S02.32XB,ANY 588 | STRKETIA,ICD10DX,S02.3XXA,ANY 589 | STRKETIA,ICD10DX,S02.3XXB,ANY 590 | STRKETIA,ICD10DX,S02.400A,ANY 591 | STRKETIA,ICD10DX,S02.400B,ANY 592 | STRKETIA,ICD10DX,S02.401A,ANY 593 | STRKETIA,ICD10DX,S02.401B,ANY 594 | STRKETIA,ICD10DX,S02.402A,ANY 595 | STRKETIA,ICD10DX,S02.402B,ANY 596 | STRKETIA,ICD10DX,S02.40AA,ANY 597 | STRKETIA,ICD10DX,S02.40AB,ANY 598 | STRKETIA,ICD10DX,S02.40BA,ANY 599 | STRKETIA,ICD10DX,S02.40BB,ANY 600 | STRKETIA,ICD10DX,S02.40CA,ANY 601 | STRKETIA,ICD10DX,S02.40CB,ANY 602 | STRKETIA,ICD10DX,S02.40DA,ANY 603 | STRKETIA,ICD10DX,S02.40DB,ANY 604 | STRKETIA,ICD10DX,S02.40EA,ANY 605 | STRKETIA,ICD10DX,S02.40EB,ANY 606 | STRKETIA,ICD10DX,S02.40FA,ANY 607 | STRKETIA,ICD10DX,S02.40FB,ANY 608 | STRKETIA,ICD10DX,S02.411A,ANY 609 | STRKETIA,ICD10DX,S02.411B,ANY 610 | STRKETIA,ICD10DX,S02.412A,ANY 611 | STRKETIA,ICD10DX,S02.412B,ANY 612 | STRKETIA,ICD10DX,S02.413A,ANY 613 | STRKETIA,ICD10DX,S02.413B,ANY 614 | STRKETIA,ICD10DX,S02.42XA,ANY 615 | STRKETIA,ICD10DX,S02.42XB,ANY 616 | STRKETIA,ICD10DX,S02.600A,ANY 617 | STRKETIA,ICD10DX,S02.600B,ANY 618 | STRKETIA,ICD10DX,S02.601A,ANY 619 | STRKETIA,ICD10DX,S02.601B,ANY 620 | STRKETIA,ICD10DX,S02.602A,ANY 621 | STRKETIA,ICD10DX,S02.602B,ANY 622 | STRKETIA,ICD10DX,S02.609A,ANY 623 | STRKETIA,ICD10DX,S02.609B,ANY 624 | STRKETIA,ICD10DX,S02.610A,ANY 625 | STRKETIA,ICD10DX,S02.610B,ANY 626 | STRKETIA,ICD10DX,S02.611A,ANY 627 | STRKETIA,ICD10DX,S02.611B,ANY 628 | STRKETIA,ICD10DX,S02.612A,ANY 629 | STRKETIA,ICD10DX,S02.612B,ANY 630 | STRKETIA,ICD10DX,S02.61XA,ANY 631 | STRKETIA,ICD10DX,S02.61XB,ANY 632 | STRKETIA,ICD10DX,S02.620A,ANY 633 | STRKETIA,ICD10DX,S02.620B,ANY 634 | STRKETIA,ICD10DX,S02.621A,ANY 635 | STRKETIA,ICD10DX,S02.621B,ANY 636 | STRKETIA,ICD10DX,S02.622A,ANY 637 | STRKETIA,ICD10DX,S02.622B,ANY 638 | STRKETIA,ICD10DX,S02.62XA,ANY 639 | STRKETIA,ICD10DX,S02.62XB,ANY 640 | STRKETIA,ICD10DX,S02.630A,ANY 641 | STRKETIA,ICD10DX,S02.630B,ANY 642 | STRKETIA,ICD10DX,S02.631A,ANY 643 | STRKETIA,ICD10DX,S02.631B,ANY 644 | STRKETIA,ICD10DX,S02.632A,ANY 645 | STRKETIA,ICD10DX,S02.632B,ANY 646 | STRKETIA,ICD10DX,S02.63XA,ANY 647 | STRKETIA,ICD10DX,S02.63XB,ANY 648 | STRKETIA,ICD10DX,S02.640A,ANY 649 | STRKETIA,ICD10DX,S02.640B,ANY 650 | STRKETIA,ICD10DX,S02.641A,ANY 651 | STRKETIA,ICD10DX,S02.641B,ANY 652 | STRKETIA,ICD10DX,S02.642A,ANY 653 | STRKETIA,ICD10DX,S02.642B,ANY 654 | STRKETIA,ICD10DX,S02.64XA,ANY 655 | STRKETIA,ICD10DX,S02.64XB,ANY 656 | STRKETIA,ICD10DX,S02.650A,ANY 657 | STRKETIA,ICD10DX,S02.650B,ANY 658 | STRKETIA,ICD10DX,S02.651A,ANY 659 | STRKETIA,ICD10DX,S02.651B,ANY 660 | STRKETIA,ICD10DX,S02.652A,ANY 661 | STRKETIA,ICD10DX,S02.652B,ANY 662 | STRKETIA,ICD10DX,S02.65XA,ANY 663 | STRKETIA,ICD10DX,S02.65XB,ANY 664 | STRKETIA,ICD10DX,S02.66XA,ANY 665 | STRKETIA,ICD10DX,S02.66XB,ANY 666 | STRKETIA,ICD10DX,S02.670A,ANY 667 | STRKETIA,ICD10DX,S02.670B,ANY 668 | STRKETIA,ICD10DX,S02.671A,ANY 669 | STRKETIA,ICD10DX,S02.671B,ANY 670 | STRKETIA,ICD10DX,S02.672A,ANY 671 | STRKETIA,ICD10DX,S02.672B,ANY 672 | STRKETIA,ICD10DX,S02.67XA,ANY 673 | STRKETIA,ICD10DX,S02.67XB,ANY 674 | STRKETIA,ICD10DX,S02.69XA,ANY 675 | STRKETIA,ICD10DX,S02.69XB,ANY 676 | STRKETIA,ICD10DX,S02.80XA,ANY 677 | STRKETIA,ICD10DX,S02.80XB,ANY 678 | STRKETIA,ICD10DX,S02.81XA,ANY 679 | STRKETIA,ICD10DX,S02.81XB,ANY 680 | STRKETIA,ICD10DX,S02.82XA,ANY 681 | STRKETIA,ICD10DX,S02.82XB,ANY 682 | STRKETIA,ICD10DX,S02.831A,ANY 683 | STRKETIA,ICD10DX,S02.831B,ANY 684 | STRKETIA,ICD10DX,S02.831D,ANY 685 | STRKETIA,ICD10DX,S02.831G,ANY 686 | STRKETIA,ICD10DX,S02.831K,ANY 687 | STRKETIA,ICD10DX,S02.831S,ANY 688 | STRKETIA,ICD10DX,S02.832A,ANY 689 | STRKETIA,ICD10DX,S02.832B,ANY 690 | STRKETIA,ICD10DX,S02.832D,ANY 691 | STRKETIA,ICD10DX,S02.832G,ANY 692 | STRKETIA,ICD10DX,S02.832K,ANY 693 | STRKETIA,ICD10DX,S02.832S,ANY 694 | STRKETIA,ICD10DX,S02.839A,ANY 695 | STRKETIA,ICD10DX,S02.839B,ANY 696 | STRKETIA,ICD10DX,S02.839D,ANY 697 | STRKETIA,ICD10DX,S02.839G,ANY 698 | STRKETIA,ICD10DX,S02.839K,ANY 699 | STRKETIA,ICD10DX,S02.839S,ANY 700 | STRKETIA,ICD10DX,S02.841A,ANY 701 | STRKETIA,ICD10DX,S02.841B,ANY 702 | STRKETIA,ICD10DX,S02.841D,ANY 703 | STRKETIA,ICD10DX,S02.841G,ANY 704 | STRKETIA,ICD10DX,S02.841K,ANY 705 | STRKETIA,ICD10DX,S02.841S,ANY 706 | STRKETIA,ICD10DX,S02.842A,ANY 707 | STRKETIA,ICD10DX,S02.842B,ANY 708 | STRKETIA,ICD10DX,S02.842D,ANY 709 | STRKETIA,ICD10DX,S02.842G,ANY 710 | STRKETIA,ICD10DX,S02.842K,ANY 711 | STRKETIA,ICD10DX,S02.842S,ANY 712 | STRKETIA,ICD10DX,S02.849A,ANY 713 | STRKETIA,ICD10DX,S02.849B,ANY 714 | STRKETIA,ICD10DX,S02.849D,ANY 715 | STRKETIA,ICD10DX,S02.849G,ANY 716 | STRKETIA,ICD10DX,S02.849K,ANY 717 | STRKETIA,ICD10DX,S02.849S,ANY 718 | STRKETIA,ICD10DX,S02.85XA,ANY 719 | STRKETIA,ICD10DX,S02.85XB,ANY 720 | STRKETIA,ICD10DX,S02.85XD,ANY 721 | STRKETIA,ICD10DX,S02.85XG,ANY 722 | STRKETIA,ICD10DX,S02.85XK,ANY 723 | STRKETIA,ICD10DX,S02.85XS,ANY 724 | STRKETIA,ICD10DX,S02.8XXA,ANY 725 | STRKETIA,ICD10DX,S02.8XXB,ANY 726 | STRKETIA,ICD10DX,S02.91XA,ANY 727 | STRKETIA,ICD10DX,S02.91XB,ANY 728 | STRKETIA,ICD10DX,S02.92XA,ANY 729 | STRKETIA,ICD10DX,S02.92XB,ANY 730 | STRKETIA,ICD10DX,S06.0X0A,ANY 731 | STRKETIA,ICD10DX,S06.0X1A,ANY 732 | STRKETIA,ICD10DX,S06.0X2A,ANY 733 | STRKETIA,ICD10DX,S06.0X3A,ANY 734 | STRKETIA,ICD10DX,S06.0X4A,ANY 735 | STRKETIA,ICD10DX,S06.0X5A,ANY 736 | STRKETIA,ICD10DX,S06.0X6A,ANY 737 | STRKETIA,ICD10DX,S06.0X7A,ANY 738 | STRKETIA,ICD10DX,S06.0X8A,ANY 739 | STRKETIA,ICD10DX,S06.0X9A,ANY 740 | STRKETIA,ICD10DX,S06.1X0A,ANY 741 | STRKETIA,ICD10DX,S06.1X1A,ANY 742 | STRKETIA,ICD10DX,S06.1X2A,ANY 743 | STRKETIA,ICD10DX,S06.1X3A,ANY 744 | STRKETIA,ICD10DX,S06.1X4A,ANY 745 | STRKETIA,ICD10DX,S06.1X5A,ANY 746 | STRKETIA,ICD10DX,S06.1X6A,ANY 747 | STRKETIA,ICD10DX,S06.1X7A,ANY 748 | STRKETIA,ICD10DX,S06.1X8A,ANY 749 | STRKETIA,ICD10DX,S06.1X9A,ANY 750 | STRKETIA,ICD10DX,S06.2X0A,ANY 751 | STRKETIA,ICD10DX,S06.2X1A,ANY 752 | STRKETIA,ICD10DX,S06.2X2A,ANY 753 | STRKETIA,ICD10DX,S06.2X3A,ANY 754 | STRKETIA,ICD10DX,S06.2X4A,ANY 755 | STRKETIA,ICD10DX,S06.2X5A,ANY 756 | STRKETIA,ICD10DX,S06.2X6A,ANY 757 | STRKETIA,ICD10DX,S06.2X7A,ANY 758 | STRKETIA,ICD10DX,S06.2X8A,ANY 759 | STRKETIA,ICD10DX,S06.2X9A,ANY 760 | STRKETIA,ICD10DX,S06.300A,ANY 761 | STRKETIA,ICD10DX,S06.301A,ANY 762 | STRKETIA,ICD10DX,S06.302A,ANY 763 | STRKETIA,ICD10DX,S06.303A,ANY 764 | STRKETIA,ICD10DX,S06.304A,ANY 765 | STRKETIA,ICD10DX,S06.305A,ANY 766 | STRKETIA,ICD10DX,S06.306A,ANY 767 | STRKETIA,ICD10DX,S06.307A,ANY 768 | STRKETIA,ICD10DX,S06.308A,ANY 769 | STRKETIA,ICD10DX,S06.309A,ANY 770 | STRKETIA,ICD10DX,S06.310A,ANY 771 | STRKETIA,ICD10DX,S06.311A,ANY 772 | STRKETIA,ICD10DX,S06.312A,ANY 773 | STRKETIA,ICD10DX,S06.313A,ANY 774 | STRKETIA,ICD10DX,S06.314A,ANY 775 | STRKETIA,ICD10DX,S06.315A,ANY 776 | STRKETIA,ICD10DX,S06.316A,ANY 777 | STRKETIA,ICD10DX,S06.317A,ANY 778 | STRKETIA,ICD10DX,S06.318A,ANY 779 | STRKETIA,ICD10DX,S06.319A,ANY 780 | STRKETIA,ICD10DX,S06.320A,ANY 781 | STRKETIA,ICD10DX,S06.321A,ANY 782 | STRKETIA,ICD10DX,S06.322A,ANY 783 | STRKETIA,ICD10DX,S06.323A,ANY 784 | STRKETIA,ICD10DX,S06.324A,ANY 785 | STRKETIA,ICD10DX,S06.325A,ANY 786 | STRKETIA,ICD10DX,S06.326A,ANY 787 | STRKETIA,ICD10DX,S06.327A,ANY 788 | STRKETIA,ICD10DX,S06.328A,ANY 789 | STRKETIA,ICD10DX,S06.329A,ANY 790 | STRKETIA,ICD10DX,S06.330A,ANY 791 | STRKETIA,ICD10DX,S06.331A,ANY 792 | STRKETIA,ICD10DX,S06.332A,ANY 793 | STRKETIA,ICD10DX,S06.333A,ANY 794 | STRKETIA,ICD10DX,S06.334A,ANY 795 | STRKETIA,ICD10DX,S06.335A,ANY 796 | STRKETIA,ICD10DX,S06.336A,ANY 797 | STRKETIA,ICD10DX,S06.337A,ANY 798 | STRKETIA,ICD10DX,S06.338A,ANY 799 | STRKETIA,ICD10DX,S06.339A,ANY 800 | STRKETIA,ICD10DX,S06.340A,ANY 801 | STRKETIA,ICD10DX,S06.341A,ANY 802 | STRKETIA,ICD10DX,S06.342A,ANY 803 | STRKETIA,ICD10DX,S06.343A,ANY 804 | STRKETIA,ICD10DX,S06.344A,ANY 805 | STRKETIA,ICD10DX,S06.345A,ANY 806 | STRKETIA,ICD10DX,S06.346A,ANY 807 | STRKETIA,ICD10DX,S06.347A,ANY 808 | STRKETIA,ICD10DX,S06.348A,ANY 809 | STRKETIA,ICD10DX,S06.349A,ANY 810 | STRKETIA,ICD10DX,S06.350A,ANY 811 | STRKETIA,ICD10DX,S06.351A,ANY 812 | STRKETIA,ICD10DX,S06.352A,ANY 813 | STRKETIA,ICD10DX,S06.353A,ANY 814 | STRKETIA,ICD10DX,S06.354A,ANY 815 | STRKETIA,ICD10DX,S06.355A,ANY 816 | STRKETIA,ICD10DX,S06.356A,ANY 817 | STRKETIA,ICD10DX,S06.357A,ANY 818 | STRKETIA,ICD10DX,S06.358A,ANY 819 | STRKETIA,ICD10DX,S06.359A,ANY 820 | STRKETIA,ICD10DX,S06.360A,ANY 821 | STRKETIA,ICD10DX,S06.361A,ANY 822 | STRKETIA,ICD10DX,S06.362A,ANY 823 | STRKETIA,ICD10DX,S06.363A,ANY 824 | STRKETIA,ICD10DX,S06.364A,ANY 825 | STRKETIA,ICD10DX,S06.365A,ANY 826 | STRKETIA,ICD10DX,S06.366A,ANY 827 | STRKETIA,ICD10DX,S06.367A,ANY 828 | STRKETIA,ICD10DX,S06.368A,ANY 829 | STRKETIA,ICD10DX,S06.369A,ANY 830 | STRKETIA,ICD10DX,S06.370A,ANY 831 | STRKETIA,ICD10DX,S06.371A,ANY 832 | STRKETIA,ICD10DX,S06.372A,ANY 833 | STRKETIA,ICD10DX,S06.373A,ANY 834 | STRKETIA,ICD10DX,S06.374A,ANY 835 | STRKETIA,ICD10DX,S06.375A,ANY 836 | STRKETIA,ICD10DX,S06.376A,ANY 837 | STRKETIA,ICD10DX,S06.377A,ANY 838 | STRKETIA,ICD10DX,S06.378A,ANY 839 | STRKETIA,ICD10DX,S06.379A,ANY 840 | STRKETIA,ICD10DX,S06.380A,ANY 841 | STRKETIA,ICD10DX,S06.381A,ANY 842 | STRKETIA,ICD10DX,S06.382A,ANY 843 | STRKETIA,ICD10DX,S06.383A,ANY 844 | STRKETIA,ICD10DX,S06.384A,ANY 845 | STRKETIA,ICD10DX,S06.385A,ANY 846 | STRKETIA,ICD10DX,S06.386A,ANY 847 | STRKETIA,ICD10DX,S06.387A,ANY 848 | STRKETIA,ICD10DX,S06.388A,ANY 849 | STRKETIA,ICD10DX,S06.389A,ANY 850 | STRKETIA,ICD10DX,S06.4X0A,ANY 851 | STRKETIA,ICD10DX,S06.4X1A,ANY 852 | STRKETIA,ICD10DX,S06.4X2A,ANY 853 | STRKETIA,ICD10DX,S06.4X3A,ANY 854 | STRKETIA,ICD10DX,S06.4X4A,ANY 855 | STRKETIA,ICD10DX,S06.4X5A,ANY 856 | STRKETIA,ICD10DX,S06.4X6A,ANY 857 | STRKETIA,ICD10DX,S06.4X7A,ANY 858 | STRKETIA,ICD10DX,S06.4X8A,ANY 859 | STRKETIA,ICD10DX,S06.4X9A,ANY 860 | STRKETIA,ICD10DX,S06.5X0A,ANY 861 | STRKETIA,ICD10DX,S06.5X1A,ANY 862 | STRKETIA,ICD10DX,S06.5X2A,ANY 863 | STRKETIA,ICD10DX,S06.5X3A,ANY 864 | STRKETIA,ICD10DX,S06.5X4A,ANY 865 | STRKETIA,ICD10DX,S06.5X5A,ANY 866 | STRKETIA,ICD10DX,S06.5X6A,ANY 867 | STRKETIA,ICD10DX,S06.5X7A,ANY 868 | STRKETIA,ICD10DX,S06.5X8A,ANY 869 | STRKETIA,ICD10DX,S06.5X9A,ANY 870 | STRKETIA,ICD10DX,S06.6X0A,ANY 871 | STRKETIA,ICD10DX,S06.6X1A,ANY 872 | STRKETIA,ICD10DX,S06.6X2A,ANY 873 | STRKETIA,ICD10DX,S06.6X3A,ANY 874 | STRKETIA,ICD10DX,S06.6X4A,ANY 875 | STRKETIA,ICD10DX,S06.6X5A,ANY 876 | STRKETIA,ICD10DX,S06.6X6A,ANY 877 | STRKETIA,ICD10DX,S06.6X7A,ANY 878 | STRKETIA,ICD10DX,S06.6X8A,ANY 879 | STRKETIA,ICD10DX,S06.6X9A,ANY 880 | STRKETIA,ICD10DX,S06.810A,ANY 881 | STRKETIA,ICD10DX,S06.811A,ANY 882 | STRKETIA,ICD10DX,S06.812A,ANY 883 | STRKETIA,ICD10DX,S06.813A,ANY 884 | STRKETIA,ICD10DX,S06.814A,ANY 885 | STRKETIA,ICD10DX,S06.815A,ANY 886 | STRKETIA,ICD10DX,S06.816A,ANY 887 | STRKETIA,ICD10DX,S06.817A,ANY 888 | STRKETIA,ICD10DX,S06.818A,ANY 889 | STRKETIA,ICD10DX,S06.819A,ANY 890 | STRKETIA,ICD10DX,S06.820A,ANY 891 | STRKETIA,ICD10DX,S06.821A,ANY 892 | STRKETIA,ICD10DX,S06.822A,ANY 893 | STRKETIA,ICD10DX,S06.823A,ANY 894 | STRKETIA,ICD10DX,S06.824A,ANY 895 | STRKETIA,ICD10DX,S06.825A,ANY 896 | STRKETIA,ICD10DX,S06.826A,ANY 897 | STRKETIA,ICD10DX,S06.827A,ANY 898 | STRKETIA,ICD10DX,S06.828A,ANY 899 | STRKETIA,ICD10DX,S06.829A,ANY 900 | STRKETIA,ICD10DX,S06.890A,ANY 901 | STRKETIA,ICD10DX,S06.891A,ANY 902 | STRKETIA,ICD10DX,S06.892A,ANY 903 | STRKETIA,ICD10DX,S06.893A,ANY 904 | STRKETIA,ICD10DX,S06.894A,ANY 905 | STRKETIA,ICD10DX,S06.895A,ANY 906 | STRKETIA,ICD10DX,S06.896A,ANY 907 | STRKETIA,ICD10DX,S06.897A,ANY 908 | STRKETIA,ICD10DX,S06.898A,ANY 909 | STRKETIA,ICD10DX,S06.899A,ANY 910 | STRKETIA,ICD10DX,S06.9X0A,ANY 911 | STRKETIA,ICD10DX,S06.9X1A,ANY 912 | STRKETIA,ICD10DX,S06.9X2A,ANY 913 | STRKETIA,ICD10DX,S06.9X3A,ANY 914 | STRKETIA,ICD10DX,S06.9X4A,ANY 915 | STRKETIA,ICD10DX,S06.9X5A,ANY 916 | STRKETIA,ICD10DX,S06.9X6A,ANY 917 | STRKETIA,ICD10DX,S06.9X7A,ANY 918 | STRKETIA,ICD10DX,S06.9X8A,ANY 919 | STRKETIA,ICD10DX,S06.9X9A,ANY 920 | STRKETIA,ICD10DX,Z51.89,DX1 921 | -------------------------------------------------------------------------------- /CC_Package_30v0/data/cc_codes_original.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_30v0/data/cc_codes_original.sas7bdat -------------------------------------------------------------------------------- /CC_Package_30v0/data/cc_desc_original.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_30v0/data/cc_desc_original.sas7bdat -------------------------------------------------------------------------------- /CC_Package_30v0/data/cc_exclude_original.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_30v0/data/cc_exclude_original.sas7bdat -------------------------------------------------------------------------------- /CC_Package_30v0/documentation/README.txt: -------------------------------------------------------------------------------- 1 | These are archived versions of the CCW condition categories. As of 1/4/2023, the algorithm is based off of the codes in the version from Feb 2022. -------------------------------------------------------------------------------- /CC_Package_30v0/documentation/ccw_27conditioncategories2010.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_30v0/documentation/ccw_27conditioncategories2010.pdf -------------------------------------------------------------------------------- /CC_Package_30v0/documentation/ccw_27conditioncategories2012.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_30v0/documentation/ccw_27conditioncategories2012.pdf -------------------------------------------------------------------------------- /CC_Package_30v0/documentation/ccw_27conditioncategories2017.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_30v0/documentation/ccw_27conditioncategories2017.pdf -------------------------------------------------------------------------------- /CC_Package_30v0/documentation/ccw_27conditioncategories2022.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USCSchaefferCenterDataCore/Chronic-Conditions-Package/90e6346dc5000af40672354ea581517e2ffcc430/CC_Package_30v0/documentation/ccw_27conditioncategories2022.pdf -------------------------------------------------------------------------------- /CC_Package_30v0/programs/contenr.sas: -------------------------------------------------------------------------------- 1 | /************************************************************************************************************************* 2 | ***** MACRO: contenr 3 | 4 | ***** DESCRIPTION: This macro identifies length of continous enrollment (in months) for all beneficiaries included in an input dateset 5 | at any point in time. The macro generates a set of yearly files with one entry for each beneficiary and 24 columns, 6 | two for each month, identifying number of months of continous enrolment from one particular month on, and up to a 7 | particular month (including the reference month). 8 | 9 | ***** ARGUMENTS 10 | 11 | - begyr: first year of data, to begin the enrollment count 12 | - endyr: last year of data, to end the enrollment count 13 | - shape: Shape of the source data. The macro allows for two different type of source data, A (annual files) and P (period file). 14 | See below for description of input files. 15 | - filein: Root name of the source file in the case of the annual files (A) or the full name for the period file (P) 16 | (E.g. if shape=A and filein=enr, the actual files are enrYYYY or enrQQYYYY or enrMMYYYY. 17 | If the file is permanently stored, the libname can be included - libname.enr). 18 | - fileout: Root name for the output file that will be generated by the macro - one file per year 19 | - id: Beneficiary identification number. 20 | - var: In the case of the annual files (A), this is the name of the flag identifying the type of enrollment we want to count (e.g. ffs, PDP). 21 | In the case of the period files (P) it can be any string. 22 | The string passed under var is used to name the set of variables counting months of continous enrollment. 23 | 24 | 25 | **** Source file description - there are two possible formats for the input dataset, annual files with monthly entries (A), single period file 26 | with beneficiary entries per each unique period of continous enrollment (P). Note that multipe entries per beneficiary are allowed in P. 27 | Type A file variables: 28 | - id, with the beneficiary unique identification number (any name) 29 | - "date", with the current month in SAS date format (set to the first day of the month) 30 | - var, an indicator (0/1) variable, with a flag for enrollment 31 | 32 | Type B file variables: 33 | - id, with the beneficiary unique identification number (any name) 34 | - "begdt", with the starting month of current enrollment period in SAS date format (set to the first day of the month) 35 | - "enddt", with the ending month of current enrollment period in SAS date format (set to the first day of the month) 36 | 37 | **** Output file description: There is one file per year, with one entry for each beneficiary in the source file that was enrolled in the 38 | plan at least one month within the year. 39 | 40 | **** NEED TO ADD THE DESCRIPTION OF THE FILE **** 41 | 42 | *************************************************************************************************************************/ 43 | 44 | 45 | %macro contenr(begyr,endyr,shape, filein, fileout, id, var); 46 | 47 | ****************************************************************; 48 | ****** Shape long monthly enrollment file as a period file; 49 | %if &shape=A %then %do; 50 | %do yr=&begyr %to &endyr; 51 | %if &yr>&begyr %then %do; 52 | proc sql; 53 | create table _file3 as 54 | select &id, per, begdt as date format=mmddyy8. 55 | from _cont_enrl_per_&var 56 | union 57 | select &id, per, enddt as date format=mmddyy8. 58 | from _cont_enrl_per_&var 59 | union 60 | select &id, . as per,date format=mmddyy8. 61 | from &filein.&yr.(where=(&var.=1)) 62 | order by &id, date; 63 | quit; 64 | %end; 65 | %if &yr=&begyr %then %do; 66 | proc sql; 67 | create table _file3 as 68 | select * 69 | from &filein.&yr. 70 | where &var=1 71 | order by &id., date; 72 | quit; 73 | %end; 74 | data _file1; 75 | set _file3; 76 | by &id. date; 77 | format per 2.0 date ldt mmddyy8.; 78 | retain per2 ldt; 79 | if first.&id then do; 80 | if per=. then per2=1; 81 | ldt=date; 82 | end; 83 | if per^=. then per2=per; 84 | else if per=. & intck('MONTH',ldt,date,'D')>1 then per2+1; 85 | ldt=date; 86 | per=per2; 87 | run; 88 | proc means data=_file1 noprint; 89 | by &id per; 90 | output out=_cont_enrl_per_&var(drop=_freq_ _type_) min(date)=begdt max(date)=enddt; 91 | run; 92 | %end; 93 | %end; 94 | ****************************************************************************************************************; 95 | ****** Compute continous enrollment as of a particular month; 96 | data 97 | %do yr=&begyr %to &endyr; 98 | _enrl_cum_&var._&yr %end;; 99 | %if &shape=A %then set _cont_enrl_per_&var;; 100 | %if &shape=P %then set &filein;; 101 | 102 | array monfl(12) &var._pre_01 - &var._pre_12; 103 | cnt=0; 104 | %do yr=&begyr %to &endyr; 105 | posmon=0; 106 | %do mon=1 %to 12; 107 | if begdt<=mdy(&mon,1,&yr) & enddt>=mdy(&mon,1,&yr) then do; 108 | cnt+1; 109 | posmon=1; 110 | end; 111 | else cnt=0; 112 | year=&yr; 113 | monfl[&mon]=cnt; 114 | %end; 115 | if posmon>0 then output _enrl_cum_&var._&yr; 116 | %end; 117 | run; 118 | 119 | ****************************************************************************************************************; 120 | ****** Compute continous enrollment after a particular month; 121 | 122 | data 123 | %do yr=&begyr %to &endyr; 124 | _enrl_cum2_&var._&yr %end;; 125 | %if &shape=A %then set _cont_enrl_per_&var;; 126 | %if &shape=P %then set &filein;; 127 | 128 | array monpst(12) &var._post_01 - &var._post_12; 129 | cnt=0; 130 | %do yr=&endyr %to &begyr %by -1; 131 | posmon=0; 132 | %do mon=12 %to 1 %by -1; 133 | if begdt<=mdy(&mon,1,&yr) & enddt>=mdy(&mon,1,&yr) then do; 134 | cnt+1; 135 | posmon=1; 136 | end; 137 | else cnt=0; 138 | year=&yr; 139 | monpst[&mon]=cnt; 140 | %end; 141 | if posmon>0 then output _enrl_cum2_&var._&yr; 142 | %end; 143 | run; 144 | 145 | ****************************************************************************************************************; 146 | ****** Aggregate the monthly counts - up to this point, multiple separate enrollment periods within a year will 147 | ****** appear as different lines; 148 | 149 | %do yr=&begyr %to &endyr; 150 | proc means data=_enrl_cum_&var._&yr noprint; 151 | by &id year; 152 | output out=fileout1(drop=_type_ _freq_) max(&var._pre_01-&var._pre_12)=; 153 | run; 154 | proc means data=_enrl_cum2_&var._&yr noprint; 155 | by &id year; 156 | output out=fileout2(drop=_type_ _freq_) max(&var._post_01-&var._post_12)=; 157 | run; 158 | 159 | ****************************************************************************************************************; 160 | ****** Combine pre and post counts and save in the same file; 161 | 162 | data &fileout.&yr; 163 | merge fileout1 fileout2; 164 | by &id year; 165 | label &var._post_01="Number of continous enrollment months from January &yr (includes current month)" 166 | &var._post_02="Number of continous enrollment months from February &yr (includes current month)" 167 | &var._post_03="Number of continous enrollment months from March &yr (includes current month)" 168 | &var._post_04="Number of continous enrollment months from April &yr (includes current month)" 169 | &var._post_05="Number of continous enrollment months from May &yr (includes current month)" 170 | &var._post_06="Number of continous enrollment months from June &yr (includes current month)" 171 | &var._post_07="Number of continous enrollment months from July &yr (includes current month)" 172 | &var._post_08="Number of continous enrollment months from August &yr (includes current month)" 173 | &var._post_09="Number of continous enrollment months from September &yr (includes current month)" 174 | &var._post_10="Number of continous enrollment months from October &yr (includes current month)" 175 | &var._post_11="Number of continous enrollment months from November &yr (includes current month)" 176 | &var._post_12="Number of continous enrollment months from December &yr (includes current month)"; 177 | run; 178 | %end; 179 | 180 | 181 | %mend; 182 | -------------------------------------------------------------------------------- /CC_Package_30v0/programs/idcond.sas: -------------------------------------------------------------------------------- 1 | /*********************************************************************************************/ 2 | TITLE1 'Chronic Conditions Macro'; 3 | 4 | * AUTHOR: Patricia Ferido; 5 | 6 | * DATE: 12/8/2020; 7 | 8 | * PURPOSE: Establish project folders and macro variables for project, all variables following the 9 | %let statements below need to be changed; 10 | 11 | options compress=yes nocenter ls=150 ps=200 errors=5 errorabend errorcheck=strict mprint merror 12 | mergenoby=warn varlenchk=error dkricond=error dkrocond=error msglevel=i; 13 | /*********************************************************************************************/ 14 | 15 | ***** Run all the macro programs based on macro function inputs; 16 | 17 | %macro idcond(projhome=,id=,minyear=,maxyear=,claims_data=,create_enr=,create_enr_shape=,create_enr_filein=,enr_prefix=,enr_var=,claims_out_prefix=, 18 | custom_algorithm=N,custom_suffix=_custom,custom_cond=); 19 | 20 | * Macro variable checks; 21 | data _null_; 22 | if "&projhome"="" then do; 23 | put "ERROR: PUT THE PROJECT FILEPATH WHERE THE MACRO IS BEING RUN. CANNOT BE SOURCE FOLDER"; 24 | abort; 25 | end; 26 | if "&claims_data"="" then do; 27 | put "ERROR: PUT THE NAME OF THE CLAIMS DATA SET ABOVE"; 28 | abort; 29 | end; 30 | if "&id"="" then do; 31 | put "ERROR: PUT THE NAME OF THE UNIQUE PATIENT IDENTIFIER"; 32 | abort; 33 | end; 34 | if "&minyear"="" then do; 35 | put "ERROR: PUT MIN YEAR"; 36 | end; 37 | if "&maxyear"="" then do; 38 | put "ERROR: PUT MAX YEAR"; 39 | end; 40 | if "&create_enr" not in("Y","N") then do; 41 | put "ERROR: INVALID VALUE FOR CREATE_ENR"; 42 | abort; 43 | end; 44 | if "&create_enr_shape" not in("","A","P") then do; 45 | put "ERROR: INVALID VALUE FOR CREATE_ENR_SHAPE"; 46 | abort; 47 | end; 48 | if "&enr_prefix"="" then do; 49 | put "ERROR: PUT THE PREFIX FOR THE ENROLLMENT FILES IN ENR_PREFIX ABOVE"; 50 | abort; 51 | end; 52 | if "&enr_var"="" then do; 53 | put "ERROR: PUT THE ENROLLMENT VARIABLE IN THE ENROLLMENT FILES IN ENR ABOVE"; 54 | abort; 55 | end; 56 | if "&claims_out_prefix"="" then do; 57 | put "ERROR: PUT CLAIMS_OUT_PREFIX"; 58 | abort; 59 | end; 60 | IF "&custom_algorithm" not in("Y","N") then do; 61 | put "ERROR: INVALID VALUE FOR CUSTOM_ALGORITHM"; 62 | abort; 63 | end; 64 | run; 65 | 66 | * checking for libref in data set names; 67 | data _null_; 68 | if find("&claims_data",".")=0 then do; 69 | put "WARNING: NO LIBREF FOR CLAIMS INPUT DATA"; 70 | end; 71 | if find("&claims_out_prefix",".")=0 then do; 72 | put "WARNING: NO LIBREF FOR CLAIMS OUTPUT DATA"; 73 | end; 74 | if find("&enr_prefix",".")=0 then do; 75 | put "WARNING: NO LIBREF FOR ENROLLMENT INPUT DATA"; 76 | end; 77 | run; 78 | 79 | libname _ccproj "&projhome.//data";; 80 | 81 | %if "&CUSTOM_ALGORITHM."="Y" %then %do; 82 | 83 | %include "readin_input_files.sas"; 84 | 85 | * create temporary data to be used in the rest of the program and to check against the custom condition list; 86 | data cc_codes; 87 | set _ccproj.cc_codes&custom_suffix.; 88 | run; 89 | 90 | data cc_exclude; 91 | set _ccproj.cc_exclude&custom_suffix.; 92 | run; 93 | 94 | data cc_desc; 95 | set _ccproj.cc_desc&custom_suffix.; 96 | run; 97 | %end; 98 | 99 | %if "&CUSTOM_ALGORITHM."="N" %then %do; 100 | 101 | * create temporary data to be used in the rest of the program and to check against the custom condition list; 102 | data cc_codes; 103 | set _ccproj.cc_codes_original; 104 | run; 105 | 106 | data cc_exclude; 107 | set _ccproj.cc_exclude_original; 108 | run; 109 | 110 | data cc_desc; 111 | set _ccproj.cc_desc_original; 112 | run; 113 | 114 | %end; 115 | 116 | * checking against the list of custom conditions; 117 | %if "&custom_cond" ne "" %then %do; 118 | data customcond; 119 | format condition $10.; 120 | condlist="&custom_cond."; 121 | ncond=countw(condlist); 122 | do i=1 to ncond; 123 | condition=scan(condlist,i," "); 124 | output; 125 | end; 126 | run; 127 | 128 | proc sort data=customcond; by condition; run; 129 | 130 | proc sort data=cc_desc; by condition; run; 131 | 132 | data custom_cond_ck; 133 | merge cc_desc (in=a keep=condition) customcond (in=b); 134 | by condition; 135 | if b=1 and a=0 then do; 136 | put "ERROR: THERE ARE CONDITIONS LISTED IN COND THAT ARE NOT SPECIFIED IN ALGORITHM e.g. " condition=/; 137 | abort abend; 138 | end; 139 | run; 140 | 141 | * if no errors then limiting to conditions in the list; 142 | proc sort data=cc_exclude; by condition; run; 143 | proc sort data=cc_codes; by condition; run; 144 | 145 | data cc_desc; 146 | merge cc_desc (in=a) customcond (in=b keep=condition); 147 | by condition; 148 | if a and b; 149 | run; 150 | 151 | data cc_exclude; 152 | merge cc_exclude (in=a) customcond (in=b keep=condition); 153 | by condition; 154 | if a and b; 155 | run; 156 | 157 | data cc_codes; 158 | merge cc_codes (in=a) customcond (in=b keep=condition); 159 | by condition; 160 | if a and b; 161 | run; 162 | 163 | %end; 164 | 165 | ***** Check Input Claims Data Sets; 166 | %macro ckinputclms; 167 | 168 | %let v=1; 169 | %let clms=%scan("&claims_data",&v," "); 170 | 171 | %do %while (%length(&clms)>0); 172 | proc contents data=&clms out=contents_claim noprint; run; 173 | 174 | * Check that there is a claim date variables and claim type variable 175 | Check that all the diagnosis codes are named 176 | Check that all other variables are dropped; 177 | 178 | data contents_claim1; 179 | set contents_claim end=_end; 180 | if upcase(name)=upcase("&id") then do; id=1; id1+1; end; 181 | else if name="claim_dt" then do; 182 | clmdt=1; 183 | clmdt1+1; 184 | if type=2 then do; put "ERROR: CONVERT CLAIM_DT TO DATE VARIABLE"; abort; end; 185 | end; 186 | else if name="claim_type" then do; clmtype=1; clmtype1+1; end; 187 | else if find(name,"icd9dx") then do; icd9dx=1; icd9dx1+1; end; 188 | else if find(name,"icd10dx") then do; icd10dx=1; icd10dx1+1; end; 189 | else if find(name,"hcpcs") then do; hcpcs=1; hcpcs1+1; end; 190 | else if find(name,"icd9prcdr") then do; icd9prcdr=1; icd9prcdr1+1; end; 191 | else if find(name,"icd10prcdr") then do; icd10prcdr=1; icd10prcdr1+1; end; 192 | else do; 193 | put "ERROR: POTENTIALLY EXTRANEOUS OR MISSPELLED VARIABLE. NEEDS REVIEW " name=/; 194 | abort; 195 | end; 196 | 197 | if _end then do; 198 | if id1=0 then do; put "ERROR: NO ID VARIABLE"; abort abend; end; 199 | if clmdt1=0 then do; put "ERROR: NO CLAIM DATE VARIABLE"; abort abend; end; 200 | if clmtype1=0 then do; put "ERROR: NO CLAIM TYPE VARIABLE"; abort abend; end; 201 | if max(icd9dx1,icd10dx1,hcpcs1,icd9prcdr1,icd10prcdr1) in(0,.) then do; put "ERROR: NO DIAGNOSIS OR PROCEDURE CODE VARIABLES"; abort abend; end; 202 | end; 203 | run; 204 | 205 | %let v=%eval(&v+1); 206 | %let clms=%scan("&claims_data",&v," "); 207 | 208 | %end; 209 | 210 | ***** Check and run enrollment files; 211 | %if "&CREATE_ENR"="Y" %then %do; 212 | 213 | data _null_; 214 | if "&create_enr_shape" not in("A","P") then do; 215 | put "ERROR: CREATE ENROLLMENT FILES MARKED AS Y, BUT INVALID CREATE_ENR_SHAPE VALUE. MUST BE 'A' OR 'P'"; 216 | abort abend; 217 | end; 218 | if "&create_enr_filein"="" then do; 219 | put "ERROR: CREATE ENROLLMENT FILES MARKED AS Y, BUT NO CREATE_ENR_FILEIN SPECIFIED"; 220 | abort abend; 221 | end; 222 | run; 223 | 224 | %include "contenr.sas"; 225 | 226 | %contenr(begyr=&minyear.,endyr=&maxyear.,shape=&create_enr_shape,filein=&create_enr_filein.,fileout=&enr_prefix,id=&id,var=&enr_var.); 227 | 228 | %end; 229 | 230 | %mend; 231 | 232 | %ckinputclms; 233 | 234 | * Check that all the claim types match the claim types CC_desc; 235 | data claim_types; 236 | set cc_desc; 237 | array clmtyp [*] claim_type:; 238 | do i=1 to dim(clmtyp); 239 | if clmtyp[i] ne "" then do; 240 | claim_type=clmtyp[i]; 241 | output; 242 | end; 243 | end; 244 | countw=countw(claim_type); 245 | run; 246 | 247 | proc sql noprint; 248 | select max(countw) 249 | into :type_max 250 | from claim_types; 251 | quit; 252 | 253 | data claim_types1; 254 | set claim_types; 255 | do i=1 to countw(claim_type); 256 | type=scan(claim_type,i); 257 | output; 258 | end; 259 | run; 260 | 261 | proc freq data=claim_types1 noprint; 262 | table type / out=cc_desc_clmtyps; 263 | run; 264 | 265 | %macro ckclmtypes; 266 | 267 | %let v=1; 268 | %let clms=%scan("&claims_data",&v," "); 269 | 270 | %do %while (%length(&clms)>0); 271 | 272 | proc freq data=&clms noprint; 273 | table claim_type / out=clms_data_clmtyps (rename=claim_type=type); 274 | run; 275 | 276 | data clm_ck; 277 | merge cc_desc_clmtyps (in=a) clms_data_clmtyps (in=b); 278 | by type; 279 | desc=a; 280 | clms=b; 281 | run; 282 | 283 | data _null_; 284 | set clm_ck; 285 | if clms=1 and desc=0 then do; 286 | put "ERROR: CLAIM TYPE IN &CLMS NOT IN CC_DESC" type=/; 287 | abort abend; 288 | end; 289 | if desc=1 and clms=0 then do; 290 | put "WARNING: CLAIM TYPE IN CC_DESC NOT FOUND IN &CLMS" type=/; 291 | end; 292 | run; 293 | 294 | %let v=%eval(&v+1); 295 | %let clms=%scan("&claims_data",&v," "); 296 | 297 | %end; 298 | 299 | %mend; 300 | 301 | %ckclmtypes; 302 | 303 | %put "SUCCESSFUL RUN. AFTER LOG IS CLEARED OF WARNINGS AND ERRORS, READY FOR 3_IDENTIFY_CONDITIONS.SAS"; 304 | 305 | %include "identify_conditions.sas"; 306 | 307 | 308 | %mend; 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | -------------------------------------------------------------------------------- /CC_Package_30v0/programs/input_program.sas: -------------------------------------------------------------------------------- 1 | /*********************************************************************************************/ 2 | TITLE1 'Chronic Conditions Macro'; 3 | 4 | * AUTHOR: Patricia Ferido; 5 | 6 | * DATE: 3/26/2018; 7 | 8 | * PURPOSE: Run all programs related to Chronic Conditions Package; 9 | 10 | options compress=yes nocenter ls=150 ps=200 errors=5 errorabend errorcheck=strict mprint merror 11 | mergenoby=warn varlenchk=error dkricond=error dkrocond=error msglevel=i; 12 | /*********************************************************************************************/ 13 | 14 | ****** Set up libnames - optional; 15 | 16 | /******************************************************************************************************************** 17 | Macro Variables - Information needed for macro below; 18 | * PROJHOME: project filepath to the Chronic_Conditions_Package folder; 19 | * ID: Name of unique patient ID variable in claims data; 20 | * MINYEAR First year of data that you want to process; 21 | * MAXYEAR: Last year of data that you want to process; 22 | * CLAIMS_DATA: Name of the cleaned claims data sets you want to process. If multiple, separate by a space; 23 | * CREATE_ENR: Y/N - Y if enrollment files need to be created, N - if they already exist; 24 | * If Y, then define the following variables:; 25 | * CREATE_ENR_SHAPE: two possible inputs: A - annual files with monthly entries, P - single period file with beneficiary 26 | entries per each unique period of continous enrollment (P). Note that multipe entries per beneficiary are allowed in P; 27 | * CREATE_ENR_FILEIN: provide input files of beneficiary enrollment information with libref; 28 | * ENR_PREFIX: name of the enrollment files you want to create with libref, yearly suffix will be added automatically; 29 | * ENR_VAR: name of enrollment variable you want to use (e.g. MA, FFS, enr), monthly suffix will be added automatically; 30 | * If N, then define the following variables:; 31 | * CREATE_ENR_SHAPE: leave blank; 32 | * CREATE_ENR_FILEIN: leave blank; 33 | * ENR_PREFIX: name of enrollment files with libref and without yearly suffix; 34 | * ENR_VAR: prefix of monthly enrollment variable in provided enrollment files; 35 | * CLAIMS_OUT_PREFIX: Prefix for yearly output data sets, suffix will automatically be year. Don't forget to include libref if creating permanent; 36 | * CUSTOM_ALGORITHM: Y/N - Y if input excel sheets have been modified and should be used, N if default chronic conditions should be used. Default is N; 37 | * CUSTOM_SUFFIX: If Y is specified above, then this suffix will be added to specify your custom algorithms. Default is _custom; 38 | * CUSTOM_COND: List of shorthand conditions to identify, default if left blank is all 27 original CCW conditions; 39 | *******************************************************************************************************************/ 40 | 41 | ****** Wrapper macro; 42 | %include "idcond.sas"; 43 | 44 | ****** Macro Function; 45 | %idcond(projhome=, 46 | id=, 47 | minyear=, 48 | maxyear=, 49 | claims_data=, 50 | create_enr=, 51 | create_enr_shape=, 52 | create_enr_filein=, 53 | enr_prefix=, 54 | enr_var=, 55 | claims_out_prefix=, 56 | custom_algorithm=, 57 | custom_suffix=, 58 | custom_cond=); 59 | 60 | 61 | ****** Example; 62 | /*%idcond(projhome=/disk/agedisk3/medicare.work/goldman-DUA51866/ferido-dua51866/CCW package/Chronic_Conditions_Package_5pct/, 63 | id=bene_id, 64 | minyear=2004, 65 | minyear=2016, 66 | claims_data=_ccproj.claims_test2002 _ccproj.claims_test2003 _ccproj.claims_test2004 _ccproj.claims_test2005 _ccproj.claims_test2006 _ccproj.claims_test2007 _ccproj.claims_test2008 _ccproj.claims_test2009 _ccproj.claims_test2010 _ccproj.claims_test2011 _ccproj.claims_test2012 _ccproj.claims_test2013 67 | _ccproj.claims_test2014 _ccproj.claims_test2015 _ccproj.claims_test2016, 68 | create_enr=N, 69 | create_enr_shape=, 70 | create_enr_filein=, 71 | enr_prefix=enr.enrffs_, 72 | enr_var=ffsab, 73 | claims_out_prefix=_ccproj.chronic_conditions_, 74 | custom_algorithm=Y, 75 | custom_suffix=_T2DIAB, 76 | cond=T2DIAB); */ 77 | 78 | -------------------------------------------------------------------------------- /CC_Package_30v0/programs/readin_input_files.sas: -------------------------------------------------------------------------------- 1 | /*********************************************************************************************/ 2 | TITLE1 'Chronic Conditions Macro'; 3 | 4 | * AUTHOR: Patricia Ferido; 5 | 6 | * DATE: 3/26/2018; 7 | 8 | * PURPOSE: - Read In Customized CSV Input files that determine conditions and algorithms, and list 9 | all codes of interest 10 | - Check that all input files and claims data are formatted correctly 11 | - Please see document titled "For Users - Chronic Conditions Macro Documentation" 12 | before running any programs; 13 | 14 | * INPUT: Claims Data, CSV files CC_codes, CC_desc, CC_exclude; 15 | * OUTPUT: SAS files CC_codes, CC_desc, CC_exclude; 16 | 17 | options compress=yes nocenter ls=150 ps=200 errors=5 errorabend errorcheck=strict mprint merror 18 | mergenoby=warn varlenchk=error dkricond=error dkrocond=error msglevel=i; 19 | /*********************************************************************************************/ 20 | 21 | ***** Read in Input CSV Files ; 22 | 23 | * CC Codes; 24 | data cc_codes; 25 | infile "&projhome./csv_input/CC_Codes.csv" dlm="2c"x dsd lrecl=32767 missover firstobs=2; 26 | informat 27 | Condition $10. 28 | CodeType $10. 29 | DxCodeLocation $8. 30 | DxCode $10.; 31 | format 32 | Condition $10. 33 | CodeType $10. 34 | DxCodeLocation $8. 35 | DxCode $10.; 36 | input 37 | Condition $ 38 | CodeType $ 39 | DxCodeLocation $ 40 | DxCode $; 41 | run; 42 | 43 | * CC Desc; 44 | proc import datafile="&projhome./csv_input/CC_Desc.csv" out=cc_desc dbms=dlm; 45 | delimiter=","; 46 | getnames=yes; 47 | guessingrows=max; 48 | run; 49 | 50 | * CC Exclude; 51 | data cc_exclude; 52 | infile "&projhome./csv_input/CC_Exclude.csv" dlm="2c"x dsd lrecl=32767 missover firstobs=2; 53 | informat 54 | Condition $10. 55 | CodeType $10. 56 | DxCode $10. 57 | DxCodeLocation $8.; 58 | format 59 | Condition $10. 60 | CodeType $10. 61 | DxCode $10. 62 | DxCodeLocation $8.; 63 | input 64 | Condition $ 65 | CodeType $ 66 | DxCode $ 67 | DxCodeLocation $; 68 | run; 69 | 70 | ***** Get contents; 71 | 72 | proc contents data=cc_codes out=contents_cc_codes noprint; run; 73 | proc contents data=cc_desc out=contents_cc_desc noprint; run; 74 | proc contents data=cc_exclude out=contents_cc_exclude noprint; run; 75 | 76 | ***** Standardize and check for values that shouldn't be there, if there are errors, the errors 77 | will print to log and the program will terminate; 78 | 79 | * Standardizing CC_Codes and checking for valid inputs; 80 | data cc_codes; 81 | set cc_codes; 82 | condition=upcase(condition); 83 | codetype=upcase(codetype); 84 | dxcodelocation=upcase(dxcodelocation); 85 | if codetype not in("ICD9DX","ICD10DX","ICD9PRCDR","ICD10PRCDR","HCPCS") then do; 86 | put "ERROR: INVALID CC_Codes Codetype " codetype=/; 87 | abort abend; 88 | end; 89 | if dxcodelocation not in("ANY","DX1","DX1 DX2") then do; 90 | put "ERROR: INVALID CC_Codes DxCodeLocation " dxcodelocation=/; 91 | abort abend; 92 | end; 93 | if codetype="ICD10PRCDR" and length(dxcode) ne 7 then do; 94 | put "ERROR: INVALID ICD10PRCDR CODE " dxcode=/; 95 | abort abend; 96 | end; 97 | if codetype="HCPCS" and length(dxcode) ne 5 then do; 98 | put "ERROR: INVALID HCPCS CODE " dxcode=/; 99 | abort abend; 100 | end; 101 | run; 102 | 103 | * Standardizing CC_Exclude and checking for valid inputs; 104 | data cc_exclude; 105 | set cc_exclude; 106 | condition=upcase(condition); 107 | codetype=upcase(codetype); 108 | dxcodelocation=upcase(dxcodelocation); 109 | if codetype not in("ICD9DX","ICD10DX","ICD9PRCDR","ICD10PRCDR","HCPCS") then do; 110 | put "ERROR: INVALID CC_Codes Codetype " codetype=/; 111 | abort abend; 112 | end; 113 | if dxcodelocation not in("ANY","DX1","DX1 DX2") then do; 114 | put "ERROR: INVALID CC_Codes DxCodeLocation " dxcodelocation=/; 115 | abort abend; 116 | end; 117 | if codetype="ICD10PRCDR" and length(dxcode) ne 7 then do; 118 | put "ERROR: INVALID ICD10PRCDR CODE " dxcode=/; 119 | abort abend; 120 | end; 121 | if codetype="HCPCS" and length(dxcode) ne 5 then do; 122 | put "ERROR: INVALID HCPCS CODE " dxcode=/; 123 | abort abend; 124 | end; 125 | run; 126 | 127 | * Standardizing CC_Desc and checking for valid inputs; 128 | data _null_; 129 | set contents_cc_desc; 130 | if name="ref_months" and type=2 then do; 131 | put "ERROR: ALPHABETIC VALUE IN ref_months FOR CC_Desc"; 132 | abort abend; 133 | end; 134 | if find(name,'num_dx') and type=2 then do; 135 | put "ERROR: ALPHABETIC VALUE IN num_dx FOR CC_Desc"; 136 | abort abend; 137 | end; 138 | if name="min_days_apart" and type=2 then do; 139 | put "ERROR: ALPHABETIC VALUE IN min_days_apart FOR CC_Desc"; 140 | abort abend; 141 | end; 142 | run; 143 | 144 | data cc_desc; 145 | set cc_desc; 146 | condition=upcase(condition); 147 | 148 | * Making max_days_apart numeric if it isn't already; 149 | max_days_apart1=max_days_apart*1; 150 | 151 | array claim_type [*] claim_type:; 152 | array num_dx [*] num_dx:; 153 | 154 | * Upcasing claim_type; 155 | do i=1 to dim(claim_type); 156 | claim_type[i]=upcase(claim_type[i]); 157 | end; 158 | 159 | * Checks; 160 | do i=1 to dim(claim_type); 161 | if claim_type[i] ne "" and num_dx[i]=. then do; 162 | put "ERROR: MISSING num_dx FOR CC_Desc"; 163 | abort abend; 164 | end; 165 | if claim_type[i]="" and num_dx[i] ne . then do; 166 | put "ERROR: MISSING claim_type FOR CC_Desc"; 167 | abort abend; 168 | end; 169 | end; 170 | if min_days_apart<=0 then do; 171 | put "ERROR: MISSING or NEGATIVE min_days_apart in CC_Desc"; 172 | abort abend; 173 | end; 174 | if ref_months<=0 then do; 175 | put "ERROR: MISSING or NEGATIVE ref_months in CC_Desc"; 176 | abort abend; 177 | end; 178 | drop max_days_apart; 179 | rename max_days_apart1=max_days_apart; 180 | run; 181 | 182 | * Checking that all condition codes are the same between the three input files; 183 | proc freq data=cc_codes noprint; 184 | table condition / out=condition_codes; 185 | run; 186 | 187 | proc freq data=cc_desc noprint; 188 | table condition / out=condition_desc; 189 | run; 190 | 191 | proc freq data=cc_exclude noprint; 192 | table condition / out=condition_exclude; 193 | run; 194 | 195 | data condition_ck; 196 | length condition $10.; 197 | merge condition_desc (in=a) condition_codes (in=b) condition_exclude (in=c); 198 | by condition; 199 | desc=a; 200 | codes=b; 201 | exclude=c; 202 | run; 203 | 204 | proc freq data=condition_ck noprint; 205 | table desc*codes*exclude / out=freq_condition_ck; 206 | run; 207 | 208 | data _null_; 209 | set freq_condition_ck; 210 | 211 | if desc=1 and codes=0 then do; 212 | put "ERROR: THERE ARE CONDITIONS IN CC_Desc BUT NOT IN CC_Codes"; 213 | abort abend; 214 | end; 215 | if codes=1 and desc=0 then do; 216 | put "ERROR: THERER ARE CONDITIONS IN CC_Codes BUT NOT IN CC_Desc"; 217 | abort abend; 218 | end; 219 | if exclude=1 and max(desc,codes) ne 1 then do; 220 | put "ERROR: THERE ARE CONDITIONS IN CC_Exclude not in CC_Desc or CC_Codes"; 221 | abort abend; 222 | end; 223 | 224 | run; 225 | 226 | ***** Create permanents - will only get to this step if there were no errors above; 227 | data _ccproj.cc_codes&custom_suffix.; 228 | set cc_codes; 229 | run; 230 | 231 | data _ccproj.cc_desc&custom_suffix.; 232 | set cc_desc; 233 | run; 234 | 235 | data _ccproj.cc_exclude&custom_suffix.; 236 | set cc_exclude; 237 | run; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Chronic-Conditions-Package 2 | The purpose of the Chronic Conditions Package is to analyze claims data and flag the presence of chronic conditions based on user-defined criteria. There are three main criteria for identifying chronic conditions in the claims data: qualifying diagnosis codes, location of diagnosis codes (e.g. inpatient, outpatient, skilled nursing facility, etc.), and the reference period in which to find the diagnoses (e.g. 2 years, 3 years). The final outputs will be yearly beneficiary level files with monthly condition and enrollment flags. 3 | The package can be applied to any data source of with complete diagnosis and procedure information on patients during the analysis period. 4 | 5 | ### Notes 6 | In 27v0, 27v1 and 30v0, the log will finish with an error referencing the following note: “49: LINE and COLUMN cannot be determined.” However this does not prevent the package from running correctly. Check future versions for cleaner versions of the log, updates to efficiency, and updates to coding definitions. 7 | 8 | ### Versions 9 |
  • 27v0 - Definitions of the 27 chronic conditions as published by CCW on Aug 2017
  • 10 |
  • 27v1 - Definitions of the 27 chronic conditions as published by CCW on Feb 2022
  • 11 |
  • 30v0 - Definitions of the 30 chronic conditions as published by CCW on Feb 2022, only applies to ICD-10 period
  • 12 | 13 | ### Citation 14 | If you use the package in your work, we ask that you cite the article which presents the package and shares examples on how to use it: 15 | Ferido, P., Gascue, L., St. Clair, P. “How Sick Is My Cohort Of Patients? A General Approach To Identify Chronic Conditions”. 1063-2021 SAS Global Forum 2021. 16 | https://communities.sas.com/t5/SAS-Global-Forum-Proceedings/How-Sick-Is-My-Cohort-Of-Patients-A-General-Approach-to-Identify/ta-p/726311 17 | 18 | ### Contact Information 19 | Patricia Ferido 20 | pferido@usc.edu 21 | --------------------------------------------------------------------------------