qc_initv2.1.1.sql 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. use `qc`;
  2. -- 执行前请看注意事项!
  3. -- 通用版均执行病历doctorId、doctorName回查 @hospitalId =**:需要更新的医院hospitalId在此调整即可
  4. -- med_behospital_info病历doctorName回查
  5. -- 最下面有仅湘雅三院医院的sql!!
  6. SET @hospitalId =35;
  7. UPDATE med_behospital_info a,
  8. (
  9. SELECT
  10. doctor_id,
  11. name
  12. NAME
  13. FROM
  14. bas_doctor_info b
  15. WHERE
  16. b.hospital_id = @hospitalId
  17. AND b.is_deleted = 'N'
  18. ) c
  19. SET a.doctor_name = c. NAME
  20. WHERE
  21. a.doctor_id = c.doctor_id
  22. AND a.hospital_id = @hospitalId
  23. AND (a.doctor_name is null or a.doctor_name = '' or a.doctor_name ='-' or a.doctor_name ='—' or LENGTH(a.doctor_name)>64);
  24. -- med_behospital_info病历doctorId回查
  25. UPDATE med_behospital_info a,
  26. (
  27. SELECT
  28. doctor_id,
  29. NAME
  30. FROM
  31. bas_doctor_info b
  32. WHERE
  33. b.hospital_id = @hospitalId
  34. AND b.is_deleted = 'N'
  35. GROUP BY
  36. b. NAME
  37. HAVING
  38. count(b.doctor_id) = 1
  39. ) c
  40. SET a.doctor_id = c.doctor_id
  41. WHERE
  42. a.doctor_name = c.NAME
  43. AND a.hospital_id = @hospitalId
  44. AND (a.doctor_id is null or a.doctor_id = '' or a.doctor_id ='-' or a.doctor_id ='—' or LENGTH(a.doctor_id)>64);
  45. -- 仅仅湘雅三院医院执行!!
  46. -- 全院
  47. update sys_menu a set a.order_no = a.order_no+1 where a.parent_id = 17 and a.order_no>0;
  48. INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '医师病案首页合格率占比', '17', 'YH-ZKK-BASYHGLYSZB_XQ', '1', '1', '1', '医师病案首页合格率占比');
  49. SET @id =@@identity;
  50. INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', @id, NULL);
  51. INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '2021-11-01 13:48:37', '2021-11-01 13:48:37', '243', '243', '1', @id, NULL);
  52. INSERT INTO `sys_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '医师病案首页合格率占比报表', '', '/console/homePageLevelStatisticsXY', 'ALL', '医师病案首页合格率占比报表', NULL);
  53. SET @id2 =@@identity;
  54. INSERT INTO `sys_role_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', @id2, NULL);
  55. INSERT INTO `sys_role_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ( 'N', '2021-11-01 13:48:37', '2021-11-01 13:48:37', '243', '243', '1', @id2, NULL);
  56. INSERT INTO `sys_menu_permission` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `menu_id`, `permission_id`, `order_nu`, `remark`)
  57. VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @id, @id2, NULL, '医师病案首页合格率占比');
  58. -- 科室
  59. update sys_menu a set a.order_no = a.order_no+1 where a.parent_id = 18 and a.order_no>1;
  60. INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '医师病案首页合格率占比', '18', 'YH-KSZR-BASYHGLYSZB_XQ', '1', '1', '2', '医师病案首页合格率占比-科室');
  61. SET @id3 =@@identity;
  62. INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', @id3, NULL);
  63. INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '2021-10-27 11:39:27', '2021-10-27 11:39:27', '13', '13', '2', @id3, NULL);
  64. INSERT INTO `sys_permission` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '医师病案首页合格率占比报表', '', '/consoleByDept/homePageLevelStatisticsXYByDept', 'ALL', '医师病案首页合格率占比报表', NULL);
  65. SET @id4 =@@identity;
  66. INSERT INTO `sys_role_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', @id4, NULL);
  67. INSERT INTO `sys_role_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ( 'N', '2021-10-27 11:39:27', '2021-10-27 11:39:27', '13', '13', '2', @id4, NULL);
  68. INSERT INTO `sys_menu_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `menu_id`, `permission_id`, `order_nu`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @id3, @id4, NULL, '医师病案首页合格率占比科室');