/************************************************************************************* Program Name: r:\usrds\%type_run%\saf\patients\pdisdetail.sas Created date: 00/00/00 By: RLW Derived From: Input Data: SAF.PATIENTS Output Data: .lst Purpose: Tabulate distribution and derivation of primary disease codes. Revision History Date By Changes made 98 12 01 RLW PROD/TEST footnotes are moved to title to produce fewer blank lines; **************************************************************************************/ options nocenter pagesize=60 linesize=192; * SAS MONOSPACE PT SIZE 6 landsacpe; options compress=YES; *****************************************************************************; * Get parameters set in .BAT file. *****************************************************************************; %let TYPE_RUN = %SYSGET(TYPE_RUN); %let sasdir = %SYSGET(SASDIR); *---------------------------------------------; * Reset input library based on parameter ; * The %IF strucuture works only in a macro ; *---------------------------------------------; %macro setupmac; %if %sysget(type_run) = TEST %then %do; libname saf '\\calyx\sasdata\saf\preliminary' ; libname safkecc '\\calyx\sasdata\saf\safkecc\preliminary' ; %end; %mend; %setupmac; *****************************************************************************; *****************************************************************************; data pdisbig /view=pdisbig; set saf.patients; length grp1 $ 2 grp2 $ 3 ; * Subtotal By Disease Group ; grp1 = substr(put(pdis,$pdxadra.),1,2); * Create the detail ; grp2 = put(pdis,$pdxadra.); length disgrpcc $ 24; disgrpcc = disgrpc|| ': ' || put(disgrpc,$disgrpc.); Label disgrpcc = 'Primary Disease Group'; length grp1c $ 60; grp1c = grp1 || ': ' || put(grp1,$pdadra.); label grp1c = 'Disease Group Level 1'; length grp2c $ 60; grp2c = grp2 || ': ' || put(grp2,$pdadra.); label grp1c = 'Disease Group Level 2'; length pdisc $ 60; pdisc = pdis || ': ' || put(pdis,$pd96det.); label pdisc = 'Detailed Primary Disease Causing ESRD'; length cyear $ 6; cyear = put(first_se,year4.); if first_se < '1jan85'd then cyear = '.<1985'; * if first_se ge '1jan80'd; run; proc tabulate data=pdisbig missing noseps format=comma7.; class grp1 grp1c grp2c grp2 pdis first_se disgrpc disgrpcc pdisc cyear; format first_se year4. grp1 $6. grp2 $6. pdis $6.; label first_se='Year of First ESRD Service'; table disgrpcc='Primary Disease Group', (all pdisc='Detailed Primary Disease'), (all cyear)*n='' / rts=62 condense box = 'Table 1: Detailed diseases Grouped by Primary Disease Group--the 8 classifications most commonly used in the ADR'; table grp1C, all grp2C, (all cyear)*n='' / rts=62 condense box = 'Table 2: Level 1 and 2 disease groups reported in Tables A15-A22'; table grp1C, grp2='Disease Group Level 2'*pdis='Detailed Primary Disease Code', (all cyear)*n='' / rts=62 condense box = 'Table 3: Detailed diseases within the two disease group levels'; title1 'New ESRD Patients by Primary Disease Causing ESRD and Year of First ESRD Service'; title2 ' '; title3 'Diseases are grouped in two ways. The first grouping scheme is the eight categories used in most tables and graphics in the'; title4 'text and Reference Tables of the ADR. This grouping scheme is labeled Primary Disease Group in these tables.'; title5 'The second grouping scheme has two levels of categories. This scheme is used only in Reference Tables A.15-A.22. The two'; title6 'levels in this scheme are labeled Disease Group Level 1 and Disease Group Level 2 in these tables.'; title7 'Detailed primary disease codes ending in Z are from the pre-1995 version of the Medical Evidence (2728) form'; title8 "r:\usrds\%type_run%\saf\patients\pdisdetail.sas"; run; proc tabulate data=pdisbig (where=(first_se ge '1jan89'd)) missing noseps format=comma6.; class grp1c grp2c pdisc first_se cyear; format first_se year4.; table grp1C, grp2c*pdisc, (all cyear='Year of First ESRD Service')*n='' / rts=120 condense box = 'Table 4: Detailed diseases within the two disease group levels'; ; title8 'Table 4 differs from Table 3 only in that fewer years are reported so the full disease group and detailed disease lables can be displayed.'; run;