# create a query for an SMQ
library(tibble)
library(dplyr, warn.conflicts = FALSE)
# create a query for a SMQ
query(
prefix = "SMQ02",
id = auto,
definition = basket_select(
name = "Pregnancy and neonatal topics (SMQ)",
scope = "NARROW",
type = "smq"
)
)
# create a query for an SDG
query(
prefix = "SDG01",
id = auto,
definition = basket_select(
name = "5-aminosalicylates for ulcerative colitis",
scope = NA_character_,
type = "sdg"
)
)
# creating a query for a customized query
cqterms <- tribble(
~TERMCHAR, ~TERMNUM,
"APPLICATION SITE ERYTHEMA", 10003041L,
"APPLICATION SITE PRURITUS", 10003053L
) %>%
mutate(SRCVAR = "AEDECOD")
query(
prefix = "CQ01",
name = "Application Site Issues",
definition = cqterms
)
# creating a customized query based on SMQs and additional terms
query(
prefix = "CQ03",
name = "Special issues of interest",
definition = list(
cqterms,
basket_select(
name = "Pregnancy and neonatal topics (SMQ)",
scope = "NARROW",
type = "smq"
),
basket_select(
id = 8050L,
scope = "BROAD",
type = "smq"
)
)
)
Run the code above in your browser using DataLab