diff --git a/R/CreateVocabMapTables.r b/R/CreateVocabMapTables.r index 60a653c..4a42f92 100644 --- a/R/CreateVocabMapTables.r +++ b/R/CreateVocabMapTables.r @@ -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. @@ -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) { diff --git a/R/LoadEventTables.r b/R/LoadEventTables.r index c0dfea8..9ffe996 100644 --- a/R/LoadEventTables.r +++ b/R/LoadEventTables.r @@ -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( diff --git a/docs/404.html b/docs/404.html index 2536686..96ef43e 100644 --- a/docs/404.html +++ b/docs/404.html @@ -49,25 +49,28 @@
Condition_occurrence.Rmd
condition_occurrence.Rmd
Cost.Rmd
cost.Rmd
Device_exposure.Rmd
device_exposure.Rmd
Drug_exposure.Rmd
drug_exposure.Rmd
Measurement.Rmd
measurement.Rmd
Payer_plan_period.Rmd
payer_plan_period.Rmd
care_site.Rmd
Destination Field | +Source field | +Logic | +Comment field | +
---|---|---|---|
care_site_id | ++ | Autogenerated | ++ |
care_site_name | +name | ++ | + |
place_of_service_concept_id | ++ | 0 | ++ |
location_id | ++ | cast(null as integer) | ++ |
care_site_source_value | +id | ++ | + |
place_of_service_source_value | ++ | cast(null as varchar) | ++ |
Care_site mapping from organizations.csv
+Condition_occurrence mapping from conditions.csv
-Cost mapping from procedures.csv,immunizations.csv and medications.csv for v2.7.0 and expanded to include conditions.csv, claims_transations.csv and claims.csv for v3.0.0
-Death mapping from encounters.csv
+Device_exposure mapping from devices.csv
-Drug_exposure mapping from medications.csv, and immunizations.csv
-location mapping from patients.csv
+Measurement mapping from procedures.csv and observations.csv
-Payer_plan_period mapping from payers.csv and payer_transitions.csv
-Death mapping from encounters.csv
Observation mapping from allergies.csv, conditions.csv and observations.csv
Observation_period mapping from encounters.csv
+Payer_plan_period mapping from payers.csv and payer_transitions.csv
Person mapping from patients.csv
location.Rmd
Destination Field | +Source field | +Logic | +Comment field | +
---|---|---|---|
location_id | ++ | Autogenerated | ++ |
address_1 | ++ | cast(null as varchar) | ++ |
address_2 | ++ | cast(null as varchar) | ++ |
city | +city | ++ | + |
state | +state | +Map state to “states_map” table to crosswalk the full state text to +the abbreviation | ++ |
county | ++ | cast(null as varchar) | ++ |
zip | +zip | ++ | + |
location_source_value | +zip | ++ | + |
CreateExtraIndices.Rd
createExtraIndices.Rd
CreateCDMTables()
Create Common Data Model Tables.
Create Optional Extra Indices for ETL Performance
backupCDM()
Backup Vocabulary and Event tables before pruning.
Create Optional Extra Indices for ETL Performance