Skip to content

Commit

Permalink
Update schema_meta.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonysena committed Sep 26, 2024
1 parent 16c9307 commit a20cf7a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
34 changes: 17 additions & 17 deletions extras/DocumentResultsDataModel.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,21 @@ write_xml(schemaMeta, "./extras/rdms/schema_meta.xml")

# Used to create the DB locally to assist in documenting the
# results model.
connectionDetails <- DatabaseConnector::createConnectionDetails(
dbms = "postgresql",
server = "127.0.0.1/strategus",
user = "user",
password = "password"
)
connection <- DatabaseConnector::connect(connectionDetails)
DatabaseConnector::executeSql(
connection = connection,
sql = "drop schema results cascade;create schema results;"
)
sql <- SqlRender::readSql("./extras/rdms/full_data_model_pg.sql")
DatabaseConnector::executeSql(
connection = connection,
sql = sql
)
DatabaseConnector::disconnect(connection)
# connectionDetails <- DatabaseConnector::createConnectionDetails(
# dbms = "postgresql",
# server = "127.0.0.1/strategus",
# user = "user",
# password = "password"
# )
# connection <- DatabaseConnector::connect(connectionDetails)
# DatabaseConnector::executeSql(
# connection = connection,
# sql = "drop schema results cascade;create schema results;"
# )
# sql <- SqlRender::readSql("./extras/rdms/full_data_model_pg.sql")
# DatabaseConnector::executeSql(
# connection = connection,
# sql = sql
# )
# DatabaseConnector::disconnect(connection)

26 changes: 13 additions & 13 deletions extras/rdms/schema_meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -590,12 +590,12 @@
<column name="comparator_max_date" comments="The last start date of the comparator cohort observed in the data (after applying all restrictions)."/>
<column name="database_id" comments="Foreign key referencing the database."/>
</table>
<table name="cm_analysis" comments="CohortMethodModule: Analysis information">
<table name="cm_analysis" comments="CohortMethodModule: Analysis reference">
<column name="analysis_id" comments="A unique identifier for an analysis."/>
<column name="description" comments="A description for an analysis, e.g. 'On-treatment'."/>
<column name="definition" comments="A CohortMethod JSON object specifying the analysis."/>
</table>
<table name="cm_result" comments="CohortMethodModule: Study results">
<table name="cm_result" comments="CohortMethodModule: Study results for main effects">
<column name="analysis_id" comments="Foreign key referencing the cm_analysis table."/>
<column name="target_id" comments="The identifier for the target cohort."/>
<column name="comparator_id" comments="The identifier for the comparator cohort."/>
Expand Down Expand Up @@ -624,7 +624,7 @@
<column name="target_estimator" comments="The target estimator, for example &quot;att&quot;, &quot;ate&quot;, &quot;atu&quot; or &quot;ato&quot;."/>
<column name="database_id" comments="Foreign key referencing the database."/>
</table>
<table name="cm_interaction_result" comments="CohortMethodModule: Interaction term result">
<table name="cm_interaction_result" comments="CohortMethodModule: Study results for interaction effects">
<column name="analysis_id" comments="Foreign key referencing the cm_analysis table."/>
<column name="target_id" comments="The identifier for the target cohort."/>
<column name="comparator_id" comments="The identifier for the comparator cohort."/>
Expand Down Expand Up @@ -772,7 +772,7 @@
<column name="comparator_std_diff" comments="The standardized difference of the means before and after propensity score adjustment in the comparator cohort."/>
<column name="target_comparator_std_diff" comments="The standardized difference of the means before and after propensity score adjustment in the union of the target and comparator cohorts."/>
</table>
<table name="es_analysis" comments="EvidenceSynthesisModule: Analysis list">
<table name="es_analysis" comments="EvidenceSynthesisModule: Analysis reference">
<column name="evidence_synthesis_analysis_id" comments="A unique identifier for the evidence synthesis analysis."/>
<column name="evidence_synthesis_description" comments="A description of the evidence synthesis analysis."/>
<column name="source_method" comments="The method used to produce the source estimates (e.g. 'CohortMethod')."/>
Expand Down Expand Up @@ -1145,7 +1145,7 @@
<column name="covariate_analysis_id" comments="A foreign key referencing the sccs_covariate_analysis table."/>
<column name="database_id" comments="Foreign key referencing the database."/>
</table>
<table name="sccs_era" comments="SelfControlledCaseSeriesModule: Era">
<table name="sccs_era" comments="SelfControlledCaseSeriesModule: Era reference">
<column name="exposures_outcome_set_id" comments="A foreign key referencing the sccs_exposures_outcome_set table."/>
<column name="analysis_id" comments="A unique identifier for an analysis."/>
<column name="era_type" comments="The type of era (e.g. 'rx' for drugs)."/>
Expand All @@ -1163,15 +1163,15 @@
<column name="era_id" comments="A foreign key referencing the sccs_era table."/>
<column name="true_effect_size" comments="If known, the true effect size. For negatitive controls this equals 1."/>
</table>
<table name="sccs_spline" comments="SelfControlledCaseSeriesModule: Spline">
<table name="sccs_spline" comments="SelfControlledCaseSeriesModule: Season, age, and calendar time splines">
<column name="analysis_id" comments="A foreign key referencing the sccs_analysis table."/>
<column name="exposures_outcome_set_id" comments="A foreign key referencing the sccs_exposures_outcome_set table."/>
<column name="database_id" comments="Foreign key referencing the database."/>
<column name="spline_type" comments="Either 'age', 'season', or 'calendar time'."/>
<column name="knot_month" comments="Location of the knot. For age, the month since birth. For season, the month of the year. For calendar time, the month since 1-1-1970."/>
<column name="rr" comments="The estimated relative risk (i.e. the incidence rate ratio)."/>
</table>
<table name="sccs_censor_model" comments="SelfControlledCaseSeriesModule: Censor Model">
<table name="sccs_censor_model" comments="SelfControlledCaseSeriesModule: Event-dependent observation censoring model">
<column name="analysis_id" comments="A foreign key referencing the sccs_analysis table."/>
<column name="exposures_outcome_set_id" comments="A foreign key referencing the sccs_exposures_outcome_set table."/>
<column name="database_id" comments="Foreign key referencing the database."/>
Expand Down Expand Up @@ -1217,7 +1217,7 @@
<column name="ci_95_lb" comments="The lower bound of the 95% confidence interval of the relative risk."/>
<column name="ci_95_ub" comments="The upper bound of the 95% confidence interval of the relative risk."/>
</table>
<table name="sccs_attrition" comments="SelfControlledCaseSeriesModule: Attrition information">
<table name="sccs_attrition" comments="SelfControlledCaseSeriesModule: Attrition table">
<column name="sequence_number" comments="The place in the sequence of steps defining the final analysis cohort. 1 indicates the original exposed population without any inclusion criteria."/>
<column name="description" comments="A description of the last restriction, e.g. &quot;Removing persons with the outcome prior&quot;."/>
<column name="analysis_id" comments="A foreign key referencing the sccs_analysis table."/>
Expand All @@ -1237,7 +1237,7 @@
<column name="analysis_id" comments="A foreign key referencing the sccs_analysis table."/>
<column name="database_id" comments="Foreign key referencing the database."/>
</table>
<table name="sccs_time_trend" comments="SelfControlledCaseSeriesModule: Time trend">
<table name="sccs_time_trend" comments="SelfControlledCaseSeriesModule: Time trend diagnostic">
<column name="analysis_id" comments="A foreign key referencing the sccs_analysis table."/>
<column name="exposures_outcome_set_id" comments="A foreign key referencing the sccs_exposures_outcome_set table."/>
<column name="database_id" comments="Foreign key referencing the database."/>
Expand All @@ -1247,7 +1247,7 @@
<column name="ratio" comments="Observed over expected ratio, where the expected count assumes a constant rate over time."/>
<column name="adjusted_ratio" comments="Observed over expected ratio, where the expected count is adjusted for age, season, or calendar time, as specified in the analysis."/>
</table>
<table name="sccs_time_to_event" comments="SelfControlledCaseSeriesModule: Time to event">
<table name="sccs_time_to_event" comments="SelfControlledCaseSeriesModule: Time-to-event diagnostic">
<column name="analysis_id" comments="A foreign key referencing the sccs_analysis table."/>
<column name="exposures_outcome_set_id" comments="A foreign key referencing the sccs_exposures_outcome_set table."/>
<column name="database_id" comments="Foreign key referencing the database."/>
Expand All @@ -1256,22 +1256,22 @@
<column name="observed_subjects" comments="The numer of people observed during the week."/>
<column name="outcomes" comments="The number of outcomes observed durig the week."/>
</table>
<table name="sccs_age_spanning" comments="SelfControlledCaseSeriesModule: Age spanning">
<table name="sccs_age_spanning" comments="SelfControlledCaseSeriesModule: Age spanning diagnostic">
<column name="analysis_id" comments="A foreign key referencing the sccs_analysis table."/>
<column name="exposures_outcome_set_id" comments="A foreign key referencing the sccs_exposures_outcome_set table."/>
<column name="database_id" comments="Foreign key referencing the database."/>
<column name="age_month" comments="Age in months since birth."/>
<column name="cover_before_after_subjects" comments="Number of subjects whose observation period covers this month as well as the one before and after."/>
</table>
<table name="sccs_calendar_time_spanning" comments="SelfControlledCaseSeriesModule: Calendar time spanning">
<table name="sccs_calendar_time_spanning" comments="SelfControlledCaseSeriesModule: Calendar time spanning diagnostic">
<column name="analysis_id" comments="A foreign key referencing the sccs_analysis table."/>
<column name="exposures_outcome_set_id" comments="A foreign key referencing the sccs_exposures_outcome_set table."/>
<column name="database_id" comments="Foreign key referencing the database."/>
<column name="calendar_year" comments="Calendar year (e.g. 2022)"/>
<column name="calendar_month" comments="Calendar month (e.g. 1 is January)."/>
<column name="cover_before_after_subjects" comments="Number of subjects whose observation period covers this month as well as the one before and after."/>
</table>
<table name="sccs_event_dep_observation" comments="SelfControlledCaseSeriesModule: Event dependent observation">
<table name="sccs_event_dep_observation" comments="SelfControlledCaseSeriesModule: Event-dependent observation diagnostic">
<column name="analysis_id" comments="A foreign key referencing the sccs_analysis table."/>
<column name="exposures_outcome_set_id" comments="A foreign key referencing the sccs_exposures_outcome_set table."/>
<column name="database_id" comments="Foreign key referencing the database."/>
Expand Down

0 comments on commit a20cf7a

Please sign in to comment.