Skip to content

Commit

Permalink
skip population creation if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
egillax committed Jan 23, 2024
1 parent 988221c commit 8fbee84
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions R/RunPlp.R
Original file line number Diff line number Diff line change
Expand Up @@ -268,21 +268,22 @@ runPlp <- function(
})

# create the population
population <- tryCatch(
{
do.call(
createStudyPopulation,
list(
plpData = plpData,
outcomeId = outcomeId,
populationSettings = populationSettings,
population = plpData$population
)
)
},
if(!is.null(plpData$population)) {
ParallelLogger::logInfo('Using existing population')

Check warning on line 272 in R/RunPlp.R

View check run for this annotation

Codecov / codecov/patch

R/RunPlp.R#L272

Added line #L272 was not covered by tests
} else {
ParallelLogger::logInfo('Creating population')
population <- tryCatch({
do.call(createStudyPopulation,
list(plpData = plpData,
outcomeId = outcomeId,
populationSettings = populationSettings,
population = plpData$population
)
)},
error = function(e){ParallelLogger::logError(e); return(NULL)}
)

)
}

if(is.null(population)){
stop('population NULL')
}
Expand Down

0 comments on commit 8fbee84

Please sign in to comment.