Skip to content

Commit

Permalink
add tol to avoid float inprec in sofa_cardio
Browse files Browse the repository at this point in the history
  • Loading branch information
prockenschaub committed Apr 20, 2023
1 parent 1942e93 commit 86c8e28
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions R/callback-sofa.R
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,12 @@ sofa_liver <- sofa_single(
sofa_cardio <- function(..., interval = NULL) {

score_calc <- function(map, dopa, norepi, dobu, epi) {
eps <- 10^-6
fifelse(
is_true(dopa > 15 | epi > 0.1 | norepi > 0.1), 4L, fifelse(
is_true(dopa > 5 | (epi > 0 & epi <= 0.1) |
(norepi > 0 & norepi <= 0.1)), 3L, fifelse(
is_true((dopa > 0 & dopa <= 5) | dobu > 0), 2L, fifelse(
is_true(dopa > 15 + eps | epi > 0.1 + eps | norepi > 0.1 + eps), 4L, fifelse(
is_true(dopa > 5 + eps | (epi > 0 + eps & epi <= 0.1 + eps) |
(norepi > 0 + eps & norepi <= 0.1 + eps)), 3L, fifelse(
is_true((dopa > 0 + eps & dopa <= 5 + eps) | dobu > 0 + eps), 2L, fifelse(
is_true(map < 70), 1L, 0L
)
)
Expand Down

0 comments on commit 86c8e28

Please sign in to comment.