mc2-center / csbc-pson-dcc

Data coordination resources for the NCI CSBC and PS-ON consortia
1 stars 4 forks source link

Update column types in merged tables #103

Closed jaeddy closed 2 years ago

jaeddy commented 3 years ago

There are a number of columns for which we should try to update types in the "merged" tables that drive CCKP. In most cases, the conversion is from a single value type to a _LIST type (which would also involve splitting a delimited string into a JSON array) — e.g.:

.delim_str_to_json()

.delim_str_to_json <- function(str, delimiter = ",") {
  json_str <- str_split(str, delimiter)[[1]] %>%
    str_trim() %>%
    jsonlite::toJSON()
  if (json_str == "[null]" || json_str == '[""]') {
    ""
  } else {
    json_str
  }
}

There are also a number of cases where we'd ideally use lists of entity IDs (ENTITYID_LIST), but this might not be possible through any of the clients right now. I was hoping this would be a simple fix, but I had it ended up being a more time consuming task (for me at least). @thomasyu888 or @andrewelamb (or anyone) — could you take a look at this?

vpchung commented 2 years ago

Closing, as we are no longer using *Id columns.