TL Catalog
  1. Listings
  2. Adverse Events
  3. LSFAE01
  • Introduction

  • Index

  • Tables
    • Adverse Events
      • TSFAE01A
      • TSFAE01B
      • TSFAE02
      • TSFAE02A
      • TSFAE03
      • TSFAE03A
      • TSFAE04
      • TSFAE04A
      • TSFAE05
      • TSFAE05A
      • TSFAE06A
      • TSFAE06B
      • TSFAE07A
      • TSFAE07B
      • TSFAE08
      • TSFAE09
      • TSFAE10
      • TSFAE11
      • TSFAE12
      • TSFAE13
      • TSFAE14
      • TSFAE15
      • TSFAE16
      • TSFAE17A
      • TSFAE17B
      • TSFAE17C
      • TSFAE17D
      • TSFAE19A
      • TSFAE19B
      • TSFAE19C
      • TSFAE19D
      • TSFAE20A
      • TSFAE20B
      • TSFAE20C
      • TSFAE21A
      • TSFAE21B
      • TSFAE21C
      • TSFAE21D
      • TSFAE22A
      • TSFAE22B
      • TSFAE22C
      • TSFAE23A
      • TSFAE23B
      • TSFAE23C
      • TSFAE23D
      • TSFAE24A
      • TSFAE24B
      • TSFAE24C
      • TSFAE24D
      • TSFAE24F
      • TSFDTH01
    • Clinical Laboratory Evaluation
      • TSFLAB01
      • TSFLAB01A
      • TSFLAB02
      • TSFLAB02A
      • TSFLAB02B
      • TSFLAB03
      • TSFLAB03A
      • TSFLAB04A
      • TSFLAB04B
      • TSFLAB05
      • TSFLAB06
      • TSFLAB07
    • Demographic
      • TSIDEM01
      • TSIDEM02
      • TSIMH01
    • Disposition of Subjects
      • TSIDS01
      • TSIDS02
      • TSIDS02A
    • Electrocardiograms
      • TSFECG01
      • TSFECG01A
      • TSFECG02
      • TSFECG03
      • TSFECG04
      • TSFECG05
    • Exposure
      • TSIEX01
      • TSIEX02
      • TSIEX03
      • TSIEX04
      • TSIEX06
      • TSIEX07
      • TSIEX08
      • TSIEX09
      • TSIEX10
      • TSIEX11
    • Pharmacokinetics
      • TPK01A
      • TPK01B
      • TPK02
      • TPK03
    • Prior and Concomitant Therapies
      • TSICM01
      • TSICM02
      • TSICM03
      • TSICM04
      • TSICM05
      • TSICM06
      • TSICM07
      • TSICM08
    • Vital Signs and Physical Findings
      • TSFVIT01
      • TSFVIT01A
      • TSFVIT02
      • TSFVIT03
      • TSFVIT04
      • TSFVIT05
      • TSFVIT06
  • Listings
    • Adverse Events
      • LSFAE01
      • LSFAE02
      • LSFAE03
      • LSFAE04
      • LSFAE05
      • LSFAE06A
      • LSFAE06B
      • LSFDTH01
    • Clinical Laboratory Evaluation
      • LSFLAB01
    • Demographic
      • LSIDEM01
      • LSIDEM02
      • LSIMH01
    • Disposition of Subjects
      • LSIDS01
      • LSIDS02
      • LSIDS03
      • LSIDS04
      • LSIDS05
    • Electrocardiograms
      • LSFECG01
      • LSFECG02
    • Exposure
      • LSIEX01
      • LSIEX02
      • LSIEX03
    • Prior and Concomitant Therapies
      • LSICM01
    • Vital Signs and Physical Findings
      • LSFVIT01
      • LSFVIT02

  • Reproducibility

  • Changelog

On this page

  • Output
  • Edit this page
  • Report an issue
  1. Listings
  2. Adverse Events
  3. LSFAE01

LSFAE01

Listing of Treatment-emergent Adverse Events


Output

  • Preview
Code
# Program Name:              lsfae01.R

# Prep environment

library(envsetup)
library(tern)
library(dplyr)
library(rtables)
library(rlistings)
library(junco)
library(stringi)

# Define script level parameters

tblid <- "LSFAE01"
fileid <- tblid
popfl <- "SAFFL"
trtvar <- "TRT01A"
key_cols <- c("COL0", "COL1", "COL2")
disp_cols <- paste0("COL", 0:10)
concat_sep <- " / "
tab_titles <- get_titles_from_file(input_path = '../../_data/', tblid)
string_map <- default_str_map
# Parameter to control whether time should be displayed # from ASTDTM
include_time <- TRUE

# Process data

adae <- pharmaverseadamjnj::adae %>%
  filter(!!rlang::sym(popfl) == "Y" & TRTEMFL == "Y")

lsting <- adae %>%
  mutate(
    AGE = explicit_na(as.character(AGE), ""),
    SEX = explicit_na(SEX, ""),
    RACE_DECODE = explicit_na(RACE_DECODE, ""),
    DOSEON = explicit_na(as.character(DOSEON), ""),
    DOSEU = explicit_na(DOSEU, ""),
    DOSEDY = explicit_na(as.character(DOSEDY), ""),
    AEDECOD = explicit_na(AEDECOD, ""),
    AETERM = ifelse(
      is.na(AETERM),
      "",
      stringi::stri_trans_totitle(gsub("\\$", "", AETERM))
    ),
    ASTDT = ifelse(
      nchar(as.character(ASTDT)) == 10,
      toupper(format(ASTDT, "%d%b%Y")),
      ""
    ),
    ASTTM = ifelse(
      include_time & !is.na(ASTDTM),
      substr(as.character(ASTDTM), 12, 16),
      ""
    ),
    ASTDYN = ifelse(!is.na(ASTDY), ASTDY, NA),
    ASTDY = ifelse(!is.na(ASTDY), ASTDY, ""),
    ASTDTFS = ifelse(!is.na(ASTDTF), "*", ""),
    AENDT = explicit_na(as.character(AENDT), ""),
    AENDT = ifelse(
      nchar(AENDT) == 10,
      toupper(format(as.Date(AENDT), "%d%b%Y")),
      ""
    ),
    AENTM = ifelse(
      include_time & !is.na(AENDTM),
      substr(as.character(AENDTM), 12, 16),
      ""
    ),
    AENDY = ifelse(!is.na(AENDY), AENDY, ""),
    AENDTFS = ifelse(!is.na(AENDTF), "*", ""),
    ADURN = explicit_na(as.character(ADURN), ""),
    AEOUTC = explicit_na(AEOUT_DECODE, ""),
    # Optional Variable: COL10/AESEV/AETOXGR
    # AESEV = explicit_na(AESEV,""),
    AETOXGR = explicit_na(AETOXGR, ""),
    AESER_DECODE = explicit_na(AESER_DECODE, ""),
    COL0 = explicit_na(.data[[trtvar]], ""),
    COL1 = explicit_na(USUBJID, ""),
    COL2 = paste(AGE, SEX, RACE_DECODE, sep = concat_sep),
    COL3 = paste(paste0(DOSEON, " ", DOSEU), DOSEDY, sep = concat_sep),
    COL4 = paste(AEDECOD, AETERM, sep = concat_sep),
    COL5 = case_when(
      ASTDT == "" ~ "",
      include_time & ASTDT != "" & ASTTM != "" & ASTDY != "" & ASTDTFS != "" ~
        paste0(ASTDT, concat_sep, ASTTM, " (", ASTDY, ")", ASTDTFS),
      include_time & ASTDT != "" & ASTTM != "" & ASTDY != "" & ASTDTFS == "" ~
        paste0(ASTDT, concat_sep, ASTTM, " (", ASTDY, ")"),
      include_time & ASTDT != "" & ASTTM == "" & ASTDY != "" & ASTDTFS != "" ~
        paste0(ASTDT, concat_sep, "--:--", " (", ASTDY, ")", ASTDTFS),
      include_time & ASTDT != "" & ASTTM == "" & ASTDY != "" & ASTDTFS == "" ~
        paste0(ASTDT, concat_sep, "--:--", " (", ASTDY, ")"),
      ASTDT != "" & ASTDY != "" & ASTDTFS != "" ~
        paste0(ASTDT, " (", ASTDY, ")", ASTDTFS),
      ASTDT != "" & ASTDY != "" & ASTDTFS == "" ~
        paste0(ASTDT, " (", ASTDY, ")"),
    ),
    COL6 = case_when(
      AENDT == "" ~ "",
      include_time & AENDT != "" & AENTM != "" & AENDY != "" & AENDTFS != "" ~
        paste0(AENDT, concat_sep, AENTM, " (", AENDY, ")", AENDTFS),
      include_time & AENDT != "" & AENTM != "" & AENDY != "" & AENDTFS == "" ~
        paste0(AENDT, concat_sep, AENTM, " (", AENDY, ")"),
      include_time & AENDT != "" & AENTM == "" & AENDY != "" & AENDTFS != "" ~
        paste0(AENDT, concat_sep, "--:--", " (", AENDY, ")", AENDTFS),
      include_time & AENDT != "" & AENTM == "" & AENDY != "" & AENDTFS == "" ~
        paste0(AENDT, concat_sep, "--:--", " (", AENDY, ")"),
      AENDT != "" & AENDY != "" & AENDTFS != "" ~
        paste0(AENDT, " (", AENDY, ")", AENDTFS),
      AENDT != "" & AENDY != "" & AENDTFS == "" ~
        paste0(AENDT, " (", AENDY, ")"),
    ),
    COL7 = explicit_na(ADURN, ""),
    # Optional Column: COL8/AEACN
    COL8 = explicit_na(AEACN_DECODE, ""),
    COL9 = explicit_na(AEREL_DECODE, ""),
    # Optional Variable: COL10/AESEV/AETOXGR
    # COL10 = paste(AEOUTC, AESEV, AESER_DECODE, sep = concat_sep)
    COL10 = paste(AEOUTC, AETOXGR, AESER_DECODE, sep = concat_sep)
  ) %>%
  arrange(
    COL0,
    COL1,
    COL2,
    !is.na(ASTDYN),
    ASTDYN,
    if (include_time) ASTDTM else ASTDT,
    AEDECOD,
    AETERM
  )

lsting <- var_relabel(
  lsting,
  COL0 = "Treatment Group",
  COL1 = "Subject ID",
  COL2 = paste("Age (years)", "Sex", "Race", sep = concat_sep),
  COL3 = paste(
    "Onset Dose (unit)",
    "Day of Last Dose~[super a,b]",
    sep = concat_sep
  ),
  COL4 = paste("Preferred Term", "Reported Term", sep = concat_sep),
  COL5 = if (include_time) {
    paste("Start Date", "Time (Study Day~[super b])", sep = concat_sep)
  } else {
    "Start Date (Study Day~[super b])"
  },
  COL6 = if (include_time) {
    paste("End Date", "Time (Study Day~[super b])", sep = concat_sep)
  } else {
    "End Date (Study Day~[super b])"
  },
  COL7 = "AE Duration (Days)",
  # Optional Column: COL8/AEACN
  COL8 = "Action Taken With Study Treatment",
  COL9 = "Relationship to Study Treatment~[super c]",
  # Optional Variable: COL10/AESEV/AETOXGR
  # COL10 = paste("Outcome", "Severity", "Serious", sep = concat_sep)
  COL10 = paste("Outcome", "Toxicity Grade", "Serious", sep = concat_sep)
)

# Build listing

result <- rlistings::as_listing(
  df = lsting,
  key_cols = key_cols,
  disp_cols = disp_cols
)

# Add titles and footnotes:

result <- set_titles(result, tab_titles)

# Output listing

tt_to_tlgrtf(string_map = string_map, tt = head(result, 100), file = fileid, orientation = "landscape")

LSFAE01: Listing of Treatment-emergent Adverse Events; Safety Analysis Set (Study jjcs - core)

Treatment Group

Subject ID

Age (years) / Sex / Race

Onset Dose (unit) / Day of Last Dosea,b

Preferred Term / Reported Term

Start Date / Time (Study Dayb)

End Date / Time (Study Dayb)

AE Duration (Days)

Action Taken With Study Treatment

Relationship to Study Treatmentc

Outcome / Toxicity Grade / Serious

Xanomeline High Dose

01-701-1028

71 / M / Asian

10 mg / 37

ERECTILE DYSFUNCTION / Erectile Dysfunction

21JUL2013 / 00:00 (3)

Not Applicable

Possible

Not Recovered/Not Resolved / 2 / Yes

10 mg / 37

APPLICATION SITE PRURITUS / Application Site Pruritus

08AUG2013 / 00:00 (21)

Unknown

Probable

Not Recovered/Not Resolved / 4 / No

01-701-1034

77 / F / White

10 mg / 37

ABNORMAL UTERINE BLEEDING / Abnormal Uterine Bleeding

27AUG2014 / 00:00 (58)

Not Applicable

Probable

Not Recovered/Not Resolved / 0 / Yes

10 mg / 37

FATIGUE / Fatigue

02NOV2014 / 00:00 (125)

Dose Rate Reduced

Possible

Not Recovered/Not Resolved / 4 / No

01-701-1146

75 / F / Unknown

10 mg / 37

APPLICATION SITE IRRITATION / Application Site Irritation

01JUN2013 / 00:00 (13)

02JUN2013 / 23:59 (14)

2

Dose Reduced

Probable

Recovered/Resolved / 1 / No

10 mg / 37

FATIGUE / Fatigue

03JUN2013 / 00:00 (15)

Dose Increased

Possible

Not Recovered/Not Resolved / 1 / Yes

10 mg / 37

APPLICATION SITE ERYTHEMA / Application Site Erythema

10JUN2013 / 00:00 (22)

Dose Increased

Probable

Not Recovered/Not Resolved / 2 / Yes

10 mg / 37

APPLICATION SITE ERYTHEMA / Application Site Erythema

10JUN2013 / 00:00 (22)

Dose Rate Reduced

Probable

Not Recovered/Not Resolved / 3 / Yes

10 mg / 37

APPLICATION SITE PRURITUS / Application Site Pruritus

10JUN2013 / 00:00 (22)

Dose Rate Reduced

Probable

Not Recovered/Not Resolved / 5 / No

10 mg / 37

APPLICATION SITE PRURITUS / Application Site Pruritus

10JUN2013 / 00:00 (22)

Drug Interrupted

Probable

Not Recovered/Not Resolved / 3 / Yes

10 mg / 37

APPLICATION SITE PAIN / Application Site Pain

22JUN2013 / 00:00 (34)

Dose Not Changed

Probable

Not Recovered/Not Resolved / 1 / Yes

10 mg / 37

APPLICATION SITE IRRITATION / Application Site Irritation

26JUN2013 / 00:00 (38)

Drug Interrupted

Probable

Not Recovered/Not Resolved / 3 / No

10 mg / 37

APPLICATION SITE VESICLES / Application Site Vesicles

26JUN2013 / 00:00 (38)

Dose Rate Reduced

Probable

Not Recovered/Not Resolved / 3 / Yes

01-701-1148

57 / M / Not reported

10 mg / 37

APPLICATION SITE ERYTHEMA / Application Site Erythema

25AUG2013 / 00:00 (3)

Dose Rate Reduced

Probable

Not Recovered/Not Resolved / 4 / Yes

10 mg / 37

APPLICATION SITE PRURITUS / Application Site Pruritus

25AUG2013 / 00:00 (3)

Drug Withdrawn

Probable

Not Recovered/Not Resolved / 2 / Yes

10 mg / 37

LOWER RESPIRATORY TRACT INFECTION / Lower Respiratory Tract Infection

12OCT2013 / 00:00 (51)

10NOV2013 / 23:59 (80)

30

Dose Rate Reduced

Not Related

Not Recovered/Not Resolved / 3 / No

10 mg / 37

LOWER RESPIRATORY TRACT INFECTION / Lower Respiratory Tract Infection

12OCT2013 / 00:00 (51)

10NOV2013 / 23:59 (80)

30

Not Applicable

Not Related

Recovered/Resolved / 4 / No

10 mg / 37

FLANK PAIN / Flank Pain

15DEC2013 / 00:00 (115)

17DEC2013 / 23:59 (117)

3

Unknown

Not Related

Recovered/Resolved / 3 / Yes

10 mg / 37

CALCULUS URETHRAL / Calculus Urethral

17DEC2013 / 00:00 (117)

17DEC2013 / 23:59 (117)

1

Not Applicable

Not Related

Recovered/Resolved / 0 / Yes

10 mg / 37

EPISTAXIS / Epistaxis

03JAN2014 / 00:00 (134)

03JAN2014 / 23:59 (134)

1

Unknown

Not Related

Recovered/Resolved / 4 / Yes

10 mg / 37

ACTINIC KERATOSIS / Actinic Keratosis

12FEB2014 / 00:00 (174)

Dose Not Changed

Not Related

Not Recovered/Not Resolved / 3 / No

01-701-1239

56 / M / White

10 mg / 37

ERYTHEMA / Erythema

12JAN2014 / 00:00 (2)

Dose Not Changed

Possible

Not Recovered/Not Resolved / 2 / Yes

10 mg / 37

ERYTHEMA / Erythema

12JAN2014 / 00:00 (2)

Not Applicable

Possible

Not Recovered/Not Resolved / 5 / Yes

10 mg / 37

SKIN ODOUR ABNORMAL / Skin Odour Abnormal

12JAN2014 / 00:00 (2)

Not Applicable

Related

Not Recovered/Not Resolved / 3 / No

10 mg / 37

PRURITUS / Pruritus

13JAN2014 / 00:00 (3)

Not Applicable

Possible

Not Recovered/Not Resolved / 2 / No

10 mg / 37

APPLICATION SITE IRRITATION / Application Site Irritation

20JAN2014 / 00:00 (10)

08FEB2014 / 23:59 (29)

20

Dose Reduced

Probable

Not Recovered/Not Resolved / 0 / Yes

10 mg / 37

APPLICATION SITE IRRITATION / Application Site Irritation

20JAN2014 / 00:00 (10)

08FEB2014 / 23:59 (29)

20

Dose Reduced

Probable

Recovered/Resolved / 4 / Yes

10 mg / 37

UPPER RESPIRATORY TRACT INFECTION / Upper Respiratory Tract Infection

20FEB2014 / 00:00 (41)

12MAR2014 / 23:59 (61)

21

Drug Withdrawn

Not Related

Not Recovered/Not Resolved / 4 / Yes

10 mg / 37

UPPER RESPIRATORY TRACT INFECTION / Upper Respiratory Tract Infection

20FEB2014 / 00:00 (41)

12MAR2014 / 23:59 (61)

21

Dose Reduced

Not Related

Recovered/Resolved / 5 / Yes

10 mg / 37

FATIGUE / Fatigue

01MAR2014 / 00:00 (50)*

Drug Interrupted

Related

Not Recovered/Not Resolved / 0 / No

10 mg / 37

HORDEOLUM / Hordeolum

01APR2014 / 00:00 (81)*

Drug Interrupted

Not Related

Not Recovered/Not Resolved / 3 / Yes

01-701-1275

61 / M / White

10 mg / 37

NAUSEA / Nausea

13FEB2014 / 00:00 (7)

03JUN2014 / 23:59 (117)

111

Dose Rate Reduced

Possible

Not Recovered/Not Resolved / 5 / No

10 mg / 37

NAUSEA / Nausea

13FEB2014 / 00:00 (7)

03JUN2014 / 23:59 (117)

111

Dose Rate Reduced

Possible

Recovered/Resolved / 0 / No

10 mg / 37

VOMITING / Vomiting

23FEB2014 / 00:00 (17)

23FEB2014 / 23:59 (17)

1

Drug Interrupted

Possible

Recovered/Resolved / 4 / Yes

10 mg / 37

ERYTHEMA / Erythema

24FEB2014 / 00:00 (18)

12JUN2014 / 23:59 (126)

109

Dose Reduced

Possible

Not Recovered/Not Resolved / 0 / No

10 mg / 37

ERYTHEMA / Erythema

24FEB2014 / 00:00 (18)

12JUN2014 / 23:59 (126)

109

Dose Increased

Possible

Recovered/Resolved / 4 / No

10 mg / 37

PAROSMIA / Parosmia

24FEB2014 / 00:00 (18)

03JUN2014 / 23:59 (117)

100

Not Applicable

Possible

Not Recovered/Not Resolved / 2 / Yes

10 mg / 37

PAROSMIA / Parosmia

24FEB2014 / 00:00 (18)

03JUN2014 / 23:59 (117)

100

Unknown

Possible

Recovered/Resolved / 4 / No

10 mg / 37

PRURITUS / Pruritus

24FEB2014 / 00:00 (18)

12JUN2014 / 23:59 (126)

109

Drug Withdrawn

Possible

Not Recovered/Not Resolved / 4 / No

10 mg / 37

PRURITUS / Pruritus

24FEB2014 / 00:00 (18)

12JUN2014 / 23:59 (126)

109

Unknown

Possible

Recovered/Resolved / 5 / No

10 mg / 37

SALIVARY HYPERSECRETION / Salivary Hypersecretion

24FEB2014 / 00:00 (18)

03JUN2014 / 23:59 (117)

100

Dose Reduced

Possible

Not Recovered/Not Resolved / 0 / Yes

10 mg / 37

SALIVARY HYPERSECRETION / Salivary Hypersecretion

24FEB2014 / 00:00 (18)

03JUN2014 / 23:59 (117)

100

Unknown

Possible

Recovered/Resolved / 1 / No

10 mg / 37

COUGH / Cough

12MAR2014 / 00:00 (34)

27MAR2014 / 23:59 (49)

16

Not Applicable

Not Related

Not Recovered/Not Resolved / 0 / Yes

10 mg / 37

COUGH / Cough

12MAR2014 / 00:00 (34)

27MAR2014 / 23:59 (49)

16

Not Applicable

Not Related

Recovered/Resolved / 2 / Yes

10 mg / 37

NASAL CONGESTION / Nasal Congestion

12MAR2014 / 00:00 (34)

27MAR2014 / 23:59 (49)

16

Dose Rate Reduced

Not Related

Not Recovered/Not Resolved / 5 / Yes

10 mg / 37

NASAL CONGESTION / Nasal Congestion

12MAR2014 / 00:00 (34)

27MAR2014 / 23:59 (49)

16

Unknown

Not Related

Recovered/Resolved / 2 / No

01-701-1287

56 / F / Multiple

10 mg / 37

SALIVARY HYPERSECRETION / Salivary Hypersecretion

26JAN2014 / 00:00 (2)

Drug Interrupted

Not Related

Not Recovered/Not Resolved / 5 / No

10 mg / 37

APPLICATION SITE PRURITUS / Application Site Pruritus

22FEB2014 / 00:00 (29)

Dose Reduced

Possible

Not Recovered/Not Resolved / 4 / Yes

10 mg / 37

APPLICATION SITE ERYTHEMA / Application Site Erythema

09MAR2014 / 00:00 (44)

Dose Increased

Probable

Not Recovered/Not Resolved / 1 / Yes

10 mg / 37

RHINORRHOEA / Rhinorrhoea

09JUL2014 / 00:00 (166)

12JUL2014 / 23:59 (169)

4

Dose Rate Reduced

Not Related

Not Recovered/Not Resolved / 4 / Yes

10 mg / 37

RHINORRHOEA / Rhinorrhoea

09JUL2014 / 00:00 (166)

12JUL2014 / 23:59 (169)

4

Drug Interrupted

Not Related

Recovered/Resolved / 0 / No

01-701-1302

61 / M / Asian

10 mg / 37

APPLICATION SITE PERSPIRATION / Application Site Perspiration

30AUG2013 / 00:00 (2)

Dose Increased

Possible

Not Recovered/Not Resolved / 4 / No

10 mg / 37

HYPERHIDROSIS / Hyperhidrosis

30AUG2013 / 00:00 (2)

Dose Rate Reduced

Possible

Not Recovered/Not Resolved / 3 / No

10 mg / 37

STOMACH DISCOMFORT / Stomach Discomfort

30AUG2013 / 00:00 (2)

Dose Not Changed

Possible

Not Recovered/Not Resolved / 1 / Yes

10 mg / 37

PAIN / Pain

31AUG2013 / 00:00 (3)

Unknown

Possible

Not Recovered/Not Resolved / 1 / No

10 mg / 37

NASAL CONGESTION / Nasal Congestion

01SEP2013 / 00:00 (4)

Dose Reduced

Not Related

Not Recovered/Not Resolved / 2 / No

10 mg / 37

DIZZINESS / Dizziness

02SEP2013 / 00:00 (5)

03SEP2013 / 23:59 (6)

2

Dose Rate Reduced

Related

Recovered/Resolved / 5 / No

10 mg / 37

MALAISE / Malaise

02SEP2013 / 00:00 (5)

Not Applicable

Related

Not Recovered/Not Resolved / 2 / Yes

10 mg / 37

MALAISE / Malaise

02SEP2013 / 00:00 (5)

Drug Interrupted

Related

Not Recovered/Not Resolved / 0 / Yes

10 mg / 37

MYALGIA / Myalgia

02SEP2013 / 00:00 (5)

Drug Interrupted

Possible

Not Recovered/Not Resolved / 3 / No

10 mg / 37

PHARYNGOLARYNGEAL PAIN / Pharyngolaryngeal Pain

02SEP2013 / 00:00 (5)

Dose Not Changed

Not Related

Not Recovered/Not Resolved / 5 / No

10 mg / 37

PRODUCTIVE COUGH / Productive Cough

02SEP2013 / 00:00 (5)

Drug Interrupted

Not Related

Not Recovered/Not Resolved / 5 / Yes

10 mg / 37

DIZZINESS / Dizziness

04SEP2013 / 00:00 (7)

Dose Rate Reduced

Possible

Not Recovered/Not Resolved / 0 / Yes

10 mg / 37

CONTUSION / Contusion

05SEP2013 / 00:00 (8)

08OCT2013 / 23:59 (41)

34

Unknown

Related

Not Recovered/Not Resolved / 4 / No

10 mg / 37

CONTUSION / Contusion

05SEP2013 / 00:00 (8)

08OCT2013 / 23:59 (41)

34

Unknown

Related

Recovered/Resolved / 1 / No

10 mg / 37

HEADACHE / Headache

15SEP2013 / 00:00 (18)

Drug Withdrawn

Not Related

Not Recovered/Not Resolved / 3 / No

10 mg / 37

EPISTAXIS / Epistaxis

30SEP2013 / 00:00 (33)

Unknown

Related

Not Recovered/Not Resolved / 1 / No

10 mg / 37

APPLICATION SITE ERYTHEMA / Application Site Erythema

15OCT2013 / 00:00 (48)

Dose Increased

Probable

Not Recovered/Not Resolved / 1 / Yes

10 mg / 37

APPLICATION SITE PRURITUS / Application Site Pruritus

15OCT2013 / 00:00 (48)

Not Applicable

Probable

Not Recovered/Not Resolved / 5 / Yes

10 mg / 37

RESPIRATORY TRACT CONGESTION / Respiratory Tract Congestion

23OCT2013 / 00:00 (56)

Drug Withdrawn

Not Related

Not Recovered/Not Resolved / 4 / No

10 mg / 37

RHINITIS / Rhinitis

23OCT2013 / 00:00 (56)

Not Applicable

Not Related

Not Recovered/Not Resolved / 3 / Yes

10 mg / 37

FEELING ABNORMAL / Feeling Abnormal

24OCT2013 / 00:00 (57)

Dose Increased

Possible

Not Recovered/Not Resolved / 2 / Yes

10 mg / 37

LIBIDO DECREASED / Libido Decreased

24OCT2013 / 00:00 (57)

Unknown

Possible

Not Recovered/Not Resolved / 5 / Yes

10 mg / 37

LISTLESS / Listless

24OCT2013 / 00:00 (57)

Drug Withdrawn

Possible

Not Recovered/Not Resolved / 3 / Yes

01-701-1383

72 / F / Native Hawaiian or other Pacific Islander

10 mg / 37

APPLICATION SITE PAIN / Application Site Pain

07FEB2013 / 00:00 (4)

07FEB2013 / 23:59 (4)

1

Not Applicable

Probable

Recovered/Resolved / 0 / No

10 mg / 37

APPLICATION SITE PRURITUS / Application Site Pruritus

07FEB2013 / 00:00 (4)

07FEB2013 / 23:59 (4)

1

Dose Not Changed

Probable

Recovered/Resolved / 4 / No

10 mg / 37

APPLICATION SITE ERYTHEMA / Application Site Erythema

23MAR2013 / 00:00 (48)

26MAR2013 / 23:59 (51)

4

Dose Increased

Possible

Recovered/Resolved / 5 / Yes

10 mg / 37

APPLICATION SITE PRURITUS / Application Site Pruritus

23MAR2013 / 00:00 (48)

Not Applicable

Possible

Not Recovered/Not Resolved / 4 / No

10 mg / 37

APPLICATION SITE PRURITUS / Application Site Pruritus

23MAR2013 / 00:00 (48)

Drug Interrupted

Possible

Not Recovered/Not Resolved / 5 / Yes

10 mg / 37

APPLICATION SITE ERYTHEMA / Application Site Erythema

12APR2013 / 00:00 (68)

Dose Rate Reduced

Possible

Not Recovered/Not Resolved / 2 / No

10 mg / 37

APPLICATION SITE IRRITATION / Application Site Irritation

12APR2013 / 00:00 (68)

Dose Reduced

Possible

Not Recovered/Not Resolved / 2 / No

10 mg / 37

APPLICATION SITE IRRITATION / Application Site Irritation

12APR2013 / 00:00 (68)

Drug Withdrawn

Possible

Not Recovered/Not Resolved / 1 / No

10 mg / 37

APPLICATION SITE VESICLES / Application Site Vesicles

07MAY2013 / 00:00 (93)

24MAY2013 / 23:59 (110)

18

Drug Interrupted

Possible

Recovered/Resolved / 1 / Yes

10 mg / 37

CHEST DISCOMFORT / Chest Discomfort

24JUN2013 / 00:00 (141)

24JUN2013 / 23:59 (141)

1

Unknown

Not Related

Recovered/Resolved / 3 / No

10 mg / 37

HEADACHE / Headache

24JUN2013 / 00:00 (141)

24JUN2013 / 23:59 (141)

1

Dose Rate Reduced

Not Related

Recovered/Resolved / 3 / Yes

10 mg / 37

COUGH / Cough

17JUL2013 / 00:00 (164)

26JUL2013 / 23:59 (173)

10

Dose Increased

Not Related

Recovered/Resolved / 1 / No

01-701-1444

63 / M / American Indian or Alaska Native

10 mg / 37

APPLICATION SITE ERYTHEMA / Application Site Erythema

19JAN2013 / 00:00 (15)

Dose Not Changed

Possible

Not Recovered/Not Resolved / 1 / No

10 mg / 37

APPLICATION SITE ERYTHEMA / Application Site Erythema

19JAN2013 / 00:00 (15)

Dose Not Changed

Possible

Not Recovered/Not Resolved / 1 / No

10 mg / 37

APPLICATION SITE PRURITUS / Application Site Pruritus

19JAN2013 / 00:00 (15)

Dose Reduced

Probable

Not Recovered/Not Resolved / 0 / No

10 mg / 37

APPLICATION SITE PRURITUS / Application Site Pruritus

19JAN2013 / 00:00 (15)

Drug Withdrawn

Probable

Not Recovered/Not Resolved / 0 / No

10 mg / 37

SALIVARY HYPERSECRETION / Salivary Hypersecretion

19JAN2013 / 00:00 (15)

Drug Withdrawn

Possible

Not Recovered/Not Resolved / 5 / Yes

10 mg / 37

APPLICATION SITE IRRITATION / Application Site Irritation

04FEB2013 / 00:00 (31)

Dose Rate Reduced

Probable

Not Recovered/Not Resolved / 5 / Yes

10 mg / 37

APPLICATION SITE VESICLES / Application Site Vesicles

04FEB2013 / 00:00 (31)

Not Applicable

Probable

Not Recovered/Not Resolved / 5 / Yes

10 mg / 37

PARAESTHESIA / Paraesthesia

08FEB2013 / 00:00 (35)

08FEB2013 / 23:59 (35)

1

Dose Not Changed

Not Related

Recovered/Resolved / 3 / No

01-703-1076

69 / M / White

10 mg / 37

BIOPSY PROSTATE / Biopsy Prostate

16NOV2013 / 00:00 (23)

16NOV2013 / 23:59 (23)

1

Dose Reduced

Not Related

Recovered/Resolved / 4 / No

10 mg / 37

BENIGN PROSTATIC HYPERPLASIA / Benign Prostatic Hyperplasia

20NOV2013 / 00:00 (27)

Dose Increased

Not Related

Not Recovered/Not Resolved / 3 / Yes

10 mg / 37

APPLICATION SITE DERMATITIS / Application Site Dermatitis

23NOV2013 / 00:00 (30)

Dose Not Changed

Probable

Not Recovered/Not Resolved / 4 / Yes

10 mg / 37

APPLICATION SITE PRURITUS / Application Site Pruritus

23NOV2013 / 00:00 (30)

Dose Reduced

Probable

Not Recovered/Not Resolved / 4 / No

10 mg / 37

APPLICATION SITE PRURITUS / Application Site Pruritus

23NOV2013 / 00:00 (30)

Drug Interrupted

Probable

Not Recovered/Not Resolved / 5 / No

10 mg / 37

HYPERHIDROSIS / Hyperhidrosis

25NOV2013 / 00:00 (32)

Unknown

Possible

Not Recovered/Not Resolved / 0 / Yes

Key: *=imputed date, day, or duration

a Study day of last administration of [study treatment] prior to or on AE start date.

b Study day is relative to [the start of [study treatment]].

c Relationship is assessed by the investigator.

Note: Adverse events are coded using MedDRA version 26.0; toxicity grade is evaluated according to NCI-CTCAE version 5.0..

[lsfae01.docx][/usr/lib/rstudio-server/bin/quarto/share/rmd/rmd.R] 12JAN2026, 16:09

Download RTF file

TSFVIT06
LSFAE02
Source Code
---
title: LSFAE01
subtitle: Listing of Treatment-emergent Adverse Events
---

------------------------------------------------------------------------

{{< include ../../_utils/envir_hook.qmd >}}

```{r setup, echo = FALSE, warning = FALSE, message = FALSE}
options(docx.add_datetime = FALSE, tidytlg.add_datetime = FALSE)
envsetup_config_name <- "default"

# Path to the combined config file
envsetup_file_path <- file.path("../..", "envsetup.yml")

Sys.setenv(ENVSETUP_ENVIRON = '')
library(envsetup)
loaded_config <- config::get(config = envsetup_config_name, file = envsetup_file_path)
envsetup::rprofile(loaded_config)


dpscomp <- compound
dpspdr <- paste(protocol,dbrelease,rpteff,sep="__")

aptcomp <- compound
aptpdr <- paste(protocol,dbrelease,rpteff,sep="__")

###### Study specific updates (formerly in envre)

dpscomp <- "standards"
dpspdr <- "jjcs__NULL__jjcs - core"

apt <- FALSE
library(junco)
default_str_map <- rbind(default_str_map, c("&ctcae", "5.0"))

```

## Output

:::: panel-tabset
## {{< fa regular file-lines sm fw >}} Preview

```{r variant1, results='hide', warning = FALSE, message = FALSE}

# Program Name:              lsfae01.R

# Prep environment

library(envsetup)
library(tern)
library(dplyr)
library(rtables)
library(rlistings)
library(junco)
library(stringi)

# Define script level parameters

tblid <- "LSFAE01"
fileid <- tblid
popfl <- "SAFFL"
trtvar <- "TRT01A"
key_cols <- c("COL0", "COL1", "COL2")
disp_cols <- paste0("COL", 0:10)
concat_sep <- " / "
tab_titles <- get_titles_from_file(input_path = '../../_data/', tblid)
string_map <- default_str_map
# Parameter to control whether time should be displayed # from ASTDTM
include_time <- TRUE

# Process data

adae <- pharmaverseadamjnj::adae %>%
  filter(!!rlang::sym(popfl) == "Y" & TRTEMFL == "Y")

lsting <- adae %>%
  mutate(
    AGE = explicit_na(as.character(AGE), ""),
    SEX = explicit_na(SEX, ""),
    RACE_DECODE = explicit_na(RACE_DECODE, ""),
    DOSEON = explicit_na(as.character(DOSEON), ""),
    DOSEU = explicit_na(DOSEU, ""),
    DOSEDY = explicit_na(as.character(DOSEDY), ""),
    AEDECOD = explicit_na(AEDECOD, ""),
    AETERM = ifelse(
      is.na(AETERM),
      "",
      stringi::stri_trans_totitle(gsub("\\$", "", AETERM))
    ),
    ASTDT = ifelse(
      nchar(as.character(ASTDT)) == 10,
      toupper(format(ASTDT, "%d%b%Y")),
      ""
    ),
    ASTTM = ifelse(
      include_time & !is.na(ASTDTM),
      substr(as.character(ASTDTM), 12, 16),
      ""
    ),
    ASTDYN = ifelse(!is.na(ASTDY), ASTDY, NA),
    ASTDY = ifelse(!is.na(ASTDY), ASTDY, ""),
    ASTDTFS = ifelse(!is.na(ASTDTF), "*", ""),
    AENDT = explicit_na(as.character(AENDT), ""),
    AENDT = ifelse(
      nchar(AENDT) == 10,
      toupper(format(as.Date(AENDT), "%d%b%Y")),
      ""
    ),
    AENTM = ifelse(
      include_time & !is.na(AENDTM),
      substr(as.character(AENDTM), 12, 16),
      ""
    ),
    AENDY = ifelse(!is.na(AENDY), AENDY, ""),
    AENDTFS = ifelse(!is.na(AENDTF), "*", ""),
    ADURN = explicit_na(as.character(ADURN), ""),
    AEOUTC = explicit_na(AEOUT_DECODE, ""),
    # Optional Variable: COL10/AESEV/AETOXGR
    # AESEV = explicit_na(AESEV,""),
    AETOXGR = explicit_na(AETOXGR, ""),
    AESER_DECODE = explicit_na(AESER_DECODE, ""),
    COL0 = explicit_na(.data[[trtvar]], ""),
    COL1 = explicit_na(USUBJID, ""),
    COL2 = paste(AGE, SEX, RACE_DECODE, sep = concat_sep),
    COL3 = paste(paste0(DOSEON, " ", DOSEU), DOSEDY, sep = concat_sep),
    COL4 = paste(AEDECOD, AETERM, sep = concat_sep),
    COL5 = case_when(
      ASTDT == "" ~ "",
      include_time & ASTDT != "" & ASTTM != "" & ASTDY != "" & ASTDTFS != "" ~
        paste0(ASTDT, concat_sep, ASTTM, " (", ASTDY, ")", ASTDTFS),
      include_time & ASTDT != "" & ASTTM != "" & ASTDY != "" & ASTDTFS == "" ~
        paste0(ASTDT, concat_sep, ASTTM, " (", ASTDY, ")"),
      include_time & ASTDT != "" & ASTTM == "" & ASTDY != "" & ASTDTFS != "" ~
        paste0(ASTDT, concat_sep, "--:--", " (", ASTDY, ")", ASTDTFS),
      include_time & ASTDT != "" & ASTTM == "" & ASTDY != "" & ASTDTFS == "" ~
        paste0(ASTDT, concat_sep, "--:--", " (", ASTDY, ")"),
      ASTDT != "" & ASTDY != "" & ASTDTFS != "" ~
        paste0(ASTDT, " (", ASTDY, ")", ASTDTFS),
      ASTDT != "" & ASTDY != "" & ASTDTFS == "" ~
        paste0(ASTDT, " (", ASTDY, ")"),
    ),
    COL6 = case_when(
      AENDT == "" ~ "",
      include_time & AENDT != "" & AENTM != "" & AENDY != "" & AENDTFS != "" ~
        paste0(AENDT, concat_sep, AENTM, " (", AENDY, ")", AENDTFS),
      include_time & AENDT != "" & AENTM != "" & AENDY != "" & AENDTFS == "" ~
        paste0(AENDT, concat_sep, AENTM, " (", AENDY, ")"),
      include_time & AENDT != "" & AENTM == "" & AENDY != "" & AENDTFS != "" ~
        paste0(AENDT, concat_sep, "--:--", " (", AENDY, ")", AENDTFS),
      include_time & AENDT != "" & AENTM == "" & AENDY != "" & AENDTFS == "" ~
        paste0(AENDT, concat_sep, "--:--", " (", AENDY, ")"),
      AENDT != "" & AENDY != "" & AENDTFS != "" ~
        paste0(AENDT, " (", AENDY, ")", AENDTFS),
      AENDT != "" & AENDY != "" & AENDTFS == "" ~
        paste0(AENDT, " (", AENDY, ")"),
    ),
    COL7 = explicit_na(ADURN, ""),
    # Optional Column: COL8/AEACN
    COL8 = explicit_na(AEACN_DECODE, ""),
    COL9 = explicit_na(AEREL_DECODE, ""),
    # Optional Variable: COL10/AESEV/AETOXGR
    # COL10 = paste(AEOUTC, AESEV, AESER_DECODE, sep = concat_sep)
    COL10 = paste(AEOUTC, AETOXGR, AESER_DECODE, sep = concat_sep)
  ) %>%
  arrange(
    COL0,
    COL1,
    COL2,
    !is.na(ASTDYN),
    ASTDYN,
    if (include_time) ASTDTM else ASTDT,
    AEDECOD,
    AETERM
  )

lsting <- var_relabel(
  lsting,
  COL0 = "Treatment Group",
  COL1 = "Subject ID",
  COL2 = paste("Age (years)", "Sex", "Race", sep = concat_sep),
  COL3 = paste(
    "Onset Dose (unit)",
    "Day of Last Dose~[super a,b]",
    sep = concat_sep
  ),
  COL4 = paste("Preferred Term", "Reported Term", sep = concat_sep),
  COL5 = if (include_time) {
    paste("Start Date", "Time (Study Day~[super b])", sep = concat_sep)
  } else {
    "Start Date (Study Day~[super b])"
  },
  COL6 = if (include_time) {
    paste("End Date", "Time (Study Day~[super b])", sep = concat_sep)
  } else {
    "End Date (Study Day~[super b])"
  },
  COL7 = "AE Duration (Days)",
  # Optional Column: COL8/AEACN
  COL8 = "Action Taken With Study Treatment",
  COL9 = "Relationship to Study Treatment~[super c]",
  # Optional Variable: COL10/AESEV/AETOXGR
  # COL10 = paste("Outcome", "Severity", "Serious", sep = concat_sep)
  COL10 = paste("Outcome", "Toxicity Grade", "Serious", sep = concat_sep)
)

# Build listing

result <- rlistings::as_listing(
  df = lsting,
  key_cols = key_cols,
  disp_cols = disp_cols
)

# Add titles and footnotes:

result <- set_titles(result, tab_titles)

# Output listing

tt_to_tlgrtf(string_map = string_map, tt = head(result, 100), file = fileid, orientation = "landscape")
```
```{r result1, echo=FALSE, message=FALSE, warning=FALSE, test = list(result_v1 = "result")}
tt_to_flextable_j(head(result,100), tblid, string_map = string_map)
```

[Download RTF file](`r paste0(tolower(tblid), '.rtf')`)
::::

Made with ❤️ by the J&J Team

  • Edit this page
  • Report an issue
Cookie Preferences