Skip to content

Commit

Permalink
Add PLP RDMS to results (#166)
Browse files Browse the repository at this point in the history
* Add RDMS to PLP results

* Update GHA dependencies
  • Loading branch information
anthonysena authored Sep 16, 2024
1 parent 984b13f commit 4a3505a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/R_CMD_check_Hades.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:

- name: Upload source package
if: success() && runner.os == 'Windows' && github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: package_tarball
path: check/*.tar.gz
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
#
# - name: Download package tarball
# if: ${{ env.new_version != '' }}
# uses: actions/download-artifact@v2
# uses: actions/download-artifact@v4
# with:
# name: package_tarball
#
Expand Down
22 changes: 21 additions & 1 deletion R/Module-PatientLevelPrediction.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ PatientLevelPredictionModule <- R6::R6Class(
cohortDatabaseSchema = jobContext$moduleExecutionSettings$workDatabaseSchema,
cdmDatabaseName = jobContext$moduleExecutionSettings$connectionDetailsReference,
cdmDatabaseId = jobContext$moduleExecutionSettings$cdmDatabaseMetaData$databaseId,
# tempEmulationSchema = , is there s temp schema specified anywhere?
tempEmulationSchema = jobContext$moduleExecutionSettings$tempEmulationSchema,
cohortTable = jobContext$moduleExecutionSettings$cohortTableNames$cohortTable,
outcomeDatabaseSchema = jobContext$moduleExecutionSettings$workDatabaseSchema,
outcomeTable = jobContext$moduleExecutionSettings$cohortTableNames$cohortTable
Expand Down Expand Up @@ -73,6 +73,13 @@ PatientLevelPredictionModule <- R6::R6Class(
fileAppend = NULL
)

resultsDataModel <- private$.getResultsDataModelSpecification()
CohortGenerator::writeCsv(
x = resultsDataModel,
file = file.path(resultsFolder, "resultsDataModelSpecification.csv"),
warnOnFileNameCaseMismatch = F
)

private$.message(paste("Results available at:", resultsFolder))
},
#' @description Create the results data model for the module
Expand Down Expand Up @@ -166,6 +173,19 @@ PatientLevelPredictionModule <- R6::R6Class(
}

return(modelDesignList)
},
.getResultsDataModelSpecification = function() {
rdms <- CohortGenerator::readCsv(
file = private$.getResultsDataModelSpecificationFileLocation()
)
rdms$tableName <-paste0(self$tablePrefix, rdms$tableName)
return(rdms)
},
.getResultsDataModelSpecificationFileLocation = function() {
return(system.file(
file.path("settings", "resultsDataModelSpecification.csv"),
package = "PatientLevelPrediction"
))
}
)
)

0 comments on commit 4a3505a

Please sign in to comment.