forked from USM-CHU-FGuyon/BlendedICU
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0_prepare_files.py
31 lines (22 loc) · 1.01 KB
/
0_prepare_files.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'''
This code generates the mapping between ingredients from the OMOP standard
vocabulary and the drugnames in the source databases.
The omop_medication module creates a ohdsi_icu_medications.csv table
which contains brand names for a number of ingredients.
This file can be completed by a manual_icu_meds.csv file that lists additional
ingredients or additional synonyms or brand names for an ingredient in the
ohdsi vocabulary.
The medication_mapping module searches the labels in the source databases
and creates a json file listing all labels associated to an ingredient for each
source database.
'''
import json
from med_to_omop.omop_medications import OMOP_Medications
from med_to_omop.medication_mapping import MedicationMapping
from omop_cdm import omop_parquet
pth_dic = json.load(open('paths.json', 'r'))
omop_parquet.convert_to_parquet(pth_dic)
om = OMOP_Medications(pth_dic)
ingredient_to_drug = om.run()
mm = MedicationMapping(pth_dic)
medication_json = mm.run(load_drugnames=True, fname='medications.json')