** SAS Code Related to Diagnostic Related Groups (DRGs) ; ******************************************************; FORMATS: The following two examples of code create the DRGSM variable, depending on whether DRG is numeric or character: NUMERIC: drgsm=put(input(drg,3.),drgsmtwo.) ; CHARACTER: drgsm=put(drg,$drg#sm.); *where # is replaced by 9 or 11, depending on the fiscal year*; LABELS: Labels for the DRG and ADRG variables are available from MCHP. The formats are specific to the revision of DRG. drg91 label: $drg91 (version 5/9) adrg9l label: $adrg91 (version 5/9) drg9wf label: $drg9wf (version 5/9, attach weights) DRG labels for the 15th revision (the latest) - available here: RDRG labels for the 19th revision (the latest) available here: RGN_labels <../internal/RGN_labels.txt> (internal access only) Formats: Formats for distinguishing surgical from medical DRG's are available as well. drgsmtwo.fmt format: drgsmtwo (version 2.3/5) drg9smtwo.fmt format: drgsmtwo (version 5/9) drg11smtwo.fmt format: drgsmtwo (version 7/11) drg9sm format: $drg9sm (version 5/9) drg11sm format: $drg11sm (version 7/11) The formats assume a numeric DRG code. Most data sets store DRG's as character strings. The following code converts character DRG to numeric DRG in the process of creating the drgsm variable. SAS CODE: || drgsm=put(input(drg,3.),drgsmtwo.); Not all formats require the conversion to numeric. If this is the case then the code is as follows: || drgsm=put(drg,$drg#sm.); *where # is replaced by 9 or 11, depending on the years of data; There is a variation on DRGSM that further subdivides DRG's into obstetrical, psychiatric and neonatal codes. The formats are specific to the version (revision) of DRG's being used. drgsmthree.fmt format: drgsmthr (version 2.3/5) drg9smthree.fmt format: drgsmthr (version 5/9) drg11smthree.fmt format: drgsmthr (version 7/11) The format assumes a numeric DRG code, and the DRG variable on most data sets is character. The SAS code to convert the variable to numeric is available from MCHP. Variation of Surgical/Medical These formats expand the above S/M split to a total of 5 categories: surgical, medical, obstetrical, psychiatric, and neonatal. They are denoted by "three" in the filename (e.g., drgsmthree.fmt; format drgsmthr). The following example of code creates the TYPE variable (representing the above 5 categories); it assumes DRG is character: drgfmt=input(drg,3.); type = put(drgfmt,drgsmthr.); if (drgfmt=470|drgfmt=468) & op01 ^= ' ' then type = '1'; if (drgfmt=470|drgfmt=468) & op01 = ' ' then type = '2'; Programming Notes Because the hospital discharge abstracts contain inpatient, day surgery,and some outpatient claims, the following should be used to keep only inpatient records for analysis: if TRANSACT = '1'; * Use this to keep only inpatient records;