示例fhir到transmart loader

fhir2transmart的Python项目详细描述


Build statuscodecovPyPIPyPI - Downloads

此包包含从HL7 FHIR(stu 3或r4)资源读取数据的映射程序 并将它们转换为TranSMART平台的数据模型, 一个用于转化生物医学研究的开源数据共享和分析平台。

它还提供了一个应用映射器并将转换后的数据写入制表符分隔的文件的实用程序。 可以使用transmart-copy工具将其加载到transmart数据库中。

fhir阅读器基于fhirclient包,向transmart的写入基于transmart-loader

注:这是一个非常初步的版本,仍在开发中。 可在https://github.com/thehyve/python_fhir2transmart/issues报告问题。

安装

这个包需要Python3.6

要安装fhir2transmart,请执行以下操作:

pip install fhir2transmart

或来源:

git clone https://github.com/thehyve/python_fhir2transmart.git
cd python_fhir2transmart
pip install .

使用以下命令运行测试(包括覆盖率):

python setup.py test

用法

从json文件input.json读取输入并将输出写入transmart copy 格式化为/path/to/output。输出目录应该是 空的不存在(然后它将被创建)。

# Translate one json file
fhir2transmart [--with-ontology] input.json /path/to/output
# Translate all json files in a directory
fhir2transmart [--with-ontology] input_dir /path/to/output

使用--with-ontology选项,概念和本体节点 基于输入数据创建。本体时不要使用此选项 已单独加载

示例数据位于MITRE SyntheticMass。说明:

# Download 1K Sample Synthetic Patient Records, FHIR STU3 : 20MB
wget https://syntheticmass.mitre.org/downloads/2017_11_06/synthea_sample_data_fhir_stu3_nov2017.zip
# unzip creates a directory 'fhir' containing 282MB of json files
unzip synthea_sample_data_fhir_stu3_nov2017.zip
# create an output directory
mkdir output
# apply the mapping
fhir2transmart fhir output

这将在output目录中生成目录i2b2metadatai2b2demodata。 生成的数据可以使用transmart-copy

# Download transmart-copy:
curl -f -L https://repo.thehyve.nl/service/local/repositories/releases/content/org/transmartproject/transmart-copy/17.1-HYVE-5.9-RC3/transmart-copy-17.1-HYVE-5.9-RC3.jar -o transmart-copy.jar
# Load data
PGUSER=tm_cz PGPASSWORD=tm_cz java -jar transmart-copy.jar -d output

映射

下表显示了FHIR资源如何映射到 Transmart数据模型。

FIHRTranSMART
Resource typeattributeClassattributeconceptmodifier
PatientidentifierPatientMappingidentifier
PatientgenderPatientsex
PatientgenderObservationvalueGender
PatientbirthDateObservationvalueBirthDate
PatientdeceasedObservationvalueDeceased
PatientdeceasedDateObservationvalueDeceasedDate
ConditionsubjectObservationpatient
ConditioncodeObservationconceptCode
ConditiononsetDateTimeObservationstartDate
ConditionabatementDateTimeObservationendDate
ConditionrecordedDateObservation
Conditioncategory
EncounteridentifierVisit
Encounterperiod.startVisitstartDate
Encounterperiod.endVisitendDate
EncounterstatusVisitactiveStatusCd
EncounterclassVisitinoutCd
EncounterhospitalizationVisitlocationCd

许可证

版权所有(c)2019 Hyve B.V.

fhir to transmart loader是根据mit许可证授权的。请参阅文件LICENSE

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

推荐PyPI第三方库


热门话题
java Spring MVC 4.0 RequestMapping无值,基于methodname   java Samsung 10 plus不允许wifi p2p发现   春爪哇。伊奥。IOException:找不到文件   java JasperReport饼图示例   java我试图使用mockito注释来测试我的代码,但无法解决mockito异常   命令行界面Java:制作简单的交互式cli应用程序   java jdk1之间的区别是什么。7_9 9和jdk1。7_271   java重载一个被重写的、继承的方法   java LazyInitializationException春季启动   java Play Framework 2.2.1 3个表之间存在大量关系