22  Exercise 3: SDTM Findings (Labs & Vital Signs)

22.1 Goal

Build the Vital Signs (VS) domain slice, the structural twin of the LB domain from The Findings session, and catch its one deliberate difference from LB.

22.2 Setup

Work from the project root. The VS raw file and the DM dataset you built earlier are the inputs:

library(tidyverse)
library(sdtm.terminology)

vs_raw <- read_csv("data/raw/vs_raw.csv", show_col_types = FALSE,
                   col_types = cols(.default = col_character()))
dm <- read_csv("data/sdtm/dm.csv", show_col_types = FALSE,
               col_types = cols(.default = col_character()))

Do the tasks in order. The Findings session is the reference; try each task before looking back.

22.3 Task

  1. (Guided) The result quartet. Build VSTESTCD, VSORRES, VSORRESU, VSSTRESC and VSSTRESN from the raw file, joining USUBJID from DM. Confirm every VSTESTCD value is valid controlled terminology.
  2. (The trap) Units. VSORRESU does not use the same units codelist as LB’s LBORRESU. Find the codelist VS uses, and check the trial’s vital-sign units against it, not against the generic UNIT codelist. Explain in one sentence why checking against the wrong codelist would have looked fine but been meaningless.
  3. (Semi-guided) Timing and structure. Derive VSDY from each subject’s RFSTDTC, and assign VSSEQ uniquely within USUBJID. How many rows does HEIGHT contribute per subject, and why does that differ from the other vitals?

22.4 Acceptance criteria

Task 2: the LB session used codelist C71620 (UNIT) for lab units. VS has its own. Search the terminology for the VS results-unit codelist by name (ct("list") filtered on something like “Vital Signs” or “VSRESU”) - the point of the exercise is that you look it up rather than assume LB’s codelist carries over.

Task 3: height is measured once, at screening; the other vitals are measured at every visit. So height contributes one row per subject and the others many.

Solutions are in the paid tier.