A Dynamic SAS/IntrNet Example with Help of ASP and JavaScript: Online Clinical Trial Randomization List Generator



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

INTRODUCTION WHY WEB APPLICATIONS?

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

Dynamic Web-Enabled Data Collection

Building a Customized Data Entry System with SAS/IntrNet

Government Girls Polytechnic, Bilaspur

ecommercesoftwareone Advance User s Guide -

NMDS-V APPLICATION GOALS

WOW! YOU DID THAT WITH SAS STORED PROCESSES? Dave Mitchell, Solution Design Team, Littleton, Colorado

TECHNIQUES FOR BUILDING A SUCCESSFUL WEB ENABLED APPLICATION USING SAS/INTRNET SOFTWARE

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

How to Create Dynamic HTML and Javascript using your Data Jennifer Sinodis, Bank One, Phoenix, AZ

ABSTRACT TECHNICAL DESIGN INTRODUCTION FUNCTIONAL DESIGN

Project Request and Tracking Using SAS/IntrNet Software Steven Beakley, LabOne, Inc., Lenexa, Kansas

A Complete Guide to HTML Form Output for SAS/IntrNet Developers Don Boudreaux, SAS Institute Inc., Austin, TX

ABSTRACT INTRODUCTION %CODE MACRO DEFINITION

HTML Form Widgets. Review: HTML Forms. Review: CGI Programs

Web Reporting by Combining the Best of HTML and SAS

Novell Identity Manager

Applications Development. Paper 28-27

The Basics of Dynamic SAS/IntrNet Applications Roderick A. Rose, Jordan Institute for Families, School of Social Work, UNC-Chapel Hill

Real SQL Programming 1

Viewing Form Results

Applicatons Development. Paper 44-26

Developing an On-Demand Web Report Platform Using Stored Processes and SAS Web Application Server

Hands-On Workshops HW003

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

InPost UK Limited GeoWidget Integration Guide Version 1.1

Using Pharmacovigilance Reporting System to Generate Ad-hoc Reports

JAVASCRIPT AND COOKIES

PharmaSUG Paper QT26

Chapter 13 Computer Programs and Programming Languages. Discovering Computers Your Interactive Guide to the Digital World

SAS Add in to MS Office A Tutorial Angela Hall, Zencos Consulting, Cary, NC

Product: DQ Order Manager Release Notes

Yandex.Widgets Quick start

USING MYWEBSQL FIGURE 1: FIRST AUTHENTICATION LAYER (ENTER YOUR REGULAR SIMMONS USERNAME AND PASSWORD)

PHP Tutorial From beginner to master

This matches a date in the MM/DD/YYYY format in the years The date must include leading zeros.

Labels, Labels, and More Labels Stephanie R. Thompson, Rochester Institute of Technology, Rochester, NY

JavaScript: Introduction to Scripting Pearson Education, Inc. All rights reserved.

Microsoft Dynamics GP. SmartList Builder User s Guide With Excel Report Builder

Technical University of Sofia Faculty of Computer Systems and Control. Web Programming. Lecture 4 JavaScript

by Jonathan Kohl and Paul Rogers 40 BETTER SOFTWARE APRIL

WIRIS quizzes web services Getting started with PHP and Java

Chapter 12 Programming Concepts and Languages

Tutorial 6 Creating a Web Form. HTML and CSS 6 TH EDITION

You have got SASMAIL!

Web Pages. Static Web Pages SHTML

Amman Jordan Mob: Tel:

Adventures in Building Web Applications: A Tutorial on Techniques for Real-World Applications

Jolly Server Getting Started Guide

SQL Injection for newbie

CS412 Interactive Lab Creating a Simple Web Form

Custom Javascript In Planning

Books-by-Users Web Development with SAS by Example (Third Edition) Frederick E. Pratter

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

Paper PO06. Randomization in Clinical Trial Studies

Importing Excel Files Into SAS Using DDE Curtis A. Smith, Defense Contract Audit Agency, La Mirada, CA

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

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

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

Client-side Web Engineering From HTML to AJAX

Creating Dynamic Web Based Reporting

Example. Represent this as XML

JavaScript and Dreamweaver Examples

Guido s Guide to PROC FREQ A Tutorial for Beginners Using the SAS System Joseph J. Guido, University of Rochester Medical Center, Rochester, NY

Design Approaches of Web Application with Efficient Performance in JAVA

Retrieving Data Using the SQL SELECT Statement. Copyright 2006, Oracle. All rights reserved.

Spambrella SaaS Encryption Enablement for Customers, Domains and Users Quick Start Guide

Post Processing Macro in Clinical Data Reporting Niraj J. Pandya

Embedded Special Characters Kiran Karidi, Mahipal Vanam, and Sridhar Dodlapati

Working with forms in PHP

c. Write a JavaScript statement to print out as an alert box the value of the third Radio button (whether or not selected) in the second form.

Decision Modeling. An Introductory Workshop. With. Corticon Studio for Analysts 6/14/2013. Mike Parish

<option> eggs </option> <option> cheese </option> </select> </p> </form>

Hands-On Workshops. HW009 Creating Dynamic Web Based Reporting Dana Rafiee, Destiny Corporation, Wethersfield, CT OVERVIEW OF SAS/INTRNET SOFTWARE

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

Lab 4.4 Secret Messages: Indexing, Arrays, and Iteration

Automating SAS Macros: Run SAS Code when the Data is Available and a Target Date Reached.

HTML Forms and CONTROLS

Paper Dynamic Data Retrieval Using SAS/IntrNet

Evaluation of Open Source Data Cleaning Tools: Open Refine and Data Wrangler

Building a Web Based EIS for Data Analysis Ed Confer, KGC Programming Solutions, Potomac Falls, VA

Tales from the Help Desk 3: More Solutions for Simple SAS Mistakes Bruce Gilsen, Federal Reserve Board

Cache Configuration Reference

Java Server Pages and Java Beans

Creating a Simple Macro

JOB POSTING & RESUME SEARCH INSTRUCTIONS.

How to make a good Software Requirement Specification(SRS)

Using SAS/IntrNet as a Web-Enabled Platform for Clinical Reporting

9.1 SAS. SQL Query Window. User s Guide

Click-To-Talk. ZyXEL IP PBX License IP PBX LOGIN DETAILS. Edition 1, 07/2009. LAN IP: WAN IP:

JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK

Using Database Metadata and its Semantics to Generate Automatic and Dynamic Web Entry Forms

Clinical trials management on the internet II. Using LATEX, PostScript, and SAS to produce barcode label sheets

Form Validation. Server-side Web Development and Programming. What to Validate. Error Prevention. Lecture 7: Input Validation and Error Handling

3M Information Technology

Fig (1) (a) Server-side scripting with PHP. (b) Client-side scripting with JavaScript.

PHP Authentication Schemes

Generic Automated Data Dictionary for Any SAS DATA Set or Format Library Dale Harrington, Kaiser Permanente, Oakland, CA

Transcription:

Paper CC03 A Dynamic SAS/IntrNet Example with Help of ASP and JavaScript: Online Clinical Trial Randomization List Generator Sijian Zhang 1, Mark Carpenter 2, Michael Windle 1 1. University of Alabama at Birmingham, AL 2. University of Alabama, AL Abstract In programming for interactive SAS Internet services, there are two important issues that programmers have to deal with. One is dynamically passing the parameters from web page to SAS program; anther is the validation of the input values. SAS macro programming can handle the first one very well. However, for the validation issue, although it can be accomplished by SAS/IntrNet solely, the programming in other languages can be easier and more efficient. By taking a practical example of an interactive SAS/IntrNet application, the Online Clinical Trial Randomization List Generator, we demonstrate the methods and skills of how to use SAS macro programs to handle the parameter passing dynamically, and how to integrate ASP and JavaScript with SAS/IntrNet tasks to make the programming simple and enhance the performance efficiency of the SAS/IntrNet applications. Keywords: SAS/IntrNet, ASP, JavaScript, clinical trial, randomization, dynamic, efficiency Introduction SAS/IntrNet is the component for SAS to vender its output to the Internet. Since Internet is now very popular, and the accessibility is not a problem for ordinary people, the advantages of IntrNet services become obvious. On the end user side, they need not install the SAS software on their computers, need not to understand the SAS programming, and even need not to aware what they get on their browsers are generated from SAS programs; and on the programmer side, it is easy to maintain the applications and powerful to offer a service to multiple users at the same time. When the web service is dynamic, it will involve an interactive process in which end users will enter certain parameters to get the customized results. However, if the values of the parameters are invalid or out of range, the SAS program may stop due to error or generate incorrect results. To avoid this kind of mistakes, close ended style data entry and validation checking are commonly used. Since IntrNet works only on the server side, it is not efficient to handle some of these, especially if there involve many interactive steps that the validation for each step depends on the inputs of previous entries. It means many communications between the browser and the server. If some of the validations can be done at the browser, it will alleviate the burden on the server and make services more efficient. In terms of programming for this purpose, other commonly used user and server side programs are easier and more efficient than IntrNet. This article uses an example to demonstrate how to build an efficient SAS/IntrNet application with help of ASP and JavaScript. Online Clinical Trial Randomization List Generator First, let s take a look at this dynamic SAS/IntrNet application. One thing that must be ready before starting a clinical trial is the randomization list. The Online Clinical Trial Randomization List Generator can produce the randomization lists online given the values of some parameters, such as total sample size, names of treatments, number of treatments, ratio of treatments, whether it is blocked, block size if blocked, whether it is by study site, number of sites if by study site, sample size for each site, seed, etc. For a simple instance: total sample size = 20, two treatments (drug : placebo = 1:1), blocked (block size = 4), randomized by site, 2 study sites, sample size for Site 1 is 8, sample size for Site 2 is 12, and seed = 15273. Figure 1 shows the page that collects the basic information for the randomization. Based on the number of treatments and number of study sites, two tables dynamically appear on the following page (see Figure 2). And on the same page, the block size options will be changed dynamically according to the treatment ratio. After pressing Submit button on Figure 2, the randomization list will come to the user s browser immediately (see Figure 3). Figure 1.

Figure 2. Figure 3. SAS Code Focus 1. Receiving Macro Variables Dynamically From Web Form IntrNet uses macro variables to pass parameter values. It is easy to handle single macro variable as we usually do, like in Code 1. A clinical trial often has multiply study sites, and each of them may have different sample size. The %do loop should be used to set the right number of macro variables dynamically according to the individual requests (see Code 2). One thing that should be noted in Code 2 is the macro key word %global. Since %do loop can be only used within a macro, the scope of the macro variables created in that macro cannot go beyond that macro. So in order to use those macro variables in other part of SAS code, you need to declare them global using %global. Code 1: * number of study sites; %let sitenum=&sitenum_; Code 2: * assign sample size for each study site; %macro get_site_size; %do i=1 %to &sitenum; %global site&i.size; %let site&i.size=&&site&i.size_; %end; %mend get_site_size; 2. Macro Variable Value Validation If a value entered is not validated on the client side, it should be checked on the server side. For instance, the default value for subject ID start number is 1000. But users may enter whatever they want. In order to make sense to final output, certain limit should be set to it, like in Code 3. Code 3: * assign the start subject ID; %let startnum=&startnum_; %macro check_start_num; %if &startnum_<0 &startnum_>1000000 %then %let startnum=0; %mend check_start_num;

3. Block Randomization The core part of the background SAS code is the procedure, Proc Plan, which plays the roll of a randomization sequence generator, see Code 4. Code 4: * randomization within block; %macro ran_block(blocknum);... %if &seed= %then %do; proc plan; factors N=&blockSize / noprint; output data=one out=two; run; %end; %else %do; proc plan seed=%eval(&seed+&blocknum); factors N=&blockSize / noprint; output data=one out=two; run; %end;... %mend ran_block; According to whether the macro variable seed has value or not, Proc Plan will use system time or predefined value as the randomization seed. The difference is that using system time will give the user different output every time the user runs the program, while a specific seed will give the same output no matter how many times the user runs the program, which is recommended. In dataset One, a block has been set up according to the block size. After randomized by Proc Plan, the subjects in the block are in a randomized sequence and result is output as dataset Two. 4. ODS to Browser The ODS statements that send the output from server to browser are simple, see Code 5. Code 5: ODS HTML BODY=_WEBOUT(DYNAMIC TITLE='Randomization List Generator') RS=NONE;... SAS Code... ODS HTML CLOSE; _WEBOUT destination and DYNAMIC option are used to generate dynamic web content. TITLE option gives the title of the browser. RS is the alias for the ODS option RECORD_SEPARATOR, which specifies an alternative character or string that separates lines in the output files. RS=NONE option is required when writing content to the _WEBOUT fileref. ASP and JavaScript Code Point Because the two web pages that collect randomization parameter information do not involve any data related contents, there is no advantage to use SAS/IntrNet to generate them. If you insist using SAS/IntrNet, the additional thing you need to do is to add some overheads, like DATA _NULL_ and many PUT statements. Since those two web pages have the dynamic contents and are required to validate some values, ASP and JavaScript can offer good help here. ASP, active server pages, is a server side program that combines HTML and script logic. It is free on IIS server, and is supported by Sun Java System Active Server Pages 4.0 on other servers. asp is the extension of the program files. JavaScript is a common client side program. The following three pieces of code will give you a sense how they can help for some applications. 1. ASP In order to get the right number of table rows for site sample size entry, Code 6 is embedded in the code generating the second web page. Say you have 10 study sites, sitenum=10. When you submit, this code will loops 10 times on the

server and generates the HTML code as Code 7 which is sent to client. This part will be displayed on the browser as in Figure 4. Code 6: <% for i=1 to Request.QueryString("siteNum") %> <tr> <td width="50%" align="center"> <%=i%> <td align="center"> <input type="text" name="site<%=i%>size"> </tr> <% next %> Code 7: <tr> <td width="50%" align="center"> 1 <td align="center"> <input type="text" name="site1size"> </tr> <tr> <td width="50%" align="center"> 10 <td align="center"> <input type="text" name="site10size"> </tr> Figure 4. 2. JavaScript Code 8 will give a warning message when the user clicks on buttons for the first scenario on Figure 1 if the total sample size is less than 1 or the number of treatments is less than 1 or the total sample size is less than the number of

treatments. Using this kind of functions, we can dramatically reduce the errors caused by wrong entries. This is much more efficient by doing checking on the user s machine other than sending the parameters to the web server that may forward them to another SAS server to do the checking. Code 8: <SCRIPT LANGUAGE="JavaScript"><!-- function onsubmitform() { if (document. form1.treatnum.value < 2 document. form1.treatnum.value>document. form1.tss.value) alert("the total sample size must not less than the number of study treatments which is at least 2."); else return true; return false; } //--></SCRIPT> 3. ASP and JavaScript ASP and JavaScript can work hand in hand to make programmer s life easier. Code 9 shows how the convenience button, Equal, is set up in Figure 4. The function for the Equal button is that it will enter all the site sample sizes automatically if all the site sample sizes are equal. If there are many study sites, this button will make users feel good by clicking on it. Code 9: <SCRIPT LANGUAGE="JavaScript"><!-- function equalsize() { <% for i=1 to Request.QueryString("siteNum") %> document.form2.site<%=i%>size.value=math.round(<%=request. QueryString("TSS")%>/<%=Request.QueryString("siteNum")%>); <% next %> } //--></SCRIPT> For instance, the total sample size is 200 and the number of study sites is 10, pressing the Equal button on Figure 4 will generate the following HTML code, Code 10, and the result of this code is that every blank will be filled with 20 in Figure 4. Code 10: <SCRIPT LANGUAGE="JavaScript"><!-- function equalsize() { document.form2.site1size.value=math.round(200/10); document.form2.site2size.value=math.round(200/10); document.form2.site10size.value=math.round(200/10); } //--></SCRIPT> Summary SAS/IntrNet is a wonderful bridge connecting SAS platform and Internet. By using it, SAS programmer can offer SAS online services. To take the full advantages of this bridge, we may also need good ramps, traffic lights and signs. Programs, such as ASP, JSP, JavaScript, VBScript, and so on, are candidates for good helpers. For most of the time, IntrNet can do the same thing as other server side programs, but others could be easier for the parts without data processing components. In terms of client side programming, script languages are the tools that should be used. As demonstrated in this example, for some interactive SAS online projects, the integration of all these programming skills not only satisfies the customers with quality services, but also makes the programming job more interesting.

Reference 1. A GUI system for the generation of clinical trial randomization plans for collaborative multi-institute clinical trials (A SAS/AF application). Sijian Zhang, Mark Carpenter. The 13th Annual Southeast SAS Users Group Conference. Savannah, September, 2002. Proceedings, 271-273 2. SAS web tools: static and dynamic solutions using SAS/IntrNet software course notes. SAS Institute Inc. Contact Information Sijian Zhang, MS Database Analyst Data Management and Statistical Analysis Unit Center for the Advancement of Youth Health University of Alabama at Birmingham 912 18th Street South Birmingham, AL 35294 Phone: (205) 975-0365 Fax: (205) 975-9494 Email: sijian@uab.edu SAS and all other SAS Institute Inc. product or service names are registered trademark or trademarks of SAS Inc. in the USA and other countries. indicates USA registration. Other brand and product names are trademarks of their respective companies.