We begin by defining a few user-supplied parameters, to make the code transferable between various projects.



Similar documents
A Method for Cleaning Clinical Trial Analysis Data Sets

Importing Excel File using Microsoft Access in SAS Ajay Gupta, PPD Inc, Morrisville, NC

An macro: Exploring metadata EG and user credentials in Linux to automate notifications Jason Baucom, Ateb Inc.

REx: An Automated System for Extracting Clinical Trial Data from Oracle to SAS

Using Pharmacovigilance Reporting System to Generate Ad-hoc Reports

How To Write A Clinical Trial In Sas

Automated distribution of SAS results Jacques Pagé, Les Services Conseils HARDY, Quebec, Qc

A Macro to Create Data Definition Documents

Post Processing Macro in Clinical Data Reporting Niraj J. Pandya

PharmaSUG Paper AD11

PharmaSUG 2014 Paper CC23. Need to Review or Deliver Outputs on a Rolling Basis? Just Apply the Filter! Tom Santopoli, Accenture, Berwyn, PA

Data Presentation. Paper Using SAS Macros to Create Automated Excel Reports Containing Tables, Charts and Graphs

ABSTRACT THE ISSUE AT HAND THE RECIPE FOR BUILDING THE SYSTEM THE TEAM REQUIREMENTS. Paper DM

Choosing the Best Method to Create an Excel Report Romain Miralles, Clinovo, Sunnyvale, CA

Creating Dynamic Reports Using Data Exchange to Excel

Using DDE and SAS/Macro for Automated Excel Report Consolidation and Generation

Combining SAS LIBNAME and VBA Macro to Import Excel file in an Intriguing, Efficient way Ajay Gupta, PPD Inc, Morrisville, NC

ABSTRACT INTRODUCTION

Let SAS Modify Your Excel File Nelson Lee, Genentech, South San Francisco, CA

SAS ODS HTML + PROC Report = Fantastic Output Girish K. Narayandas, OptumInsight, Eden Prairie, MN

Combining External PDF Files by Integrating SAS and Adobe Acrobat Brandon Welch, Rho, Inc., Chapel Hill, NC Ryan Burns, Rho, Inc.

AN ANIMATED GUIDE: SENDING SAS FILE TO EXCEL

Instant Interactive SAS Log Window Analyzer

Better Safe than Sorry: A SAS Macro to Selectively Back Up Files

How To Create An Audit Trail In Sas

An Overview of REDCap, a secure web-based application for Electronic Data Capture

Effective Use of SQL in SAS Programming

PharmaSUG Paper DG06

Automation of Large SAS Processes with and Text Message Notification Seva Kumar, JPMorgan Chase, Seattle, WA

Paper TT09 Using SAS to Send Bulk s With Attachments

ABSTRACT INTRODUCTION %CODE MACRO DEFINITION

SQL SUBQUERIES: Usage in Clinical Programming. Pavan Vemuri, PPD, Morrisville, NC

Essential Project Management Reports in Clinical Development Nalin Tikoo, BioMarin Pharmaceutical Inc., Novato, CA

EXTRACTING DATA FROM PDF FILES

Managing Tables in Microsoft SQL Server using SAS

Spelling Checker Utility in SAS using VBA Macro and SAS Functions Ajay Gupta, PPD, Morrisville, NC

Using Macros to Automate SAS Processing Kari Richardson, SAS Institute, Cary, NC Eric Rossland, SAS Institute, Dallas, TX

Create an Excel report using SAS : A comparison of the different techniques

Applications Development

SSN validation Virtually at no cost Milorad Stojanovic RTI International Education Surveys Division RTP, North Carolina

SAS Macros as File Management Utility Programs

Internet/Intranet, the Web & SAS. II006 Building a Web Based EIS for Data Analysis Ed Confer, KGC Programming Solutions, Potomac Falls, VA

Managing very large EXCEL files using the XLS engine John H. Adams, Boehringer Ingelheim Pharmaceutical, Inc., Ridgefield, CT

ABSTRACT INTRODUCTION SAS AND EXCEL CAPABILITIES SAS AND EXCEL STRUCTURES

Improving Your Relationship with SAS Enterprise Guide

Overview. NT Event Log. CHAPTER 8 Enhancements for SAS Users under Windows NT

Flat Pack Data: Converting and ZIPping SAS Data for Delivery

MODULE 2: SMARTLIST, REPORTS AND INQUIRIES

Real-Time Market Monitoring using SAS BI Tools

Managing Data Issues Identified During Programming

ing Automated Notification of Errors in a Batch SAS Program Julie Kilburn, City of Hope, Duarte, CA Rebecca Ottesen, City of Hope, Duarte, CA

Using SAS With a SQL Server Database. M. Rita Thissen, Yan Chen Tang, Elizabeth Heath RTI International, RTP, NC

Switching from PC SAS to SAS Enterprise Guide Zhengxin (Cindy) Yang, inventiv Health Clinical, Princeton, NJ

Applications Development ABSTRACT PROGRAM DESIGN INTRODUCTION SAS FEATURES USED

You have got SASMAIL!

SENDING S IN SAS TO FACILITATE CLINICAL TRIAL. Frank Fan, Clinovo, Sunnyvale CA

SAS UNIX-Space Analyzer A handy tool for UNIX SAS Administrators Airaha Chelvakkanthan Manickam, Cognizant Technology Solutions, Teaneck, NJ

How To Use Sas With A Computer System Knowledge Management (Sas)

Report Customization Using PROC REPORT Procedure Shruthi Amruthnath, EPITEC, INC., Southfield, MI

Optimizing System Performance by Monitoring UNIX Server with SAS

Get in Control! Configuration Management for SAS Projects John Quarantillo, Westat, Rockville, MD

Order from Chaos: Using the Power of SAS to Transform Audit Trail Data Yun Mai, Susan Myers, Nanthini Ganapathi, Vorapranee Wickelgren

Preparing your data for analysis using SAS. Landon Sego 24 April 2003 Department of Statistics UW-Madison

SUGI 29 Applications Development

Paper Hot Links: Creating Embedded URLs using ODS Jonathan Squire, C 2 RA (Cambridge Clinical Research Associates), Andover, MA

StARScope: A Web-based SAS Prototype for Clinical Data Visualization

Chapter 24: Creating Reports and Extracting Data

Network Detective Client Connector

DiskPulse DISK CHANGE MONITOR

Leveraging the SAS Open Metadata Architecture Ray Helm & Yolanda Howard, University of Kansas, Lawrence, KS

CHAPTER 1 Overview of SAS/ACCESS Interface to Relational Databases

Tips and Tricks for Creating Multi-Sheet Microsoft Excel Workbooks the Easy Way with SAS. Vincent DelGobbo, SAS Institute Inc.

Sending s in SAS to Facilitate Clinical Trial Frank Fan, Clinovo, Sunnyvale, CA

Managing Qualtrics Survey Distributions and Response Data with SAS

Create a PDF File. Tip. In this lesson, you will learn how to:

Leveraging APIs in SAS to Create Interactive Visualizations

Using SAS to Control and Automate a Multi SAS Program Process. Patrick Halpin November 2008

SAS and Microsoft Excel for Tracking and Managing Clinical Trial Data: Methods and Applications for Information Delivery

How to Convert Outlook Folder Into a Single PDF Document

Using SAS Enterprise Business Intelligence to Automate a Manual Process: A Case Study Erik S. Larsen, Independent Consultant, Charleston, SC

Analyzing the Server Log

Improve your Clinical Data Management With Online Query Management System

Using Proc SQL and ODBC to Manage Data outside of SAS Jeff Magouirk, National Jewish Medical and Research Center, Denver, Colorado

PharmaSUG Paper PO01

Paper An Introduction to SAS PROC SQL Timothy J Harrington, Venturi Partners Consulting, Waukegan, Illinois

Let SAS Write Your SAS/GRAPH Programs for You Max Cherny, GlaxoSmithKline, Collegeville, PA

SAS Drug Development Release Notes 35DRG07

From Database to your Desktop: How to almost completely automate reports in SAS, with the power of Proc SQL

Paper PO03. A Case of Online Data Processing and Statistical Analysis via SAS/IntrNet. Sijian Zhang University of Alabama at Birmingham

SDTM, ADaM and define.xml with OpenCDISC Matt Becker, PharmaNet/i3, Cary, NC

Using FileMaker Pro with Microsoft Office

A Microsoft Access Based System, Using SAS as a Background Number Cruncher David Kiasi, Applications Alternatives, Upper Marlboro, MD

Transcription:

PharmaSUG 2013 Paper CC31 A Quick Patient Profile: Combining External Data with EDC-generated Subject CRF Titania Dumas-Roberson, Grifols Therapeutics, Inc., Durham, NC Yang Han, Grifols Therapeutics, Inc., Durham, NC ABSTRACT This paper reads the current PDF files within a directory to generate a list of subjects which need their clinical data combined with external vendor data. It creates dynamic Visual Basic script which is used to merge multiple PDFs. The VB script is then executed to produce a combined PDF with active bookmarks. SAS 9.3 and Adobe Acrobat 9 Pro were utilized to develop this program. INTRODUCTION With the increased use of electronic data capture (EDC) systems for clinical trials, it has become easier to provide a subject s entire case report form (CRF) with just a few clicks. However, this EDC-generated CRF only provides data present in the clinical database. Oftentimes, when a Medical Monitor needs to write a serious adverse event (SAE) narrative, the data collected within the EDC system does not suffice. Additional supporting information is sometimes stored in external data files, such as central lab or imaging data sets. Some benefits to using the EDC-generated include: 1. Limited programming required 2. Data presented is up-to-date 3. Access to the fields captured, audit trail and comments entered for items for end-user PARSE THE DIRECTORY We begin by defining a few user-supplied parameters, to make the code transferable between various projects. %LET profiledir=c:\pharmasug PDF\ ; %LET external=c:\pharmasug PDF\Central Lab\ ; LIBNAME clabdata "&external" ACCESS=readonly ; Since the study may have hundreds of subjects, the first step is to select only the subject(s) who need an updated patient profile. The subject CRFs from the EDC system should be stored in a specified directory. A DATA step is used to search the directory. FILENAME direct pipe "dir ""&profiledir.*.*"" " ; DATA dirlist (keep=subj_num) ; INFILE direct lrecl=200 truncover ; INPUT line $200. ; LENGTH subj_num $15 ; subj_num=upcase(scan(line,-1," ")) ; if index(subj_num,'.pdf')=0 then delete ; subj_num=scan(subj_num,1,'.') ; For processing ease and flexibility, each subject within the directory and the total number of subjects are assigned to a macro variable. Additionally, the columns needed to display from the external data set were selected and sorted to allow for desired pagination. GENERATE A TEMPORARY PDF FOR EXTERNAL DATA Some external vendors provide reports in PDF format, but access to these reports by a statistical programmer can be limited or possibly outdated. In order to circumvent delays by other parties, one solution is to generate a temporary PDF which contains the most recently transferred data from the external vendor. This is achieved by combination of the PRINT procedure and an ODS PDF statement. 1

Bookmarking is important to the end-user for navigation, therefore options PDFTOC, BOOKMARKGEN and BOOKMARKLIST are incorporated. ODS PDF file="&profiledir.\&&subj&subno. Lab.pdf" PDFTOC=1 BOOKMARKGEN=yes BOOKMARKLIST=show startpage=yes ; ODS PROCLABEL="CLAB (Central Lab Results)" ; PROC PRINT data=clab HEADING=horizontal LABEL WIDTH=min ; WHERE subjid="&&subj&subno" ; BY battrnam lbtest ; PAGEBY lbtest ; Repeat the generation of PDFs, as needed, for each subject and external data source. CREATE VISUAL BASIC CODE TO APPEND PDFS In order to append the PDFs, SAS needs to interact with Adobe using OLE automation. Programmatically, this is accomplished by dynamically generating a data set containing VB script and order of execution. The VB code opens the PDFs which need to be combined, then inserts then pages from the secondary PDF after the final page of the primary PDF. The method InsertPages() is important code as it contains information crucial to proper file insertion. Its syntax follows: InsertPages(nInsertPageAfter, ipddocsource, nstartpage, nnumpages, bbookmarks) where bbookmarks must be a positive number for bookmarks to be copied into the combined file. VBScripts VBOrder Dim ecrfpdfdoc 1 Dim CLABPdfDoc 1 Set ecrfpdfdoc= CreateObject("AcroExch.PDDoc") 2 Set CLABPdfDoc= CreateObject("AcroExch.PDDoc") 2 file1=ecrfpdfdoc.open("c:\pharmasug PDF\1991234.pdf") 3 file2=clabpdfdoc.open("c:\pharmasug PDF\1991234 Lab.pdf") 3 Stack = ecrfpdfdoc.insertpages(ecrfpdfdoc.getnumpages- 4 1,CLABPdfDoc,0,CLABPdfdoc.GetNumPages,1) SaveStack = ecrfpdfdoc.save(1,"c:\pharmasug PDF\1991234 Combo.pdf") 5 Table 1. Displays the contents of the dataset containing Visual Basic commands created for the sample subject. Refer to the listed reference for additional detailed information on the VB functions and their meanings. SUBMIT THE VBS FILE Once the data set has been generated, the next steps are to produce and submit a VBScript file. FILENAME vbsout "&profiledir.pdf_combine.vbs" ; DATA generate ; SET getstmt ; FILE vbsout ; PUT vbscripts ; OPTIONS XSYNC NOXWAIT ; X %unquote( %str(%') "&profiledir.pdf_combine.vbs" %str(%') ) ; The system option XSYNC is utilized to insure that X command completes execution prior to returning control back to the SAS session, while NOXWAIT dictates the command prompt window initiated by the X command automatically returns to the SAS session. 2

Display 1. Final combined PDF output To finish the process, the temporary lab files are deleted from the directory. X %unquote( %str(%' del) "&profiledir.&&subj&subno Lab.pdf" %str(%') ) ; CONCLUSION Since EDC systems have the capability of generating the entire subject CRF, the need to independently program a patient profile is limited. Incorporation of external data can be achieved by appending the data to the EDC-generated PDF with a few common blocks of programming code. REFERENCES Welch, Brandon. 2011. Combining External PDF Files by Integrating SAS and Adobe Acrobat Proceedings of the Southeast SAS User s Group Conference 2011. Raleigh, NC: Institute for Advanced Analytics, NCSU. Available at http://analytics.ncsu.edu/sesug/2011/bb15.welch.pdf. ACKNOWLEDGMENTS We would like to thank Peg Becker for providing dummy data for this paper, as well as our families for their continued support. CONTACT INFORMATION Your comments and questions are valued and encouraged. Contact the author at: Name: Titania Dumas-Roberson Enterprise: Grifols Therapeutics, Inc. Address: 79 TW Alexander, 4101 Research Commons Drive City, State ZIP: Durham, NC 27709 Work Phone: (919) 316-6153 E-mail: Titania.Dumas-Roberson@grifols.com SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. indicates USA registration. Other brand and product names are trademarks of their respective companies. 3

APPENDIX BEGIN: User-supplied parameters %LET profiledir=c:\pharmasug PDF\ ; **List storage location for EDC-generated CRFs** ; %LET EXTERNAL=C:\PharmaSUG PDF\Central Lab\ ; *** List location of data *** ; %LET lab_dt=2014-01-27 ; *** Date of external lab transfer *** ; END: User-supplied parameters LIBNAME clabdata "&external" ACCESS=readonly ; FILENAME direct pipe "dir ""&profiledir.*.*"" " ; Read all files in directory, keep list with extension.pdf DATA dirlist (keep=subj_num) ; infile direct lrecl=200 truncover ; input line $200. ; length subj_num $15 ; subj_num=upcase(scan(line,-1," ")) ; if index(subj_num,'.pdf')=0 then delete ; subj_num=scan(subj_num,1,'.') ; Assign macro variables to each subject in directory PROC SQL NOPRINT ; SELECT put( count(distinct subj_num),2.) into :totsubj from dirlist ; SELECT distinct subj_num into :subj1 - :subj%cmpres(&totsubj) from dirlist order subj_num ; CREATE table clab as select subjid, visit, visittyp, battrnam, lbtest, rptresc, rptu, rptnrlo, rptnrhi, alrtfl from clabdata.clab order subjid, battrnam, lbtest, lbdtm ; QUIT ; OPTION ORIENTATION=portrait TOPMARGIN=1in LEFTMARGIN=1in RIGHTMARGIN=1in NOCENTER NODATE NONUMBER ; ODS LISTING CLOSE ; %macro loopsubjs ; %do subno = 1 %to &totsubj ; *********** Build temporary CRF with central lab data *********** ODS PDF FILE="&profiledir.&&Subj&subno. Lab.pdf" PDFTOC=1 BOOKMARKGEN=yes BOOKMARKLIST=show STARTPAGE=yes ; title1 j=l "Study ID: TST2013-05" color=blue j=c bold bcolor=yellow "Subject &&subj&subno" ; footnote1 j=l "Data extracted on: &lab_dt" ; ***** print the actual data ***** ; ODS PROCLABEL="CLAB (Central Lab Results)" ; PROC PRINT DATA=CLAB HEADING=horizontal LABEL WIDTH=min ; title2 j=l "Dataset: CLAB (Central Lab Results)" ; WHERE subjid="&&subj&subno" ; BY battrnam lbtest ; PAGEBY lbtest ; 4

ODS PDF CLOSE ; *********** Write Visual Basic code to append PDFs *********** DATA getstmt ; DO type='ecrfpdfdoc','clabpdfdoc' ; LENGTH VBScripts $200 ; vbscripts='dim ' strip(type) ; VBOrder=1 ; vbscripts='set ' strip(type) '= CreateObject("AcroExch.PDDoc")' ; VBOrder=2 ; if type='ecrfpdfdoc' then vbscripts='file1=' strip(type) '.Open("' "&profiledir.&&subj&subno" '.pdf") ' ; else if type='clabpdfdoc' then vbscripts='file2=' strip(type) '.Open("' "&profiledir.&&subj&subno" ' Lab.pdf") ' ; VBOrder=3 ; END ; vbscripts='stack = ecrfpdfdoc.insertpages(ecrfpdfdoc.getnumpages- 1,CLABPdfDoc,0,CLABPdfdoc.GetNumPages,1)' ; VBOrder=4 ; vbscripts='savestack = ecrfpdfdoc.save(1,"' "&profiledir.&&subj&subno" ' Profile.pdf")' ; VBOrder=5 ; DROP type ; PROC SORT data=getstmt out=getstmt ; BY VBOrder ; FILENAME vbsout "&profiledir.pdf_combine.vbs" ; DATA generate ; SET getstmt ; FILE vbsout ; PUT vbscripts ; OPTIONS XSYNC NOXWAIT ; X %unquote( %str(%') "&profiledir.pdf_combine.vbs" %str(%') ) ; ***** Clean directory ***** ; X %unquote( %str(%' del) "&profiledir.&&subj&subno Lab.pdf" %str(%') ) ; %end ; %MEND loopsubjs ; %loopsubjs ; ODS LISTING ; 5