You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
klhis/sql/2024/202411.sql

133 lines
7.6 KiB

-- HIS_GAT_YPCF_ZB definition
CREATE TABLE "HIS_GAT_YPCF_ZB"
( "PKEY" VARCHAR2(20),
"CFRQ" VARCHAR2(20),
"CFH" VARCHAR2(30),
"CFLX" VARCHAR2(1),
"JGID" VARCHAR2(36),
"CFKS" VARCHAR2(20),
"CFYS" VARCHAR2(20),
"HZPKEY" VARCHAR2(20),
"JZPKEY" VARCHAR2(20),
"JSZT" VARCHAR2(1),
"CFJE" NUMBER(12,4),
"CFZCTS" NUMBER(3,0),
"JY_PZS" NUMBER(2,0),
"JY_JE" NUMBER(12,4),
"GZ_KSS1_PZS" NUMBER(2,0),
"GZ_KSS1_JE" NUMBER(12,4),
"GZ_KSS2_PZS" NUMBER(2,0),
"GZ_KSS2_JE" NUMBER(12,4),
"GZ_KSS3_PZS" NUMBER(2,0),
"GZ_KSS3_JE" NUMBER(12,4),
"YF_SY_PZS" NUMBER(2,0),
"YF_SY_JE" NUMBER(12,4),
"YF_JZ_PZS" NUMBER(2,0),
"YF_JZ_JE" NUMBER(12,4),
"GZ_J1_PZS" NUMBER(2,0),
"GZ_J1_JE" NUMBER(12,4),
"GZ_J2_PZS" NUMBER(2,0),
"GZ_J2_JE" NUMBER(12,4),
"GZ_MZ_PZS" NUMBER(2,0),
"GZ_MZ_JE" NUMBER(12,4),
"PZS" NUMBER(2,0)
) ;
CREATE UNIQUE INDEX "HIS_GAT_YPCF_ZB_PK" ON "HIS_GAT_YPCF_ZB" ("PKEY");
CREATE INDEX "HIS_GAT_YPCF_ZB_JGID_IDX" ON "HIS_GAT_YPCF_ZB" ("JGID", "CFRQ");
CREATE INDEX "HIS_GAT_YPCF_ZB_IDX1" ON "HIS_GAT_YPCF_ZB" ("CFRQ") ;
COMMENT ON TABLE HIS_GAT_YPCF_ZB IS 'HIS归集信息 药品处方主表';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.PKEY IS 'PKEY';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.CFRQ IS '处方日期 HIS_SFZD_SFXMXB.JFRQ 格式yyyyMMdd';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.CFH IS '处方号 HIS_YZ_MXB.CFH';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.CFLX IS '处方类型 0门诊 1住院';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.JGID IS '所属机构 HIS_SFZD_SFXMXB.JGID';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.CFKS IS '处方科室 HIS_JZ_BASEINFO.JJKS';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.CFYS IS '处方医生 HIS_YZ_MXB.HZPKEY';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.HZPKEY IS '患者信息主键 HIS_YZ_MXB.HZPKEY';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.JZPKEY IS '就诊信息主键 HIS_YZ_MXB.JZPKEY';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.JSZT IS '0未结算 1结算 2作废 3冲红';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.CFJE IS '处方金额 SUM(HIS_SFZD_SFXMXB.SFXZFY)';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.CFZCTS IS '处方最长天数 医嘱天数 HIS_YZ_MXB.YZTS 最长的那个';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.JY_PZS IS '基本药品 品种数 HIS_YPXX.ISGJJBYW=''1''';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.JY_JE IS '基本药品 金额 HIS_YPXX.ISGJJBYW=''1'' SUM(HIS_SFZD_SFXMXB.SFXZFY)';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.GZ_KSS1_PZS IS '管制分类 非限制使用抗菌药 品种数 HIS_YPXX.GZFL=''KSS1''';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.GZ_KSS1_JE IS '管制分类 非限制使用抗菌药 金额 HIS_YPXX.GZFL=''KSS1''';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.GZ_KSS2_PZS IS '管制分类 限制使用抗菌药 品种数 HIS_YPXX.GZFL=''KSS2''';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.GZ_KSS2_JE IS '管制分类 限制使用抗菌药 金额 HIS_YPXX.GZFL=''KSS2''';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.GZ_KSS3_PZS IS '管制分类 特殊使用抗菌药 品种数 HIS_YPXX.GZFL=''KSS3''';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.GZ_KSS3_JE IS '管制分类 特殊使用抗菌药 金额 HIS_YPXX.GZFL=''KSS3''';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.YF_SY_PZS IS '用法 输液 品种数';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.YF_SY_JE IS '用法 输液 金额';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.YF_JZ_PZS IS '用法 肌注 品种数';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.YF_JZ_JE IS '用法 肌注 金额';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.GZ_J1_PZS IS '管制分类 一类精神药品 品种数 HIS_YPXX.GZFL=''J1''';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.GZ_J1_JE IS '管制分类 一类精神药品 金额 HIS_YPXX.GZFL=''J1''';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.GZ_J2_PZS IS '管制分类 二类精神药品 品种数 HIS_YPXX.GZFL=''J2''';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.GZ_J2_JE IS '管制分类 二类精神药品 种类数量 HIS_YPXX.GZFL=''J2''';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.GZ_MZ_PZS IS '管制分类 麻醉药品 品种数 HIS_YPXX.GZFL=''MZ''';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.GZ_MZ_JE IS '管制分类 麻醉药品 金额 HIS_YPXX.GZFL=''MZ''';
COMMENT ON COLUMN HIS_GAT_YPCF_ZB.PZS IS '药品品种数';
-- HIS_GAT_YPCF_MXB definition
CREATE TABLE "HIS_GAT_YPCF_MXB"
( "PKEY" VARCHAR2(20) NOT NULL ENABLE,
"ZBPKEY" VARCHAR2(20) NOT NULL ENABLE,
"SFX" VARCHAR2(20) NOT NULL ENABLE,
"SFXDJ" NUMBER(12,4) NOT NULL ENABLE,
"SFXSL" NUMBER(4,0) NOT NULL ENABLE,
"SFXZJE" NUMBER(12,4) NOT NULL ENABLE,
"JBDWSL" NUMBER(4,0) NOT NULL ENABLE,
"YZMXPKEY" VARCHAR2(20) NOT NULL ENABLE,
"YZTS" NUMBER(4,0) NOT NULL ENABLE,
"YZYF" VARCHAR2(20) NOT NULL ENABLE,
"IS_JB" VARCHAR2(1) DEFAULT '0' NOT NULL ENABLE,
"GZFL" VARCHAR2(20) NOT NULL ENABLE,
"KSS1_BDD" NUMBER(6,3) DEFAULT 0 NOT NULL ENABLE,
"KSS1_BDDS" NUMBER(9,3) DEFAULT 0 NOT NULL ENABLE,
"KSS1_DDD" NUMBER(6,3) DEFAULT 0 NOT NULL ENABLE,
"KSS1_DDDS" NUMBER(9,3) DEFAULT 0 NOT NULL ENABLE,
"KSS2_BDD" NUMBER(6,3) DEFAULT 0 NOT NULL ENABLE,
"KSS2_BDDS" NUMBER(9,3) DEFAULT 0 NOT NULL ENABLE,
"KSS2_DDD" NUMBER(6,3) DEFAULT 0 NOT NULL ENABLE,
"KSS2_DDDS" NUMBER(9,3) DEFAULT 0 NOT NULL ENABLE,
"KSS3_BDD" NUMBER(6,3) DEFAULT 0 NOT NULL ENABLE,
"KSS3_BDDS" NUMBER(9,3) DEFAULT 0 NOT NULL ENABLE,
"KSS3_DDD" NUMBER(6,3) DEFAULT 0 NOT NULL ENABLE,
"KSS4_DDDS" NUMBER(9,3) DEFAULT 0 NOT NULL ENABLE
);
CREATE INDEX "HIS_GAT_YPCF_MXB_PK" ON "HIS_GAT_YPCF_MXB" ("PKEY") ;
CREATE INDEX "HIS_GAT_YPCF_MXB_IDX" ON "HIS_GAT_YPCF_MXB" ("ZBPKEY");
COMMENT ON TABLE HIS_GAT_YPCF_MXB IS 'HIS归集信息 药品处方明细表';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.PKEY IS 'PKEY';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.ZBPKEY IS '主表PKEY';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.SFX IS '药品编码 HIS_SFZD_SFXMXB.SFX';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.SFXDJ IS '收费项单价 HIS_SFZD_SFXMXB.SFXDJ';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.SFXSL IS '收费项数量 HIS_SFZD_SFXMXB.SFXSL';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.SFXZJE IS '收费项总费用 HIS_SFZD_SFXMXB.SFXZJE';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.JBDWSL IS '基本单位数量';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.YZMXPKEY IS '医嘱明细主键 HIS_SFZD_SFXMXB.YZMX';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.YZTS IS '医嘱天数 HIS_YZ_MXB.YZTS';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.YZYF IS '医嘱用法 HIS_YZ_MXB.YZYF';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.IS_JB IS '基本药物 0否 1是 HIS_YPXX.ISGJJBYW';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.GZFL IS '管制分类 HIS_YPXX.GZFL';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.KSS1_BDD IS '非限制使用抗生素 基本单位剂量 HIS_YPXX.BDD';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.KSS1_BDDS IS '非限制使用抗生素 基本单位总剂量 HIS_YPXX.BDD * JBDWSL';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.KSS1_DDD IS '非限制使用抗生素 日最高剂量限额 HIS_YPXX.DDD';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.KSS1_DDDS IS '非限制使用抗生素 处方天数最高剂量限额 HIS_YPXX.DDD * YZTS';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.KSS2_BDD IS '限制使用抗生素 基本单位剂量 HIS_YPXX.BDD';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.KSS2_BDDS IS '限制使用抗生素 基本单位总剂量 HIS_YPXX.BDD * JBDWSL';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.KSS2_DDD IS '限制使用抗生素 日最高剂量限额 HIS_YPXX.DDD';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.KSS2_DDDS IS '限制使用抗生素 处方天数最高剂量限额 HIS_YPXX.DDD * YZTS';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.KSS3_BDD IS '特殊使用抗生素 基本单位剂量 HIS_YPXX.BDD';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.KSS3_BDDS IS '特殊使用抗生素 基本单位总剂量 HIS_YPXX.BDD * JBDWSL';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.KSS3_DDD IS '特殊使用抗生素 日最高剂量限额 HIS_YPXX.DDD';
COMMENT ON COLUMN HIS_GAT_YPCF_MXB.KSS4_DDDS IS '特殊使用抗生素 处方天数最高剂量限额 HIS_YPXX.DDD * YZTS';