/*------------------------------------------------------------* 
* program:     cdisc62.sas                                    * 
* Description: Case #62. Time Reference Null For All (Timing) variables, this identifies records that violate *
*              the condition [Time Point Reference is not null], limited to records *
*              where [Elapsed Time from Reference Point is not null].* 
* By:          Sy Truong, 10/14/2009                          * 
*-------------------------------------------------------------*/
libname templib '../data';
data templib.mh(label="Medical History");
attrib STUDYID length=$7 label="Study Identifier";
attrib DOMAIN length=$2 label="Domain Abbreviation";
attrib USUBJID length=$14 label="Unique Subject Identifier";
attrib MHSEQ length=8 label="Sequence Number";
attrib MHTERM length=$169 label="Reported Term for the Medical History";
attrib MHCAT length=$28 label="Category for Medical History";
attrib MHPRESP length=$2 label="Medical History Event Pre-Specified";
attrib MHOCCUR length=$2 label="Medical History Occurrence";
attrib MHBODSYS length=$23 label="Body System or Organ Class";
attrib MHDTC length=$10 label="Date/Time of History Collection";
attrib MHSTDTC length=$10 label="Start Date/Time of Medical History Event";
attrib MHENDTC label="End Date/Time of Specimen Collection" length=$10;
attrib MHENRF length=$30 label="End Relative to Reference Period";
attrib MHTPTREF label="Planned Time Point Number" length=4;
attrib MHELTM label="Planned Time Point Name" length=$4;

STUDYID="CDISC01";
DOMAIN="MH";
USUBJID="CDISC01.100008";
MHSEQ=1;
MHTERM="ARTHRITIS";
MHCAT="MEDICAL AND SURGICAL HISTORY";
MHPRESP="";
MHOCCUR="";
MHBODSYS="Musculoskeletal";
MHDTC="2003-04-15";
MHSTDTC="1996";
MHENDTC="1997";
MHENRF="DURING/AFTER";
MHTPTREF="001";
MHELTM="001";
output;
STUDYID="CDISC01";
DOMAIN="MH";
USUBJID="CDISC01.100008";
MHSEQ=2;
MHTERM="HEARING AIDS";
MHCAT="MEDICAL AND SURGICAL HISTORY";
MHPRESP="";
MHOCCUR="";
MHBODSYS="Eyes-Ears-Nose-Throat";
MHDTC="2003-04-15";
MHSTDTC="1998";
MHENDTC="1996";
MHENRF="DURING/AFTER";
MHTPTREF="001";
MHELTM="001";

output;
STUDYID="CDISC01";
DOMAIN="MH";
USUBJID="CDISC01.100008";
MHSEQ=3;
MHTERM="DEPRESSION OF ALZHEIMER'S DISEASE";
MHCAT="PSYCHIATRIC HISTORY";
MHPRESP="Y";
MHOCCUR="Y";
MHBODSYS="";
MHDTC="";
MHSTDTC="2003-04-11";
MHENDTC="2003-05-11";
MHENRF="";
MHTPTREF="";
MHELTM="001";
output;
STUDYID="CDISC01";
DOMAIN="MH";
USUBJID="CDISC01.100008";
MHSEQ=4;
MHTERM="PROBABLE ALZHEIMER'S DISEASE";
MHCAT="PSYCHIATRIC HISTORY";
MHPRESP="Y";
MHOCCUR="Y";
MHBODSYS="";
MHDTC="";
MHSTDTC="2002-04-04";
MHENDTC="2002-04-04";
MHENRF="";
MHTPTREF="001";
MHELTM="001";
output;
run;
%cdisc(datlib=templib,datname=mh);
