add option to only include subset of tables
This commit is contained in:
parent
759270d000
commit
0c07bfe881
|
@ -1,6 +1,8 @@
|
||||||
|
|
||||||
cdmVersion <- '5.4'
|
cdmVersion <- '5.4'
|
||||||
cdmPart <- c('CDM','VOCAB', 'RESULTS')
|
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)
|
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)
|
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)) {
|
if (!(table$schema %in% cdmPart)) {
|
||||||
next
|
next
|
||||||
}
|
}
|
||||||
|
if (!is.null(cdmTables) && !(table$cdmTableName %in% cdmTables)) {
|
||||||
|
next
|
||||||
|
}
|
||||||
mermaidDdlLines <- c(mermaidDdlLines,
|
mermaidDdlLines <- c(mermaidDdlLines,
|
||||||
sprintf(' %s {', tableName))
|
sprintf(' %s {', tableName))
|
||||||
|
|
||||||
|
@ -37,6 +42,9 @@ for (i in 1:nrow(tableSpecs)) {
|
||||||
if (!(fkTable$schema %in% cdmPart)) {
|
if (!(fkTable$schema %in% cdmPart)) {
|
||||||
next
|
next
|
||||||
}
|
}
|
||||||
|
if (!is.null(cdmTables) && !(fkTable$cdmTableName %in% cdmTables)) {
|
||||||
|
next
|
||||||
|
}
|
||||||
|
|
||||||
fkRelation <- sprintf(' %s ||--o{ %s : ""', tableName, field$fkTableName)
|
fkRelation <- sprintf(' %s ||--o{ %s : ""', tableName, field$fkTableName)
|
||||||
if (fkRelation %in% mermaidFkLines) {
|
if (fkRelation %in% mermaidFkLines) {
|
||||||
|
|
Loading…
Reference in New Issue