Skip to main content

CHUV License Codacy Badge CircleCI

I2B2 Import

Introduction

This library provides functions to import data into an I2B2 DB schema.

Installation

Run: pip install i2b2_import

Usage

To import brain features (and/or other observations) from a CSV file, use:

features_csv_import.csv2db(file_path, i2b2_conn, dataset, config):
    Import brain features and other observation facts data from a CSV file into the I2B2 DB schema.
    * param file_path: Path to the CSV file.
    * param i2b2_db_url: URL of the I2B2 DB.
    * param dataset: Data set name.
    * param config: A few settings. It is a dictionary that accepts the following fields:
        - pid_in_vid: Rarely, a data set might mix patient IDs and visit IDs. E.g. : LREN data. In such a case, you
        to enable this flag. This will try to split PatientID into VisitID and PatientID.
        - sid_by_patient: Rarely, a data set might use study IDs which are unique by patient (not for the whole study).
        E.g.: LREN data. In such a case, you have to enable this flag. This will use PatientID + StudyID as a sessionID.
    * param regions_name_file: CSV file containing the abbreviated regions name in the first column and the full names
        in the second column.

or from a folder:

features_csv_import.folder2db(folder, i2b2_conn, dataset, config):
    Import brain features and other observation facts data from a folder containing CSV files into the I2B2 DB schema.
    * param folder: Folder path
    * param i2b2_db_url: URL of the I2B2 DB.
    * param dataset: Data set name.
    * param config: A few settings. It is a dictionary that accepts the following fields:
        - pid_in_vid: Rarely, a data set might mix patient IDs and visit IDs. E.g. : LREN data. In such a case, you
        to enable this flag. This will try to split PatientID into VisitID and PatientID.
        - sid_by_patient: Rarely, a data set might use study IDs which are unique by patient (not for the whole study).
        E.g.: LREN data. In such a case, you have to enable this flag. This will use PatientID + StudyID as a sessionID.
    * param regions_name_file: CSV file containing the abbreviated regions name in the first column and the full names
        in the second column.

To import metadata from the data-catalog-db, use:

data_catalog_import.catalog2i2b2(data_catalog_conn, i2b2_conn):
    Import meta data from the Data Catalog DB to the I2B2 schema.
    * param data_catalog_conn: Connection to the Data Catalog DB.
    * param i2b2_db_url: URL of the I2B2 DB.

To import metadata from extra files (XML, JSON, …), use:

ppmi_xml_import.meta2i2b2(file_path, db_conn, dataset):
    Import meta-data from a file into the I2B2 schema.
    * param file_path: File (XML, JSON, ...) containing meta-data for a given dataset (PPMI, EDSD, ...).
    * param i2b2_db_url: Connection to the I2B2 DB.
    * param dataset: Dataset ID (each dataset uses its own meta-data files format)

or from a folder:

ppmi_xml_import.folder2db(folder, db_conn, dataset):
    Import meta-data from files from a given folder (recursive) and for a given dataset into the I2B2 schema.
    * param folder: Folder containing meta-data files for a given dataset.
    * param i2b2_db_url: URL of the I2B2 DB.
    * param dataset: Dataset ID (each dataset uses its own meta-data files format)

Test

Open the tests directory and run ./test.sh.

NOTE: Docker is needed.

build

Run ./build.sh.

Push on PyPi

Run ./publish.sh.

(This builds the project prior to pushing it).

Metadata

Release files for i2b2-import 1.6.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for i2b2-import 1.6.3
File Interpreter ABI Platform
i2b2_import-1.6.3-py3-none-any.whl Python 3 none any Details

Release files / i2b2_import-1.6.3-py3-none-any.whl

Download URL i2b2_import-1.6.3-py3-none-any.whl
Size 18.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1ae0659daead24e074f68f4085e5d9ea56ca6c09227cefb9f687daca291cc67
BLAKE2b-256 checksum
How to use checksums
b417ee0138e4e44b37c031861824abb61a6a290f8883a61d490608cb8dfd0e39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.6.3 This release

1 release file

1.6.2

1 release file

1.6.1

1 release file

1.6.0

2 release files

1.5.34

1 release file

1.5.33

1 release file

1.5.32

1 release file

1.5.31

1 release file

1.5.30

1 release file

1.5.29

1 release file

1.5.28

1 release file

1.5.27

1 release file

1.5.26

1 release file

1.5.25

1 release file

1.5.24

1 release file

1.5.23

1 release file

1.5.22

1 release file

1.5.21

1 release file

1.5.20

1 release file

1.5.19

1 release file

1.5.18

1 release file

1.5.17

1 release file

1.5.16

1 release file

1.5.15

1 release file

1.5.14

1 release file

1.5.13

1 release file

1.5.12

1 release file

1.5.11

1 release file

1.5.10

1 release file

1.5.9

1 release file

1.5.8

1 release file

1.5.7

1 release file

1.5.6

1 release file

1.5.5

1 release file

1.5.4

1 release file

1.5.3

1 release file

1.5.2

1 release file

1.5.1

1 release file

1.5.0

1 release file

1.4.6

1 release file

1.4.5

1 release file

1.4.3

1 release file

1.4.2

1 release file

1.4.1

1 release file

1.4.0

1 release file

1.3.16

1 release file

1.3.15

1 release file

1.3.14

1 release file

1.3.13

1 release file

1.3.12

1 release file

1.3.11

1 release file

1.3.10

1 release file

1.3.9

1 release file

1.3.8

1 release file

1.3.7

1 release file

1.3.6

1 release file

1.3.5

1 release file

1.3.3

1 release file

1.3.2

1 release file

1.3.0

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page