-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinitialize_sqlite_db.sh
executable file
·53 lines (45 loc) · 1.54 KB
/
initialize_sqlite_db.sh
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
53
#!/bin/bash
#
##########################################################################
#
# This file is part of OCEMR.
#
# OCEMR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OCEMR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OCEMR. If not, see <http://www.gnu.org/licenses/>.
#
#
#########################################################################
# Copyright 2011-8 Philip Freeman <[email protected]>
##########################################################################
VAR=/var/lib/ocemr
APP_DIR=/usr/share/ocemr/apps
APP=$APP_DIR/ocemr
UTIL=/usr/share/ocemr/util
export PYTHONPATH=$APP_DIR
if [ -e ${VAR}/db/ocemr.db ]; then
echo SQLite database present, aborting initialization...
exit 10
fi
python ${APP}/manage.py migrate
#----------
python ${UTIL}/import_symptom_csv.py
python ${UTIL}/import_vital_csv.py
python ${UTIL}/import_examnotes_csv.py
python ${UTIL}/import_labs_csv.py
python ${UTIL}/import_dx_csv.py
python ${UTIL}/import_rx_csv.py
#----------
#
# python ./util/import_test_patients_csv.py
#
echo "all done initializing in ${VAR}/db/ocemr.db"