At the time of writing this, in March 2008, graphical patient profiles are a relatively new thing. But my prediction for the end of 2008 is that every pharmaceutical company will have, or will want, graphical patient profiles so that Clinical people monitoring a trial can have a frequently-updated pictorial representation of how all individual patients are doing on a drug trial as well as an overall pictue of the progress of the whole clinical trial. The idea is that a Clinical person can see, at a glance, all they need to know about a trial or any individual patient such as their demography details, their dosing, their lab results, their AEs with their start and end dates along with the severity or seriousness of these AEs, their vital signs, their concomitant medications with their start and end dates, and everything else that is needed, in an easy-to-read pictorial form with time going from left to right. Enough of words, now for pictures! See what I mean by clicking on a dummy patient profile using the link below. Before you look at it then I will explain that the top two titles are generated by the software and for licenced users, these titles will be removed.
The full explanation about the patient profiles will be given on seven pages starting with this one, and they should be read in the order given. The following page can be linked to at the bottom of the previous page. The first page (this one) will explain what RGPP is and you will be able to download it and play with it. The second page will tell you how to improve layout of demography ites. The third page will show you how to transform your data into a format that the patient profiles can use. The fourth page will give a practical demonstration of transforming CDISC data into the RGPP format (which created the example you can link to above). The fifth page will explain how you can enhance your output to include graphical legends in pop-up widows so that where you have color-coded certain things, the explanation of the colors can be made to appear. The sixth page will explain how I expect you to set up your html for viewing the patient profiles output. The seventh page will set out my vision for RGPP. You can link to these other pages below, but I must stress that it is important that you have read and understood the previous pages.
A better display of Demography details
Transforming your data for RGPP
Transforming CDISC data for RGPP
Creating graphical legends for RGPP
Html for viewing RGPP
My Vision for RGPP
Terms for RGPP Licencing and Support
Another thing about html pages is that you can hide messages behind shapes, text and pictures. If you move your cursor (mouse pointer) over a shape, text or pictures then you can see this text behind it, if there is any put there. Again, my patient profiles is aimed to fully exploit that ability. People using it will be strongly encouraged to put full detail in text form behind every object shown. So a bar that shows the period an AE lasts will give extra details about the AE such as its system organ class, its severity, whether it is considered serious or not plus any other information a clinician needs to see, providing that data is recorded. The same for Vital Signs or Lab values, even if these are shown as numeric values on the chart. The same for drug dosing. So lurking behind every representation of data, either in text or shape form, it is intended to put fuller details so that a clinician just has to "mouse over" it to get more details.
Now before we leave this section I would ask you to click on the dummy patient profile above and mouse over the shapes and values displayed. Apart from the demography details, all the other text values shown in the timescale region and the shapes have more text behind it. Mouse over each one and you will see.
The graphical patient profiles is aimed for viewing and not for printing. If it is printed out then not only will it be less clear but the information hiding behind the values will be lost. So this is not something to be printed and faxed to somebody. Instead, you can email the html page and its related gif to people who need to see it. They will then have the full "picture" and be able to see the text behind the values as well. Remember that html format is easy to distribute. People don't have to be logged onto a server to see it because you can email it to them. But, of course, you should treat this sort of information as confidential and be careful who you send it to.
There will be a dataset with only one observation in it that contains the style settings for the patient profiles that controls the general layout and colors and the default scale spacing to use. This dataset is named rgpp_style. This dataset has many variables and takes a while to set up but once set, can be used without change on all clinical trials. It holds the unchanging values that dictate the patient profiles layout style that is intended for use throughout an organisation without alteration. If you are used to using sas macros then you should think of this dataset as a "macro parameter dataset". In fact, the contents of this dataset will be converted to effective macro parameters by the patient profiles.
There will be a dataset with only one observation in it that contains the global values for a run of the graphical patient profiles. You would put the name of the patient variable in this, the folder destination for the html pages and gif files produced and the scale you want to display. This dataset is named rgpp_global. If you are used to using sas macros then you should think of this dataset as a "macro parameter dataset". In fact, the contents of this dataset will be converted to effective macro parameters by the patient profiles.
There will be a dataset with one observation per patient (subject). This will contain the subject identity, the html file name, the gif image name and the start and end days for the data you want selected for a patient and the start and end days to show on the scale. This dataset is named rgpp_patients.
Lastly, there is the data you want to display. There will be multiple observations per patient. This dataset should be is named rgpp_data.
In the following sections, the structure of each of these datasets will be explained.
You can tailor the display of the patient profiles to get it to look how you want. You can choose colors and fonts. You can choose the size of the html page. You can choose how much of it you want to use for the time display area and how much to leave for text on the left. What I will say at this point is that you are required to choose some colors and because of the way sas works, your color names must not be more than eight characters long. This does not mean you are limited to colors with names that are eight characters long or less. Any and every color in existence can be referred to as an eight character name once you know how. So if you wanted to use AntiqueWhite as a background then you can use it. If you wanted to use DarkSlateBlue as the default text color then you can use that as well. You just have to find out how to refer to these colors by an eight character code and use that instead. This involves a bit of study so I have written a page on this that explains it all very clearly that you can link to below. It will open in a new window. Keep referring to that page to become expert on choosing colors for your sas html displays.
Assuming you can choose whatever color you like and refer to it by an eight character name (or less) I will continue with the description of the rgpp_settings dataset. What you will see below is an example of it with settings filled in. Note that this is sas code you can use. You can changes the settings but you must not change the length of the variables or change their type. The variable declarations must not be changed. Just their values. And you must make sure that numeric variables and given numeric values and character variable are given character values that do not exceed the allowed length.
Note that some of the numeric variables used are of the True/False type and should only be given the numeric value "0" or "1". 0=False, 1=True.
Note that fonts declared below that are non-sas internal fonts must be specified inside single quotes that in turn are contained in double quotes. You are not seeing double!
All heights are in "cells", if you know "goptions" and annotate datasets. The patient profiles uses the cell reference system, rather than percentages. This is the sas default. Using cells is much better for "long" pages such patient profile html pages.
This first dataset, with only one observation, has a lot of variables.
It dictates the style you want for the patient profiles output. Once this
dataset is created correctly it is intended to be used without change for
the forseeable future. You can always store this dataset somewhere, call
it with a "set" statement and override individual values in your code if
you need to.
| data sasuser.rgpp_style;
*- This is the version 4.0 template for the RGPP style dataset. -; *- The version of this dataset should match the version of RGPP -; *- you are using which will be displayed in the log if you call -; *- the macro with a positional parameter value set like this: -; *- %rgpp(xxx) -; *- Note that the above call only gives you information about -; *- the macro and does not do any processing of data. Do not use -; *- the word "check" (unquoted) for this call as this is for -; *- checking input datasets in addition to providing information -; *- about the macro. -; *- Whether you want a border drawn around your output. The
only -;
RETAIN border "noborder"; /* new in version 2.0 */ *- Whether you want the html output to be transparent to
the -;
RETAIN transparency "notransparency"; /* new in version
2.0 */
*- Note that ALL COLORS ARE LIMITED TO 8 CHARACTERS except
for cback. -;
*- Do not change any of these variable names or their characteristics
-;
*- Note that ALL VARIABLES MUST BE SET to mon-missing values.
-;
*- Size of html output with number of rows and columns. -;
*- Start and end hpos positions for date area. The maximum
-;
*- Colors of the stripes across the date area -;
*- Backgound color. This can be up to 32 characters long.
-;
*- Font, color and height of text displayed on the left of
the date area -;
*- Height, font and default color of the text to use when
text values -;
*- Maximum upper case and mixed case letters that you know
will -;
*- Font, color, height and background color of Patient top-of-page
title -;
*- Font, color, height and background color of block titles
-;
*- color, height and width of block description background
-;
*- Whether to draw a box around each block of information
displayed -;
*- Height, color and font of the time scale to draw if this
is requested. -;
*- Whether the time ticks on the scale should be uniformly
spaced. -;
*- Whether to use arrow heads to point to start or end day
values -;
*- Height and color of the figures. Height is effectively
the -;
*- This is the minimum width in hpos values that you want
for -;
*- hposmingap is a control used when you are displaying text
-;
run;
|
| data rgpp_global;
*- This is the version 4.0 template for the RGPP global dataset. -; *- Do not change any of these variable names or their characteristics. -; length patvar $ 32 webout scale $ 200; *- Name of the unique patient identifier variable present
-;
*- Destination folder for the html files and gif files -;
*- Set this to your scale you want to show on the time axis.
They should be pairs -;
*- write out the contents of "patvar" to a macro variable
of the same name -;
|
The code you see below is there to help you. It lists the variables
the patient profiler needs and describes them. You need your subject
variable as well, as described in the code. It is not the complete code.
You will need a "set" statement for whatever dataset of patients you have
got and you will maybe merge with a dataset (or two) of day values you
need. How you do this is entirely up to you. The important thing is that
the patient profiler gets the variables it needs with specific names and
characteristics.
| data rgpp_patients;
*- This is the version 4.0 template for the RGPP patients dataset. -; *- Do not change any of these variable names or their characteristics. -; *- This list of variables does not include the subject variable -; *- defined in rgpp_global and you should ensure that this subject -; *- variable is also present on this dataset and added to the "keep" -; *- list you will find below. -; length htmlfile $ 64 gifname $ 8 minscaleday mindataday maxdataday maxscaleday 8 ; *- Note that "&patvar" will be assigned when rgpp_global
is created -;
*- "htmlfile" will be the name of the html file created.
Do not put -;
*- "gifname" can only be eight characters long. You must
ensure that -;
*- "minscaleday" is the lowest day to show on the scale for this patient -; *- "mindataday" is the lowest day for accepting data for
this patient. -;
*- "maxscaleday" is the highest day to show on the scale for this patient -; *- "maxdataday" is the highest day for accepting data for
this patient. -;
/***************
run;
|
Once you get used to it, coding this dataset will become easy. The real hard work will be in setting up the variable itemhtml. Each and every item you display on the time scale (not "demog" type of data which does not have a day associated with it) should have a text box that appears when you mouse over it that states what the value is, what the parameter or type of measure is, the units, the days since first dose and maybe many other things. It is important to repeat whatever information is implicit for its position on the day scale. Even if you were displaying the value "98.4°F" as text then you would still need to have this value in your box that appears when you mouse over it.
To help you code this dataset faster, you are allowed to have missing
values for things like "citemtext" and "hitemtext". In this case, the patient
profiler will use the defaults defined in the rgpp_style dataset.
| %macro dclvars;
*- This is the version 4.0 template for the RGPP data dataset. -; *- Do not change any of these variable names or their characteristics. -; *- This list of variables does not include the subject variable -; *- defined in rgpp_global and you should ensure that this subject -; *- variable is also present on this dataset and added to the "keep" -; *- list you will find below. -; LENGTH blockisdemog blockismsg blockscale 8
*- Note that "&patvar" will be assigned when rgpp_global
is created -;
data rgpp_data; %dclvars *- Below is a "retain list" to help you. You will declare
all the -;
RETAIN blockisdemog 0 blockismsg 0 blockscale 1
*- "blockisdemog" is set to 1 if what is contained within
the block is -;
*- "blockismsg" is set to 1 if what is contained within the
block -;
*- "blockscale" is set to 1 if you want to display the day
scale -;
*- For "blockhtml" refer to "itemhtml" for how to construct
this. -;
*- "itemhtml" should be set for each and every item you want
to -;
/********
*- "blockseq" is the block sequence number used for sorting
the -;
*- "itemseq" is the item sequence number used for sorting
the -;
*- "blockdesc" is the block description that will get displayed
-;
*- "itemdesc" is the item description that will get displayed
-;
*- "citemdesc", if blank, will default to the color defined
in -;
*- "hitemdesc", if missing, will default to the height defined
-;
*- "fitemdesc", if left missing, will default to the font
-;
*- "itemtext" is the text, such as the value of a vital signs
-;
*- "citemtext", if blank, will default to the color defined
in -;
*- "citemline", if blank, will default to the color defined
in -;
*- "witemline", if missing, will default to the width defined
-;
*- "mitemfill" is the "map" pattern to fill the drawn shapes
-;
*- "hitemtext", if left missing, will default to the height
-;
*- "fitemtext", if left missing, will default to the font
-;
*- "day1" is start day of event calculated as days since
first -;
*- "day2" is end day of event calculated as days since first
-;
*- "pctdata1" acts like "day1" except it places your item
in a -;
*- "pctdata2" is the "day2" equivalent of "pctdata1" and
-;
*- "day1_imp" is the flag that tells the patient profiler
if -;
*- "day2_imp" is the flag that tells the patient profiler
if -;
|
When you use stored macros you have to set some system options. This is explained in the official sas documentation. The key options are MSTORED, which tells sas that you will be using stored macros, and SASMSTORE=, which tells sas the catalog the stored macro(s) reside in. If you already have a macro catalog then you can copy my macro from its own catalog into your catalog.
When you are ready to run, you have to make sure the 4 datasets are
present and correct and that the output folder (that you defined in rgpp_global)
actually exists and is ready to receive the created html and gif files
and they you run the %rgpp macro like in the following very simplified
case.
| libname _mstore "C:\my\macrostore";
options mstored sasmstore=_mstore; data rgpp_style;
data rgpp_global;
data rgpp_patients;
data rgpp_data;
%rgpp libname _mstore clear; |
| *- Assign the macro store library and set options to use it -;
libname _mstore "C:\mstored" access=readonly; options mstored sasmstore=_mstore; *- Run the code on the web site to create rgpp_style in your sasuser
library -;
data rgpp_global;
*- Note that "&patvar" will be assigned when rgpp_global is
created -;
data rgpp_data;
*- Note that "&patvar" will be
assigned when rgpp_global is created -;
RETAIN blockisdemog 0 blockscale 0 &patvar "1234-001-0001"
blockseq=1;
itemseq=2;
itemseq=3;
blockseq=2;
day1=7;
day1=14;
day1=30;
day1=54;
blockseq=3;
itemseq=1;
blockseq=4;
itemseq=1;
itemseq=2;
itemseq=3;
run; %rgpp;
|
You can see the output here
Please take time to play with RGPP. The more you play with it,
the more you will understand the way it works and the more uses you will
find for it. Remember my quote, "RGPP is really a graphics rendering
macro". After you have run the following code for yourself, I hope
you will be closer to realizing that. Two patient's AE data will be displayed
on the same page when you run the code below. I have been lazy and made
the patients AEs the same, but you can see what I mean, I hope!
| *- Assign the macro store library and set options to use it -;
libname _mstore "C:\mstored" access=readonly; options mstored sasmstore=_mstore; *- Run the code on the web site to create rgpp_style in your
sasuser library -;
data rgpp_global;
*- Note that "&patvar" will be assigned when rgpp_global is
created -;
data rgpp_data;
*- Note that "&patvar"
will be assigned when rgpp_global is created -;
RETAIN blockisdemog 0 blockismsg 0 blockscale 0 studyid
"Study 1234"
blockseq=1;
blockseq=2;
blockseq=3;
run; %rgpp;
|
If you can't run the code, you can link to the output it created here.
A better display of Demography details
Go back to the home page.
E-mail the macro and web site author.