knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

denodoExtractor

The goal of denodoExtractor is to make it easy to pull common patient flow metrics from denodo views into R. Examples include daily ED visits, admits/census/discharges for specified nursing units, etc.

Installation

You can install the package from GitHub:

# install.packages("devtools")
devtools::install_github("nayefahmad/denodoExtractor")

Example

This is a basic example which shows you how to set up the Denodo ODBC connection and pull admits data. I assume you have set up the Denodo ODBC Driver, and that you have a ODBC connection named "cnx_denodo_spappcsta001". If you have a different name, you can pass that to the dsn_name argument of the setup_denodo() function.

First, let's set up our ODBC connection:

library(denodoExtractor)

# first set up odbc: 
setup_denodo()
# should return 3 views: vw_adtc, vw_census, vw_eddata

Let's pull admits to major LGH units in January:

extract_admits("20190101", "20190201")

Now let's try VGH ECC unit instead:

extract_admits("20190101", 
               "20190115",
               site = "Vancouver General Hospital", 
               n_units = "ECC")

Getting help

To see a list of all available functions, use the following:

# help(package = "denodoExtractor")

To see documentation for a specific function, use a question mark followed by the function name in the console. For example:

# ?setup_denodo
# ?extract_admits

Notes on package development

Problems with filepaths

You may run into an error like UNC paths are not supported. Defaulting to Windows directory. What seems to work is to go into Tools > Project Options > Build toold > Package directory, and set the folder path without using paths that start with "vch.ca". For example, use H:/denodoExtractor

Git problems

When using usethis::use_github, by default, your .git folder will have a file named pre-commit in it. This tells git to do the checks specified there before you can commit anything. Unfortunately, this seems to create problems with using RStudio or GitHub desktop to commit/push. You will have to use git bash with command git commit --no-verify. There’s no way to specify this command in GUIs.

To get around this, simply add .sample at the end of the filename: pre-commit.sample. Now it will be ignored by GitHub.

Package installation errors

You may get an error saying: Error: failed to install package X ... cannot remove prior installation of package. If this happens, just manually install the package in console using install.packages(package name)



nayefahmad/denodoExtractor documentation built on Nov. 14, 2019, 4:33 p.m.