-
Notifications
You must be signed in to change notification settings - Fork 0
/
report.Rmd
187 lines (114 loc) · 4.13 KB
/
report.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
---
header-includes:
- \usepackage{fancyhdr}
- \fancyfoot[CO,CE]{OSC-Group - http://www.osc-lab.de - JMU Wuerzburg - Pharmazie}
- \fancyfoot[LE,RO]{\thepage}
- \usepackage{fontspec}
- \setmainfont{OpenSans}
- \usepackage{lscape}
- \newcommand{\blandscape}{\begin{landscape}}
- \newcommand{\elandscape}{\end{landscape}}
title: "TDM Report - Vancomycin"
output:
pdf_document:
latexengine: xelatex
df_print: paged
date: "`r format(Sys.time(), '%d.%B %Y')`"
---
\setmainfont{OpenSans}
\addtolength{\headheight}{1.0cm}
\pagestyle{fancyplain}
\rhead{\includegraphics[height=1.2cm]{./logo_rechts.png}}
\lhead{\includegraphics[height=1.2cm]{./logo_links.png}}
\renewcommand{\headrulewidth}{0pt}
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# **Patient characteristics at baseline**
Patient ID: **`r input$pat_ID`**
Body weight: **`r input$WT`** kg
Creatinine Clearance: **`r input$CRCL`** mL/min
Receives Dialysis: **`r if(input$has_dialysis) {"Yes"}else{"No"}`**
``` {r ind_pars, echo=FALSE}
```
# **Pathogen Information**
Pathogen: **`r names(GLOB_PATHOGENS[as.numeric(input$choose_pathogen)])`**
MIC: **`r input$MIC`** mg/L
``` {r scheme, echo=FALSE}
```
# **Clinical Recommendation**
**`r names(GLOB_RECOMMENDATIONS[as.numeric(input$choose_recommendation)])`**
`r input$report_comment`
`r if(input$additional_tdm){
"Additional TDM sample should be obtained (see Graphic for further information)"
} `
`r if(input$add_dur_info){
"Infusion Duration should not fall below 60 min. CAVE: Red-Man-Syndrome!"
} `
\newpage
## **Recommended Dosing strategy**
`r if(app_data$forecast_advanced){
tmp <- app_data$user_forecast_data_set
colnames(tmp) <- c('Date', 'Time', 'Dose [mg]', 'Infusion duration [min]')
kable(tmp, format = "latex") %>%
kable_styling(position = "left")
} else {
tmp <- data.frame('Interdose Interval [h]'=input$adapt.ii,
'Dose [mg]'=input$adapt.dose,
'Infusion duration [min]'=input$adapt.dur)
colnames(tmp) <- c('Interdose Interval [h]', 'Dose [mg]', 'Infusion duration [min]')
kable(tmp, format = "latex") %>%
kable_styling(position = "left")
} `
\newpage
\blandscape
## **Forecast for the next `r input$adapt.n` doses:**
``` {r recomm, echo=FALSE, warning=FALSE, fig.height = 7, fig.width = 12, fig.align = "center"}
app_data$adapted_pk_plot_withTDM
```
\elandscape
\newpage
# **Dataset used**
``` {r tdm, echo=FALSE, warning=FALSE}
kable(app_data$user_data_set, format = "latex") %>%
kable_styling(position = "left")
```
\newpage
\blandscape
# **Simulated Plasmaconcentration from Dataset**
```{r simulation, echo=FALSE, warning=FALSE, fig.height = 7, fig.width = 12, fig.align = "center"}
if(app_data$tdm_samples_available){
app_data$pk_plots[[1]]
} else {
app_data$pk_plots[[2]]
}
```
\elandscape
\newpage
# **MCMC Diagnostic Plots (1/2) - Results of Gibbs-Sampling and prior vs posterior distribution**
```{r mcmc_diag, echo=FALSE, warning=FALSE}
if(app_data$tdm_samples_available){
gridExtra::grid.arrange(app_data$mcmc_result[[1]]$p_iter_ETA1, app_data$mcmc_result[[1]]$p_dens_ETA1,
app_data$mcmc_result[[1]]$p_iter_ETA2, app_data$mcmc_result[[1]]$p_dens_ETA2,
app_data$mcmc_result[[1]]$p_iter_ETA3, app_data$mcmc_result[[1]]$p_dens_ETA3, nrow=3, ncol=2, widths=c(3,1))
}
```
\newpage
# **MCMC Diagnostic Plots (2/2) - distribution and correlation of random effects**
```{r mcmc_diag_2, echo=FALSE, warning=FALSE}
if(app_data$tdm_samples_available){
chart.Correlation(app_data$mcmc_result[[1]]$chain_data, histogram=TRUE)
}
```
\newpage
# **MC Diagnostic Plots - distribution and correlation of random effects**
```{r mc_diag, echo=FALSE, warning=FALSE}
chart.Correlation(app_data$mc_result[[3]], histogram=TRUE)
```
\newpage
\blandscape
# **Simulated PK Parameter distributions** at baseline
```{r par_dist, echo=FALSE, warning=FALSE, fig.height = 7, fig.width = 16, fig.align = "center"}
grid.arrange(app_data$dist_plots[[1]],app_data$dist_plots[[2]],app_data$dist_plots[[3]], nrow=1, ncol=3)
```
\elandscape