1 The SAS System 14:05 Monday, July 13, 2015 NOTE: Copyright (c) 2002-2010 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) Proprietary Software 9.3 (TS1M0) Licensed to NATIONAL BUREAU OF ECONOMIC RESEARCH, Site 70111351. NOTE: This session is executing on the Linux 2.6.32-431.29.2.el6.x86_64 (LIN X64) platform. You are running SAS 9. Some SAS 8 files will be automatically converted by the V9 engine; others are incompatible. Please see http://support.sas.com/rnd/migration/planning/platform/64bit.html PROC MIGRATE will preserve current SAS file attributes and is recommended for converting all your SAS libraries from any SAS 8 release to SAS 9. For details and examples, please see http://support.sas.com/rnd/migration/index.html This message is contained in the SAS news file, and is presented upon initialization. Edit the file "news" in the "misc/base" directory to display site-specific news and information in the program log. The command line option "-nonews" will prevent this display. NOTE: SAS initialization used: real time 0.23 seconds cpu time 0.02 seconds 1 2 ** Modified by Jean Roth , jroth@nber.org , 2015-03-18 ; 3 4 5 LIBNAME LIBRARY "." ; NOTE: Libref LIBRARY was successfully assigned as follows: Engine: V9 Physical Name: /disk/data3/cms/MedicareAdvtgSpecRateStats/risk-adjustment/example/2014/12 5 ! ** "location of formats"; 6 FILENAME IN0 "." ; ** "location of macros"; 7 LIBNAME IN1 "input" ; NOTE: Libref IN1 was successfully assigned as follows: Engine: V9 Physical Name: /disk/data3/cms/MedicareAdvtgSpecRateStats/risk-adjustment/example/2014/12/input 7 ! ** "location of person-level file"; 8 LIBNAME IN2 "input" ; NOTE: Libname IN2 refers to the same physical library as IN1. NOTE: Libref IN2 was successfully assigned as follows: Engine: V9 Physical Name: /disk/data3/cms/MedicareAdvtgSpecRateStats/risk-adjustment/example/2014/12/input 8 ! ** "location of diagnosis file"; 9 LIBNAME INCOEF "." ; NOTE: Libname INCOEF refers to the same physical library as LIBRARY. NOTE: Libref INCOEF was successfully assigned as follows: Engine: V9 Physical Name: /disk/data3/cms/MedicareAdvtgSpecRateStats/risk-adjustment/example/2014/12 9 ! ** "location of the coefficients file"; 10 LIBNAME OUT "output" ; NOTE: Libref OUT was successfully assigned as follows: 2 The SAS System 14:05 Monday, July 13, 2015 Engine: V9 Physical Name: /disk/data3/cms/MedicareAdvtgSpecRateStats/risk-adjustment/example/2014/12/output 10 ! ** "location for the output file"; 11 12 /* 13 The following is JCL if you are using an IBM-type mainframe: 14 15 //JOBCARD 16 //V1213J1P EXEC SAS9,REGION=8M, 17 // OPTIONS='ERRORS=0,NOCENTER,NEWS' 18 //WORK DD SPACE=(CYL,(1000,2)) 19 //WORK1 DD SPACE=(CYL,(2000,2)) 20 //* user-defined the location of formats 21 //LIBRARY DD DISP=SHR,DSN=XXXX.XXXXXXX 22 //*user-defined the location of macros 23 //IN0 DD DISP=SHR,DSN=XXXX.XXXXXX 24 //*the location of person-level file 25 //IN1 DD DISP=SHR,DSN=XXXX.PERSON 26 //*the location of the diagnosis file 27 //IN2 DD DISP=SHR,DSN=XXXX.DIAG 28 //*the location of the file containing all coefficients 29 //INCOEF DD DISP=SHR,DSN=XXXX.HCCCOEFN 30 //*the output file containing person-level scores 31 //OUT DD DISP=(NEW,CATLG,KEEP), 32 // DSN=XXX.V1213J1P.PERSON, 33 // SPACE=(TRK,(20,10),RLSE) 34 //SYSIN DD * 35 36 ****************************************************************** 37 If you are using PC-SAS, you must specify the location of the files 38 on your PC in a libname/filename statement. 39 40 LIBNAME LIBRARY "location of formats"; 41 FILENAME IN0 "location of macros"; 42 LIBNAME IN1 "location of person-level file"; 43 LIBNAME IN2 "location of diagnosis file"; 44 LIBNAME INCOEF "location of the coefficients file"; 45 LIBNAME OUT "location for the output file"; 46 */ 47 *********************************************************************** 48 * 49 * DESCRIPTION: 50 * 51 * V1213J1P program creates seventy HCC variables (&CMSHCC) and four 52 * score variables for each person who is present in a person file 53 * supplied by a user. 54 * If a person has at least one diagnosis in DIAG file (supplied by a 55 * user) then HCC variables are created, otherwise HCCs are set to 0 . 56 * Score variables are created using coefficients from 4 final models: 57 * community, institutional, new enrollees, and SNP new enrollees. 58 * 59 * Assumptions about input files: 60 * - both files are sorted by person ID 61 * 62 * - person level file has the following variables: 63 * :&IDVAR - person ID variable (it is a macro parameter, HICNO 64 * for Medicare data) 65 * :DOB - date of birth 3 The SAS System 14:05 Monday, July 13, 2015 66 * :SEX - sex 67 * :OREC - original reason for entitlement 68 * :MCAID - Medicaid dummy variable (base year) 69 * :NEMCAID - Medicaid dummy variable for new enrollees (predicted 70 * year) 71 * 72 * - diagnosis level file has the following vars: 73 * :&IDVAR - person ID variable (it is a macro parameter, HICNO 74 * for Medicare data) 75 * :DIAG - diagnosis 76 * 77 * The program supplies parameters to a main macro %V1213J1M that calls 78 * other external macros: 79 * 80 * %AGESEXNV - create age/sex, originally disabled, disabled vars 81 * %EDITICD9 - perform edits to diagnosis 82 * %V12H70M - assign one ICD9 to multiple CCs 83 * %V12H70L1 - assign labels to HCCs 84 * %V12H70H - set HCC=0 according to hierarchies 85 * %SCOREVAR - calculate a score variable 86 * 87 * 88 * Program steps: 89 * step1: include external macros 90 * step2: define internal macro variables 91 * step3: merge person and diagnosis files outputting one 92 * record per person for each input person level record 93 * step3.1: declaration section 94 * step3.2: bring regression coefficients 95 * step3.3: merge person and diagnosis file 96 * step3.4: for the first record for a person set CC to 0 97 * and calculate age 98 * step3.5: if there are any diagnoses for a person 99 * then do the following: 100 * - create CC using format $I12131Y12Y13YC 101 * - perform ICD9 edits using macro EDITICD9 102 * - create additional CC using V12H70M macro 103 * step3.6: for the last record for a person do the 104 * following: 105 * - create demographic variables needed 106 * for regressions (macro AGESEXNV) 107 * - create HCC using hierarchies (macro V12H70H) 108 * - create HCC interaction variables 109 * - create HCC and DISABL interaction variables 110 * - set HCCs and interaction vars to zero if there 111 * are no diagnoses for a person 112 * - create score for community model 113 * - create score for institutional model 114 * - create score for new enrollee model 115 * - create score for SNP new enrollee model 116 * - normalize score if needed 117 * step4: data checks and proc contents 118 * 119 * USER CUSTOMIZATION: 120 * A user must supply 2 files with the variables described above and 121 * set the following parameters: 122 * INP - SAS input person dataset 123 * IND - SAS input diagnosis dataset 4 The SAS System 14:05 Monday, July 13, 2015 124 * OUTDATA - SAS output dataset 125 * IDVAR - name of person id variable (HICNO for medicare data) 126 * KEEPVAR - variables to keep in the output dataset 127 * SEDITS - a switch that controls whether to perform edits on 128 * ICD9. 1-YES, 0-NO 129 * DATE_ASOF- reference date to calculate age. Set to February 1 of 130 * the payment year for consistency with CMS. 131 * The default value in the code below is 1FEB2013. 132 * FMNAME - format name (set to I12131Y12Y13YC by default) 133 * DF - normalization factor (set to 1 by default) 134 ***********************************************************************; 135 136 137 %LET INPUTVARS=%STR(DOB MCAID NEMCAID OREC); 138 139 %*demographic variables; 140 %LET DEMVARS =%STR(AGEF ORIGDS DISABL 141 F0_34 F35_44 F45_54 F55_59 F60_64 F65_69 142 F70_74 F75_79 F80_84 F85_89 F90_94 F95_GT 143 M0_34 M35_44 M45_54 M55_59 M60_64 M65_69 144 M70_74 M75_79 M80_84 M85_89 M90_94 M95_GT 145 NEF0_34 NEF35_44 NEF45_54 NEF55_59 NEF60_64 146 NEF65 NEF66 NEF67 NEF68 NEF69 147 NEF70_74 NEF75_79 NEF80_84 NEF85_89 NEF90_94 148 NEF95_GT 149 NEM0_34 NEM35_44 NEM45_54 NEM55_59 NEM60_64 150 NEM65 NEM66 NEM67 NEM68 NEM69 151 NEM70_74 NEM75_79 NEM80_84 NEM85_89 NEM90_94 152 NEM95_GT); 153 154 %*list of HCCs included in models; 155 %LET CMSHCC = %STR( 156 HCC1 HCC2 HCC5 HCC7 HCC8 157 HCC9 HCC10 HCC15 HCC16 HCC17 158 HCC18 HCC19 HCC21 HCC25 HCC26 159 HCC27 HCC31 HCC32 HCC33 HCC37 160 HCC38 HCC44 HCC45 HCC51 HCC52 161 HCC54 HCC55 HCC67 HCC68 HCC69 162 HCC70 HCC71 HCC72 HCC73 HCC74 163 HCC75 HCC77 HCC78 HCC79 HCC80 164 HCC81 HCC82 HCC83 HCC92 HCC95 165 HCC96 HCC100 HCC101 HCC104 HCC105 166 HCC107 HCC108 HCC111 HCC112 HCC119 167 HCC130 HCC131 HCC132 HCC148 HCC149 168 HCC150 HCC154 HCC155 HCC157 HCC158 169 HCC161 HCC177 HCC164 HCC174 HCC176); 170 171 %*list of CCs that correspond to model HCCs; 172 %LET CMSCC = %STR( 173 CC1 CC2 CC5 CC7 CC8 174 CC9 CC10 CC15 CC16 CC17 175 CC18 CC19 CC21 CC25 CC26 176 CC27 CC31 CC32 CC33 CC37 177 CC38 CC44 CC45 CC51 CC52 178 CC54 CC55 CC67 CC68 CC69 179 CC70 CC71 CC72 CC73 CC74 180 CC75 CC77 CC78 CC79 CC80 181 CC81 CC82 CC83 CC92 CC95 5 The SAS System 14:05 Monday, July 13, 2015 182 CC96 CC100 CC101 CC104 CC105 183 CC107 CC108 CC111 CC112 CC119 184 CC130 CC131 CC132 CC148 CC149 185 CC150 CC154 CC155 CC157 CC158 186 CC161 CC177 CC164 CC174 CC176); 187 188 %LET SCOREVARS=%STR(SCORE_COMMUNITY 189 SCORE_INSTITUTIONAL 190 SCORE_NEW_ENROLLEE 191 SCORE_SNP_NEW_ENROLLEE); 192 193 %* include main macro; 194 %INCLUDE IN0(V1213J1M.sas)/SOURCE2; NOTE: %INCLUDE (level 1) file IN0(V1213J1M.sas) is file /disk/data3/cms/MedicareAdvtgSpecRateStats/risk-adjustment/example/2014/12/V1213J1M.sas. 195 + %MACRO V1213J1M(INP=, IND=, OUTDATA=, IDVAR=, KEEPVAR=, SEDITS=, 196 + DATE_ASOF=, FMNAME=I12131Y12Y13YC, DF=1 ); 197 + 198 +%********************************************************************** 199 + * V1213J1M creates HCC and score variables for each person who is 200 + * present in a person file. 201 + * If a person has at least one diagnosis in DIAG file then HCCs are 202 + * created, otherwise HCCs are set to 0. 203 + * Score variables are created using coefficients from 4 final models: 204 + * community, institutional, new enrollees, SNP new enrollees. 205 + * 206 + * Assumptions about input files: 207 + * - both files are sorted by person ID 208 + * - person level file has the following variables: 209 + * :&IDVAR - person ID variable (it is a macro parameter) 210 + * :DOB - date of birth 211 + * :SEX - sex 212 + * :OREC - original reason for entitlement 213 + * :MCAID - Medicaid dummy variable 214 + * :NEMCAID - Medicaid dummy variable for new enrollees 215 + * 216 + * - diagnosis level file has the following variables: 217 + * :&IDVAR - person ID variable (it is a macro parameter) 218 + * :DIAG - diagnosis 219 + * 220 + * Parameters: 221 + * INP - input person dataset 222 + * IND - input diagnosis dataset 223 + * OUTDATA - output dataset 224 + * IDVAR - name of person id variable (HICNO for Medicare data) 225 + * KEEPVAR - variables to keep in the output file 226 + * SEDITS - a switch that controls whether to perform edits on 227 + * ICD9. 1-YES, 0-NO 228 + * DATE_ASOF - reference date to calculate age. Set to February 1 229 + * of the payment year for consistency with CMS. 230 + * FMNAME - version of format. For this version of the software 231 + * it is set to default FMNAME=I12131Y12Y13YC 232 + * DF - normalization factor. 233 + * Default=1 234 + * 235 + * External macros. 236 + * %AGESEXNV - create age/sex, originally disabled, disabled vars 237 + * %EDITICD9 - perform edits to diagnosis 6 The SAS System 14:05 Monday, July 13, 2015 238 + * %V12H70M - assign one ICD9 to multiple CCs 239 + * %V12H70L1 - assign labels to HCCs 240 + * %V12H70H - set HCC=0 according to hierarchies 241 + * %SCOREVAR - calculate a score variable 242 + 243 + ***********************************************************************; 244 + 245 + %********************************************************************** 246 + * step1: include external macros 247 + ***********************************************************************; 248 + %INCLUDE IN0(AGESEXNV.sas) /SOURCE2; %* create demographic variables; 249 + %INCLUDE IN0(EDITICD9.sas) /SOURCE2; %* perform edits; 250 + %INCLUDE IN0(V12H70L1.sas) /SOURCE2; %* hcc labels; 251 + %INCLUDE IN0(V12H70H.sas) /SOURCE2; %* hierarchies; 252 + %INCLUDE IN0(V12H70M.sas) /SOURCE2; %* multiple CCs; 253 + %INCLUDE IN0(SCOREVAR.sas) /SOURCE2; %* calculate score variable; 254 + 255 + %********************************************************************** 256 + * step2: define internal macro variables 257 + ***********************************************************************; 258 + 259 + %LET N_CC=189; %*max # of HCCs; 260 + 261 + %* age/sex variables for community and insititutional regression; 262 + %LET AGESEXV= F0_34 F35_44 F45_54 F55_59 F60_64 F65_69 263 + F70_74 F75_79 F80_84 F85_89 F90_94 F95_GT 264 + M0_34 M35_44 M45_54 M55_59 M60_64 M65_69 265 + M70_74 M75_79 M80_84 M85_89 M90_94 M95_GT; 266 + 267 + %*list of HCCs included in models; 268 + %LET CMSHCC = %STR( 269 + HCC1 HCC2 HCC5 HCC7 HCC8 270 + HCC9 HCC10 HCC15 HCC16 HCC17 271 + HCC18 HCC19 HCC21 HCC25 HCC26 272 + HCC27 HCC31 HCC32 HCC33 HCC37 273 + HCC38 HCC44 HCC45 HCC51 HCC52 274 + HCC54 HCC55 HCC67 HCC68 HCC69 275 + HCC70 HCC71 HCC72 HCC73 HCC74 276 + HCC75 HCC77 HCC78 HCC79 HCC80 277 + HCC81 HCC82 HCC83 HCC92 HCC95 278 + HCC96 HCC100 HCC101 HCC104 HCC105 279 + HCC107 HCC108 HCC111 HCC112 HCC119 280 + HCC130 HCC131 HCC132 HCC148 HCC149 281 + HCC150 HCC154 HCC155 HCC157 HCC158 282 + HCC161 HCC164 HCC174 HCC176 HCC177); 283 + 284 + %*interaction variables; 285 + %LET INTERRAC_VARS = %STR( D_HCC5 D_HCC44 D_HCC51 D_HCC52 D_HCC107 286 + DM_CHF1 DM_CVD CHF_COPD COPD_CVD_CAD 287 + RF_CHF1 RF_CHF_DM DM_CHF RF_CHF); 288 + 289 + %*variables for Community regression ; 290 + %LET COMM_REG= %STR(&AGESEXV 291 + Medicaid_Female_Aged Medicaid_Female_Disabled 292 + Medicaid_Male_Aged Medicaid_Male_Disabled 293 + OriginallyDisabled_Female OriginallyDisabled_Male 294 + D_HCC5 D_HCC44 D_HCC51 D_HCC52 D_HCC107 295 + DM_CHF1 DM_CVD CHF_COPD COPD_CVD_CAD RF_CHF1 RF_CHF_DM 7 The SAS System 14:05 Monday, July 13, 2015 296 + &CMSHCC); 297 + 298 + %*variables for Institutional regression ; 299 + %LET INST_REG = %STR(&AGESEXV MCAID ORIGDS 300 + D_HCC5 D_HCC44 D_HCC51 D_HCC52 D_HCC107 301 + DM_CHF1 DM_CVD CHF_COPD COPD_CVD_CAD RF_CHF1 RF_CHF_DM 302 + &CMSHCC); 303 + 304 + %*variables for New Enrollees and SNP New Enrollees regression ; 305 + %LET NE_REG=%STR( 306 + NEF0_34 NEF35_44 NEF45_54 NEF55_59 NEF60_64 307 + NEF65 NEF66 NEF67 NEF68 NEF69 308 + NEF70_74 NEF75_79 NEF80_84 NEF85_89 NEF90_94 NEF95_GT 309 + NEM0_34 NEM35_44 NEM45_54 NEM55_59 NEM60_64 310 + NEM65 NEM66 NEM67 NEM68 NEM69 311 + NEM70_74 NEM75_79 NEM80_84 NEM85_89 NEM90_94 NEM95_GT 312 + Medicaid_female0_64 Medicaid_female65 Medicaid_female66_69 313 + Medicaid_female70_74 Medicaid_female75_GT 314 + Medicaid_male0_64 Medicaid_male65 Medicaid_male66_69 315 + Medicaid_male70_74 Medicaid_male75_GT 316 + Origdis_female65 Origdis_female66_69 317 + Origdis_female70_74 Origdis_female75_GT 318 + Origdis_male65 Origdis_male66_69 319 + Origdis_male70_74 Origdis_male75_GT); 320 + 321 + %********************************************************************** 322 + * step3: merge person and diagnosis files outputting one record 323 + * per person with score and HCC variables for each input person 324 + * level record 325 + ***********************************************************************; 326 + 327 + *DATA &OUTDATA(KEEP=&KEEPVAR ); 328 + DATA &OUTDATA; 329 + %**************************************************** 330 + * step3.1: declaration section 331 + ****************************************************; 332 + 333 + %V12H70L1; *HCC labels; 334 + 335 + %* length of new variables (length for other age/sex vars is set in 336 + AGESEXNV macro); 337 + LENGTH CC $4. AGEF 3. 338 + Medicaid_Female_Aged Medicaid_Female_Disabled 339 + Medicaid_Male_Aged Medicaid_Male_Disabled 340 + OriginallyDisabled_Female OriginallyDisabled_Male 341 + Medicaid_female0_64 Medicaid_female65 Medicaid_female66_69 342 + Medicaid_female70_74 Medicaid_female75_GT 343 + Medicaid_male0_64 Medicaid_male65 Medicaid_male66_69 344 + Medicaid_male70_74 Medicaid_male75_GT 345 + Origdis_female65 Origdis_female66_69 346 + Origdis_female70_74 Origdis_female75_GT 347 + Origdis_male65 Origdis_male66_69 348 + Origdis_male70_74 Origdis_male75_GT 349 + CC1-CC&N_CC 350 + HCC1-HCC&N_CC 351 + &INTERRAC_VARS 3.; 352 + 353 + %*retain cc vars; 8 The SAS System 14:05 Monday, July 13, 2015 354 + RETAIN CC1-CC&N_CC 0 AGEF 355 + ; 356 + %*arrays; 357 + ARRAY C(&N_CC) CC1-CC&N_CC; 358 + ARRAY HCC(&N_CC) HCC1-HCC&N_CC; 359 + %*interaction vars; 360 + ARRAY RV &INTERRAC_VARS; 361 + 362 + %*************************************************** 363 + * step3.2: to bring in regression coefficients 364 + ****************************************************; 365 + IF _N_ = 1 THEN SET INCOEF.HCCCOEFN; 366 + %*************************************************** 367 + * step3.3: merge 368 + ****************************************************; 369 + MERGE &INP(IN=IN1) 370 + &IND(IN=IN2); 371 + BY &IDVAR; 372 + 373 + IF IN1 THEN DO; 374 + 375 + %******************************************************* 376 + * step3.4: for the first record for a person set CC to 0 377 + ********************************************************; 378 + 379 + IF FIRST.&IDVAR THEN DO; 380 + %*set ccs to 0; 381 + DO I=1 TO &N_CC; 382 + C(I)=0; 383 + END; 384 + %* age; 385 + AGEF =FLOOR((INTCK( 386 + 'MONTH',DOB,&DATE_ASOF)-(DAY(&DATE_ASOF)0); 444 + Medicaid_female65 =(SEX="2" & NEF65 & NEMCAID>0); 445 + Medicaid_female66_69 =(SEX="2" & 446 + sum(NEF66,NEF67,NEF68,NEF69) & NEMCAID>0); 447 + Medicaid_female70_74 =(SEX="2" & 70<=AGEF <75 & NEMCAID>0); 448 + Medicaid_female75_GT =(SEX="2" & AGEF >74 & NEMCAID>0); 449 + 450 + Medicaid_male0_64 =(SEX="1" & 0<=AGEF <65 & NEM65=0 451 + & NEMCAID>0); 452 + Medicaid_male65 =(SEX="1" & NEM65 & NEMCAID>0); 453 + Medicaid_male66_69 =(SEX="1" & 454 + sum(NEM66,NEM67,NEM68,NEM69) & NEMCAID>0); 455 + Medicaid_male70_74 =(SEX="1" & 70<=AGEF <75 456 + & NEMCAID>0); 457 + Medicaid_male75_GT =(SEX="1" & AGEF >74 & NEMCAID>0); 458 + 459 + Origdis_female65 =(ORIGDS & NEF65 & SEX='2'); 460 + Origdis_female66_69 =(ORIGDS & 461 + sum(NEF66,NEF67,NEF68,NEF69) & SEX='2'); 462 + Origdis_female70_74 =(ORIGDS & 70 <= AGEF <75 & SEX='2'); 463 + Origdis_female75_GT =(ORIGDS & AGEF >74 & SEX='2'); 464 + 465 + Origdis_male65 =(ORIGDS & NEM65 & SEX='1'); 466 + Origdis_male66_69 =(ORIGDS & 467 + sum(NEM66,NEM67,NEM68,NEM69) & SEX='1'); 468 + Origdis_male70_74 =(ORIGDS & 70 <= AGEF <75 & SEX='1'); 469 + Origdis_male75_GT =(ORIGDS & AGEF >74 & SEX='1'); 10 The SAS System 14:05 Monday, July 13, 2015 470 + 471 + IF IN1 & IN2 THEN DO; 472 + %********************** 473 + * hierarchies 474 + **********************; 475 + %V12H70H; 476 + %************************ 477 + * interaction variables 478 + *************************; 479 + %*diagnostic categories; 480 + DM = MAX (HCC15, HCC16, HCC17, HCC18, HCC19); 481 + CHF = HCC80; 482 + COPD = HCC108; 483 + CVD = MAX (HCC95, HCC96, HCC100, HCC101); 484 + VD = MAX (HCC104, HCC105); 485 + CAD = MAX (HCC81, HCC82, HCC83); 486 + RF = HCC131; 487 + %* interactions ; 488 + DM_CHF =DM*CHF ; 489 + DM_CVD =DM*CVD ; 490 + CHF_COPD =CHF*COPD ; 491 + COPD_CVD_CAD =COPD*CVD*CAD; 492 + RF_CHF =RF*CHF ; 493 + RF_CHF_DM =RF*CHF*DM ; 494 + 495 + DM_CHF1 = DM_CHF *( RF_CHF_DM = 0); 496 + RF_CHF1 = RF_CHF *( RF_CHF_DM = 0); 497 + 498 + %*interactions with disabled ; 499 + D_HCC5 = DISABL*HCC5 ; %*opportunistic infections; 500 + D_HCC44 = DISABL*HCC44; %*severe hematological disorders; 501 + D_HCC51 = DISABL*HCC51; %*drug/alcohol psychosis; 502 + D_HCC52 = DISABL*HCC52; %*drug/alcohol dependence; 503 + D_HCC107 = DISABL*HCC107; %*cystic fibrosis; 504 + END; *there are some diagnoses for a person; 505 + ELSE DO; 506 + DO I=1 TO &N_CC; 507 + HCC(I)=0; 508 + END; 509 + DO OVER RV; 510 + RV=0; 511 + END; 512 + END; 513 + 514 + %*score calculation; 515 + 516 + /***************************/ 517 + /* community model */ 518 + /***************************/; 519 + 520 + %SCOREVAR(PVAR=SCORE_COMMUNITY, RLIST=&COMM_REG, CPREF=CE_); 521 + 522 + /***************************/ 523 + /* institutional model */ 524 + /***************************/; 525 + 526 + %SCOREVAR(PVAR=SCORE_INSTITUTIONAL, RLIST=&INST_REG, CPREF=INS_); 527 + 11 The SAS System 14:05 Monday, July 13, 2015 528 + /***************************/ 529 + /* new enrollees model */ 530 + /***************************/; 531 + 532 + %SCOREVAR(PVAR=SCORE_NEW_ENROLLEE, RLIST=&NE_REG, CPREF=NE_); 533 + 534 + /***************************/ 535 + /* SNP new enrollees model */ 536 + /***************************/; 537 + 538 + %SCOREVAR(PVAR=SCORE_SNP_NEW_ENROLLEE, RLIST=&NE_REG, CPREF=SNPNE_); 539 + 540 + /****************************/ 541 + /* normalize the scores */ 542 + /***************************/; 543 + SCORE_COMMUNITY = SCORE_COMMUNITY *&DF; 544 + SCORE_INSTITUTIONAL = SCORE_INSTITUTIONAL *&DF; 545 + SCORE_NEW_ENROLLEE = SCORE_NEW_ENROLLEE *&DF; 546 + SCORE_SNP_NEW_ENROLLEE = SCORE_SNP_NEW_ENROLLEE *&DF; 547 + 548 + OUTPUT &OUTDATA; 549 + END; %*last record for a person; 550 + END; %*there is a person record; 551 + RUN; 552 + 553 + %********************************************************************** 554 + * step4: data checks and proc contents 555 + ***********************************************************************; 556 + PROC PRINT U DATA=&OUTDATA(OBS=46); 557 + TITLE '*** V1213J1M output file ***'; 558 + RUN ; 559 + PROC CONTENTS DATA=&OUTDATA; 560 + RUN; 561 + 562 + %MEND V1213J1M; NOTE: %INCLUDE (level 1) ending. 563 564 %V1213J1M(INP =IN1.PERSON, 565 IND =IN2.DIAG, 566 OUTDATA =OUT.PERSON, 567 IDVAR =HICNO, 568 KEEPVAR =HICNO &INPUTVARS &SCOREVARS &DEMVARS 569 &CMSHCC &CMSCC, 570 SEDITS =1, 571 DATE_ASOF="1FEB2013"D); NOTE: %INCLUDE (level 1) file IN0(AGESEXNV.sas) is file /disk/data3/cms/MedicareAdvtgSpecRateStats/risk-adjustment/example/2014/12/AGESEXNV.sas. 572 + %MACRO AGESEXNV(AGEF=, SEX=, OREC=); 573 + %********************************************************************** 574 + *********************************************************************** 575 + 1 MACRO NAME: AGESEXNV 576 + 2 PURPOSE: create demographic variables used in regressions. 577 + 3 PARAMETERS: 578 + AGEF - age variable (integer) 579 + SEX - sex variable (character) 580 + OREC - original reason for entitlement 581 + variable from Denominator (character) 582 + 4 CREATED VARIABLES: 12 The SAS System 14:05 Monday, July 13, 2015 583 + ORIGDS - originally disabled dummy variable 584 + DISABL - disabled dummy variable 585 + 24 dummy agesex variables for all models except 586 + "new enrollee": 587 + F0_34 F35_44 F45_54 F55_59 F60_64 F65_69 588 + F70_74 F75_79 F80_84 F85_89 F90_94 F95_GT 589 + M0_34 M35_44 M45_54 M55_59 M60_64 M65_69 590 + M70_74 M75_79 M80_84 M85_89 M90_94 M95_GT 591 + 32 dummy agesex variables for "new enrollee" model: 592 + NEF0_34 NEF35_44 NEF45_54 NEF55_59 NEF60_64 593 + NEF65 NEF66 NEF67 NEF68 NEF69 594 + NEF70_74 NEF75_79 NEF80_84 NEF85_89 NEF90_94 595 + NEF95_GT 596 + NEM0_34 NEM35_44 NEM45_54 NEM55_59 NEM60_64 597 + NEM65 NEM66 NEM67 NEM68 NEM69 598 + NEM70_74 NEM75_79 NEM80_84 NEM85_89 NEM90_94 599 + NEM95_GT 600 + ***********************************************************************; 601 + LENGTH 602 + /* for all score variables except "NEW ENROLLEE" */ 603 + F0_34 F35_44 F45_54 F55_59 F60_64 F65_69 604 + F70_74 F75_79 F80_84 F85_89 F90_94 F95_GT 605 + M0_34 M35_44 M45_54 M55_59 M60_64 M65_69 606 + M70_74 M75_79 M80_84 M85_89 M90_94 M95_GT 607 + DISABL 608 + ORIGDS 609 + /* for "NEW ENROLLEE" score variable */ 610 + NEF0_34 NEF35_44 NEF45_54 NEF55_59 NEF60_64 611 + NEF65 NEF66 NEF67 NEF68 NEF69 612 + NEF70_74 NEF75_79 NEF80_84 NEF85_89 NEF90_94 613 + NEF95_GT 614 + NEM0_34 NEM35_44 NEM45_54 NEM55_59 NEM60_64 615 + NEM65 NEM66 NEM67 NEM68 NEM69 616 + NEM70_74 NEM75_79 NEM80_84 NEM85_89 NEM90_94 617 + NEM95_GT 618 + 3.; 619 + 620 + /* for all score variables except "NEW ENROLLEE" */ 621 + ARRAY CELL(24) 622 + F0_34 F35_44 F45_54 F55_59 F60_64 F65_69 623 + F70_74 F75_79 F80_84 F85_89 F90_94 F95_GT 624 + M0_34 M35_44 M45_54 M55_59 M60_64 M65_69 625 + M70_74 M75_79 M80_84 M85_89 M90_94 M95_GT 626 + ; 627 + /* for "NEW ENROLLEE" score variable */ 628 + ARRAY NECELL(32) 629 + NEF0_34 NEF35_44 NEF45_54 NEF55_59 NEF60_64 630 + NEF65 NEF66 NEF67 NEF68 NEF69 631 + NEF70_74 NEF75_79 NEF80_84 NEF85_89 NEF90_94 NEF95_GT 632 + NEM0_34 NEM35_44 NEM45_54 NEM55_59 NEM60_64 633 + NEM65 NEM66 NEM67 NEM68 NEM69 634 + NEM70_74 NEM75_79 NEM80_84 NEM85_89 NEM90_94 NEM95_GT 635 + ; 636 + %********************************************************************** 637 + * disabled, originally disabled variables 638 + ***********************************************************************; 639 + 640 + %* disabled; 13 The SAS System 14:05 Monday, July 13, 2015 641 + DISABL = (&AGEF < 65 & &OREC ne "0"); 642 + %* originally disabled ; 643 + ORIGDS = (&OREC IN ('1','3'))*(DISABL = 0); 644 + 645 + %********************************************************************** 646 + * variables for all models exept "new enrollee" 647 + ***********************************************************************; 648 + 649 + SELECT; 650 + WHEN(&SEX='2' & 0<= &AGEF <=34) _AGESEX = 1; 651 + WHEN(&SEX='2' & 34< &AGEF <=44) _AGESEX = 2; 652 + WHEN(&SEX='2' & 44< &AGEF <=54) _AGESEX = 3; 653 + WHEN(&SEX='2' & 54< &AGEF <=59) _AGESEX = 4; 654 + WHEN(&SEX='2' & 59< &AGEF <=64) _AGESEX = 5; 655 + WHEN(&SEX='2' & 64< &AGEF <=69) _AGESEX = 6; 656 + WHEN(&SEX='2' & 69< &AGEF <=74) _AGESEX = 7; 657 + WHEN(&SEX='2' & 74< &AGEF <=79) _AGESEX = 8; 658 + WHEN(&SEX='2' & 79< &AGEF <=84) _AGESEX = 9; 659 + WHEN(&SEX='2' & 84< &AGEF <=89) _AGESEX = 10; 660 + WHEN(&SEX='2' & 89< &AGEF <=94) _AGESEX = 11; 661 + WHEN(&SEX='2' & &AGEF >94) _AGESEX = 12; 662 + WHEN(&SEX='1' & 0<= &AGEF <=34) _AGESEX = 13; 663 + WHEN(&SEX='1' & 34< &AGEF <=44) _AGESEX = 14; 664 + WHEN(&SEX='1' & 44< &AGEF <=54) _AGESEX = 15; 665 + WHEN(&SEX='1' & 54< &AGEF <=59) _AGESEX = 16; 666 + WHEN(&SEX='1' & 59< &AGEF <=64) _AGESEX = 17; 667 + WHEN(&SEX='1' & 64< &AGEF <=69) _AGESEX = 18; 668 + WHEN(&SEX='1' & 69< &AGEF <=74) _AGESEX = 19; 669 + WHEN(&SEX='1' & 74< &AGEF <=79) _AGESEX = 20; 670 + WHEN(&SEX='1' & 79< &AGEF <=84) _AGESEX = 21; 671 + WHEN(&SEX='1' & 84< &AGEF <=89) _AGESEX = 22; 672 + WHEN(&SEX='1' & 89< &AGEF <=94) _AGESEX = 23; 673 + WHEN(&SEX='1' & &AGEF > 94) _AGESEX = 24; 674 + OTHERWISE; 675 + END; 676 + DO _I=1 TO 24; 677 + CELL(_I) = (_AGESEX = _I); 678 + END; 679 + 680 + %********************************************************************** 681 + * age/sex vars for "new enrollee" model 682 + ***********************************************************************; 683 + SELECT; 684 + WHEN(&SEX='2' & 0<= &AGEF <=34) NE_AGESEX = 1; 685 + WHEN(&SEX='2' & 34< &AGEF <=44) NE_AGESEX = 2; 686 + WHEN(&SEX='2' & 44< &AGEF <=54) NE_AGESEX = 3; 687 + WHEN(&SEX='2' & 54< &AGEF <=59) NE_AGESEX = 4; 688 + WHEN(&SEX='2' & 59< &AGEF <=63) NE_AGESEX = 5; 689 + WHEN(&SEX='2' & &AGEF=64 & &OREC NE '0') NE_AGESEX = 5; 690 + WHEN(&SEX='2' & &AGEF=64 & &OREC='0') NE_AGESEX = 6; 691 + WHEN(&SEX='2' & &AGEF =65) NE_AGESEX = 6; 692 + WHEN(&SEX='2' & &AGEF =66) NE_AGESEX = 7; 693 + WHEN(&SEX='2' & &AGEF =67) NE_AGESEX = 8; 694 + WHEN(&SEX='2' & &AGEF =68) NE_AGESEX = 9; 695 + WHEN(&SEX='2' & &AGEF =69) NE_AGESEX = 10; 696 + WHEN(&SEX='2' & 69< &AGEF <=74) NE_AGESEX = 11; 697 + WHEN(&SEX='2' & 74< &AGEF <=79) NE_AGESEX = 12; 698 + WHEN(&SEX='2' & 79< &AGEF <=84) NE_AGESEX = 13; 14 The SAS System 14:05 Monday, July 13, 2015 699 + WHEN(&SEX='2' & 84< &AGEF <=89) NE_AGESEX = 14; 700 + WHEN(&SEX='2' & 89< &AGEF <=94) NE_AGESEX = 15; 701 + WHEN(&SEX='2' & &AGEF >94) NE_AGESEX = 16; 702 + WHEN(&SEX='1' & 0<= &AGEF <=34) NE_AGESEX = 17; 703 + WHEN(&SEX='1' & 34< &AGEF <=44) NE_AGESEX = 18; 704 + WHEN(&SEX='1' & 44< &AGEF <=54) NE_AGESEX = 19; 705 + WHEN(&SEX='1' & 54< &AGEF <=59) NE_AGESEX = 20; 706 + WHEN(&SEX='1' & 59< &AGEF <=63) NE_AGESEX = 21; 707 + WHEN(&SEX='1' & &AGEF=64 & &OREC NE '0') NE_AGESEX = 21; 708 + WHEN(&SEX='1' & &AGEF=64 & &OREC='0') NE_AGESEX = 22; 709 + WHEN(&SEX='1' & &AGEF =65) NE_AGESEX = 22; 710 + WHEN(&SEX='1' & &AGEF =66) NE_AGESEX = 23; 711 + WHEN(&SEX='1' & &AGEF =67) NE_AGESEX = 24; 712 + WHEN(&SEX='1' & &AGEF =68) NE_AGESEX = 25; 713 + WHEN(&SEX='1' & &AGEF =69) NE_AGESEX = 26; 714 + WHEN(&SEX='1' & 69< &AGEF <=74) NE_AGESEX = 27; 715 + WHEN(&SEX='1' & 74< &AGEF <=79) NE_AGESEX = 28; 716 + WHEN(&SEX='1' & 79< &AGEF <=84) NE_AGESEX = 29; 717 + WHEN(&SEX='1' & 84< &AGEF <=89) NE_AGESEX = 30; 718 + WHEN(&SEX='1' & 89< &AGEF <=94) NE_AGESEX = 31; 719 + WHEN(&SEX='1' & &AGEF >94) NE_AGESEX = 32; 720 + OTHERWISE; 721 + END; 722 + DO _I=1 TO 32; 723 + NECELL(_I)=(NE_AGESEX=_I); 724 + END; 725 + 726 + %**********************************************************************; 727 + LABEL 728 + ORIGDS ="originally disabled dummy variable" 729 + DISABL ="disabled dummy variable" 730 + ; 731 + 732 + %MEND AGESEXNV; NOTE: %INCLUDE (level 1) ending. NOTE: %INCLUDE (level 1) file IN0(EDITICD9.sas) is file /disk/data3/cms/MedicareAdvtgSpecRateStats/risk-adjustment/example/2014/12/EDITICD9.sas. 733 + %MACRO EDITICD9(AGE=, ICD9= ); 734 + %********************************************************************** 735 + *********************************************************************** 736 + 737 + 1 MACRO NAME: EDITICD9 738 + 2 PURPOSE: age/sex edits on ICD9 codes 739 + 3 PARAMETERS: AGE - age variable in a person level file 740 + ICD9 - diagnosis variable in a diagnosis file 741 + **********************************************************************; 742 + 743 + _ICD9_3 = SUBSTR(&ICD9,1,3); %*first 3 characters from ICD9; 744 + _ICD9_4 = SUBSTR(&ICD9,1,4); %*first 4 characters from ICD9; 745 + 746 + %* age restrictions; 747 + IF &AGE < 18 THEN DO; 748 + /*emphysema chronic bronchitis */ 749 + IF _ICD9_3 IN ('491','492','496') OR &ICD9 IN ('5181','5182') 750 + THEN CC='109'; 751 + ELSE 752 + IF _ICD9_4 = '4932' THEN CC='110'; 753 + /*chronic obstructive asthma */ 15 The SAS System 14:05 Monday, July 13, 2015 754 + END; 755 + 756 + %*esophageal atresia/stenosis, oth cong GI anomalies age<2; 757 + IF &AGE<2 THEN 758 + IF &ICD9 IN ('7503', '7504', '7507', '7508', '7509', '751', 759 + '7515', '7516', '75160','75162','75169','7517', 760 + '7518','7519') 761 + THEN CC='170'; 762 + 763 + %* age/sex restrictions; 764 + SELECT; 765 + /* males only */ 766 + WHEN (( '185'<= _ICD9_3 <='187' 767 + or _ICD9_3 = '257' 768 + or '600'<= _ICD9_3 <='608' 769 + or '7525'<=_ICD9_4<='7526' 770 + or &ICD9='7528') 771 + & SEX='2') CC='-1.0'; 772 + 773 + /* females only */ 774 + WHEN ( (&ICD9='1121' OR _ICD9_3='131' 775 + OR '179'<=_ICD9_3<='184' 776 + OR _ICD9_3='256' 777 + OR '614'<=_ICD9_3<='627' 778 + OR _ICD9_3='629' 779 + OR &ICD9='677') 780 + & SEX='1') CC='-1.0'; 781 + 782 + 783 + /*Infertility, Pregnancy DXGs Restricted to Females 784 + Between Ages 8 and 59 */ 785 + WHEN ( (_ICD9_3='628' OR 786 + '630'<=_ICD9_3<='676' OR 787 + _ICD9_3 IN ('V22','V23','V24','V27','V28')) 788 + & (SEX='1' OR &AGE<8 OR &AGE>59)) CC='-1.0'; 789 + 790 + /* newborns */ 791 + WHEN((&ICD9 IN ('0900 ','0901 ','0902 ','7485 ' 792 + '7505 ','7506 ','7511 ','7512 ' 793 + '7513 ','7514 ','75161','7566 ') OR 794 + '760' <=_ICD9_3<='770' OR 795 + '771 ' <=_ICD9_4<='7717' OR 796 + &ICD9 IN ('7718','77182','77183','77189') OR 797 + '772' <=_ICD9_3<='779' OR 798 + _ICD9_4='V213' OR 799 + 'V29' <=_ICD9_3<='V39') 800 + & &AGE>=2) CC='-1.0'; 801 + OTHERWISE; 802 + END; *SELECT; 803 + 804 + %MEND EDITICD9; NOTE: %INCLUDE (level 1) ending. NOTE: %INCLUDE (level 1) file IN0(V12H70L1.sas) is file /disk/data3/cms/MedicareAdvtgSpecRateStats/risk-adjustment/example/2014/12/V12H70L1.sas. 805 + %MACRO V12H70L1; 806 +%*********************************************************************** 807 +************************************************************************ 808 + 16 The SAS System 14:05 Monday, July 13, 2015 809 +1 MACRO NAME: V12H70L1 810 +2 PURPOSE: HCC version 12 labels for 70 HCCs 811 +***********************************************************************; 812 +LABEL 813 +HCC1 ='HIV/AIDS ' 814 +HCC2 ='Septicemia/Shock ' 815 +HCC5 ='Opportunistic Infections ' 816 +HCC7 ='Metastatic Cancer and Acute Leukemia ' 817 +HCC8 ='Lung, Upper Digestive Tract, and Other Severe Cancers ' 818 +HCC9 ='Lymphatic, Head and Neck, Brain, and Other Major Cancers ' 819 +HCC10 ='Breast, Prostate, Colorectal and Other Cancers and Tumors ' 820 +HCC15 ='Diabetes with Renal or Peripheral Circulatory Manifestation ' 821 +HCC16 ='Diabetes with Neurologic or Other Specified Manifestation ' 822 +HCC17 ='Diabetes with Acute Complications ' 823 +HCC18 ='Diabetes with Ophthalmologic or Unspecified Manifestation ' 824 +HCC19 ='Diabetes without Complication ' 825 +HCC21 ='Protein-Calorie Malnutrition ' 826 +HCC25 ='End-Stage Liver Disease ' 827 +HCC26 ='Cirrhosis of Liver ' 828 +HCC27 ='Chronic Hepatitis ' 829 +HCC31 ='Intestinal Obstruction/Perforation ' 830 +HCC32 ='Pancreatic Disease ' 831 +HCC33 ='Inflammatory Bowel Disease ' 832 +HCC37 ='Bone/Joint/Muscle Infections/Necrosis ' 833 +HCC38 ='Rheumatoid Arthritis and Inflammatory Connective Tissue Disease' 834 +HCC44 ='Severe Hematological Disorders ' 835 +HCC45 ='Disorders of Immunity ' 836 +HCC51 ='Drug/Alcohol Psychosis ' 837 +HCC52 ='Drug/Alcohol Dependence ' 838 +HCC54 ='Schizophrenia ' 839 +HCC55 ='Major Depressive, Bipolar, and Paranoid Disorders ' 840 +HCC67 ='Quadriplegia, Other Extensive Paralysis ' 841 +HCC68 ='Paraplegia ' 842 +HCC69 ='Spinal Cord Disorders/Injuries ' 843 +HCC70 ='Muscular Dystrophy ' 844 +HCC71 ='Polyneuropathy ' 845 +HCC72 ='Multiple Sclerosis ' 846 +HCC73 ='Parkinsons and Huntingtons Diseases ' 847 +HCC74 ='Seizure Disorders and Convulsions ' 848 +HCC75 ='Coma, Brain Compression/Anoxic Damage ' 849 +HCC77 ='Respirator Dependence/Tracheostomy Status ' 850 +HCC78 ='Respiratory Arrest ' 851 +HCC79 ='Cardio-Respiratory Failure and Shock ' 852 +HCC80 ='Congestive Heart Failure ' 853 +HCC81 ='Acute Myocardial Infarction ' 854 +HCC82 ='Unstable Angina and Other Acute Ischemic Heart Disease ' 855 +HCC83 ='Angina Pectoris/Old Myocardial Infarction ' 856 +HCC92 ='Specified Heart Arrhythmias ' 857 +HCC95 ='Cerebral Hemorrhage ' 858 +HCC96 ='Ischemic or Unspecified Stroke ' 859 +HCC100='Hemiplegia/Hemiparesis ' 860 +HCC101='Cerebral Palsy and Other Paralytic Syndromes ' 861 +HCC104='Vascular Disease with Complications ' 862 +HCC105='Vascular Disease ' 863 +HCC107='Cystic Fibrosis ' 864 +HCC108='Chronic Obstructive Pulmonary Disease ' 865 +HCC111='Aspiration and Specified Bacterial Pneumonias ' 866 +HCC112='Pneumococcal Pneumonia, Empyema, Lung Abscess ' 17 The SAS System 14:05 Monday, July 13, 2015 867 +HCC119='Proliferative Diabetic Retinopathy and Vitreous Hemorrhage ' 868 +HCC130='Dialysis Status ' 869 +HCC131='Renal Failure ' 870 +HCC132='Nephritis ' 871 +HCC148='Decubitus Ulcer of Skin ' 872 +HCC149='Chronic Ulcer of Skin, Except Decubitus ' 873 +HCC150='Extensive Third-Degree Burns ' 874 +HCC154='Severe Head Injury ' 875 +HCC155='Major Head Injury ' 876 +HCC157='Vertebral Fractures without Spinal Cord Injury ' 877 +HCC158='Hip Fracture/Dislocation ' 878 +HCC161='Traumatic Amputation ' 879 +HCC164='Major Complications of Medical Care and Trauma ' 880 +HCC174='Major Organ Transplant Status ' 881 +HCC176='Artificial Openings for Feeding or Elimination ' 882 +HCC177='Amputation Status, Lower Limb/Amputation Complications ' 883 + ; 884 + %MEND V12H70L1; NOTE: %INCLUDE (level 1) ending. NOTE: %INCLUDE (level 1) file IN0(V12H70H.sas) is file /disk/data3/cms/MedicareAdvtgSpecRateStats/risk-adjustment/example/2014/12/V12H70H.sas. 885 + %MACRO V12H70H; /* HIERARCHIES */; 886 + %********************************************************************** 887 + *********************************************************************** 888 + 889 + 1 MACRO NAME: V12H70H 890 + 2 PURPOSE: HCC HIERARCHIES: version 12 of HCCs 891 + only 70 CMS HCCs are included 892 + 3 COMMENT: arrays to work with CCs and HCCs must be set in the 893 + main program, 894 + format ICD to CC creates only 70 CMS CCs 895 + **********************************************************************; 896 + 897 + %*to copy CC into HCC; 898 + DO K=1 TO &N_CC; 899 + HCC(K)=C(K); 900 + END; 901 + 902 + %*imposing hierarchies; 903 + /* Infection 5 */ if hcc5 =1 then do i=112;hcc(i)=0;end; 904 + /* Neoplasm1 */ if hcc7 =1 then do i=8,9,10;hcc(i)=0;end; 905 + /* Neoplasm 2 */ if hcc8 =1 then do i=9,10;hcc(i)=0;end; 906 + /* Neoplasm 3 */ if hcc9 =1 then do i=10;hcc(i)=0;end; 907 + /* Diabetes 1 */ if hcc15 =1 then do i=16,17,18,19;hcc(i)=0;end; 908 + /* Diabetes 2 */ if hcc16 =1 then do i=17,18,19;hcc(i)=0;end; 909 + /* Diabetes 3 */ if hcc17 =1 then do i=18,19;hcc(i)=0;end; 910 + /* Diabetes 4 */ if hcc18 =1 then do i=19;hcc(i)=0;end; 911 + /* Liver 1 */ if hcc25 =1 then do i=26,27;hcc(i)=0;end; 912 + /* Liver 2 */ if hcc26 =1 then do i=27;hcc(i)=0;end; 913 + /* SA1 */ if hcc51 =1 then do i=52;hcc(i)=0;end; 914 + /* Psychiatric */ if hcc54 =1 then do i=55;hcc(i)=0;end; 915 + /* Spinal 1 */ if hcc67 =1 then do i=68,69,100,101,157;hcc(i)=0;end; 916 + /* Spinal 2 */ if hcc68 =1 then do i=69,100,101,157;hcc(i)=0;end; 917 + /* Spinal 3 */ if hcc69 =1 then do i=157;hcc(i)=0;end; 918 + /* Arrest 1 */ if hcc77 =1 then do i=78,79;hcc(i)=0;end; 919 + /* Arrest 2 */ if hcc78 =1 then do i=79;hcc(i)=0;end; 920 + /* Heart 2 */ if hcc81 =1 then do i=82,83;hcc(i)=0;end; 921 + /* Heart 3 */ if hcc82 =1 then do i=83;hcc(i)=0;end; 18 The SAS System 14:05 Monday, July 13, 2015 922 + /* CVD 1 */ if hcc95 =1 then do i=96;hcc(i)=0;end; 923 + /* CVD6 */ if hcc100 =1 then do i=101;hcc(i)=0;end; 924 + /* Vascular 1 */ if hcc104 =1 then do i=105,149;hcc(i)=0;end; 925 + /* Lung 1 */ if hcc107 =1 then do i=108;hcc(i)=0;end; 926 + /* Lung 5 */ if hcc111 =1 then do i=112;hcc(i)=0;end; 927 + /* Urinary 3 */ if hcc130 =1 then do i=131,132;hcc(i)=0;end; 928 + /* Urinary 4 */ if hcc131 =1 then do i=132;hcc(i)=0;end; 929 + /* Skin 1 */ if hcc148 =1 then do i=149;hcc(i)=0;end; 930 + /* Injury 1 */ if hcc154 =1 then do i=75,155;hcc(i)=0;end; 931 + /* Injury 8 */ if hcc161 =1 then do i=177;hcc(i)=0;end; 932 + 933 + %MEND V12H70H; NOTE: %INCLUDE (level 1) ending. NOTE: %INCLUDE (level 1) file IN0(V12H70M.sas) is file /disk/data3/cms/MedicareAdvtgSpecRateStats/risk-adjustment/example/2014/12/V12H70M.sas. 934 + %MACRO V12H70M(ICD9=); 935 + %*********************************************************************** 936 + ************************************************************************ 937 + 938 + 1 MACRO NAME: V12H70M 939 + 2 PURPOSE: to assign additional CC for some ICD9s 940 + 3 PARAMETERS: ICD9 - diagnosis variable in a diagnosis file 941 + ***********************************************************************; 942 + IF &ICD9 IN ('40403','40413','40493') THEN CC80=1; 943 + 944 + %MEND V12H70M; NOTE: %INCLUDE (level 1) ending. NOTE: %INCLUDE (level 1) file IN0(SCOREVAR.sas) is file /disk/data3/cms/MedicareAdvtgSpecRateStats/risk-adjustment/example/2014/12/SCOREVAR.sas. 945 + %MACRO SCOREVAR( PVAR=, RLIST=, CPREF=); 946 + %********************************************************************** 947 + *********************************************************************** 948 + 1 MACRO NAME: SCOREVAR 949 + 2 PURPOSE: calculate SCORE variable 950 + 3 PARAMETERS: 951 + PVAR - SCORE variable name 952 + RLIST - regression variables list 953 + CPREF - coefficients Prefix: coefficients name 954 + are the same as corresponding variable 955 + name with thei prefix 956 + ***********************************************************************; 957 + %LOCAL I; 958 + %LET I=1; 959 + &PVAR=0; 960 + %DO %UNTIL(%SCAN(&RLIST,&I)=); 961 + &PVAR = &PVAR + %SCAN(&RLIST,&I)*&CPREF%SCAN(&RLIST,&I); 962 + %LET I=%EVAL(&I+1); 963 + %END; 964 + 965 + %MEND SCOREVAR; NOTE: %INCLUDE (level 1) ending. NOTE: Data file INCOEF.HCCCOEFN.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. NOTE: Data file IN1.PERSON.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. NOTE: Data file IN2.DIAG.DATA is in a format that is native to another host, or the file encoding does not match the session 19 The SAS System 14:05 Monday, July 13, 2015 encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. NOTE: There were 1 observations read from the data set INCOEF.HCCCOEFN. NOTE: There were 24 observations read from the data set IN1.PERSON. NOTE: There were 70512 observations read from the data set IN2.DIAG. NOTE: The data set OUT.PERSON has 24 observations and 819 variables. NOTE: DATA statement used (Total process time): real time 0.71 seconds cpu time 0.27 seconds NOTE: There were 24 observations read from the data set OUT.PERSON. NOTE: The PROCEDURE PRINT printed pages 1-36. NOTE: PROCEDURE PRINT used (Total process time): real time 0.13 seconds cpu time 0.06 seconds NOTE: PROCEDURE CONTENTS used (Total process time): real time 0.01 seconds cpu time 0.00 seconds NOTE: The PROCEDURE CONTENTS printed pages 37-53. NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 1.19 seconds cpu time 0.36 seconds