--原内容: --diag_type:1:西医诊断 2:中医主病诊断 3:中医主证诊断 4:手术操作 maindiag_flag:主诊断标志 0:否' '1','是' update ZY_YBJSDX a set diag_name='主要诊断:'||substrb(diag_name,1,90) where YBJKID=PYBJKID and JKJDBM='diseinfo' and diag_type in ('1') --1:西医诊断 2:中医主病诊断 3:中医主证诊断 4:手术操作 and maindiag_flag in ('1') --主诊断标志 0:否' '1','是' and diag_name is not null ; --diag_type:1:西医诊断 2:中医主病诊断 3:中医主证诊断 4:手术操作 maindiag_flag:主诊断标志 0:否' '1','是' update ZY_YBJSDX a set diag_name='其他诊断:'||substrb(diag_name,1,90) where YBJKID=PYBJKID and JKJDBM='diseinfo' and diag_type in ('1') --1:西医诊断 2:中医主病诊断 3:中医主证诊断 4:手术操作 and maindiag_flag not in ('1') --主诊断标志 0:否' '1','是' and diag_name is not null ; --更新中医主病诊断--beign--1:西医诊断 2:中医主病诊断 3:中医主证诊断 4:手术操作 update ZY_YBJSDX a set diag_code_zy=diag_code, --住院诊断信息.中医诊断代码 diag_name_zy='主病:'||substrb(diag_name,1,90), --住院诊断信息.中医诊断诊断名称 adm_cond_type_zy=adm_cond_type, --住院诊断信息.中医入院病情类型 adm_cond_type_zy_mc=(select aa.sxsm00 from bm_ybsxzd aa where aa.sxbm00='adm_cond_type' and aa.jkbm00=2 and aa.VALUE0=nvl(a.adm_cond_type_zy,'4')) --住院诊断信息.中医入院病情名称 where YBJKID=PYBJKID and JKJDBM='diseinfo' and diag_type in ('2') and diag_name is not null ; --更新写改为空值 update ZY_YBJSDX a set diag_code=null, diag_name=null, adm_cond_type=null where YBJKID=PYBJKID and JKJDBM='diseinfo' and diag_type in ('2') and diag_name is not null ; --更新中医主病诊断--end-- --更新中医主病诊断--beign--1:西医诊断 2:中医主病诊断 3:中医主证诊断 4:手术操作 update ZY_YBJSDX a set diag_code_zy=diag_code, --住院诊断信息.中医诊断代码 diag_name_zy='主证:'||substrb(diag_name,1,90), --住院诊断信息.中医诊断诊断名称 adm_cond_type_zy=adm_cond_type, --住院诊断信息.中医入院病情类型 adm_cond_type_zy_mc=(select aa.sxsm00 from bm_ybsxzd aa where aa.sxbm00='adm_cond_type' and aa.jkbm00=2 and aa.VALUE0=nvl(a.adm_cond_type_zy,'4')) --住院诊断信息.中医入院病情名称 where YBJKID=PYBJKID and JKJDBM='diseinfo' and diag_type in ('3') and diag_name is not null ; --更新写改为空值 update ZY_YBJSDX a set diag_code=null, diag_name=null, adm_cond_type=null where YBJKID=PYBJKID and JKJDBM='diseinfo' and diag_type in ('3') and diag_name is not null ; --修改后: --diag_type:1:西医诊断 2:中医主病诊断 3:中医主证诊断 4:手术操作 maindiag_flag:主诊断标志 0:否' '1','是' update ZY_YBJSDX a set diag_name=substrb(diag_name,1,90) where YBJKID=PYBJKID and JKJDBM='diseinfo' and diag_type in ('1') --1:西医诊断 2:中医主病诊断 3:中医主证诊断 4:手术操作 and maindiag_flag in ('1') --主诊断标志 0:否' '1','是' and diag_name is not null ; --diag_type:1:西医诊断 2:中医主病诊断 3:中医主证诊断 4:手术操作 maindiag_flag:主诊断标志 0:否' '1','是' update ZY_YBJSDX a set diag_name=substrb(diag_name,1,90) where YBJKID=PYBJKID and JKJDBM='diseinfo' and diag_type in ('1') --1:西医诊断 2:中医主病诊断 3:中医主证诊断 4:手术操作 and maindiag_flag not in ('1') --主诊断标志 0:否' '1','是' and diag_name is not null ; --更新中医主病诊断--beign--1:西医诊断 2:中医主病诊断 3:中医主证诊断 4:手术操作 update ZY_YBJSDX a set diag_code_zy=diag_code, --住院诊断信息.中医诊断代码 diag_name_zy=substrb(diag_name,1,90), --住院诊断信息.中医诊断诊断名称 adm_cond_type_zy=adm_cond_type, --住院诊断信息.中医入院病情类型 adm_cond_type_zy_mc=(select aa.sxsm00 from bm_ybsxzd aa where aa.sxbm00='adm_cond_type' and aa.jkbm00=2 and aa.VALUE0=nvl(a.adm_cond_type,'4')) --住院诊断信息.中医入院病情名称 where YBJKID=PYBJKID and JKJDBM='diseinfo' and diag_type in ('2') and diag_name is not null ; --更新写改为空值 update ZY_YBJSDX a set diag_code=null, diag_name=null, adm_cond_type=null where YBJKID=PYBJKID and JKJDBM='diseinfo' and diag_type in ('2') and diag_name is not null ; --更新中医主病诊断--end-- --更新中医主病诊断--beign--1:西医诊断 2:中医主病诊断 3:中医主证诊断 4:手术操作 update ZY_YBJSDX a set diag_code_zy=diag_code, --住院诊断信息.中医诊断代码 diag_name_zy=substrb(diag_name,1,90), --住院诊断信息.中医诊断诊断名称 adm_cond_type_zy=adm_cond_type, --住院诊断信息.中医入院病情类型 adm_cond_type_zy_mc=(select aa.sxsm00 from bm_ybsxzd aa where aa.sxbm00='adm_cond_type' and aa.jkbm00=2 and aa.VALUE0=nvl(a.adm_cond_type,'4')) --住院诊断信息.中医入院病情名称 where YBJKID=PYBJKID and JKJDBM='diseinfo' and diag_type in ('3') and diag_name is not null ; --更新写改为空值 update ZY_YBJSDX a set diag_code=null, diag_name=null, adm_cond_type=null where YBJKID=PYBJKID and JKJDBM='diseinfo' and diag_type in ('3') and diag_name is not null ;