Skip to content

Commit

Permalink
Add location and caresite support #177 (#181)
Browse files Browse the repository at this point in the history
* Add scripts and vignettes for location and care_site support
  • Loading branch information
burrowse authored Feb 8, 2024
1 parent 5319443 commit 9392b87
Show file tree
Hide file tree
Showing 63 changed files with 1,424 additions and 404 deletions.
5 changes: 3 additions & 2 deletions R/CreateVocabMapTables.r
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' \code{DatabaseConnector} package.
#' @param cdmSchema The name of the database schema that will contain the Vocab mapping
#' tables. Requires read and write permissions to this database. On SQL
#' Server, this should specifiy both the database and the schema,
#' Server, this should specify both the database and the schema,
#' so for example 'cdm_instance.dbo'.
#' @param cdmVersion The version of your CDM. Currently "5.3" and "5.4" are supported.
#' @param sqlOnly A boolean that determines whether or not to perform the load or generate SQL scripts. Default is FALSE.
Expand All @@ -33,7 +33,8 @@ CreateVocabMapTables <-
queries <-
c(
"create_source_to_standard_vocab_map.sql",
"create_source_to_source_vocab_map.sql"
"create_source_to_source_vocab_map.sql",
"create_states_map.sql"
)

if (!sqlOnly) {
Expand Down
22 changes: 22 additions & 0 deletions R/LoadEventTables.r
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,28 @@ LoadEventTables <- function(connectionDetails,
}
}

# location
fileQuery <- "insert_location.sql"
sql <- SqlRender::loadRenderTranslateSql(
sqlFilename = file.path(sqlFilePath, fileQuery),
packageName = "ETLSyntheaBuilder",
dbms = connectionDetails$dbms,
cdm_schema = cdmSchema,
synthea_schema = syntheaSchema
)
runStep(sql, fileQuery)

# care_site
fileQuery <- "insert_care_site.sql"
sql <- SqlRender::loadRenderTranslateSql(
sqlFilename = file.path(sqlFilePath, fileQuery),
packageName = "ETLSyntheaBuilder",
dbms = connectionDetails$dbms,
cdm_schema = cdmSchema,
synthea_schema = syntheaSchema
)
runStep(sql, fileQuery)

# person
fileQuery <- "insert_person.sql"
sql <- SqlRender::loadRenderTranslateSql(
Expand Down
20 changes: 13 additions & 7 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 14 additions & 8 deletions docs/articles/Condition_occurrence.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 14 additions & 8 deletions docs/articles/Cost.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 16 additions & 9 deletions docs/articles/Device_exposure.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 14 additions & 8 deletions docs/articles/Drug_exposure.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 14 additions & 8 deletions docs/articles/Measurement.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9392b87

Please sign in to comment.