# Report-specific parameters
template: plotTemplate.Rmd
templatePackage: clinDataReview
reportTitle: "Laboratory profiles"
reportTitleLevel: 2
split_by: 4

# Dataset of interest
dataFileName: lb.xpt
dataProcessing:
  - annotate:
    - dataset: dm
      vars: ["RFXSTDTC", "ARM"]
    - vars: LBCAT
      varFct: 'ifelse(LBCAT == "", "Not Coded", LBCAT)'
    # combine parameter name and unit
    - vars: LBTESTSP
      varLabel: "Lab Test (Standard Units)"
      varFct: paste0(LBTEST, " (", LBSTRESU, ")")
      
  - filter:
    # safety analysis set: treated-patients
    - var: "RFXSTDTC" 
      value: ""
      rev: true
      
# Looping parameters
loopingVar: ["LBCAT", "LBTESTSP"]

# Plot parameters
plotFunction: "scatterplotClinData"
plotParams:
  xVar: "LBDY"
  yVar: "LBSTRESN"
  aesPointVar:
    colour: "ARM"
    fill: "ARM"
    shape: "LBNRIND"
  aesLineVar:
    group: "USUBJID"
  refLinePars:
    - yintercept: "LBSTNRLO"
      colour: "lightblue"
    - yintercept: "LBSTNRHI"
      colour: "darkblue"
  scalePars:
    - aesthetic: shape
      values: !r-lazy clinUtils::getPaletteCDISC(x = dataI$LBNRIND, var = "NRIND", type = "shape")
  themePars:
      legend.position: "none"
  hoverVars: ["USUBJID", "VISIT", "LBDY", "LBSTRESN", "LBNRIND", "LBSTNRLO", "LBSTNRHI"]
  tableVars: ["LBCAT", "LBTESTSP", "USUBJID", "VISIT", "LBDY", "LBSTRESN", "LBNRIND", "LBSTNRLO", "LBSTNRHI"]
