diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index f2ea7821..9fcf3153 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -2,7 +2,7 @@ # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - branches: [main, master] + branches: [results-data-model, main, master] pull_request: branches: [main, master] release: @@ -81,7 +81,7 @@ jobs: - name: Execute SchemaSpy run: | - java -jar extras/rdms/schemaspy-6.2.4.jar -vizjs -dp $HOME -configFile extras/rdms/schemaspy-config.properties -meta extras/rdms/schema_meta.xml -debug -desc "Results data model" -noTablePaging + java -jar extras/rdms/schemaspy-6.2.4.jar -vizjs -dp $HOME -configFile extras/rdms/schemaspy-config.properties -meta extras/rdms/schema_meta.xml -debug -desc "Results data model" -noTablePaging -noimplied - name: Upload artifact uses: actions/upload-artifact@v4 diff --git a/extras/DocumentResultsDataModel.R b/extras/DocumentResultsDataModel.R index 5f882b88..b6944ffe 100644 --- a/extras/DocumentResultsDataModel.R +++ b/extras/DocumentResultsDataModel.R @@ -110,7 +110,12 @@ schemaMeta <- xml_new_root("schemaMeta", "xsi:noNamespaceSchemaLocation" = "http://schemaspy.org/xsd/6/schemameta.xsd") # Add comments node -xml_add_child(schemaMeta, "comments", "This is where we'll describe the Strategus results data model.") +xml_add_child( + schemaMeta, + "comments", + "The tables in the results data model are grouped using a unique prefix for + each Strategus module. For example, the CharacterizationModule results tables + all start with \"c_\".") # Create tables node tables <- xml_add_child(schemaMeta, "tables") @@ -127,7 +132,7 @@ resultsTableRelationships <-CohortGenerator::readCsv( for (i in seq_along(uniqueTableNames)) { # Add table node with attributes currentTableName <- uniqueTableNames[i] - print(currentTableName) + #print(currentTableName) # Get the table description, if it exists currentTableDescriptionInfo <- tableDescriptions %>% filter(.data$tableName == currentTableName) @@ -144,14 +149,14 @@ for (i in seq_along(uniqueTableNames)) { for (j in 1:nrow(columnsForCurrentTable)) { curColumnName <- columnsForCurrentTable$columnName[j] description <- columnsForCurrentTable$description[j] - print(paste0(" -- ", curColumnName)) + #print(paste0(" -- ", curColumnName)) # Add column node with attributes columnNode <- xml_add_child(table, "column", name = curColumnName, comments = description) # Determine if this table + column has a FK relationship to any other tables curColumnFk <- resultsTableRelationships %>% filter(.data$tableName == currentTableName & .data$columnName == curColumnName) if (nrow(curColumnFk) > 0) { - print(paste0("-- FK FOUND FOR: ", currentTableName, ".", curColumnName)) + #print(paste0("-- FK FOUND FOR: ", currentTableName, ".", curColumnName)) for (k in 1:nrow(curColumnFk)) { fkTable <- curColumnFk$fkTableName[k] fkColumn <- curColumnFk$fkColumnName[k] diff --git a/extras/rdms/results_table_relationships.csv b/extras/rdms/results_table_relationships.csv index e319a5cc..ae805e9b 100644 --- a/extras/rdms/results_table_relationships.csv +++ b/extras/rdms/results_table_relationships.csv @@ -18,21 +18,21 @@ c_covariates_continuous,covariate_id,c_covariate_ref,covariate_id c_covariates_continuous,database_id,c_settings,database_id c_covariates_continuous,database_id,database_meta_data,database_id database_meta_data,database_id,c_cohort_details,database_id -c_DECHALLENGE_RECHALLENGE,target_cohort_definition_id,cg_cohort_definition,cohort_definition_id -c_DECHALLENGE_RECHALLENGE,outcome_cohort_definition_id,cg_cohort_definition,cohort_definition_id -c_DECHALLENGE_RECHALLENGE,database_id,database_meta_data,database_id -ci_incidence_SUMMARY,outcome_id,ci_outcome_def,outcome_id -ci_incidence_SUMMARY,ref_id,ci_outcome_def,ref_id -ci_incidence_SUMMARY,ref_id,ci_tar_def,ref_id -ci_incidence_SUMMARY,tar_id,ci_tar_def,ref_id -ci_incidence_SUMMARY,subgroup_id,ci_subgroup_def,subgroup_id -ci_incidence_SUMMARY,ref_id,ci_subgroup_def,ref_id -ci_incidence_SUMMARY,age_group_id,ci_age_group_def,age_group_id -ci_incidence_SUMMARY,ref_id,ci_age_group_def,ref_id -ci_incidence_SUMMARY,database_id,database_meta_data,database_id -ci_incidence_SUMMARY,target_cohort_definition_id,cg_cohort_definition,cohort_definition_id -ci_incidence_SUMMARY,outcome_cohort_definition_id,cg_cohort_definition,cohort_definition_id -c_TIME_TO_EVENT,database_id,database_meta_data,database_id +c_dechallenge_rechallenge,target_cohort_definition_id,cg_cohort_definition,cohort_definition_id +c_dechallenge_rechallenge,outcome_cohort_definition_id,cg_cohort_definition,cohort_definition_id +c_dechallenge_rechallenge,database_id,database_meta_data,database_id +ci_incidence_summary,outcome_id,ci_outcome_def,outcome_id +ci_incidence_summary,ref_id,ci_outcome_def,ref_id +ci_incidence_summary,ref_id,ci_tar_def,ref_id +ci_incidence_summary,tar_id,ci_tar_def,ref_id +ci_incidence_summary,subgroup_id,ci_subgroup_def,subgroup_id +ci_incidence_summary,ref_id,ci_subgroup_def,ref_id +ci_incidence_summary,age_group_id,ci_age_group_def,age_group_id +ci_incidence_summary,ref_id,ci_age_group_def,ref_id +ci_incidence_summary,database_id,database_meta_data,database_id +ci_incidence_summary,target_cohort_definition_id,cg_cohort_definition,cohort_definition_id +ci_incidence_summary,outcome_cohort_definition_id,cg_cohort_definition,cohort_definition_id +c_time_to_event,database_id,database_meta_data,database_id cd_temporal_covariate_ref,analysis_id,cd_temporal_analysis_ref,analysis_id cd_temporal_covariate_ref,covariate_id,cd_temporal_covariate_value,covariate_id cd_temporal_covariate_ref,time_id,cd_temporal_time_ref,time_id @@ -40,13 +40,13 @@ cd_included_source_concept,concept_id,cd_concept,concept_id cd_incidence_rate,database_id,cd_cohort_count,database_id cd_incidence_rate,cohort_id,cd_cohort_count,cohort_id cd_index_event_breakdown,concept_id,cd_concept,concept_id -cd_orphan_concept,cohort_id,cd_concept_set,cohort_id -cd_orphan_concept,concept_set_id,cd_concept_set,concept_set_id +cd_orphan_concept,cohort_id,cd_concept_sets,cohort_id +cd_orphan_concept,concept_set_id,cd_concept_sets,concept_set_id cd_orphan_concept,concept_id,cd_concept,concept_id cd_cohort_count,database_id,database_meta_data,database_id cd_visit_context,concept_id,cd_concept,concept_id cg_cohort_count,database_id,database_meta_data,database_id -cg_cohort_count,cohort_id,cg_cohort_definition,cohort_id +cg_cohort_count,cohort_id,cg_cohort_definition,cohort_definition_id cg_cohort_generation,database_id,database_meta_data,database_id cg_cohort_summary_stats,database_id,database_meta_data,database_id cg_cohort_summary_stats,cohort_definition_id,cg_cohort_definition,cohort_definition_id @@ -68,11 +68,11 @@ cm_covariate_balance,database_id,cm_covariate,database_id cm_covariate,covariate_id,cm_propensity_model,covariate_id cm_analysis,analysis_id,cm_result,analysis_id cm_analysis,database_id,database_meta_data,database_id -cm_analysis,analysis_id,cm_diagnostic_summary,analysis_id -cm_analysis,target_id,cm_diagnostic_summary,target_id -cm_analysis,comparator_id,cm_diagnostic_summary,comparator_id -cm_analysis,outcome_id,cm_diagnostic_summary,outcome_id -cm_analysis,database_id,cm_diagnostic_summary,database_id +cm_analysis,analysis_id,cm_diagnostics_summary,analysis_id +cm_analysis,target_id,cm_diagnostics_summary,target_id +cm_analysis,comparator_id,cm_diagnostics_summary,comparator_id +cm_analysis,outcome_id,cm_diagnostics_summary,outcome_id +cm_analysis,database_id,cm_diagnostics_summary,database_id cm_analysis,target_id,cg_cohort_definition,cohort_definition_id cm_analysis,outcome_id,cg_cohort_definition,cohort_definition_id cm_analysis,comparator_id,cg_cohort_definition,cohort_definition_id @@ -100,12 +100,12 @@ sccs_result,exposures_outcome_set_id,sccs_covariate,exposures_outcome_set_id sccs_result,database_id,sccs_covariate,database_id sccs_result,covariate_id,sccs_covariate,covariate_id sccs_result,database_id,database_meta_data,database_id -sccs_result,exposures_outcome_set_id,sccs_diagnostics_sumary,exposures_outcome_set_id -sccs_result,database_id,sccs_diagnostics_sumary,database_id -sccs_result,analysis_id,sccs_diagnostics_sumary,analysis_id -sccs_result,covariate_id,sccs_diagnostics_sumary,covariate_id +sccs_result,exposures_outcome_set_id,sccs_diagnostics_summary,exposures_outcome_set_id +sccs_result,database_id,sccs_diagnostics_summary,database_id +sccs_result,analysis_id,sccs_diagnostics_summary,analysis_id +sccs_result,covariate_id,sccs_diagnostics_summary,covariate_id sccs_result,analysis_id,sccs_covariate,analysis_id -sccs_result,exposures_outcome_set_id,sccs_exposure_outcome_set,exposures_outcome_set_id +sccs_result,exposures_outcome_set_id,sccs_exposures_outcome_set,exposures_outcome_set_id sccs_result,analysis_id,sccs_analysis,analysis_id sccs_result,outcome_id,cg_cohort_definition,cohort_definition_id sccs_exposures_outcome_set,nesting_cohort_id,cg_cohort_definition,cohort_definition_id @@ -114,15 +114,15 @@ sccs_exposures_outcome_set,exposures_outcome_set_id,sccs_exposure,exposures_outc sccs_exposures_outcome_set,era_id,sccs_exposure,era_id sccs_exposures_outcome_set,era_id,cg_cohort_definition,era_id sccs_result,exposures_outcome_set_id,sccs_exposures_outcome_set,exposures_outcome_set_id -sccs_covariate_result,exposures_outcome_set_id,sccs_exposure_outcome_set,exposures_outcome_set_id -sccs_time_trend,exposures_outcome_set_id,sccs_exposure_outcome_set,exposures_outcome_set_id -sccs_diagnostics_summary,exposures_outcome_set_id,sccs_exposure_outcome_set,exposures_outcome_set_id -sccs_time_to_event,exposures_outcome_set_id,sccs_exposure_outcome_set,exposures_outcome_set_id -sccs_attrition,exposures_outcome_set_id,sccs_exposure_outcome_set,exposures_outcome_set_id -sccs_event_dep_observation,exposures_outcome_set_id,sccs_exposure_outcome_set,exposures_outcome_set_id -sccs_age_spanning,exposures_outcome_set_id,sccs_exposure_outcome_set,exposures_outcome_set_id -sccs_calendar_time_spanning,exposures_outcome_set_id,sccs_exposure_outcome_set,exposures_outcome_set_id -sccs_spline,exposures_outcome_set_id,sccs_exposure_outcome_set,exposures_outcome_set_id +sccs_covariate_result,exposures_outcome_set_id,sccs_exposures_outcome_set,exposures_outcome_set_id +sccs_time_trend,exposures_outcome_set_id,sccs_exposures_outcome_set,exposures_outcome_set_id +sccs_diagnostics_summary,exposures_outcome_set_id,sccs_exposures_outcome_set,exposures_outcome_set_id +sccs_time_to_event,exposures_outcome_set_id,sccs_exposures_outcome_set,exposures_outcome_set_id +sccs_attrition,exposures_outcome_set_id,sccs_exposures_outcome_set,exposures_outcome_set_id +sccs_event_dep_observation,exposures_outcome_set_id,sccs_exposures_outcome_set,exposures_outcome_set_id +sccs_age_spanning,exposures_outcome_set_id,sccs_exposures_outcome_set,exposures_outcome_set_id +sccs_calendar_time_spanning,exposures_outcome_set_id,sccs_exposures_outcome_set,exposures_outcome_set_id +sccs_spline,exposures_outcome_set_id,sccs_exposures_outcome_set,exposures_outcome_set_id sccs_diagnostics_summary,analysis_id,sccs_covariate,analysis_id plp_model_designs,target_id,cg_cohort_definition,cohort_definition_id plp_model_designs,outcome_id,cg_cohort_definition,cohort_definition_id @@ -137,4 +137,4 @@ plp_performances,development_database_id,database_meta_data,database_id plp_performances,validation_database_id,database_meta_data,database_id plp_performances,database_id,database_meta_data,database_id plp_cohorts,cohort_definition_id,cg_cohort_definition,cohort_definition_id -c_cohort_details,target_id,cg_cohort_definition,cohort_id +c_cohort_details,target_id,cg_cohort_definition,cohort_definition_id diff --git a/extras/rdms/run-local.txt b/extras/rdms/run-local.txt index 18444184..2405217c 100644 --- a/extras/rdms/run-local.txt +++ b/extras/rdms/run-local.txt @@ -1 +1 @@ -"E:\Program Files\Amazon Corretto\jdk17.0.12_7\bin\java.exe" -jar schemaspy-6.2.4.jar -vizjs -dp E:\jdbcDrivers -configFile schemaspy-config.properties -meta schema_meta.xml -desc "Results data model" -noTablePaging +"E:\Program Files\Amazon Corretto\jdk17.0.12_7\bin\java.exe" -jar schemaspy-6.2.4.jar -vizjs -dp E:\jdbcDrivers -configFile schemaspy-config.properties -meta schema_meta.xml -desc "Results data model" -noTablePaging -noimplied diff --git a/extras/rdms/schema_meta.xml b/extras/rdms/schema_meta.xml index 03e61c20..8d1a4f91 100644 --- a/extras/rdms/schema_meta.xml +++ b/extras/rdms/schema_meta.xml @@ -1,6 +1,8 @@ - This is where we'll describe the Strategus results data model. + The tables in the results data model are grouped using a unique prefix for + each Strategus module. For example, the CharacterizationModule results tables + all start with "c_". @@ -20,7 +22,9 @@
- + + + @@ -49,11 +53,17 @@
- + + + - - + + + + + + @@ -204,7 +214,9 @@ - + + +
@@ -358,10 +370,16 @@
- - + + + + + + - + + +
@@ -476,16 +494,22 @@ - + + + - + + +
- + + + @@ -501,8 +525,12 @@
- - + + + + + + @@ -513,8 +541,12 @@
- - + + + + + +
@@ -536,14 +568,31 @@ - - + + + + + + + + + - - - - - + + + + + + + + + + + + + + + @@ -633,15 +682,24 @@
- + + + +
- - - + + + + + + + + + @@ -694,7 +752,9 @@
- + + + @@ -706,12 +766,19 @@
- + + + + - - + + + + + + @@ -725,11 +792,21 @@
- - - - - + + + + + + + + + + + + + + + @@ -797,11 +874,18 @@
- + + + - - + + + + + + + @@ -910,7 +994,9 @@
- + + +
@@ -980,8 +1066,12 @@
- - + + + + + + @@ -993,9 +1083,15 @@
- - - + + + + + + + + +
@@ -1053,10 +1149,18 @@
- - - - + + + + + + + + + + + + @@ -1196,9 +1300,14 @@
- + + + + - + + +
@@ -1207,7 +1316,9 @@
- + + + @@ -1222,9 +1333,22 @@
- - - + + + + + + + + + + + + + + + + @@ -1248,13 +1372,29 @@ - + + + + +
- - - - + + + + + + + + + + + + + + + + @@ -1263,7 +1403,9 @@ - + + + @@ -1281,7 +1423,9 @@
- + + + @@ -1291,7 +1435,9 @@
- + + + @@ -1300,14 +1446,18 @@
- + + +
- + + + @@ -1315,17 +1465,31 @@
- + + +
- - - - + + + + + + + + + + + + + + + +