use `med_2021`;

INSERT INTO `kl_lexicon` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `is_has_common`, `only_one`, `can_change`, `remark`) VALUES ('45', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '疾病系统分类', '411', '0', '0', '0', '');
INSERT INTO `kl_lexicon` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `is_has_common`, `only_one`, `can_change`, `remark`) VALUES ('46', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '性质', '412', '0', '0', '0', '');

INSERT INTO `kl_lexicon_relationship` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `remark`) VALUES ('12', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '关联科室', '511', '');
INSERT INTO `kl_lexicon_relationship` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `remark`) VALUES ('13', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '关联部位', '512', '');
INSERT INTO `kl_lexicon_relationship` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `remark`) VALUES ('14', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '关联系统分类', '513', '');
INSERT INTO `kl_lexicon_relationship` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `remark`) VALUES ('15', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '关联伴随症状', '514', '');

ALTER TABLE `kl_disease` add COLUMN `en_name` varchar(255) not null DEFAULT '' COMMENT '英文名称' AFTER `icd10_code`;
ALTER TABLE `kl_disease` add COLUMN `en_name_simple` varchar(255) not null DEFAULT '' COMMENT '英文简称' AFTER `icd10_code`;
ALTER TABLE `kl_disease` add COLUMN `name_simple` varchar(255) not null DEFAULT '' COMMENT '简称' AFTER `icd10_code`;
ALTER TABLE `kl_disease` add COLUMN `is_heredity` TINYINT(4) not null DEFAULT '0' COMMENT '是否遗传（0：否，1：是）' AFTER `icd10_code`;
ALTER TABLE `kl_disease` add COLUMN `is_common_dis` TINYINT(4) not null DEFAULT '0' COMMENT '是否常见病（0：否，1：是）' AFTER `icd10_code`;
ALTER TABLE `kl_disease` add COLUMN `ch_western` TINYINT(4) not null DEFAULT '0' COMMENT '中西医疾病（0：通用，1：西，2：中）' AFTER `icd10_code`;
ALTER TABLE `kl_disease` add COLUMN `dis_type` varchar(1024) not null DEFAULT '' COMMENT '疾病分型' AFTER `icd10_code`;
ALTER TABLE `kl_disease` add COLUMN `pathogeny` varchar(1024) not null DEFAULT '' COMMENT '病因' AFTER `icd10_code`;
ALTER TABLE `kl_disease` add COLUMN `complication` varchar(1024) not null DEFAULT '' COMMENT '并发症' AFTER `icd10_code`;
ALTER TABLE `kl_disease` add COLUMN `is_infect` TINYINT(4) not null DEFAULT '0' COMMENT '是否传染（0：否，1：是）' AFTER `icd10_code`;
ALTER TABLE `kl_disease` add COLUMN `incidence` double(11,5) DEFAULT NULL COMMENT '发病率' AFTER `icd10_code`;
ALTER TABLE `kl_disease` add COLUMN `vul_crowd` varchar(255) not null DEFAULT '' COMMENT '好发人群' AFTER `icd10_code`;
ALTER TABLE `kl_disease` add COLUMN `vul_area` varchar(255) not null DEFAULT '' COMMENT '好发地区' AFTER `icd10_code`;
ALTER TABLE `kl_disease` add COLUMN `clinic_type` varchar(1024) not null DEFAULT '' COMMENT '临床分类' AFTER `icd10_code`;
ALTER TABLE `kl_disease` add COLUMN `pernicious` varchar(255) not null DEFAULT '' COMMENT '危害性' AFTER `icd10_code`;
ALTER TABLE `kl_disease` add COLUMN `healing` varchar(255) not null DEFAULT '' COMMENT '治愈性' AFTER `icd10_code`;
ALTER TABLE `kl_disease` add COLUMN `hazard` varchar(1024) not null DEFAULT '' COMMENT '危险因素' AFTER `icd10_code`;
ALTER TABLE `kl_disease` add COLUMN `food_prohibition` varchar(1024) not null DEFAULT '' COMMENT '饮食禁忌' AFTER `icd10_code`;
ALTER TABLE `kl_disease` add COLUMN `inducement` varchar(255) not null DEFAULT '' COMMENT '诱因' AFTER `icd10_code`;
ALTER TABLE `kl_disease` add COLUMN `course` varchar(255) not null DEFAULT '' COMMENT '病程' AFTER `icd10_code`;

-- ----------------------------
-- Alter Table structure for kl_lis
-- ----------------------------
ALTER TABLE `kl_lis` add COLUMN `en_name` varchar(255) not null DEFAULT '' COMMENT '英文名称' AFTER `unit`;
ALTER TABLE `kl_lis` add COLUMN `category` varchar(255) not null DEFAULT '' COMMENT '所属类别' AFTER `unit`;
ALTER TABLE `kl_lis` add COLUMN `qualitative` varchar(255) not null DEFAULT '' COMMENT '定性（阴、阳性）' AFTER `unit`;
ALTER TABLE `kl_lis` add COLUMN `clinical_sig` varchar(1024) not null DEFAULT '' COMMENT '临床意义' AFTER `unit`;
ALTER TABLE `kl_lis` add COLUMN `influence_fac` varchar(1024) not null DEFAULT '' COMMENT '影响因素' AFTER `unit`;
ALTER TABLE `kl_lis` add COLUMN `check_method` varchar(1024) not null DEFAULT '' COMMENT '检查方法' AFTER `unit`;
ALTER TABLE `kl_lis` add COLUMN `check_specimen` varchar(255) not null DEFAULT '' COMMENT '检查标本' AFTER `unit`;

-- ----------------------------
-- Table structure for kl_drug_register
-- ----------------------------
DROP TABLE IF EXISTS `kl_drug_register`;
CREATE TABLE `kl_drug_register` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `is_deleted` char(1) NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除，Y:删除',
  `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
  `creator` varchar(20) NOT NULL DEFAULT '0' COMMENT '创建人，0表示无创建人值',
  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
  `drug_code` varchar(255) NOT NULL DEFAULT '' COMMENT '药品代码',
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT '注册名称',
  `en_name` varchar(255) NOT NULL DEFAULT '' COMMENT '英文名称',
  `trade_name` varchar(255) NOT NULL DEFAULT '' COMMENT '商品名称',
  `form` varchar(255) NOT NULL DEFAULT '' COMMENT '药品剂型',
  `specification` varchar(255) NOT NULL DEFAULT '' COMMENT '注册规格',
  `min_pack_quantity` varchar(255) NOT NULL DEFAULT '' COMMENT '最小包装数量',
  `min_pack_unit` varchar(255) NOT NULL DEFAULT '' COMMENT '最小包装单位',
  `company` varchar(255) NOT NULL DEFAULT '' COMMENT '药品企业',
  `approval` varchar(255) NOT NULL DEFAULT '' COMMENT '批准文号',
  `standard_code` varchar(255) NOT NULL DEFAULT '' COMMENT '药品本位码',
  `insurance_type` varchar(255) NOT NULL DEFAULT '' COMMENT '医保类型',
  `insurance_remrk` varchar(255) NOT NULL DEFAULT '' COMMENT '医保备注',
  `drug_type` varchar(255) NOT NULL DEFAULT '' COMMENT '药品类别',
  `remark` varchar(300) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='药品注册表';

-- ----------------------------
-- Table structure for kl_drug_mapping
-- ----------------------------
DROP TABLE IF EXISTS `kl_drug_mapping`;
CREATE TABLE `kl_drug_mapping` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `is_deleted` char(1) NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除，Y:删除',
  `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
  `creator` varchar(20) NOT NULL DEFAULT '0' COMMENT '创建人，0表示无创建人值',
  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
  `drug_concept` bigint(20) NOT NULL DEFAULT '0' COMMENT '药品通用名conceptId',
  `register_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '药品注册名Id',
  `order_no` int(11) NOT NULL DEFAULT '0' COMMENT '顺序号',
  `remark` varchar(300) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`),
  KEY `drug_concept` (`drug_concept`) USING BTREE,
  KEY `register_id` (`register_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='药品通用名和注册名映射表';

-- ----------------------------
-- Table structure for kl_symptom
-- ----------------------------
DROP TABLE IF EXISTS `kl_symptom`;
CREATE TABLE `kl_symptom` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `is_deleted` char(1) NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除，Y:删除',
  `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
  `creator` varchar(20) NOT NULL DEFAULT '0' COMMENT '创建人，0表示无创建人值',
  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
  `concept_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '术语概念id',
  `en_name` varchar(255) NOT NULL DEFAULT '' COMMENT '英文名称',
  `definition` varchar(1024) NOT NULL DEFAULT '' COMMENT '定义',
  `ch_western` TINYINT(4) not null DEFAULT '0' COMMENT '中西医症状（0：通用，1：西，2：中）',
  `mitigating_fac` varchar(255) NOT NULL DEFAULT '' COMMENT '缓解因素',
  `aggravate_fac` varchar(255) NOT NULL DEFAULT '' COMMENT '加重因素',
  `cause` varchar(255) NOT NULL DEFAULT '' COMMENT '症状起因',
  `common_dis` varchar(255) NOT NULL DEFAULT '' COMMENT '常见疾病',
  `pre_measures` varchar(255) NOT NULL DEFAULT '' COMMENT '预防措施',
  `food_prohibition` varchar(1024) not null DEFAULT '' COMMENT '饮食禁忌',
  `common_explain` varchar(255) NOT NULL DEFAULT '' COMMENT '通俗解释',
  `remark` varchar(300) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_concept_id` (`concept_id`) USING BTREE COMMENT '概念id全表唯一'
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='症状扩展表';

-- ----------------------------
-- Table structure for kl_pacs
-- ----------------------------
DROP TABLE IF EXISTS `kl_pacs`;
CREATE TABLE `kl_pacs` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `is_deleted` char(1) NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除，Y:删除',
  `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
  `creator` varchar(20) NOT NULL DEFAULT '0' COMMENT '创建人，0表示无创建人值',
  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
  `concept_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '术语概念id',
  `check_method` varchar(255) NOT NULL DEFAULT '' COMMENT '检查方法',
  `definition` varchar(1024) NOT NULL DEFAULT '' COMMENT '项目定义',
  `check_objective` varchar(1024) NOT NULL DEFAULT '' COMMENT '检查目的',
  `check_skillful` varchar(255) NOT NULL DEFAULT '' COMMENT '检查技术',
  `cond_limit` varchar(1024) NOT NULL DEFAULT '' COMMENT '禁忌症和局限性',
  `interventional` varchar(1024) NOT NULL DEFAULT '' COMMENT '适应症',
  `emergency_sign` TINYINT(4) not null DEFAULT '0' COMMENT '危急标识（0：不危急，1：危急）',
  `check_prepare` varchar(1024) not null DEFAULT '' COMMENT '检查前准备',
  `remark` varchar(300) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_concept_id` (`concept_id`) USING BTREE COMMENT '概念id全表唯一'
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='辅检扩展表';

-- ----------------------------
-- Table structure for operation
-- ----------------------------
DROP TABLE IF EXISTS `kl_operation`;
CREATE TABLE `kl_operation` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `is_deleted` char(1) NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除，Y:删除',
  `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
  `creator` varchar(20) NOT NULL DEFAULT '0' COMMENT '创建人，0表示无创建人值',
  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
  `concept_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '术语概念id',
  `operation_level` TINYINT(4) not null DEFAULT '0' COMMENT '手术级别（0,1,2,3,4）',
  `operation_code` varchar(255) not null DEFAULT '' COMMENT '手术操作码',
  `remark` varchar(300) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_concept_id` (`concept_id`) USING BTREE COMMENT '概念id全表唯一'
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='手术扩展表';

-- ----------------------------
-- Table structure for vital result
-- ----------------------------
DROP TABLE IF EXISTS `kl_vital_result`;
CREATE TABLE `kl_vital_result` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `is_deleted` char(1) NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除，Y:删除',
  `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
  `creator` varchar(20) NOT NULL DEFAULT '0' COMMENT '创建人，0表示无创建人值',
  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
  `concept_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '术语概念id',
  `suitable_pop_no` varchar(255) not null DEFAULT '' COMMENT '不适宜人群',
  `check_method` varchar(1024) not null DEFAULT '' COMMENT '操作方法',
  `remark` varchar(300) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_concept_id` (`concept_id`) USING BTREE COMMENT '概念id全表唯一'
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='体征结果扩展表';