Skip to content

Instantly share code, notes, and snippets.

@cemeng
Created April 5, 2016 02:19
Show Gist options
  • Save cemeng/37553b8b9535e851a3cdf9ea6528c267 to your computer and use it in GitHub Desktop.
Save cemeng/37553b8b9535e851a3cdf9ea6528c267 to your computer and use it in GitHub Desktop.
Patient
CREATE TABLE `patient` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`version` bigint(20) NOT NULL,
`adaptation_to_loss` varchar(255) DEFAULT NULL,
`address` varchar(255) DEFAULT NULL,
`age` int(11) NOT NULL,
`age_care_facility_address_id` bigint(20) DEFAULT NULL,
`age_care_facility_building_name` varchar(255) DEFAULT NULL,
`age_care_facility_name` varchar(255) DEFAULT NULL,
`age_care_facility_other` varchar(255) DEFAULT NULL,
`age_care_facility_room_no` varchar(255) DEFAULT NULL,
`age_care_facility_section_no` varchar(255) DEFAULT NULL,
`cataract_left_eye` bit(1) NOT NULL,
`cataract_refer_surgery` bit(1) NOT NULL,
`cataract_right_eye` bit(1) NOT NULL,
`client_understanding` varchar(255) DEFAULT NULL,
`cognitive_behaviour_aggressive_behaviour_physical` bit(1) DEFAULT NULL,
`cognitive_behaviour_aggressive_behaviour_verbal` bit(1) DEFAULT NULL,
`cognitive_behaviour_long_term` bit(1) DEFAULT NULL,
`cognitive_behaviour_short_term_memory_problem` bit(1) DEFAULT NULL,
`consent` bit(1) DEFAULT NULL,
`date_created` datetime NOT NULL,
`deceased` bit(1) DEFAULT NULL,
`diabetes_comments` varchar(255) DEFAULT NULL,
`diabetes_current_treatment` varchar(255) DEFAULT NULL,
`diabetes_left_eye` bit(1) NOT NULL,
`diabetes_retinopathy` bit(1) NOT NULL,
`diabetes_review12months` bit(1) NOT NULL,
`diabetes_right_eye` bit(1) NOT NULL,
`dob` datetime DEFAULT NULL,
`dry_eye_comments` varchar(255) DEFAULT NULL,
`dry_eye_current_treatment` varchar(255) DEFAULT NULL,
`dry_eye_left_eye` bit(1) NOT NULL,
`dry_eye_optive` bit(1) NOT NULL,
`dry_eye_right_eye` bit(1) NOT NULL,
`dry_eye_systane` bit(1) NOT NULL,
`eligible_forndi` bit(1) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`eye_specialist_address_id` bigint(20) DEFAULT NULL,
`eye_specialist_email` varchar(255) DEFAULT NULL,
`eye_specialist_last_seen` datetime DEFAULT NULL,
`eye_specialist_mobile_phone` varchar(255) DEFAULT NULL,
`eye_specialist_name` varchar(255) DEFAULT NULL,
`eye_specialist_next_appointment` datetime DEFAULT NULL,
`eye_specialist_work_phone` varchar(255) DEFAULT NULL,
`facility_id` bigint(20) DEFAULT NULL,
`first_name` varchar(255) NOT NULL,
`gender` varchar(1) DEFAULT NULL,
`general_health_allergies` varchar(255) DEFAULT NULL,
`general_health_cardiac_problems` bit(1) NOT NULL,
`general_health_depression` bit(1) NOT NULL,
`general_health_diabetes` bit(1) NOT NULL,
`general_health_dialysis` bit(1) NOT NULL,
`general_health_functional_history` varchar(255) DEFAULT NULL,
`general_health_hearing_aids` bit(1) NOT NULL,
`general_health_hearing_loss` bit(1) NOT NULL,
`general_health_hypertension` bit(1) NOT NULL,
`general_health_medications` varchar(255) DEFAULT NULL,
`general_health_respiratory` bit(1) NOT NULL,
`general_health_smoker` bit(1) NOT NULL,
`general_health_stroke` bit(1) NOT NULL,
`glaucoma_comments` varchar(255) DEFAULT NULL,
`glaucoma_current_treatment` varchar(255) DEFAULT NULL,
`glaucoma_left_eye` bit(1) NOT NULL,
`glaucoma_review3months` bit(1) NOT NULL,
`glaucoma_review6months` bit(1) NOT NULL,
`glaucoma_right_eye` bit(1) NOT NULL,
`gp_address_id` bigint(20) DEFAULT NULL,
`gp_email` varchar(255) DEFAULT NULL,
`gp_last_seen` datetime DEFAULT NULL,
`gp_mobile_phone` varchar(255) DEFAULT NULL,
`gp_name` varchar(255) DEFAULT NULL,
`gp_next_appointment` datetime DEFAULT NULL,
`gp_work_phone` varchar(255) DEFAULT NULL,
`home_phone` varchar(255) DEFAULT NULL,
`last_name` varchar(255) NOT NULL,
`last_updated` datetime NOT NULL,
`legally_blind` bit(1) DEFAULT NULL,
`low_vision_assessment_date_last_seen` datetime DEFAULT NULL,
`low_vision_assessment_location` varchar(255) DEFAULT NULL,
`low_vision_assessment_name` varchar(255) DEFAULT NULL,
`macular_degeneration_left_eye` bit(1) NOT NULL,
`macular_degeneration_lutein_vision` bit(1) NOT NULL,
`macular_degeneration_macuvision` bit(1) NOT NULL,
`macular_degeneration_right_eye` bit(1) NOT NULL,
`medicare_exp_date` datetime DEFAULT NULL,
`medicare_no` varchar(255) DEFAULT NULL,
`medicare_ref_no` int(11) DEFAULT NULL,
`mobile_phone` varchar(255) DEFAULT NULL,
`other_comments` varchar(255) DEFAULT NULL,
`other_contact1address_id` bigint(20) DEFAULT NULL,
`other_contact1email` varchar(255) DEFAULT NULL,
`other_contact1home_phone` varchar(255) DEFAULT NULL,
`other_contact1mobile_phone` varchar(255) DEFAULT NULL,
`other_contact1name` varchar(255) DEFAULT NULL,
`other_contact1relationship` varchar(255) DEFAULT NULL,
`other_contact1work_phone` varchar(255) DEFAULT NULL,
`other_contact2address_id` bigint(20) DEFAULT NULL,
`other_contact2email` varchar(255) DEFAULT NULL,
`other_contact2home_phone` varchar(255) DEFAULT NULL,
`other_contact2mobile_phone` varchar(255) DEFAULT NULL,
`other_contact2name` varchar(255) DEFAULT NULL,
`other_contact2relationship` varchar(255) DEFAULT NULL,
`other_contact2work_phone` varchar(255) DEFAULT NULL,
`other_contact3address_id` bigint(20) DEFAULT NULL,
`other_contact3email` varchar(255) DEFAULT NULL,
`other_contact3home_phone` varchar(255) DEFAULT NULL,
`other_contact3mobile_phone` varchar(255) DEFAULT NULL,
`other_contact3name` varchar(255) DEFAULT NULL,
`other_contact3relationship` varchar(255) DEFAULT NULL,
`other_contact3work_phone` varchar(255) DEFAULT NULL,
`pensioner` varchar(7) DEFAULT NULL,
`postcode` varchar(255) DEFAULT NULL,
`preferred_name` varchar(255) DEFAULT NULL,
`prev_optometrist_address_id` bigint(20) DEFAULT NULL,
`prev_optometrist_email` varchar(255) DEFAULT NULL,
`prev_optometrist_last_seen` datetime DEFAULT NULL,
`prev_optometrist_mobile_phone` varchar(255) DEFAULT NULL,
`prev_optometrist_name` varchar(255) DEFAULT NULL,
`prev_optometrist_next_due_date` datetime DEFAULT NULL,
`prev_optometrist_work_phone` varchar(255) DEFAULT NULL,
`private_health_care` varchar(255) DEFAULT NULL,
`private_health_care_exp_date` datetime DEFAULT NULL,
`private_health_care_no` varchar(255) DEFAULT NULL,
`refused` bit(1) DEFAULT NULL,
`resident_type` varchar(255) DEFAULT NULL,
`retinal_scan` bit(1) DEFAULT NULL,
`self_funded_retiree` bit(1) DEFAULT NULL,
`state` varchar(255) DEFAULT NULL,
`suburb` varchar(255) DEFAULT NULL,
`user_id` bigint(20) DEFAULT NULL,
`veteran_affairs_no` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FK_6i3fp8wcdxk473941mbcvdao4` (`user_id`),
KEY `FK_7stbo6c4irbkvfb8aml17r5oy` (`other_contact1address_id`),
KEY `FK_a8radn3887lumy75qwdlcnwis` (`other_contact2address_id`),
KEY `FK_hemm6mcmbj1voafhnjb30la8j` (`facility_id`),
KEY `FK_je9wl78xlxoi5ftuidjxdl79q` (`prev_optometrist_address_id`),
KEY `FK_on96ll700wsv65rcybajhghc` (`eye_specialist_address_id`),
KEY `FK_pf7itv51ympqg9h3j6ln6a5jv` (`age_care_facility_address_id`),
KEY `FK_pnbuqqno54nfjg3xhcmj7dair` (`other_contact3address_id`),
KEY `FK_rvvt5ucppox4voq542666yoqk` (`gp_address_id`),
CONSTRAINT `FK_6i3fp8wcdxk473941mbcvdao4` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`),
CONSTRAINT `FK_7stbo6c4irbkvfb8aml17r5oy` FOREIGN KEY (`other_contact1address_id`) REFERENCES `address` (`id`),
CONSTRAINT `FK_a8radn3887lumy75qwdlcnwis` FOREIGN KEY (`other_contact2address_id`) REFERENCES `address` (`id`),
CONSTRAINT `FK_hemm6mcmbj1voafhnjb30la8j` FOREIGN KEY (`facility_id`) REFERENCES `facility` (`id`),
CONSTRAINT `FK_je9wl78xlxoi5ftuidjxdl79q` FOREIGN KEY (`prev_optometrist_address_id`) REFERENCES `address` (`id`),
CONSTRAINT `FK_on96ll700wsv65rcybajhghc` FOREIGN KEY (`eye_specialist_address_id`) REFERENCES `address` (`id`),
CONSTRAINT `FK_pf7itv51ympqg9h3j6ln6a5jv` FOREIGN KEY (`age_care_facility_address_id`) REFERENCES `address` (`id`),
CONSTRAINT `FK_pnbuqqno54nfjg3xhcmj7dair` FOREIGN KEY (`other_contact3address_id`) REFERENCES `address` (`id`),
CONSTRAINT `FK_rvvt5ucppox4voq542666yoqk` FOREIGN KEY (`gp_address_id`) REFERENCES `address` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment