将数据导入i2b2数据库架构

i2b2-import的Python项目详细描述


CHUVLicenseCodacy BadgeCircleCI

i2b2导入

简介

此库提供将数据导入i2b2数据库架构的函数。

安装

运行:pip install i2b2_import

使用量

要从csv文件导入大脑特征(和/或其他观察结果), 使用:

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.

或从文件夹:

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.

要从数据目录数据库导入元数据,请使用:

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.

要从额外文件(xml、json,…)导入元数据,请使用:

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)

或从文件夹:

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)

测试

打开tests目录并运行./test.sh

注意:需要Docker。

建造

运行./build.sh

推动Pypi

运行./publish.sh

(这将在推送项目之前构建项目)。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java正在寻找Java8中的内置函数以忽略异常   javascript JQuery更改Div的颜色   java PostgreSQL使用JDBC写入inet列   java为什么体重指数计算结果不正确?   java禁用linux中的log4j控制台日志记录   java我可以让我的JMS主题在新订阅者连接时通知发布者(使用ActiveMQ)   基于三个浮点输入的java过滤器JTable?   Java OpenGL/LWJGL体素纹理   在SpringBoot java应用程序中,有没有一种方法可以通过不同的机器使用hostIP作为主机远程连接到redis服务器   java Struts 2 s:提交按钮语法以在映射中设置值   java源代码:setDomainEnv。windows 7中的cmd文件   缺少货币计算java的返回语句   JavaHibernate没有注意到从其他源进行的数据库更新   无法在OpenCV/Java中生成负矩阵   Java不做循环   java无法使用类对象写入文件ArrayList   jpa使用数组作为调用Java的存储过程的输入   java使用文件提供程序检索内容Uri失败   需要java程序来创建方法模板