Download presentation
Presentation is loading. Please wait.
Published byΜαία Παπαντωνίου Modified over 6 years ago
1
Set Yourself Free-- Use ODS Report Writing Technology in SAS EG Instead of Dynamic Data Exchange in PC SAS Part II: SAS Code Revealed Robert R. Springborn, Ph.D. Office Statewide Health Planning & Development, Healthcare Outcomes Center Sacramento, California Copyright © 2010, SAS Institute Inc. All rights reserved.
2
Talk Overview DATA APPLICATION. The California CABG Outcomes Reporting Program provides quality of care ratings for 120 state-licensed hospitals who performed isolated coronary artery bypass graft (CABG) surgery in Surgeon and Hospital performance ratings are based on a clinical data source which is compared to an administrative data source (Please See Paper) . NEED FOR A CUSTOM REPORT. The accuracy of performance ratings are evaluated by comparing the clinical data source to an administrative data source. A hospital specific custom report is needed to identify differences between these data sources and help hospitals reconcile those differences (Please See Paper). TECHNICAL CHALLENGE. The previous report was created in MS Excel using Dynamic Data Exchange (DDE) in PC SAS. However Migration to SAS Enterprise Guide now requires the report to live in SAS Enterprise Guide where DDE will not function (Please See Paper). COMPARE METHODS. My previous paper presented at WUSS 2012 in Long Beach (Part I: Introduction) described differences between DDE and ODS Report Writing Technology (Please See Paper). SAS PROGRAM CODE. This talk will focus on the SAS code used to create the custom report.
3
If you like Dr. Seuss stomp your feet and clap your hands…
4
Data Application Each year the California Report on Coronary Artery Bypass Graft (CABG)Surgery publishes quality of care performance ratings for 315 surgeons and 122 hospitals who perform heart surgery in California. The performance ratings are based on risk-adjusted operative mortality in a logistic model containing clinical risk factors. Clinical Risk factors include: all CABG surgeries; Status of Isolated and Non-Isolated CABG surgery; Resuscitation Prior to CABG Procedure; CABG surgery deaths; and six postoperative complications. CABG surgery performance ratings are intended for; cardiac patients and their families who are developing treatment plans with their doctors; hospitals and surgeons who are developing quality improvement activities; and organizations that purchase health care coverage for their members. Not all surgeons and hospitals are happy with their results. The media may use these results to challenge the reputation of surgeons and hospitals. Oh My!
5
Need for Custom Report Hospitals are required to submit their data to two different data sources, a clinical data source called California CABG Outcome Reporting Program (CCORP), and an administrative data source called Patient Discharge Data (PDD). A Data Discrepancy Report (DDR) verifies the accuracy of quality of care ratings. First the report identifies risk factor differences between these two data sources. Second, this report assists hospital staff to review of patient medical charts and verify that risk factor coding is consistent in both data sources. It is important to ensure each patient record receives the correct risk adjusted weight. Hospitals that handle more complex cases receive a larger risk-adjustment weight in the risk model, and hospitals that handle less complex cases receive a smaller weight. Thus hospitals and surgeons treating sicker patients are not at a disadvantage when their performance is compared with other hospitals or surgeons.
6
What the …. Can somebody tell me what Dr. Seuss stories these characters are from?
7
Technical Challenge The previous report in MS Excel was created using Dynamic Data Exchange (DDE). Everyone loves a report in MS Excel because you can: investigate trends and differences using a large selection of colorful graphs, charts, and statistical analysis tools. However report content and appearance can be changed during review. We need a different custom report that is “easy to read” like MS Excel but also protects report content and appearance. The office is migrating to SAS EG which does not support Dynamic Data Exchange (DDE). So the new report must be created using SAS Enterprise Guide.
8
Compare Methods Dynamic Data Exchange (DDE) and ODS Report Writing Technology (RWT) are both powerful automation tools which read a data source and build a custom report without manually entering data thus saving time and reducing human error. DDE requires a formatted MS Excel template but RWT does not. Writing code in DDE is very time consuming because it requires careful calculation of row and column location. Also the dimensions of each DDE report item are limited to number of surrounding columns and rows. RWT allows you to position report items on the page with ease. Locating a single page of a multi-sheet DDE report is difficult and printing the entire report is also difficult. RWT creates a PDF file with bookmarks linked to specific report pages and printing this report is simple. A DDE report in MS Excel can be modified. A RWT report created as a PDF file in Adobe cannot be modified.
9
SAS Program Code Now we want to examine the SAS program code that creates the custom report displayed in the next three pages (Display 1-3). The SAS code for this report was organized into four functional groups. Each group performs a similar set of tasks (See paper for details). The fourth group contains the SAS program code which features object oriented code statements using the DATA _NULL_ which is the flagship of this paper. This is where we will spend our remaining time together. Note on terminology. A data variable discrepancy is one where the risk factor coded value is different between the clinical data source (CCORP) and the administrative data source (PDD).
10
Display 1. Data Discrepancy Variable Help Instructions
11
Display 2. Summary Sheet for Each of Ten Data Variable Discrepancy Sections.
12
Display 3. Patient Level Data for Each of Ten Data Variable Discrepancy Sections.
13
SAS Program Code Section 1: File Management Tasks
Lines Create a bucket for SAS Job Log using PROC PRINTTO to collect SAS messages. Every time you execute a RWT statement, SAS inserts “WARNING: Data step interface is preproduction in this release” in the SAS Job Log totally destroying any useful information. We will remove these messages and print a useful SAS Job Log at the end of my program. Lines Remove special characters from a list of hospital names and license numbers. Lines Create a unique list of hospital license numbers and store the list in macros &hosplist, Lines create a unique list of hospital names and store the list in macro &qhosplist.
14
SAS Program Code Section 2: Compile macro %HelpSheet
This macro creates a list of variable definitions given in Display 1 which will be the first page of the report. Lines create the title and footnote. Line 78 uses statement “ods proclabel” to create a bookmark link “DEFINITIONS FOR EACH DDR VARIABLE” Lines is our first example of using object oriented program statements in a Data _Null_ Step. Here we create two columns of printed text where the first row is highlighted in yellow. Note the following statements. dcl odsout obj() to begin a new table definition. obj.layout_gridded to define number of columns and justification for entire table. obj.region to define column width for current column. obj.format_text to insert text or a data value. overrides to specify format properties applied to text and data values.
15
SAS Program Code Section 3: Compile macro %DDRVarSection
For each of ten data variable discrepancies (sections) at each hospital, this macro generates a summary page (Display 2.) which identifies under-reporting records (CCORP=“N”; PDD=“Y”), and over reporting records (CCORP=“Y”; PDD=“N”). Line 119 provides a different bookmark link for each of ten summary pages. In lines a DATA _NULL_ creates the summary page, using a DO LOOP which controls how data is read from two different SAS datasets (&dataname1.; &dataname2.) and four variables (notevar, notedescrip, &sumunder. and &sumover.). The DO LOOP is needed to control the flow of data because of the different variables used to print the count of under-reported (“&sumunder.”) and over-reported cases (“&sumover.”). The variables “notevar,” and “notedescrip,” contain the text printed in the first two columns of each row. The macro variables “&sumunder.” and “&sumover.” contain the number of cases printed in the third column of the second and third rows respectively. Again note the use of statements obj.table_start(), obj.row_start(), obj.format_cell(), overrides, obj.row_end(), and obj.table_end to define each column of each row of the summary table.
16
You did a great job, give your self a hand. OK, something fun
You did a great job, give your self a hand !! OK, something fun. Can somebody tell me what Dr. Seuss stories these characters are from?
17
SAS Program Code Section 4: Compile macro %DDRVarSection (continued)
For each of ten data variable discrepancies (sections) at each hospital, this macro also displays patient hospitalization records (Display 3.) identified in the previous summary page. Hospitals need information to track down the patient medical record in question. This information is printed in the first three rows of the first table and generated by lines First “Data Found Only in PDD (Under-Reporting),” or “Data Found Only in CCORP (Over-Reporting).” Second “Isolated CABG Surgery,” “Non-Isolated CABG Surgery,” or “Total.” Third “Both Hospitals Match” if there was a complete patient record (both CCORP data and PDD data was present for same hospitalization), “Only CCORP Hospital” (CCORP orphan), or “Only PDD Hospital” (PDD orphan). Lines adds four rows to this table containing eight additional patient identifiers of medical record number, social security number, sex, birth date, surgery date, discharge date, death date, and surgeon name. Lines creates a new table for patient diagnosis and procedure information. Remember that risk factors are identified in the administrative data (PDD) using a complex recipe of diagnosis and procedure information.
18
SAS Program Code Section 5: Run the Data Discrepancy Report for Each Hospital. Next we compile macro %hospitalddr (lines ). Note we have a global macro variable named &hospitalnum that is shared between macro %hospitalddr (line 362), macro %helpsheet (line 366), and the first occurrence of macro %ddrvarsection ( ). Also the text that is passed as keyword parameters to each of ten calls to macro %ddrvarsection clearly notes the creation of ten data discrepancy variable sections. Next we create another macro %callddr which will build our list of hospitals and execute the macro %hospitalddr for each hospital on that list (lines ). Remember the list of hospital numbers and hospital names were created as macros &hosplist, and &qhosplist in lines of this SAS program. The macro function %scan reads each list and selects both the hospital number and name which is then passed to the macro %hospitalddr . Finally we saved the best for last. Now we can close the original SAS Job Log (filename ddr_log), remove all occurrences of the text string “WARNING: DATA step interface is preproduction in this release,” and create a revised SAS Job Log for our viewing pleasure (lines ).
19
Conclusion In today’s sophisticated business environment where the ability to prepare custom designed reports and convey your message in a clear and concise manner is an absolute imperative; and many organizations are transitioning to SAS Enterprise Guide for their data collection, analytics, and data reporting needs; ODS Report Writing technology using SAS Enterprise Guide is an powerful alternative to Dynamic Data Exchange (DDE) using PC SAS.
20
Thanks for Your Attention
Your comments and questions are valued and encouraged. Also if you would like a copy of the SAS code. Contact the author at: Robert Richard Springborn, Ph.D. Healthcare Outcomes Center Office of Statewide Health Planning and Development 400 R Street, Suite 250 Sacramento, CA Office (916)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.