get_view: Create a normal materialized view from the set available on...

Description Usage Arguments Details Value Author(s) Examples

Description

Create a normal materialized view from the set available on the MIMIC code repository This function creates a materialized view from those available on the MIMIC code repository. See details about where these come from.

Usage

1
get_view(URL, dbSource, conn)

Arguments

URL

a character string URL to the location of a plaintext file containing sql code.

dbSource

your dplyr database source (Currently must be postgres). Defaults to pg_src in the global environment.

conn

your postgres DBI object to connect to the postgres db

Details

TBD

Value

a remote processed view (dplyr).

Author(s)

Jesse D. Raffa

Examples

1
2
3
4
5
6
7
## Setup Connection
# m <- dbDriver("PostgreSQL")
# passwd <- "secret";
# con <- dbConnect(m, user="user", password=passwd, dbname="mimic",host="localhost",port=5674) # The trickiest part
# dbSendStatement(con,"SET search_path to mimiciii"); # or whatever schema you have
# pg_src <- src_postgres(dbname = "mimic", host = "127.0.0.1", port = 5674, user = "user", password = passwd,options="-c search_path=mimiciii")
# myView <- get_view("https://raw.githubusercontent.com/MIT-LCP/mimic-code/master/concepts/code-status.sql",dbSource=pg_src,conn=con)

jraffa/MIMICutil documentation built on May 6, 2019, 7:32 a.m.