/*------------------------------------------------------------* 
* program:     cdisc68.sas                                    * 
* Description: Case #68. Clinically Significant Lab For LB domains, this identifies *
*              a Sponsor-provided Flag Variable for 'Clinically Significant Lab'*
*              where the derivation can't be executed.* 
* By:          Sy Truong, 10/14/2009                          * 
*-------------------------------------------------------------*/
libname templib '../data';
data templib.lb(label="Laboratory Data");
attrib STUDYID length=$7 label="Study Identifier";
attrib DOMAIN length=$2 label="Domain Abbreviation";
attrib USUBJID length=$14 label="Unique Subject Identifier";
attrib LBSEQ length=8 label="Sequence Number";
attrib LBREFID length=$7 label="Specimen ID";
attrib LBTESTCD length=$7 label="LAB Test or Examination Short Name";
attrib LBTEST length=$22 label="LAB Test or Examination Name";
attrib LBCAT length=$10 label="Category for Lab Test";

attrib LBORRES length=$8 label="Result or Finding in Original Units";
attrib LBORRESU length=$7 label="Original Units";

attrib VISITNUM length=8 label="Visit Number";
attrib VISIT length=$7 label="Visit Name";
attrib VISITDY length=8 label="Planned Study Day of Visit";
attrib LBDTC length=$16 label="LBDTC";
attrib LBDY length=8 label="Study Day of Specimen Collection";

attrib LBDTC label="Date/Time of Specimen Collection" length=$20;
attrib LBENDTC label="End Date/Time of Specimen Collection" length=$50;
attrib LBCLSIG label="Clinically Significant Lab" length=$50;

STUDYID="CDISC01";
DOMAIN="LB";
USUBJID="CDISC01.100008";
LBSEQ=1;
LBREFID="B232115";
LBTESTCD="BILI";
LBTEST="Bilirubin";
LBCAT="Chemistry";
LBORRES="0.4";
LBORRESU="MG/DL";

VISITNUM=1;
VISIT="SCREEN";
VISITDY=-13;
LBDTC="2003-04-15T11:20";
LBDY=-14;
LBDTC='12/09/2009';
LBENDTC="12/09/2009";
LBCLSIG="001";
output;
STUDYID="CDISC01";
DOMAIN="LB";
USUBJID="CDISC01.100008";
LBSEQ=2;
LBREFID="B290028";
LBTESTCD="BILI";
LBTEST="Bilirubin";
LBCAT="Chemistry";
LBORRES="";
LBORRESU="";

VISITNUM=10;
VISIT="WEEK 24";
VISITDY=169;
LBDTC="2003-10-13T11:55";
LBDY=168;
LBDTC='12/09/2009';
LBENDTC="12/09/2009";

output;
STUDYID="CDISC01";
DOMAIN="LB";
USUBJID="CDISC01.100008";
LBSEQ=3;
LBREFID="B232115";
LBTESTCD="BUN";
LBTEST="Blood Urea Nitrogen";
LBCAT="Chemistry";
LBORRES="20";
LBORRESU="MG/DL";

VISITNUM=1;
VISIT="SCREEN";
VISITDY=-13;
LBDTC='12/09/2009';
LBENDTC="12/09/2009";
LBDY=-14;
output;
STUDYID="CDISC01";
DOMAIN="LB";
USUBJID="CDISC01.100008";
LBSEQ=4;
LBREFID="B290028";
LBTESTCD="BUN";
LBTEST="Blood Urea Nitrogen";
LBCAT="Chemistry";
LBORRES="18";
LBORRESU="MG/DL";

VISITNUM=10;
VISIT="WEEK 24";
VISITDY=169;
LBDTC="2003-10-13T11:55";
LBDY=168;
LBDTC='12/09/2009';
LBENDTC="12/09/2009";

output;
run;
%cdisc(datlib=templib,datname=lb);
