FOCUS AREAS

Graphics

adverse effects plot
Base SAS: ODS Graphics Procedure: SGPLOT

%let gpath='.';
%let dpi=100;

/*--Attribute Maps--*/
data attrmap;
  retain id 'Severity';
  length value $9 fillcolor $ 15;
  input value fillcolor;
  datalines;
MILD      lightgreen
MODERATE  yellow
SEVERE    red
;
run;

/*--AE Timeline data--*/
data AETimeline;
  length lowcap $12;
  length highcap $12;
  attrib aestdate informat=yymmdd10. format=yymmdd10.;
  attrib aeendate informat=yymmdd10. format=yymmdd10.;
  input  aeseq aedecod $ 5-39 aesev $ aestdate aeendate aestdy aeendy lowcap $ highcap $;
  datalines;
.   Dummy                               MILD               .  .              .        .   None   None
.   Dummy                               MODERATE           .  .              .        .   None   None
.   Dummy                               SEVERE             .  .              .        .   None   None
1   DIZZINESS                           MODERATE  2013-03-06  2013-03-06     3        3   None   None
2   COUGH                               MILD      2013-03-20  .             17        .   None   None
3   APPLICATION SITE DERMATITIS         MILD      2013-03-26  2013-06-18    23      107   None   None
4   DIZZINESS                           MILD      2013-03-27  2013-03-27    24       24   None   None
5   ELECTROCARDIOGRAM T WAVE INVERSION  MILD      2013-03-30  .             27        .   None   None
6   DIZZINESS                           MILD      2013-04-01  2013-04-11    29       39   None   None
7   APPLICATION SITE DERMATITIS         MODERATE  2013-03-26  2013-06-18    23      107   None   None
8   HEADACHE                            MILD      2013-05-17  2013-05-18    75       76   None   None
9   PRURITUS                            MODERATE  2013-05-27  2013-06-18    85      107   None   None
;
run;

/*--Add End Caps to AE Timeline data--*/
data AETImelineCap;
  set aetimeline;
  label aesev='Severity';
  if aeendate = . then do;
     aeendate='18Jun2013'd;
     aeendy=107;
     highcap='FilledArrow';
  end;

ods html close;

/*--Adverse Event Timeline--*/
ods listing gpath=&gpath image_dpi=&dpi;
ods graphics / reset attrpriority=none width=5in height=3.75in 
    imagename='AETimeline';
title 'Adverse Event Timeline for Patient xxxxxxxx';
proc sgplot data=AETimelinecap dattrmap=attrmap;
  highlow y=aeseq low=aestdate high=aeendate / type=bar group=aesev 
    lineattrs=(color=black thickness=2) labelattrs=(color=black size=7) 
    barwidth=0.8 lowlabel=aedecod highcap=highcap attrid=Severity;
  xaxis grid display=(nolabel) valueattrs=(size=8);  
  yaxis grid display=(noticks novalues nolabel);
  run;

title;