Browse Source

Updated documentation

master
Maxime Wack 6 years ago
parent
commit
4af342ab2e
28 changed files with 212 additions and 85 deletions
  1. +5
    -0
      NAMESPACE
  2. +7
    -1
      R/utils.R
  3. +8
    -7
      man/add_encounters.Rd
  4. +8
    -8
      man/add_observations.Rd
  5. +5
    -5
      man/add_ont.Rd
  6. +8
    -8
      man/add_ontology.Rd
  7. +5
    -5
      man/add_patients_demodata.Rd
  8. +5
    -5
      man/add_patients_imdata.Rd
  9. +1
    -1
      man/clear_default_demodata.Rd
  10. +1
    -1
      man/clear_default_imdata.Rd
  11. +1
    -1
      man/clear_default_metadata.Rd
  12. +1
    -1
      man/clear_table.Rd
  13. +2
    -2
      man/dbUpdate.Rd
  14. +20
    -0
      man/dbUpsert.Rd
  15. +3
    -3
      man/delete_concept.Rd
  16. +3
    -3
      man/delete_modifier.Rd
  17. +3
    -3
      man/delete_ont.Rd
  18. +3
    -3
      man/delete_ontology.Rd
  19. +20
    -0
      man/get_ont.Rd
  20. +5
    -5
      man/import_data.Rd
  21. +18
    -0
      man/list_ont.Rd
  22. +18
    -0
      man/list_schemes.Rd
  23. +20
    -0
      man/list_user_roles.Rd
  24. +18
    -0
      man/list_users.Rd
  25. +8
    -7
      man/populate_concept.Rd
  26. +8
    -8
      man/populate_ont.Rd
  27. +7
    -7
      man/populate_provider.Rd
  28. +1
    -1
      man/rebuild_indexes_demodata.Rd

+ 5
- 0
NAMESPACE View File

@@ -25,7 +25,12 @@ export(delete_ont)
export(delete_ontology)
export(delete_users)
export(fresh_install)
export(get_ont)
export(import_data)
export(list_ont)
export(list_schemes)
export(list_user_roles)
export(list_users)
export(populate_concept)
export(populate_ont)
export(populate_provider)


+ 7
- 1
R/utils.R View File

@@ -45,7 +45,7 @@ dbPush <- function(df, con, table)
RPostgreSQL::dbGetQuery(conn = con, .)
}

#' Udpdate a dataframe into a database table
#' Update a dataframe into a database table
#'
#' @param df Dataframe to update into the database
#' @param con Database connection
@@ -88,6 +88,12 @@ clear_table <- function(db, table, host = "", admin = "", pass = "")
RPostgreSQL::dbDisconnect(con)
}

#' Upserta dataframe into a database table
#'
#' @param df Dataframe to upsert into the database
#' @param con Database connection
#' @param table Table in the database in which to push the dataframe
#' @param PK Character vector of the primary key(s)
dbUpsert <- function(df, con, table, PK)
{
columns <- setdiff(names(df), PK)


+ 8
- 7
man/add_encounters.Rd View File

@@ -4,20 +4,21 @@
\alias{add_encounters}
\title{Add encounters to the CRC cell}
\usage{
add_encounters(host, admin, pass, encounters, project, patient_mapping)
add_encounters(encounters, project, patient_mapping, host = "", admin = "",
pass = "")
}
\arguments{
\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{The password for the admin account}

\item{encounters}{A dataframe of patients}

\item{project}{The project to add the patients to}

\item{patient_mapping}{The patient mapping table}

\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{The password for the admin account}
}
\value{
An encounter mapping dataframe for the encounters


+ 8
- 8
man/add_observations.Rd View File

@@ -4,21 +4,21 @@
\alias{add_observations}
\title{Add observations to the CRC cell}
\usage{
add_observations(host, admin, pass, observations, patient_mapping,
encounter_mapping)
add_observations(observations, patient_mapping, encounter_mapping, host = "",
admin = "", pass = "")
}
\arguments{
\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{The password for the admin account}

\item{observations}{A dataframe of observation facts}

\item{patient_mapping}{The patient mapping table}

\item{encounter_mapping}{The encounter mapping table}

\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{The password for the admin account}
}
\description{
Add observations to the CRC cell


+ 5
- 5
man/add_ont.Rd View File

@@ -4,18 +4,18 @@
\alias{add_ont}
\title{Add an ontology to metadata}
\usage{
add_ont(host, admin, pass, name, scheme)
add_ont(name, scheme, host = "", admin = "", pass = "")
}
\arguments{
\item{name}{The name of the new ontology}

\item{scheme}{The scheme to use for this ontology}

\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{the password for the admin account}

\item{name}{The name of the new ontology}

\item{scheme}{The scheme to use for this ontology}
}
\description{
Add an empty ontology space


+ 8
- 8
man/add_ontology.Rd View File

@@ -4,16 +4,10 @@
\alias{add_ontology}
\title{Add an ontology to i2b2}
\usage{
add_ontology(host = "127.0.0.1", admin, pass, name, scheme, ont,
modi = NULL, include_code = T)
add_ontology(name, scheme, ont, modi = NULL, include_code = T, host = "",
admin = "", pass = "")
}
\arguments{
\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{the password for the admin account}

\item{name}{The name of the new ontology}

\item{scheme}{The scheme to use for this ontology}
@@ -23,6 +17,12 @@ add_ontology(host = "127.0.0.1", admin, pass, name, scheme, ont,
\item{modi}{The modifiers to insert}

\item{include_code}{Whether to include the code in the label or not}

\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{the password for the admin account}
}
\description{
Add an ontology into i2b2


+ 5
- 5
man/add_patients_demodata.Rd View File

@@ -4,18 +4,18 @@
\alias{add_patients_demodata}
\title{Add patients to the CRC cell}
\usage{
add_patients_demodata(host, admin, pass, patients, project)
add_patients_demodata(patients, project, host = "", admin = "", pass = "")
}
\arguments{
\item{patients}{A dataframe of patients}

\item{project}{The project to add the patients to}

\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{The password for the admin account}

\item{patients}{A dataframe of patients}

\item{project}{The project to add the patients to}
}
\value{
A patient mapping dataframe for the patients


+ 5
- 5
man/add_patients_imdata.Rd View File

@@ -4,18 +4,18 @@
\alias{add_patients_imdata}
\title{Add patients to the IM cell}
\usage{
add_patients_imdata(host, admin, pass, patients, project)
add_patients_imdata(patients, project, host = "", admin = "", pass = "")
}
\arguments{
\item{patients}{A vector of patients IDs to insert}

\item{project}{The project to add the patients to}

\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{The password for the admin account}

\item{patients}{A vector of patients IDs to insert}

\item{project}{The project to add the patients to}
}
\description{
Add patients to the IM cell, generate new encrypted IDs,


+ 1
- 1
man/clear_default_demodata.Rd View File

@@ -4,7 +4,7 @@
\alias{clear_default_demodata}
\title{Clear the default demodata tables}
\usage{
clear_default_demodata(host, admin, pass)
clear_default_demodata(host = "", admin = "", pass = "")
}
\arguments{
\item{host}{The host to connect to}


+ 1
- 1
man/clear_default_imdata.Rd View File

@@ -4,7 +4,7 @@
\alias{clear_default_imdata}
\title{Clear the default imdata tables}
\usage{
clear_default_imdata(host, admin, pass)
clear_default_imdata(host = "", admin = "", pass = "")
}
\arguments{
\item{host}{The host to connect to}


+ 1
- 1
man/clear_default_metadata.Rd View File

@@ -4,7 +4,7 @@
\alias{clear_default_metadata}
\title{Clear the default metadata tables}
\usage{
clear_default_metadata(host, admin, pass)
clear_default_metadata(host = "", admin = "", pass = "")
}
\arguments{
\item{host}{The host to connect to}


+ 1
- 1
man/clear_table.Rd View File

@@ -4,7 +4,7 @@
\alias{clear_table}
\title{Clear a database table}
\usage{
clear_table(db, table, host, admin, pass)
clear_table(db, table, host = "", admin = "", pass = "")
}
\arguments{
\item{db}{Name of the database}


+ 2
- 2
man/dbUpdate.Rd View File

@@ -2,7 +2,7 @@
% Please edit documentation in R/utils.R
\name{dbUpdate}
\alias{dbUpdate}
\title{Udpdate a dataframe into a database table}
\title{Update a dataframe into a database table}
\usage{
dbUpdate(df, con, table, PK)
}
@@ -16,5 +16,5 @@ dbUpdate(df, con, table, PK)
\item{PK}{Character vector of the primary key(s)}
}
\description{
Udpdate a dataframe into a database table
Update a dataframe into a database table
}

+ 20
- 0
man/dbUpsert.Rd View File

@@ -0,0 +1,20 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{dbUpsert}
\alias{dbUpsert}
\title{Upserta dataframe into a database table}
\usage{
dbUpsert(df, con, table, PK)
}
\arguments{
\item{df}{Dataframe to upsert into the database}

\item{con}{Database connection}

\item{table}{Table in the database in which to push the dataframe}

\item{PK}{Character vector of the primary key(s)}
}
\description{
Upserta dataframe into a database table
}

+ 3
- 3
man/delete_concept.Rd View File

@@ -4,16 +4,16 @@
\alias{delete_concept}
\title{Delete concepts}
\usage{
delete_concept(host, admin, pass, scheme)
delete_concept(scheme, host = "", admin = "", pass = "")
}
\arguments{
\item{scheme}{The scheme to delete from the concepts}

\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{the password for the admin account}

\item{scheme}{The scheme to delete from the concepts}
}
\description{
Delete concepts from concept_dimension


+ 3
- 3
man/delete_modifier.Rd View File

@@ -4,16 +4,16 @@
\alias{delete_modifier}
\title{Delete modifiers}
\usage{
delete_modifier(host, admin, pass, scheme)
delete_modifier(scheme, host = "", admin = "", pass = "")
}
\arguments{
\item{scheme}{The scheme to delete from the concepts}

\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{the password for the admin account}

\item{scheme}{The scheme to delete from the concepts}
}
\description{
Delete modifiers from modifier_dimension


+ 3
- 3
man/delete_ont.Rd View File

@@ -4,16 +4,16 @@
\alias{delete_ont}
\title{Delete an ontology from metadata}
\usage{
delete_ont(host, admin, pass, scheme)
delete_ont(scheme, host = "", admin = "", pass = "")
}
\arguments{
\item{scheme}{The scheme to use for this ontology}

\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{the password for the admin account}

\item{scheme}{The scheme to use for this ontology}
}
\description{
Delete an existing ontology from metadata


+ 3
- 3
man/delete_ontology.Rd View File

@@ -4,16 +4,16 @@
\alias{delete_ontology}
\title{Delete an ontology from i2b2}
\usage{
delete_ontology(host = "127.0.0.1", admin, pass, scheme)
delete_ontology(scheme, host = "", admin = "", pass = "")
}
\arguments{
\item{scheme}{The scheme to use for this ontology}

\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{the password for the admin account}

\item{scheme}{The scheme to use for this ontology}
}
\description{
Delete an existing ontology from metadata


+ 20
- 0
man/get_ont.Rd View File

@@ -0,0 +1,20 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/metadata.R
\name{get_ont}
\alias{get_ont}
\title{Fetch an ontology}
\usage{
get_ont(ont, host = "", admin = "", pass = "")
}
\arguments{
\item{ont}{The name of the ontology, from the c_table_name column in list_ont()}

\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{the password for the admin account}
}
\description{
Fetch an ontology
}

+ 5
- 5
man/import_data.Rd View File

@@ -4,18 +4,18 @@
\alias{import_data}
\title{Import data into i2b2}
\usage{
import_data(host, admin, pass, data, project)
import_data(data, project, host = "", admin = "", pass = "")
}
\arguments{
\item{data}{A dataframe of observation facts}

\item{project}{The project to which to add the patients and their data}

\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{The password for the admin account}

\item{data}{A dataframe of observation facts}

\item{project}{The project to which to add the patients and their data}
}
\description{
Import data from a data frame into i2b2


+ 18
- 0
man/list_ont.Rd View File

@@ -0,0 +1,18 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/metadata.R
\name{list_ont}
\alias{list_ont}
\title{List the available ontologies}
\usage{
list_ont(host = "", admin = "", pass = "")
}
\arguments{
\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{the password for the admin account}
}
\description{
List the available ontologies
}

+ 18
- 0
man/list_schemes.Rd View File

@@ -0,0 +1,18 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/metadata.R
\name{list_schemes}
\alias{list_schemes}
\title{List the available schemes}
\usage{
list_schemes(host = "", admin = "", pass = "")
}
\arguments{
\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{the password for the admin account}
}
\description{
List the available schemes
}

+ 20
- 0
man/list_user_roles.Rd View File

@@ -0,0 +1,20 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/users.R
\name{list_user_roles}
\alias{list_user_roles}
\title{List user roles}
\usage{
list_user_roles(user, host = "", admin = "", pass = "")
}
\arguments{
\item{user}{An user id}

\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{The password for the database admin}
}
\description{
Delete i2b2 users from the instance
}

+ 18
- 0
man/list_users.Rd View File

@@ -0,0 +1,18 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/users.R
\name{list_users}
\alias{list_users}
\title{List users}
\usage{
list_users(host = "", admin = "", pass = "")
}
\arguments{
\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{The password for the database admin}
}
\description{
Delete i2b2 users from the instance
}

+ 8
- 7
man/populate_concept.Rd View File

@@ -4,15 +4,10 @@
\alias{populate_concept}
\title{Populate the concept_dimension}
\usage{
populate_concept(host, admin, pass, ont, modi, name, scheme)
populate_concept(ont, modi, name, scheme, host = "", admin = "",
pass = "")
}
\arguments{
\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{the password for the admin account}

\item{ont}{The ontology to insert}

\item{modi}{The modifiers to insert}
@@ -20,6 +15,12 @@ populate_concept(host, admin, pass, ont, modi, name, scheme)
\item{name}{The name of the new ontology}

\item{scheme}{The scheme to use for this ontology}

\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{the password for the admin account}
}
\description{
Populate the concept_dimension with new concepts


+ 8
- 8
man/populate_ont.Rd View File

@@ -4,16 +4,10 @@
\alias{populate_ont}
\title{Populate an empty ontology table}
\usage{
populate_ont(host, admin, pass, ont, modi = NULL, name, scheme,
include_code = T)
populate_ont(ont, modi = NULL, name, scheme, include_code = T, host = "",
admin = "", pass = "")
}
\arguments{
\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{the password for the admin account}

\item{ont}{The ontology to insert}

\item{modi}{The modifiers to insert}
@@ -23,6 +17,12 @@ populate_ont(host, admin, pass, ont, modi = NULL, name, scheme,
\item{scheme}{The scheme to use for this ontology}

\item{include_code}{Whether to include the code in the label or not}

\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{the password for the admin account}
}
\description{
Populate an empty ontology table


+ 7
- 7
man/populate_provider.Rd View File

@@ -4,20 +4,20 @@
\alias{populate_provider}
\title{Populate the provider_dimension}
\usage{
populate_provider(host, admin, pass, ont, name, scheme)
populate_provider(ont, name, scheme, host = "", admin = "", pass = "")
}
\arguments{
\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{the password for the admin account}

\item{ont}{The ontology to insert}

\item{name}{The name of the new ontology}

\item{scheme}{The scheme to use for this ontology}

\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{the password for the admin account}
}
\description{
Populate the provider_dimension with new providers


+ 1
- 1
man/rebuild_indexes_demodata.Rd View File

@@ -4,7 +4,7 @@
\alias{rebuild_indexes_demodata}
\title{Rebuild the indexes}
\usage{
rebuild_indexes_demodata(host, admin, pass)
rebuild_indexes_demodata(host = "", admin = "", pass = "")
}
\arguments{
\item{host}{The host to connect to}


Loading…
Cancel
Save