#!/bin/sh

# creates core_data.gz from hmds_lims tables

DBUSER=raj
DBPASS=adm1n
SRC=hilis4
GZ=core_data

# -t = Do not write CREATE TABLE statements that re-create each dumped table;
# -c = Use complete INSERT statements that include column names
mysqldump -u $DBUSER -p$DBPASS $SRC -t -c  \
additional_options \
consent_options \
diagnosis_change_options \
diagnostic_categories \
error_codes \
hospital_departments \
parent_organisations \
phone_log_options \
referral_sources \
referral_types \
referrer_department \
referrers \
report_error_codes \
status_options \
user_functions \
user_group_function \
user_groups \
| gzip -9 - >$GZ.gz # -9 = best compression

# discontinued tables:

#_lab_test_map \
#audit_request_categories \
#audit_request_options \
#clinical_trials \
#diagnoses \
#diagnosis_context_warnings \
#email_contacts \
#error_code_assignment \
#icdo_category \
#lab_sections \
#lab_test_data_type \
#lab_test_result_data_types \
#lab_test_result_options \
#lab_test_status_options \
#lab_tests \
#result_summary_options \
#screens \
#specimens \
#user_locations \
