*************************************************************************************************; * * CLIENT: ModernaTX, Inc. * PROTOCOL: mRNA-1273-P301 * * PURPOSE: Create analysis dataset adar * * INPUT FILES: SDTM domains * OUTPUT FILES: ADAR.sas7bdat * * USAGE NOTES: * *************************************************************************************************; * Copyright 2020 Pharmaceutical Product Development, Inc. * All Rights Reserved. *************************************************************************************************; options noquotelenmax; %include "madam.sas"; **Assign global macro variable DSETNAME to reflect the name of the final ADaM dataset**; %global DSETNAME; %let dsetname = adar; %let adslvar=tr01sdt tr01sdtm tr01edt tr01edtm dose2dt dos2dtm dose2fl tr02sdt tr02sdtm oldos2dt oldo2dtm; **Merge supplemental data onto parent domain**; %revsupp(libin=trans,libout=work,ds=face,supp=suppface,outds=face_all); %revsupp(libin=trans,libout=work,ds=vs,supp=suppvs,outds=vs_all); data vs_all; set vs_all; output; if MEDTAK=:'Y' then do; vstestcd='MEDTAK'; vsorres='Y'; vsstresc='Y'; vsorresu=''; vsstresn=.; output; end; if MEDTAKP=:'Y' then do; vstestcd='MEDTAKP'; vsorres='Y'; vsstresc='Y'; vsorresu=''; vsstresn=.; output; end; if MEDTAKT=:'Y' then do; vstestcd='MEDTAKT'; vsorres='Y'; vsstresc='Y'; vsorresu=''; vsstresn=.; output; end; run; data face_vs; set vs_all(in=vs where=(vscat='REACTOGENICITY' and vstptnum<=7 and (missing(vsstat) or index(vstestcd,'MEDTA')) %if %lowcase(&DSETNAME.)^=adare %then %do; and ^missing(VSTPTREF) %end;)) face_all(in=face where=(facat^='EFFICACY' %if %index("&ADAM_SPEC.",DSMB) or %lowcase(&DSETNAME.)=adare %then %do; and faeval='STUDY SUBJECT' %end; and not (fatestcd='OCCUR' and lowcase(faobj) in ('erythema' 'swelling') and upcase(faorres) in ('Y' 'YES')) and missing(fastat) %if %lowcase(&DSETNAME.)^=adare %then %do; and ^missing(FATPTREF) %end;)); run; proc sort tagsort data=face_vs; by usubjid ; run; proc format; value $param "LYMPH" = "Underarm Gland Swelling or Tenderness" "PAIN" = "Pain" "ERYTHDIA" = "Erythema Longest Diameter (mm)" "SWELLDIA" = "Swelling Longest Diameter (mm)" "HEADACHE" = "Headache" "FATIGUE" = "Fatigue" "MYALGIA" = "Myalgia" "ARTHRALG" = "Arthralgia" "NAUSEA" = "Nausea/Vomiting" "CHILLS" = "Chills" "FEVER" = "Fever (C)" 'MEDTAKP'='Prevent Pain or Fever from Occurring' 'MEDTAKT'='Treat Pain or Fever already Occurred' 'MEDTAK'='Medication Taken Today for Pain or Fever'; ; run; **INSERT CODE TO GENERATE DATASET**; data face_adsl; merge face_vs(in=a) adb.adsl(in=b keep=USUBJID &adslvar.); by usubjid ; if a and b; run; data face_date; length ATPT $60 PARCAT1 $50 AVALC $100 _war PARAM $200 PARAMCD $8; set face_adsl; * Analysis Datetime; if domain='VS' then fadtc = vsdtc; %ISO2SAS(isodate=fadtc, datec=_fadtc, daten=ADT, timec=_atm); if ^missing(_atm) and ^missing(ADT) then ADTM = input(compress(put(ADT,date9.)||':'||_atm),datetime20.); if ^missing(_atm) then ATM = input(_atm,time5.); %*caldy(stdt=ADT,endt=TR01SDT,outdy=ADY,stdtm=ADTM,endtm=TR01SDTM); if domain='VS' then ady=vsdy; else if domain ="FA" then ady=fady; * Most Recent Dose Reference; %xxdoserf(xx=FA,adt=ADT,adtm=ADTM,rddy=RDDY); ATPTREF = out_fadoserf; if index(fatptref,'1') or index(vstptref,'1') then ATPTREF = 'Vaccination 1'; else if index(fatptref,'2') or index(vstptref,'2') then ATPTREF = 'Vaccination 2'; * Analysis Timepoint; if domain='VS' then ATPT = vstpt; else ATPT = fatpt; %if %lowcase(&DSETNAME.)=adar %then %do; if fatpt='DAY 1' and FAEVAL='INVESTIGATOR' then atpt='DAY 1, AFTER VACCINATION (AT HOME)'; %end; if ATPT='DAY 1, 30 MINUTES AFTER VACCINATION (AT STUDY CLINIC)' then ATPTN = 1.1; else if ATPT='DAY 1, AFTER VACCINATION (AT HOME)' then ATPTN = 1.2; else if ATPT='DAY 1' then ATPTN = 1; else if ATPT='DAY 2' then ATPTN = 2; else if ATPT='DAY 3' then ATPTN = 3; else if ATPT='DAY 4' then ATPTN = 4; else if ATPT='DAY 5' then ATPTN = 5; else if ATPT='DAY 6' then ATPTN = 6; else if ATPT='DAY 7' then ATPTN = 7; * Pooled Analysis Timepoint; if .100 or find(fastresc,'GRADE 3') then ATOXGRN = 3; else if find(fastresc,'GRADE 4') then ATOXGRN = 4; end; else if PARAMCD='FEVER' then do; if .40.0 or find(fastresc,'GRADE 4') then ATOXGRN = 4; end; else if PARAMCD in ('PAIN' 'LYMPH' 'HEADACHE') then do; if upcase(AVALC)='NONE' or find(fastresc,'GRADE 0') then ATOXGRN = 0; else if upcase(AVALC)='DOES NOT INTERFERE WITH ACTIVITY' or find(fastresc,'GRADE 1') then ATOXGRN = 1; else if upcase(AVALC)='NO INTERFERENCE WITH ACTIVITY' or find(fastresc,'GRADE 1') then ATOXGRN = 1; else if index(upcase(AVALC),'REPEATED') or find(fastresc,'GRADE 2') then ATOXGRN = 2; else if upcase(AVALC)='ANY USE OF PRESCRIPTION RELIEVER OR PREVENTS DAILY ACTIVITY' or find(fastresc,'GRADE 3') then ATOXGRN = 3; else if upcase(AVALC)='ANY USE OF PRESCRIPTION PAIN RELIEVER OR PREVENTS DAILY ACTIVITY' or find(fastresc,'GRADE 3') then ATOXGRN = 3; else if find(fastresc,'GRADE 4') then ATOXGRN = 4; else if ^missing(AVALC) then do; _war = 'Put Aler'||'t_A: ATOXGR needs udapte. '; put _war SUBJID= PARAMCD= PARAM=; put _war AVALC=; end; end; else if PARAMCD in ('FATIGUE' 'MYALGIA' 'ARTHRALG') then do; if upcase(AVALC)='NONE' or find(fastresc,'GRADE 0') then ATOXGRN = 0; else if upcase(AVALC)='NO INTERFERENCE WITH ACTIVITY' or find(fastresc,'GRADE 1') then ATOXGRN = 1; else if upcase(AVALC)='SOME INTERFERENCE WITH ACTIVITY' or find(fastresc,'GRADE 2') then ATOXGRN = 2; else if upcase(AVALC)='SIGNIFICANT; PREVENTS DAILY ACTIVITY' or find(fastresc,'GRADE 3') then ATOXGRN = 3; else if find(fastresc,'GRADE 4') then ATOXGRN = 4; else if ^missing(AVALC) then do; _war = 'Put Aler'||'t_A: ATOXGR needs udapte. '; put _war SUBJID= PARAMCD= PARAM=; put _war AVALC=; end; end; else if PARAMCD='NAUSEA' then do; if upcase(AVALC)='NONE' or find(fastresc,'GRADE 0') then ATOXGRN = 0; else if upcase(AVALC)='NO INTERFERENCE WITH ACTIVITY OR 1-2 EPISODES/24 HOURS' or find(fastresc,'GRADE 1') then ATOXGRN = 1; else if upcase(AVALC)='SOME INTERFERENCE WITH ACTIVITY OR >2 EPISODES/24 HOURS' or find(fastresc,'GRADE 2') then ATOXGRN = 2; else if upcase(AVALC)='PREVENTS DAILY ACTIVITY, REQUIRES OUTPATIENT IV HYDRATION' or find(fastresc,'GRADE 3') then ATOXGRN = 3; else if find(fastresc,'GRADE 4') then ATOXGRN = 4; else if ^missing(AVALC) then do; _war = 'Put Aler'||'t_A: ATOXGR needs udapte. '; put _war SUBJID= PARAMCD= PARAM=; put _war AVALC=; end; end; else if PARAMCD='CHILLS' then do; if upcase(AVALC)='NONE' or find(fastresc,'GRADE 0') then ATOXGRN = 0; else if upcase(AVALC)='NO INTERFERENCE WITH ACTIVITY' or find(fastresc,'GRADE 1') then ATOXGRN = 1; else if upcase(AVALC)='SOME INTERFERENCE WITH ACTIVITY NOT REQUIRING MEDICAL ATTENTION' or find(fastresc,'GRADE 2') then ATOXGRN = 2; else if upcase(AVALC)='PREVENTS DAILY ACTIVITY AND REQUIRES MEDICAL ATTENTION' or find(fastresc,'GRADE 3') then ATOXGRN = 3; else if find(fastresc,'GRADE 4') then ATOXGRN = 4; else if ^missing(AVALC) then do; _war = 'Put Aler'||'t_A: ATOXGR needs udapte. '; put _war SUBJID= PARAMCD= PARAM=; put _war AVALC=; end; end; if ^missing(ATOXGRN) then ATOXGR = 'Grade '||strip(put(ATOXGRN,best.)); * Surce Data, Sequence, Variable; if domain='VS' then do; SRCDOM = DOMAIN; SRCSEQ = VSSEQ; if PARAMCD='MEDTAKP' then SRCVAR ="SUPPVS.QVAL where QNAM='MEDTAKP'"; else if PARAMCD='MEDTAKT' then SRCVAR ="SUPPVS.QVAL where QNAM='MEDTAKT'"; else if PARAMCD='MEDTAK' then SRCVAR ="SUPPVS.QVAL where QNAM='MEDTAK'"; else SRCVAR = 'VSSTRESN'; end; else do; SRCDOM = DOMAIN; SRCSEQ = FASEQ; SRCVAR = 'FASTRESC'; end; postfl='Y'; %if %lowcase(&DSETNAME.)=adar %then %do; if faeval='STUDY SUBJECT' or (faeval='' and PARAMCD='FEVER') then _faeval=1; else _faeval=2; %end; %else %do; _faeval = 1; %end; if param='Rash' then delete; run; * Analysis Flag 01; proc sort tagsort data=face_date; by usubjid paramcd descending postfl atptref atptgr1n descending atoxgrn adt _faeval atm atptn vsseq srcseq; run; data crit; set face_date; by usubjid paramcd descending postfl atptref atptgr1n descending atoxgrn adt _faeval atm atptn vsseq ; if first.atptgr1n and postfl='Y' and ^missing(atoxgrn) and ^missing(atptref) then ANL01FL = 'Y'; if PARAMCD='FEVER' and ^missing(AVAL) then do; if (9*AVAL/5)+32>102.6 then CRIT1FL = 'Y'; if (9*AVAL/5)+32>103.1 then CRIT2FL = 'Y'; if (9*AVAL/5)+32>103.6 then CRIT3FL = 'Y'; if (9*AVAL/5)+32>104.1 then CRIT4FL = 'Y'; if CRIT1FL='Y' then CRIT1 = '> 102.6 degrees F'; if CRIT2FL='Y' then CRIT2 = '> 103.1 degrees F'; if CRIT3FL='Y' then CRIT3 = '> 103.6 degrees F'; if CRIT4FL='Y' then CRIT4 = '> 104.1 degrees F'; end; if PARAMCD in ('PAIN' 'ERYTHDIA' 'SWELLDIA') and ATOXGRN>0.0001 then anl02fl='Y'; if atoxgrn~=. then _agfl=1; run; ***ANL03FL***; proc sort tagsort data=crit; by usubjid param atptref atpt _agfl atoxgrn descending adt descending _faeval descending srcseq; run; data an03; set crit; by usubjid param atptref atpt _agfl atoxgrn descending adt descending _faeval; if last.atpt and _agfl=1 then ANL03FL='Y'; run; proc sort tagsort data=an03; by usubjid parcat1 paramcd param atptref atptn adt atm srcseq; %if %lowcase(&DSETNAME.)^=adare %then %do; where not (dose2fl='N' and atptref='Vaccination 2'); %end; run; data &DSETNAME.;*(rename=(AEMAFL=MAAEFL)); set an03; by usubjid parcat1 paramcd param atptref atptn adt atm srcseq; ASEQ + 1; if first.usubjid then ASEQ = 1; drop &adslvar. SUBJID; run; **Generate final dataset by updating certain attributes. Optionally merge common variables & create sequence variable as needed**; %trta(dsname=&DSETNAME); %adam_dataset_update( ds=&DSETNAME, libin=work, libout=output, adsllib=adb, addcomvar=Y, addseq=, dropinfmt=Y, mapspecfile=&ADAM_SPEC, maploc=&ADAM_SPEC_LOC, debug=N ); **Generate Value Level Metadata values for the ad dataset**; %* dod_vlm( type=ADAM, selmems=&DSETNAME, excmems=, specloc=&ADAM_SPEC_LOC, specname=&ADAM_SPEC, debug=N ); **Generate Enhanced Controlled Terminology for the ad dataset**; %* dod_enhcd_ct( type=ADAM, selmems=&DSETNAME, excmems=, specloc=&ADAM_SPEC_LOC, specname=&ADAM_SPEC, map_ct_nm=, map_ct_loc=, debug=N );