add option to only include subset of tables
This commit is contained in:
parent
759270d000
commit
0c07bfe881
|
@ -1,6 +1,8 @@
|
|||
|
||||
cdmVersion <- '5.4'
|
||||
cdmPart <- c('CDM','VOCAB', 'RESULTS')
|
||||
cdmTables <- NULL #c('PERSON', 'OBSERVATION_PERIOD', 'VISIT_OCCURRENCE', 'CONDITION_OCCURRENCE', 'CONCEPT')
|
||||
|
||||
cdmTableCsvLoc <- system.file(file.path("csv", paste0("OMOP_CDMv", cdmVersion, "_Table_Level.csv")), package = "CommonDataModel", mustWork = TRUE)
|
||||
cdmFieldCsvLoc <- system.file(file.path("csv", paste0("OMOP_CDMv", cdmVersion, "_Field_Level.csv")), package = "CommonDataModel", mustWork = TRUE)
|
||||
|
||||
|
@ -15,6 +17,9 @@ for (i in 1:nrow(tableSpecs)) {
|
|||
if (!(table$schema %in% cdmPart)) {
|
||||
next
|
||||
}
|
||||
if (!is.null(cdmTables) && !(table$cdmTableName %in% cdmTables)) {
|
||||
next
|
||||
}
|
||||
mermaidDdlLines <- c(mermaidDdlLines,
|
||||
sprintf(' %s {', tableName))
|
||||
|
||||
|
@ -37,6 +42,9 @@ for (i in 1:nrow(tableSpecs)) {
|
|||
if (!(fkTable$schema %in% cdmPart)) {
|
||||
next
|
||||
}
|
||||
if (!is.null(cdmTables) && !(fkTable$cdmTableName %in% cdmTables)) {
|
||||
next
|
||||
}
|
||||
|
||||
fkRelation <- sprintf(' %s ||--o{ %s : ""', tableName, field$fkTableName)
|
||||
if (fkRelation %in% mermaidFkLines) {
|
||||
|
|
Loading…
Reference in New Issue