knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  message = FALSE,
  results = 'hide'
)
library(chariot)
conn <- connectAthena()

Mapping Regimens to the HemOnc Ontology as represented in the OMOP Vocabularies can be approached several different ways. The grepl approach uses pattern matching in lieu of the ontological relationships to find the appropriate HemOnc counterpart to the input.

ex1 <- ho_grep_regimens("Trastuzumab",
                 conn = conn)

In this example, all Trastuzumab monotherapy regimens in HemOnc are searched for. The monotherapy is assumed by the length of the input (1), and the function first searches for "trastuzumab" and runs an additional search for the pattern "monotherapy" based on the value of 1.

ex1

If the search was intended to be for all regimens containing trastuzumab with a known number of additional components, a component_count value can be provided. For example, if I want to know all the HemOnc regimens that contain 2 components, with 1 being trastuzumab:

ex2 <- 
  ho_grep_regimens("Trastuzumab",
                   conn = conn, 
                   component_count = 2)

The pattern matched is "Trastuzumab" with any HemOnc Regimens containing the pattern "and" for 2 components.

ex2

For searches for component counts greater than 2, the pattern matched is the number of commas. HemOnc Regimens composed of greater than 2 components are named by a comma-separated string.

ex3 <- 
  ho_grep_regimens("Trastuzumab",
                   conn = conn, 
                   component_count = 3)

For trastuzumab regimens containing 3 components, 2 commas are searched for.

ex3

To get all the possible combinations in regimens containing the component, component_count can be set to infinity.

ex4 <- 
  ho_grep_regimens("Trastuzumab",
                   conn = conn, 
                   component_count = Inf)

For all HemOnc functions, guardrails are put in place to prevent searches for components that may have been misspelled or subject to a typo. Here, I have mistyped trastuzumab.

ho_grep_regimens("tastuzumab",
                 conn = conn)

You can also look up the Components that belong to a Regimen in HemOnc.

ex5 <- ho_lookup_antineoplastics(35804201,
                          conn = conn)
ex5

The inverse can also be done, where a Regimen comprised by a set of Component Concept Ids is derived.

ex6 <-
ho_lookup_regimen(35803229,35803361,
                  conn = conn)
ex6

These functions also allow Concept Class object support. For example, for the most recent example, using a Concept Class object may allow the user to stay informed with the Concept attributes when executing the function.

Paclitaxel <- get_concept(concept_id = 35803229)
Trastuzumab <- get_concept(concept_id = 35803361)

Now we know what is being looked up while also containing the concept_id needed as the essential input for the function.

Paclitaxel
Trastuzumab 
ex7 <-
ho_lookup_regimen(Paclitaxel,
                  Trastuzumab, 
                  conn = conn)
ex7
dcAthena(conn = conn)


patelm9/chariot documentation built on Feb. 19, 2022, 11:29 a.m.