** Hysterectomy SAS Code ; ******************************; proc format ; *** ICD9CM codes used by CIHI in exclusions for hysterectomy rates ; value $hystex '140'-'1720', '1740'-'2089', 'V581', 'V580' = 'C' /** cancer - originals coded to 3 character level**/ '042'-'0429', '043'-0439', '044'-0449', 'V089' = 'H' /* hiv - originals coded to 3 character level**/ 'E800'-'E848', 'E8810'-'E8841','E8849', 'E8860', 'E890'-'E899', 'E900'-'E910', 'E913'-'E926', 'E928', 'E950'-'E968', 'E970'-'E976', 'E990'-'E998' = 'T' /** Trauma **/ OTHER = ' ' ; value $hystexl 'C' = 'Cancer - hyst comorb' 'H' = 'HIV - hyst comorb' 'T' = 'Trauma - hyst comorb' ; *** ICD9CM Hysterectomy codes used ; value $hyst '684 '-'6849','685 '-'6859', '686'-6869', '687'-'6879','689'= '1' other = '0'; * HYSTERECTOMY ; run; data hosp ; set cpe8.hsp0102 cpe8.hsp0203 ; if '20000401' <= datesep <= '20020331' ; hyst = 0 ; hystex = ' ' ; array op {12} op01-op12 ; do i = 1 to 12 while(op{i}^=' ') ; if put(op{i},$hyst.) = '1' then hyst = 1; end ; array diag {16} dx01-dx16 ; do i = 1 to 16 until(diag{i}=' ' or hystex^=' ') ; hystex = put(substr(diag{i},1,4),$hystex.) ; end ; if transact = '1' & sepcode in('2','3','4') then oth_exl = 1 ; else if transact in('3','5') & sepcode = '6' then oth_exl=1 ; *** Identify hysterectomy codes tthat are likely not discretionary ; non_d_hyst = 0 ; if hyst = 1 & hystex ^=' ' & oth_exl = 1 then non_d_hyst = 0 ; else if hyst = 1 & hystex = ' ' then non_d_hyst = 1 ; if hyst = 1 ; label hyst = 'Hysterectomy performed' hystex = 'Exclusions for hysterectomy with comorb condition' non_d_hyst = 'Non descretionay hysterectomy (those with comorb condition)' ; run;