Code Monkey home page Code Monkey logo

claritydictionaryingester's Introduction

ClarityDictionaryIngester

Project Status: WIP - Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. License: GPL (>= 3)
R build status R build status R build status R build status

Overview

The EPIC Clarity Dictionary is a centralized resource that helps one search the Clarity data model to achieve reporting goals. The Dictionary is designed as a series of webpages for a human to navigate and search for information, but this design makes programmatic access difficult. Programmatic access to the Dictionary facilitates accomplishing alternative goals such as analysis of the available information in the Dictionary as well as automation of data dictionary creation in a data brokerage setting.

The goal of {ClarityDictionaryIngester} is to provide helpful functions for ingesting the EPIC Clarity Dictionary into a database, thus enabling programmatic access.

Usage

Setup

  1. If on Windows one option to manage database drivers and data sources is through the ODBC Data Sources Administrator.
  2. If using token authentication with tokens that expire, ensure the token is not expired.
  3. If connecting to a Databricks cluster, R will hang as the cluster starts up.
# 1. Connect to Database
con <- clarity_dictionary_database_connect()

# 2. Prepare Database (if needed)
## drop all dictionary tables to remove any dictionary data from the database
clarity_dictionary_drop_all(con)

## initiate all dictionary tables if the tables do not yet exist
clarity_dictionary_init(con)

# 3. Select Tables for Processing
## Generate a vector of table names to ingest by comparing the names of 
## Clarity tables in the database to names of tables that have already been 
## ingested
tables_to_ingest <- clarity_dictionary_select_tables_to_ingest(con)

# 4. Setup Browser
## The ingestion process uses {Chromote}](https://github.com/rstudio/chromote)
b <- clarity_dictionary_chromote_session_open()`

# 5. Manual Login
## Go to the Chromote window and manually login.

# 6. Ingest
## Start documentation ingestion
clarity_dictionary_ingest(tables_to_ingest, b, con)

# 7. On Error
## Check the log file "clarity_dictionary_ingester_log.csv" for clues.

## Depending on what went wrong, one could drop the last table (partially) 
## ingested and all associated records:
tables_to_ingest <- clarity_dictionary_revert_last_table(con, tables_to_ingest)

## One could instead revert the entire database to a known good timestamp:
clarity_dictionary_revert_all(con, "2024-03-07T14:19:08Z")

## The vector of table names to ingest should be updated accordingly and then 
## repeat Step 7.

# 8. Clean Up
## Close the Chromote session:
clarity_dictionary_chromote_session_close(b)

## Close the database connection:
clarity_dictionary_database_disconnect(con)

Once the documentation for all tables has been ingested

## Query Full Dictionary in R:
clarity_dictionary_select_all(con)

## Or produce the full query SQL syntax:
clarity_dictionary_select_all_sql()

Installation

You can install {ClarityDictionaryIngester} from GitHub with:

pak::pkg_install("the-mad-statter/ClarityDictionaryIngester")

If necessary {pak} can be installed with:

install.packages(
  "pak", 
  repos = sprintf(
    "https://r-lib.github.io/p/pak/stable/%s/%s/%s", 
    .Platform$pkgType, 
    R.Version()$os, 
    R.Version()$arch
  )
)

Code of Conduct

Please note that the {ClarityDictionaryIngester} project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.


Code Style

This repository attempts to follow the tidyverse style guide.

The use of {styler}, {lintr}, and {devtools} are recommended.


About

Washington University in Saint Louis

Established in 1853, Washington University in Saint Louis is among the world’s leaders in teaching, research, patient care, and service to society. Boasting 24 Nobel laureates to date, the University is ranked 7th in the world for most cited researchers, received the 4th highest amount of NIH medical research grants among medical schools in 2019, and was tied for 1st in the United States for genetics and genomics in 2018. The University is committed to learning and exploration, discovery and impact, and intellectual passions and challenging the unknown.

claritydictionaryingester's People

Contributors

the-mad-statter avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.