Package 'readepi'

Title: Read Data from Health Information Systems
Description: Data import from several health information systems ('HIS'). The current version of the package covers 'HIS' such as 'MS SQL', 'MySQL', and 'PostGRESQL' servers, 'REDCap', 'DHIS2' and 'Fingertips'.
Authors: Karim Mané [aut, cre, cph] , Bubacarr Bah [ctb] , Bankolé Ahadzie [ctb], Nuredin Mohammed [ctb], Abdoelnaser Degoot [ctb], Hugo Gruson [rev] , Pratik Gupte [rev] , Andree Valle-Campos [rev] , London School of Hygiene and Tropical Medicine, LSHTM [cph], data.org [fnd]
Maintainer: Karim Mané <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2024-12-08 05:04:15 UTC
Source: https://github.com/epiverse-trace/readepi

Help Index


Get the target DHIS2 attribute identifiers and names

Description

Get the target DHIS2 attribute identifiers and names

Usage

dhis2_get_attributes(base_url, user_name, password, which = "dataSets")

Arguments

base_url

the base URL of the DHIS2 server

user_name

the user name

password

the user's password

which

the target DHIS2 attribute name.

Value

an object of type data.frame with details about the DHIS2 attributes of interest.

Examples

## Not run: 
datasets <- dhis2_get_attributes(
  base_url  = "https://play.dhis2.org/demo/",
  user_name = "admin",
  password  = "district",
  which     = "dataSets"
)

## End(Not run)

Import data from different data_sources into R

Description

the function allows import of data from Health Information Systems (HIS), files, and folders.The HIS consist of database management systems (DBMS) and website of public data collection.

Usage

readepi(
  data_source = NULL,
  records = NULL,
  fields = NULL,
  id_position = NULL,
  id_col_name = NULL,
  ...
)

Arguments

data_source

the URL of the HIS

records

a vector or a comma-separated string of subject IDs. When specified, only these records will be imported.

fields

a vector or a comma-separated string of column names. If provided, only those columns will be imported.

id_position

the column position of the variable that unique identifies the subjects. When the name of the column with the subject IDs is known, this can be provided using the id_col_name argument

id_col_name

the column name with the subject IDs.

...

additional arguments passed to the readepi() function. These are enumerated and described in the vignette.

Value

a list of 1 or several object(s) of type ⁠data frame⁠.

a list of 2 or more object(s) of type ⁠data frame⁠.

Examples

# reading from a MySQL server
## Not run: 
data <- readepi(
  data_source      = "mysql-rfam-public.ebi.ac.uk",
  credentials_file = system.file("extdata", "test.ini", package = "readepi"),
  driver_name      = "",
  from             = "author"
)

## End(Not run)

Display the structure of the credentials file

Description

Display the structure of the credentials file

Usage

show_example_file()

Value

Displays the content of the template credential file.

Examples

show_example_file()

Display the list of tables in a database

Description

Display the list of tables in a database

Usage

show_tables(data_source, driver_name, credentials_file = NULL)

Arguments

data_source

the URL of the server of interest

driver_name

the name of the MS driver. use odbc::odbcListDrivers() to display the list of installed drivers

credentials_file

the path to the file with the user-specific credential details for the projects of interest. See the help of the readepi function for more details.

Value

a character that contains the list of all tables found in the specified database.

Examples

## Not run: 
show_tables(
  data_source      = "mysql-rfam-public.ebi.ac.uk",
  credentials_file = system.file("extdata", "test.ini", package = "readepi"),
  driver_name      = ""
)

## End(Not run)

Visualize the first 5 rows of the data from a table

Description

Visualize the first 5 rows of the data from a table

Usage

visualise_table(data_source, credentials_file, from, driver_name)

Arguments

data_source

the the URL of the HIS

credentials_file

the path to the file with the user-specific credential details for the projects of interest

from

the table name

driver_name

the name of the MS driver

Value

prints the first 5 rows of the specified table.

Examples

## Not run: 
  result <- visualise_table(
    data_source      = "mysql-rfam-public.ebi.ac.uk",
    credentials_file = system.file("extdata", "test.ini",
                                   package = "readepi"),
    from             = "author",
    driver_name      = ""
  )

## End(Not run)