SDTM.VS

SDTM day 6: Vital Sign

Introduction:

the Vital Sign domain captures all the measurements of body’s most basic functions, such as height, weight, blood pressure, heart rate… VS is a critical dataset in Drug Safety Analysis.

General Vital Sign Dataset Building Steps:

1. Read in Raw.VS dataset and remove the records without  VSORRES output 7 levels(Diastolic BP, Systolic BP, Heart Rate,         Height, Weight, Respiratory Rate, Temperature)

2. Merge with SDTM.DM for common variables

3. Merge with SDTM.SE for epoch

4. Clean dataset and create variables such as baseline flag, vsseq 

GDJ / Pixabay

Key Variables:

STUDYID USUBJID VSSEQ VSTESTCD VSTEST VSORRES VSORRESU VSSTRESN VSSTRESU VSBLFL VISITNUM EPOCH VSDTC VSDY

Variable Derivation Logic:

STUDYID, Study Identifier, Assigned Variable. 

STUDYID="TF-001"

USUBJID, Unique Subject Identifier, Derived from raw.lb.SUBJID.

USUBJID=catx("-","TF-001",substr(SUBJID,1,5));

EPOCH, Derived Variable base on SDTM.SE(Subject Elements) Start and End Day

proc sql noprint;
    create table vs_merge(drop=id) as 
    select a.*,b.*, c.RFSTDTC,d.value
    from vs1 a
    left join se_t(rename=(usubjid=id)) b on a.usubjid=b.ID
    left join sdtm.dm c on a.usubjid=c.usubjid
    left join visit d on a.cpevent=d.code
;
quit; 


VSTESTCD, Vital Signs Test Short Name, from control terminology sheet TESTCD values
VSTEST, Vital Signs Test Name, from control terminology sheet TEST values
VSORRES,  Result of Finding in Original value, 
VSORRESU, Original Units, Assigned variable
VSSTRESN, Numberic Result/Finding in Standard Units, Standard Result from variables
VSSTRESU, Standard Units, Assigned base on the parameters

data vs1;
  set vs;
 
  /** DIABP - Distolic Blood Pressure **/
      vstestcd = "DIABP";
      vstest = "Diastolic Blood Pressure";
      vsorres = strip(diabpf);
      vsstresc = vsorres;
      vsstresn = diabp;
      vsorresu = "mmHg";
      vsstresu = vsorresu;

      output;

  /** SYSBP - Systolic Blood Pressure **/
      vstestcd = "SYSBP";
      vstest = "Systolic Blood Pressure";
      vsorres = strip(sysbpf);
      vsstresc = vsorres;
      vsstresn = sysbp;
      vsorresu = "mmHg";
      vsstresu = vsorresu;

      output;

   /** HR - Heart Rate **/
      vstestcd = "HR";
      vstest = "Heart Rate";
      vsorres = strip(hrf);
      vsstresc = vsorres;
      vsstresn = hr;
      vsorresu = "BEATS/MIN";
      vsstresu = vsorresu;

      output;

  /** HEIGHT - Height **/
      vstestcd = "HEIGHT";
      vstest = "Height";
      vsorres = strip(heightf);
      vsstresc = vsorres;
      vsstresn = height;
      vsorresu = "cm";
      vsstresu = vsorresu;

      output;

  /** RESP - Respiratory Rate **/
      vstestcd = "RESP";
      vstest = "Respiratory Rate";
      vsorres = strip(respf);
      vsstresc = vsorres;
      vsstresn = resp;
      vsorresu = "BREATHS/MIN";
      vsstresu = vsorresu;

      output;

  /** TEMP - Temperature **/
      vstestcd = "TEMP";
      vstest = "Temperature";
      vsorres = strip(tempf);
      vsstresc = vsorres;
      vsstresn = temp;
      vsorresu = "C";
      vsstresu = vsorresu;

      output;
  /** WEIGHT - Weight **/
      vstestcd = "WEIGHT";
      vstest = "Weight";
      vsorres = strip(weightf);
      vsstresc = vsorres;
      vsstresn = weight;
      vsorresu = "kg";
      vsstresu = vsorresu;

      output;
run;

 

VSBLFL, Baseline Flag, Last non-missing value on or before the treatment start date

proc sort;
  by USUBJID VSTESTCD VSDTC;
run;

data blfl(rename=(flag=vsblfl));
  set vs2(where=(flag='Y'));
  by USUBJID VSTESTCD VSDTC;
  if last.VSTESTCD;
run;
if st_treatment eq '' then do;
if ST_SCREENING ne '' and en_SCREENING ne ''
and input(ST_SCREENING,e8601da.)<=input(vsdtc,e8601da.)<=input(en_SCREENING,e8601da.)
then epoch='SCREENING';
end;
if st_treatment ne '' then do;
if ST_SCREENING ne '' and en_SCREENING ne ''
nd input(ST_SCREENING,e8601da.)<=input(vsdtc,e8601da.)<input(en_SCREENING,e8601da.)
then epoch='SCREENING';
end;

if st_follow_up eq '' then do;
if ST_treatment ne '' and en_treatment ne ''
and input(substr(ST_treatment,1,10),e8601da.)
<=input(vsdtc,e8601da.)<=input(substr(en_treatment,1,10),e8601da.)
then epoch='TREATMENT';
end;
if st_follow_up ne '' then do;
if ST_treatment ne '' and en_treatment ne ''
and input(substr(ST_treatment,1,10),e8601da.)
<=input(vsdtc,e8601da.)<input(substr(en_treatment,1,10),e8601da.)
then epoch='TREATMENT';
  
if input(ST_follow_up,e8601da.)<=input(vsdtc,e8601da.)<=input(en_follow_up,e8601da.)
then epoch='FOLLOW-UP';
end;

 

VISIT, Visit Name, Derived variable

visit= raw.vs.CPEVENT 

VSDTC, Date/Time of Measurements, Derived variable from raw.vs.vsdx in IS8601 format

if vsdtc ne "" and length(vsdtc) = 10 then vsdtn = input(vsdtc,yymmdd10.);

VSDY, Study Day of Vital Signs, Derived variable

If (VSDTC < DM.RFSTDTC) then VSDY=VSDTC-DM.RFSTDTC; 
Else if (VSDTC >= DM.RFSTDTC) then VSDY=(VSDTC-DM.RFSTDTC)+1.

VSTPTNUM, Planned Time Point Number, Derived

visitnumx = input(cpevent,$visitnum.);
visitnum = input(visitnumx,best.);

VSSEQ, Sequence Number, Sequential number uniquely identifying the records within the domain by USUBJID and generated using the key sequence from the domain level metadata.

Data vsseq;
set vs;
by usubjid ;
retain vsseq vstestcd vstest vsdtc;
if first.usubjid then vsseq=1;
else vsseq=vsseq+1;
run;

 

Sample Vital Sign Dataset:

 

Happy studying!🙌

 

 

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Social media & sharing icons powered by UltimatelySocial
%d bloggers like this: