Skip to content

Initial attempt at cleansing via sqlrender#241

Open
AnthonyMolinaro wants to merge 12 commits intodevelopfrom
cleanse
Open

Initial attempt at cleansing via sqlrender#241
AnthonyMolinaro wants to merge 12 commits intodevelopfrom
cleanse

Conversation

@AnthonyMolinaro
Copy link
Collaborator

Frank,

Only concept_plausible_gender.sql has been modified in this initial attempt - no R code has changed. Here's how to test it:

library(SqlRender)

actions <- list(CLEANSE=FALSE, EXECUTE=TRUE) # execute only - Orig behavior
# actions <- list(CLEANSE=TRUE, EXECUTE=TRUE) # Cleanse first, then execute

sql <- SqlRender::readSql("inst/sql/sql_server/concept_plausible_gender.sql")

# Supply some dummy params for verification
renderedSql <- SqlRender::render(
  sql, 
  CLEANSE = actions$CLEANSE, 
  EXECUTE = actions$EXECUTE,
  cdmDatabaseSchema = "cdm_truven_ccae_v0000",
  cdmTableName = "measurement",
  cdmFieldName = "measurement_concept_id",
  conceptId = 99999999,
  plausibleGender = 'Male',
  cohort = FALSE)

# write out to a file for easy viewing
SqlRender::writeSql(renderedSql,"cleansed_concept_plausible_gender.sql")

With CLEANSE=FALSE, we should get default concept_plausible_gender.sql file. With CLEANSE=TRUE, we should get the INSERT + DELETE added to the file. Let me know how it looks.

@MaximMoinat MaximMoinat changed the base branch from main to develop October 15, 2022 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant