omopify_xml: Create an OMOP database from ICNARC XML

Description Usage Arguments Value

View source: R/omopify.R

Description

This function instantiates an OHDSI CDM (referred to throughout as OMOP for brevity) database from raw ICNARC XML. It can be specfied to output either version 5.3.1 or 6.0.0. In doing so, it creates an extremely spartan instance of OMOP. This behaviour is intentional to short cut the creation of an OMOP database, which can be a daunting process. After the OMOP database has been created, you have the option to add more data directly from additional ICNARC XML in the future, or begin to populate the database directly with data from another source, with your patient and their outcomes already populated.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
omopify_xml(
  project_path,
  nhs_trust,
  cdm_version = "5.3.1",
  vocabulary_version = "5",
  database_name = NULL,
  database_engine = "postgres",
  host_name = "localhost",
  port_no = 5432,
  username = NULL,
  from_empty = TRUE,
  vocabulary = TRUE,
  indexes = TRUE,
  constraints = TRUE,
  sqlite_file = NULL,
  dummy_data = FALSE
)

Arguments

project_path

the path to your project folder with the following populated folders:

  • vocab - contains ATHENA vocabularies.

  • meta - constains metadata on the ICNARC ETL process.

  • xml - contains raw ICNARC XML in lexicographical order.

nhs_trust

a character string with the full name of the trust.

cdm_version

the version of the CDM you are using, choose from:

  • 5.3.1

  • 6.0.0

vocabulary_version

the version of the vocabulary you are using

database_name

the name of the database you are connecting to

database_engine

the database engine, choose from:

  • sqlite: SQLite

  • postgres: PostgreSQL

  • mysql: Microsoft SQL Server (or similar varients)

host_name

host ip address

port_no

port number

username

username to database (*must* have write privaleges)

from_empty

logical flag: do you want to create the OMOP database from stratch. If you want to first write out the tables yourself this can be set to FALSE

vocabulary

logical flag: do you want to write out vocabularies

indexes

logical flag: do you want to create db with indexes

constraints

logical flag: do you want to create db with relational constraints

sqlite_file

a filename if using sqlite

dummy_data

logical flag: do you want to ignore XML files and use local dummy data instead

Value

TRUE if completed without errors


CC-HIC/icnarc2omop documentation built on March 4, 2020, 11:11 a.m.