Skip to content

Commit

Permalink
allow to specify label in modules content by the end user
Browse files Browse the repository at this point in the history
  • Loading branch information
m7pr committed Sep 27, 2023
1 parent ab95313 commit 500b8f1
Show file tree
Hide file tree
Showing 25 changed files with 125 additions and 75 deletions.
8 changes: 5 additions & 3 deletions R/tm_g_pp_patient_timeline.R
Original file line number Diff line number Diff line change
Expand Up @@ -894,10 +894,12 @@ srv_g_patient_timeline <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Patient Profile Timeline Plot")
card$append_text("Patient Profile Timeline Plot", "header2")
title <- "Patient Profile Timeline Plot"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_g_pp_therapy.R
Original file line number Diff line number Diff line change
Expand Up @@ -682,10 +682,12 @@ srv_g_therapy <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Patient Profile Therapy Plot")
card$append_text("Patient Profile Therapy Plot", "header2")
title <- "Patient Profile Therapy Plot"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_g_pp_vitals.R
Original file line number Diff line number Diff line change
Expand Up @@ -528,10 +528,12 @@ srv_g_vitals <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Patient Profile Vitals Plot")
card$append_text("Patient Profile Vitals Plot", "header2")
title <- "Patient Profile Vitals Plot"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_abnormality.R
Original file line number Diff line number Diff line change
Expand Up @@ -647,10 +647,12 @@ srv_t_abnormality <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Abnormality Summary Table")
card$append_text("Abnormality Summary Table", "header2")
title <- "Abnormality Summary Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_abnormality_by_worst_grade.R
Original file line number Diff line number Diff line change
Expand Up @@ -664,10 +664,12 @@ srv_t_abnormality_by_worst_grade <- function(id, # nolint

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Laboratory Test Results Table")
card$append_text("Laboratory Test Results Table", "header2")
title <- "Laboratory Test Results Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
card$append_text("Laboratory test results with highest grade post-baseline Table", "header3")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_ancova.R
Original file line number Diff line number Diff line change
Expand Up @@ -945,10 +945,12 @@ srv_ancova <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("ANCOVA")
card$append_text("ANCOVA", "header2")
title <- "ANCOVA"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
card$append_text("Analysis of Covariance", "header3")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_binary_outcome.R
Original file line number Diff line number Diff line change
Expand Up @@ -1008,10 +1008,12 @@ srv_t_binary_outcome <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Binary Outcome Table")
card$append_text("Binary Outcome Table", "header2")
title <- "Binary Outcome Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_events.R
Original file line number Diff line number Diff line change
Expand Up @@ -793,10 +793,12 @@ srv_t_events_byterm <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Events by Term Table")
card$append_text("Events by Term Table", "header2")
title <- "Events by Term Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_events_by_grade.R
Original file line number Diff line number Diff line change
Expand Up @@ -1193,10 +1193,12 @@ srv_t_events_by_grade <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Events by Grade Table")
card$append_text("Events by Grade Table", "header2")
title <- "Events by Grade Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_events_patyear.R
Original file line number Diff line number Diff line change
Expand Up @@ -555,10 +555,12 @@ srv_events_patyear <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Event Rates Adjusted For Patient-Years Table")
card$append_text("Event Rates Adjusted For Patient-Years Table", "header2")
title <- "Event Rates Adjusted For Patient-Years Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_events_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -965,10 +965,12 @@ srv_t_events_summary <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Adverse Events Summary Table")
card$append_text("Adverse Events Summary Table", "header2")
title <- "Adverse Events Summary Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_exposure.R
Original file line number Diff line number Diff line change
Expand Up @@ -645,10 +645,12 @@ srv_t_exposure <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Exposure for Risk Management Plan Table")
card$append_text("Exposure for Risk Management Plan Table", "header2")
title <- "Exposure for Risk Management Plan Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_logistic.R
Original file line number Diff line number Diff line change
Expand Up @@ -713,10 +713,12 @@ srv_t_logistic <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Logistic Regression Table")
card$append_text("Logistic Regression Table", "header2")
title <- "Logistic Regression Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_mult_events.R
Original file line number Diff line number Diff line change
Expand Up @@ -591,10 +591,12 @@ srv_t_mult_events_byterm <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Multiple Events by Term Table")
card$append_text("Multiple Events by Term Table", "header2")
title <- "Multiple Events by Term Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_pp_basic_info.R
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,12 @@ srv_t_basic_info <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Patient Profile Basic Info Table")
card$append_text("Patient Profile Basic Info Table", "header2")
title <- "Patient Profile Basic Info Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_pp_laboratory.R
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,12 @@ srv_g_laboratory <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Patient Profile Laboratory Table")
card$append_text("Patient Profile Laboratory Table", "header2")
title <- "Patient Profile Laboratory Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_pp_medical_history.R
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,12 @@ srv_t_medical_history <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Patient Medical History Table")
card$append_text("Patient Medical History Table", "header2")
title <- "Patient Medical History Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_pp_prior_medication.R
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,12 @@ srv_t_prior_medication <- function(id,
)

if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Patient Prior Medication Table")
card$append_text("Patient Prior Medication Table", "header2")
title <- "Patient Prior Medication Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_shift_by_arm.R
Original file line number Diff line number Diff line change
Expand Up @@ -528,10 +528,12 @@ srv_shift_by_arm <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Shift by Arm Table")
card$append_text("Shift by Arm Table", "header2")
title <- "Shift by Arm Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_shift_by_arm_by_worst.R
Original file line number Diff line number Diff line change
Expand Up @@ -566,10 +566,12 @@ srv_shift_by_arm_by_worst <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Shift by Arm by Worst Table")
card$append_text("Shift by Arm by Worst Table", "header2")
title <- "Shift by Arm by Worst Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_shift_by_grade.R
Original file line number Diff line number Diff line change
Expand Up @@ -886,10 +886,12 @@ srv_t_shift_by_grade <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Grade Summary Table")
card$append_text("Grade Summary Table", "header2")
title <- "Grade Summary Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_smq.R
Original file line number Diff line number Diff line change
Expand Up @@ -658,10 +658,12 @@ srv_t_smq <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("SMQ Table")
card$append_text("Adverse Events Table by Standardized `MedDRA` Query (SMQ)", "header2")
title <- "Adverse Events Table by Standardized `MedDRA` Query (SMQ)"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -576,10 +576,12 @@ srv_summary <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Summary Table")
card$append_text("Summary Table", "header2")
title <- "Summary Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_summary_by.R
Original file line number Diff line number Diff line change
Expand Up @@ -733,10 +733,12 @@ srv_summary_by <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Summarize Variables by Row Groups Table")
card$append_text("Summarize Variables by Row Groups Table", "header2")
title <- "Summarize Variables by Row Groups Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_tte.R
Original file line number Diff line number Diff line change
Expand Up @@ -926,10 +926,12 @@ srv_t_tte <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
card$set_name("Time To Event Table")
card$append_text("Time To Event Table", "header2")
title <- "Time To Event Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
Expand Down

0 comments on commit 500b8f1

Please sign in to comment.