All of Us Surveys

knitr::opts_chunk$set(
  collapse = TRUE,
  echo = FALSE,
  message = FALSE,
  warning = FALSE,
  comment = "#>"
)
library(allofus)
library(dplyr)
library(tidyr)
library(purrr)
library(forcats)
library(tibble)
library(DT)

This table consists of mapped rows from the publicly available All of Us Survey Codebook to the All of Us PPI Vocabulary available on Athena. A small number of rows did not match between the codebook and the Athena PPI Vocabulary. The code to generate a full table can be found here. It can also be accessed in R using allofus::aou_codebook.

More information on the All of Us Surveys is available at the All of Us Survey Explorer. PDF versions of the individual surveys are linked in the table.

cols <- c(
  "concept_code", "concept_id", "concept_name",
  # "concept_class_id",
  "form_name", "pdf", "field_type", "field_label", "choices"
)

df <- allofus::aou_codebook
df$concept_id <- paste0("<a href=https://athena.ohdsi.org/search-terms/terms/", df$concept_id, ' target="_blank">', df$concept_id, "</a>")
df$pdf <- paste0("<a href=", df$link, ' target="_blank">', df$form_name, "</a>")
df$form_name <- as.factor(df$form_name)
# df$concept_class_id = as.factor(df$concept_class_id)
df$field_type <- as.factor(df$field_type)

df <- df[, cols]

DT::datatable(df,
  rownames = FALSE,
  filter = "top",
  plugins = "ellipsis",
  extensions = "Buttons",
  escape = FALSE,
  options = list(
    # autoWidth = TRUE,
    hover = TRUE,
    dom = "Bfrtip",
    buttons = c("copy", "csv", "excel", "pdf", "print"),
    # scrollX = TRUE,
    # scrollCollapse = TRUE,
    columnDefs = list(list(
      targets = c(2, 6, 7),
      # targets = c(2, 5, 6),
      render = DT::JS("$.fn.dataTable.render.ellipsis( 10, false )")
    ))
  )
) %>%
  DT::formatStyle(table = ., columns = cols, fontSize = "80%")


Try the allofus package in your browser

Any scripts or data that you put into this service are public.

allofus documentation built on July 4, 2024, 9:09 a.m.