/******************************************************************/ /* Title: CCS MENTAL HEALTH / SUBSTANCE ABUSE CATEGORIES */ /* INTEGRATION SOFTWARE, VERSION 1.0 */ /* */ /* PROGRAM: CCS-MHSA_INTEGRATION */ /* */ /* Description: This program integrates the new CCS Mental Health */ /* and Substance Abuse (CCS-MHSA) categories into */ /* data containing original CCS categories. */ /* */ /* The program identifies the regular CCS categories */ /* for mental health, and using a SAS informat, */ /* replaces them with the new CCS-MHSA categories. */ /* Categories 662 & 663 are excluded, and several */ /* diagnosis codes from categories 660 & 661 are */ /* excluded. */ /* */ /* NOTE: Users will need to customize this program */ /* in certain places for their use. Please modify */ /* the macro variables at the beginning of this file */ /* and the CCS variable names at the end of the file.*/ /******************************************************************/ FILENAME INRAW 'C:\DATA\CCS-MHSA_GENERAL_05.CSV'; * Modify the Path & name of CCS-MHSA General tool ; LIBNAME IN1 'C:\DATA\'; * Modify the location of input discharge data; LIBNAME OUT1 'C:\DATA\'; * Modify the location of output data; TITLE1 'INTEGRATION OF CCS MENTAL HEALTH/SUBSTANCE ABUSE CATEGORIES'; TITLE2 'USE WITH DISCHARGE ADMINISTRATIVE DATA THAT HAS ORIGINAL CCS CATEGORIES'; /*******************************************************************/ /* Macro Variables that must be set to define the characteristics */ /* of the input discharge data to the program */ /*******************************************************************/ * Enter the Maximum number of DXs on your SAS File; %LET NUMDX=15; * Enter Your SAS file name; %LET CORE=NIS_TEST_DATA_2002; * Are the CCS vars on your SAS file character? (Y/N); %LET CHAR_="N"; %Macro Integrate; /*******************************************************************/ /* SAS Load the CCS-MHSA General Tool and use it to create a temp */ /* SAS informat that will be used to assign the new categories. */ /*******************************************************************/ DATA INFORMAT; INFILE INRAW DSD DLM=',' END = EOF FIRSTOBS=2; INPUT START : $CHAR5. LABEL : $CHAR3. ; RETAIN HLO " "; %If &CHAR_ = "Y" or &CHAR_= "y" %then %do; FMTNAME = "$MHSA"; TYPE = "J"; %End; %Else %do; FMTNAME = "MHSA"; TYPE = "I"; %End; OUTPUT; IF EOF THEN DO; START = " "; LABEL = " "; HLO = "O"; OUTPUT; END; RUN; PROC FORMAT LIB=WORK CNTLIN = INFORMAT ; RUN; /*******************************************************************/ /* Modify a dataset containing original CCS mental health */ /* categories by replacing them with the new CCS-MHSA categories. */ /* Exclude categories 662 & 663 and DX codes from 660 & 661. */ /* Run frequencies on CCS variables to see the new MHSA values. */ /* Original CCS categories are replaced by the new CCS-MHSA */ /* categories. */ /*******************************************************************/ DATA OUT1.INTEGRATION; SET IN1.&CORE; ARRAY DXS (*) $ DX1-DX&NUMDX; * Change diagnosis variable names to match your file; %if &CHAR_ = "Y" or &CHAR_ = "y" %then %do; ARRAY CCS (*) $ DXCCS1-DXCCS&NUMDX; * Change CCS variable names to match your SAS file; %end; %else %do; ARRAY CCS (*) DXCCS1-DXCCS&NUMDX; * Change CCS variable names to match your SAS file; %end; DO I = 1 TO &NUMDX; IF DXS(I) NOT IN('65550','65551','65553','76072','76073','76075','7795 ', '96500','96501','96502','96509','V6542','64830','64831', '64832','64833','64834','64840','64841','64842','64843','64844') AND INPUT(DXS(I),MHSA.) NOT IN(662,663) THEN DO; %if &CHAR_ = "Y" or &CHAR_ = "y" %then %do; IF ('65' <= CCS(I) <= '75') THEN CCS(I) = INPUT(DXS(I),$MHSA.); %end; %else %do; IF (65 <= CCS(I) <= 75) THEN CCS(I) = INPUT(DXS(I),MHSA.); %end; END; END; RUN; PROC FREQ DATA=OUT1.INTEGRATION; TABLES DXCCS1-DXCCS&NUMDX / MISSING LIST; * Change CCS variable names to match your file; TITLE3 'FREQUENCY OF CCS REPLACED WITH NEW CCS-MHSA CATEGORIES'; RUN; %Mend Integrate; %Integrate;