referral <-------------------------------------------------------------------------------- primary referral_id INT(11) patient_id INT (11) ---- patient_id of patient referral_status_id INT (11) date_created DATETIME creator_id INT (11) ---- user_id of person priority_id INT (11) comment TEXT data_changed DATETIME changed_by INT (11) ---- user_id of person voided SMALLINT(6) voided_by INT(11) ---- user_id of person date_voided DATETIME void_reason TEXT uuid CHAR(36) referral_post primary referral_post_id INT (11) referral_id INT(11) referral_post_position INT (11) date_posted DATETIME posted_by INT (11) ---- user_id of person post TEXT uuid CHAR(36) referral_attachment <-------------------------------------------------------------------- primary referral_attachment_id INT (11) referral_post_id INT (11) posted_by INT (11) ---- user_id of person attachment BLOB size ext mime filename uuid CHAR(36) referral_recipient <------------------------------------------------------------------------ primary referral_id user_id doctor <------------------------------------------------------------------------------------ primary doctor_id user_id ---- user_id of person specialization_id location_id ---- location_id of location uuid CHAR(36) user_contact_detail <-------------------------------------------------------------------- primary user_contact_detail_id user_id contact_type_id contact_info uuid CHAR(36) contact_type <---------------------------------------------------------------------------- primary contact_type_id contact_type specialization <---------------------------------------------------------------------------- primary specialization_id specialization_name