Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial attempt at cleansing via sqlrender #241

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open

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