-
Notifications
You must be signed in to change notification settings - Fork 48
/
Makefile
52 lines (40 loc) · 1.84 KB
/
Makefile
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
MIMIC_SCHEMA=mimic
OMOP_SCHEMA=omop
MIMIC="host=localhost dbname=mimic user=postgres options=--search_path=$(MIMIC_SCHEMA)"
OMOP="host=localhost dbname=mimic user=postgres options=--search_path=$(OMOP_SCHEMA)"
runetl: sequence concept load
runetlprivate: runetl private
buildomop:
psql $(OMOP) -f omop/build-omop/postgresql/omop_ddl_comments.sql &&\
psql $(OMOP) -f omop/build-omop/postgresql/mimic-omop-add-column.sql &&\
psql $(OMOP) -f omop/build-omop/postgresql/mimic-omop-alter.sql
loadvocab:
psql $(OMOP) -f omop/build-omop/postgresql/omop_vocab_load.sql
concept:
Rscript --vanilla etl/ConceptTables/loadTables.R $(MIMIC_SCHEMA)
sequence:
psql $(MIMIC) --set=OMOP_SCHEMA="$(OMOP_SCHEMA)" -f mimic/build-mimic/postgres_create_mimic_id.sql
load:
psql $(MIMIC) --set=OMOP_SCHEMA="$(OMOP_SCHEMA)" -f etl/etl.sql
private:
psql $(MIMIC) --set=OMOP_SCHEMA="$(OMOP_SCHEMA)" -f etl/etl_contrib.sql
check:
psql $(MIMIC) --set=OMOP_SCHEMA="$(OMOP_SCHEMA)" -f etl/check_etl.sql
export:
psql $(MIMIC) --set=OMOP_SCHEMA="$(OMOP_SCHEMA)" -f export/export_mimic_omop.sql &&\
cp import/import_mimic_omop.sql etl/Result/ &&\
cp omop/build-omop/postgresql/* etl/Result/
# tar -cf $(MIMIC_SCHEMA)-omop.tar etl/Result/
exportmonet:
psql $(MIMIC) --set=OMOP_SCHEMA="$(OMOP_SCHEMA)" -f export/export_mimic_omop_monetdb.sql &&\
cp import/import_mimic_omop_monetdb.sh etl/Result/ &&\
cp omop/build-omop/monetdb/ddl_monetdb.sql etl/Result/
# tar -cf $(MIMIC_SCHEMA)-omop.tar etl/Result/
exportmonetdenorm:
psql $(MIMIC) --set=OMOP_SCHEMA="$(OMOP_SCHEMA)" -f export/export_mimic_omop_monetdb_denorm.sql &&\
cp import/import_mimic_omop_monetdb.sh etl/Result/ &&\
cp omop/build-omop/monetdb/ddl_monetdb_denorm.sql etl/Result/
purgeresult:
find etl/Result/ -name "*.gz" -delete &&\
find etl/Result/ -name "*.tar" -delete &&\
find etl/Result/ -name "*.sql" -delete