Code Monkey home page Code Monkey logo

n2c22018t12sql's Introduction

n2c22018t12sql

What is this?

This is a tool to import the n2c2 2018 Track 1 "Cohort Selection for Clinical Trials" data into a SQL database.

By default it's capable of using Sqlite3, MariaDB, and Postgres. Adding the jar file for additional drivers to the classpath is possible should you need support for others.

Usage

The following example shows how to run the tool to import tagged XML files from /path/to/dir into a sqlite database called train.sqlite3:

clj -M -m n2c22018t12sql.core -t 'table-name' -a true -d /path/to/dir -j 'jdbc:sqlite:train.sqlite3'

The following arguments are supported:

  • -j, --jdbc URL: JDBC database connection string.
  • -p, --patient-table TABLE-NAME: Name of patient table. Default: "patients".
  • -t, --doc-table TABLE-NAME: Name of document table. Default: "documents".
  • -T, --annotation-table TABLE-NAME: Table to insert cohort annotations to. Default: "annotations".
  • -a, --annotated: Whether data is annotated with cohort challenge tags (met/not met). Defaults to false.
  • -k, --keep: If flag provided then do not drop existing tables before trying to insert data.
  • -d, --dataset-dir DIRECTORY: Path to directory containing n2c2 XML files.
  • -?, --help: Prints help message.

Additionally it is possible to provide --jdbc as an environment variable instead of a command line option. To do this set the JDBC environment variable to the connection string you would like to use. This is recommended to prevent leaking your database username/password as command-line arguments of running processes may often be accessible to other users.

Examples of supported JDBC strings:

  • jdbc:sqlite:C:/Users/me/MyDatabase.db
  • jdbc:mariadb://localhost:3306/MyDatabase?user=maria&password=hunter2
  • jdbc:postgresql://localhost/n2c2?user=n2c2&password=n2c2

Bear in mind that the question mark ? and ampersand & characters are commonly special characters in shells and must be escaped. For this reason it is recommended you put your connection string in quotes as shown in the example at the top of this README.

Please note that --dataset-dir will scan recursively for all XML files. For this reason do not mix unnecessary XML files in with the n2c2 data, even if in subfolders.

Why

SQL is more readily supported as a data source for a lot of further work, compared to XML.

Specifically this allows for easy conversion to an RDF graph using R2RML.

n2c22018t12sql's People

Contributors

rob-a-bolton avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.