#!/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  \
_lab_test_map \
additional_options \
audit_request_categories \
audit_request_options \
clinical_trials \
consent_options \
diagnoses \
diagnosis_change_options \
diagnosis_context_warnings \
diagnostic_categories \
email_contacts \
error_code_assignment \
error_codes \
hospital_departments \
icdo_category \
lab_sections \
lab_test_data_type \
lab_test_result_data_types \
lab_test_result_options \
lab_test_status_options \
lab_tests \
parent_organisations \
phone_log_options \
referral_sources \
referral_types \
referrer_department \
referrers \
report_error_codes \
result_summary_options \
screens \
specimens \
status_options \
user_functions \
user_group_function \
user_groups \
user_locations \
| gzip -9 - >$GZ.gz # -9 = best compression
