/*------------------------------------------------------------*
* program:     cdisc24.sas                                    *
* Description: Case #24. Serious AE For AE domains, this identifies records where *
*              Serious Event='Y' but none of Involves Cancer, Congenital Anomaly or Birth Defect, *
*              Persist or Signif Disability/Incapacity, Results in Death, Requires or Prolongs Hospitalization, *
*              Is Life Threatening, Other Medically Important Serious Event, or Occurred with Overdose equals 'Y'.*
* By:          Sy Truong, 10/14/2009                          *
*-------------------------------------------------------------*/
 
libname templib '../data';

*** Create some data to be selected ***;
data templib.ae(label="Adverse Events");
attrib STUDYID	label="Study Identifier" length=$100;
attrib DOMAIN	label="Domain Abbreviation" length=$100;
attrib USUBJID	label="Unique Subject Identifier" length=$100;
attrib AESEQ	label="Sequence Number" length=8;
attrib AEGRPID	label="Group ID" length=$100;
attrib AEREFID	label="Reference ID" length=$100;
attrib AESPID	label="Sponsor-Defined Identifier" length=$100;
attrib AETERM	label="Reported Term for the Adverse Event" length=$100;
attrib AEMODIFY	label="Modified Reported Term" length=$100;
attrib AEDECOD	label="Dictionary-Derived Term" length=$100;
attrib AESER	label="Serious Event" length=$1;
attrib AESCAN	label="Involves Cancer" length=$1;
attrib AESCONG	label="Congenital Anomaly or Birth Defect" length=$1;
attrib AESDISAB	label="Persist or Signif Disability/Incapacity" length=$1;
attrib AESDTH	label="Results in Death" length=$1;
attrib AESHOSP	label="Requires or Prolongs Hospitalization" length=$1;
attrib AESLIFE	label="Is Life Threatening" length=$1;
attrib AESOD	label="Occurred with Overdose" length=$1;
attrib AESMIE	label="Other Medically Important Serious Event" length=$1;


STUDYID='test';DOMAIN='test';USUBJID='test';AESEQ=1;AEGRPID='test';AEREFID='test';AESPID='test';AETERM='term1';AEMODIFY='test';AEDECOD='decode1';
AESER = 'Y';AESCAN = 'Y';AESCONG = 'Y';AESDISAB = 'Y';AESDTH = 'N';AESHOSP = 'Y';AESLIFE = 'Y';AESOD = 'N';AESMIE = 'Y';
output;
STUDYID='test';DOMAIN='test';USUBJID='test';AESEQ=1;AEGRPID='test';AEREFID='test';AESPID='test';AETERM='term2';AEMODIFY='test';AEDECOD='decode2';
AESER = 'Y';AESCAN = 'Y';AESCONG = 'Y';AESDISAB = 'Y';AESDTH = 'Y';AESHOSP = 'N';AESLIFE = 'Y';AESOD = 'Y';AESMIE = 'Y';
output;
STUDYID='test';DOMAIN='test';USUBJID='test';AESEQ=1;AEGRPID='test';AEREFID='test';AESPID='test';AETERM='term3';AEMODIFY='test';AEDECOD='decode3';
AESER = 'Y';AESCAN = 'Y';AESCONG = 'Y';AESDISAB = 'Y';AESDTH = 'Y';AESHOSP = 'Y';AESLIFE = 'Y';AESOD = 'N';AESMIE = 'N';
output;
STUDYID='test';DOMAIN='test';USUBJID='test';AESEQ=1;AEGRPID='test';AEREFID='test';AESPID='test';AETERM='term4';AEMODIFY='test';AEDECOD='decode4';
AESER = 'N';AESCAN = 'N';AESCONG = 'N';AESDISAB = 'N';AESDTH = 'N';AESHOSP = 'N';AESLIFE = 'N';AESOD = 'N';AESMIE = 'N';
output;
STUDYID='test';DOMAIN='test';USUBJID='test';AESEQ=1;AEGRPID='test';AEREFID='test';AESPID='test';AETERM='term5';AEMODIFY='test';AEDECOD='decode5';
AESER = 'Y';AESCAN = 'N';AESCONG = 'N';AESDISAB = 'N';AESDTH = 'N';AESHOSP = 'N';AESLIFE = 'N';AESOD = 'N';AESMIE = 'N';
output;
STUDYID='test';DOMAIN='test';USUBJID='test';AESEQ=1;AEGRPID='test';AEREFID='test';AESPID='test';AETERM='term6';AEMODIFY='test';AEDECOD='decode5';
AESER = 'Y';AESCAN = 'Y';AESCONG = 'Y';AESDISAB = 'Y';AESDTH = 'Y';AESHOSP = 'Y';AESLIFE = 'Y';AESOD = 'N';AESMIE = 'N';
output;
STUDYID='test';DOMAIN='test';USUBJID='test';AESEQ=1;AEGRPID='test';AEREFID='test';AESPID='test';AETERM='term7';AEMODIFY='test';AEDECOD='decode6';
AESER = 'Y';AESCAN = 'Y';AESCONG = 'Y';AESDISAB = 'Y';AESDTH = 'Y';AESHOSP = 'Y';AESLIFE = 'Y';AESOD = 'N';AESMIE = 'N';
output;
STUDYID='test';DOMAIN='test';USUBJID='test';AESEQ=1;AEGRPID='test';AEREFID='test';AESPID='test';AETERM='term8';AEMODIFY='test';AEDECOD='decode7';
AESER = 'Y';AESCAN = 'Y';AESCONG = 'Y';AESDISAB = 'Y';AESDTH = 'Y';AESHOSP = 'N';AESLIFE = 'Y';AESOD = 'N';AESMIE = 'N';
output;
STUDYID='test';DOMAIN='test';USUBJID='test';AESEQ=1;AEGRPID='test';AEREFID='test';AESPID='test';AETERM='term9';AEMODIFY='test';AEDECOD='decode8';
AESER = 'Y';AESCAN = 'Y';AESCONG = 'Y';AESDISAB = 'Y';AESDTH = 'Y';AESHOSP = 'N';AESLIFE = 'Y';AESOD = 'Y';AESMIE = 'N';
output;
STUDYID='test';DOMAIN='test';USUBJID='test';AESEQ=1;AEGRPID='test';AEREFID='test';AESPID='test';AETERM='term10';AEMODIFY='test';AEDECOD='decode5';
AESER = 'Y';AESCAN = 'Y';AESCONG = 'Y';AESDISAB = 'Y';AESDTH = 'Y';AESHOSP = 'N';AESLIFE = 'Y';AESOD = 'N';AESMIE = 'N';
output;
STUDYID='test';DOMAIN='test';USUBJID='test';AESEQ=1;AEGRPID='test';AEREFID='test';AESPID='test';AETERM='term11';AEMODIFY='test';AEDECOD='decode5';
AESER = 'Y';AESCAN = 'N';AESCONG = 'N';AESDISAB = 'N';AESDTH = 'N';AESHOSP = 'N';AESLIFE = 'N';AESOD = 'N';AESMIE = 'N';
output;
run;
%cdisc(datlib=templib,datname=ae);
