CREATE TABLE `opd_allergy` (
`hn` varchar(9) NOT NULL DEFAULT '',
`report_date` date DEFAULT NULL,
`agent` varchar(250) NOT NULL DEFAULT '',
`symptom` varchar(250) DEFAULT NULL,
`reporter` varchar(250) DEFAULT NULL,
`relation_level` varchar(50) DEFAULT NULL,
`note` text,
`allergy_type` char(1) DEFAULT NULL,
`display_order` int(11) DEFAULT NULL,
`begin_date` date DEFAULT NULL,
`allergy_group_id` int(11) DEFAULT NULL,
`seriousness_id` int(11) DEFAULT NULL,
`allergy_result_id` int(11) DEFAULT NULL,
`allergy_relation_id` int(11) DEFAULT NULL,
`ward` varchar(4) DEFAULT NULL,
`department` char(3) DEFAULT NULL,
`spclty` char(2) DEFAULT NULL,
`entry_datetime` datetime DEFAULT NULL,
`update_datetime` datetime DEFAULT NULL,
`depcode` char(3) DEFAULT NULL,
`no_alert` char(1) DEFAULT NULL,
`naranjo_result_id` int(11) DEFAULT NULL,
`force_no_order` char(1) DEFAULT NULL,
`opd_allergy_alert_type_id` int(11) DEFAULT NULL,
PRIMARY KEY (`hn`,`agent`),
UNIQUE KEY `unique` (`hn`,`agent`),
KEY `agent` (`agent`),
KEY `hn` (`hn`),
KEY `report_date` (`report_date`)
) ENGINE=InnoDB DEFAULT CHARSET=tis620
UNIQUE KEY `unique` (`hn`,`agent`),
ตรวจสอบ ข้อมูล opd_allergy