瀏覽代碼

增加his对接接口

lantone 5 年之前
父節點
當前提交
48bb20d1dd
共有 90 個文件被更改,包括 7019 次插入26 次删除
  1. 43 0
      src/main/java/com/diagbot/dto/data/ABasDeptInfoDTO.java
  2. 40 0
      src/main/java/com/diagbot/dto/data/ABasDoctorInfoDTO.java
  3. 111 0
      src/main/java/com/diagbot/dto/data/ABehospitalInfoDTO.java
  4. 131 0
      src/main/java/com/diagbot/dto/data/ADoctorAdviceDTO.java
  5. 43 0
      src/main/java/com/diagbot/dto/data/AHomeDiagnoseDTO.java
  6. 79 0
      src/main/java/com/diagbot/dto/data/AHomeOperationDTO.java
  7. 652 0
      src/main/java/com/diagbot/dto/data/AHomePageDTO.java
  8. 92 0
      src/main/java/com/diagbot/dto/data/AMedCrisisDTO.java
  9. 40 0
      src/main/java/com/diagbot/dto/data/AMedicalRecordContentDTO.java
  10. 48 0
      src/main/java/com/diagbot/dto/data/AMedicalRecordDTO.java
  11. 38 0
      src/main/java/com/diagbot/dto/data/AMedicalRecordTypeDTO.java
  12. 17 0
      src/main/java/com/diagbot/dto/data/AMrContentDTO.java
  13. 7 6
      src/main/java/com/diagbot/entity/BasDeptInfo.java
  14. 171 0
      src/main/java/com/diagbot/entity/BasDoctorInfo.java
  15. 13 12
      src/main/java/com/diagbot/entity/MedCrisisInfo.java
  16. 1 1
      src/main/java/com/diagbot/entity/MedicalRecord.java
  17. 101 0
      src/main/java/com/diagbot/facade/data/ABasDeptInfoFacade.java
  18. 96 0
      src/main/java/com/diagbot/facade/data/ABasDoctorInfoFacade.java
  19. 171 0
      src/main/java/com/diagbot/facade/data/ABehospitalInfoFacade.java
  20. 109 0
      src/main/java/com/diagbot/facade/data/ADoctorAdviceFacade.java
  21. 85 0
      src/main/java/com/diagbot/facade/data/AHomeDiagnoseInfoFacade.java
  22. 88 0
      src/main/java/com/diagbot/facade/data/AHomeOperationInfoFacade.java
  23. 265 0
      src/main/java/com/diagbot/facade/data/AHomePageFacade.java
  24. 84 0
      src/main/java/com/diagbot/facade/data/AMedCrisisFacade.java
  25. 89 0
      src/main/java/com/diagbot/facade/data/AMedRecordTypeFacade.java
  26. 78 0
      src/main/java/com/diagbot/facade/data/AMedicalRecordContentFacade.java
  27. 299 0
      src/main/java/com/diagbot/facade/data/AMedicalRecordFacade.java
  28. 2 0
      src/main/java/com/diagbot/mapper/BasDeptInfoMapper.java
  29. 20 0
      src/main/java/com/diagbot/mapper/BasDoctorInfoMapper.java
  30. 6 0
      src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java
  31. 3 1
      src/main/java/com/diagbot/mapper/DoctorAdviceMapper.java
  32. 4 0
      src/main/java/com/diagbot/mapper/HomeDiagnoseInfoMapper.java
  33. 4 0
      src/main/java/com/diagbot/mapper/HomeOperationInfoMapper.java
  34. 7 0
      src/main/java/com/diagbot/mapper/HomePageMapper.java
  35. 4 0
      src/main/java/com/diagbot/mapper/MedCrisisInfoMapper.java
  36. 4 0
      src/main/java/com/diagbot/mapper/MedRecordTypeMapper.java
  37. 4 0
      src/main/java/com/diagbot/mapper/MedicalRecordContentMapper.java
  38. 2 0
      src/main/java/com/diagbot/mapper/MedicalRecordMapper.java
  39. 16 0
      src/main/java/com/diagbot/service/BasDoctorInfoService.java
  40. 9 0
      src/main/java/com/diagbot/service/impl/BasDeptInfoServiceImpl.java
  41. 29 0
      src/main/java/com/diagbot/service/impl/BasDoctorInfoServiceImpl.java
  42. 1 0
      src/main/java/com/diagbot/service/impl/BasHospitalInfoServiceImpl.java
  43. 8 0
      src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java
  44. 9 1
      src/main/java/com/diagbot/service/impl/DoctorAdviceServiceImpl.java
  45. 8 1
      src/main/java/com/diagbot/service/impl/HomeDiagnoseInfoServiceImpl.java
  46. 8 1
      src/main/java/com/diagbot/service/impl/HomeOperationInfoServiceImpl.java
  47. 8 0
      src/main/java/com/diagbot/service/impl/HomePageServiceImpl.java
  48. 8 0
      src/main/java/com/diagbot/service/impl/MedCrisisInfoServiceImpl.java
  49. 8 2
      src/main/java/com/diagbot/service/impl/MedRecordTypeServiceImpl.java
  50. 8 1
      src/main/java/com/diagbot/service/impl/MedicalRecordContentServiceImpl.java
  51. 8 0
      src/main/java/com/diagbot/service/impl/MedicalRecordServiceImpl.java
  52. 15 0
      src/main/java/com/diagbot/service/impl/QcTypeServiceImpl.java
  53. 69 0
      src/main/java/com/diagbot/task/BasDeptInfoTask.java
  54. 68 0
      src/main/java/com/diagbot/task/BasDoctorInfoTask.java
  55. 68 0
      src/main/java/com/diagbot/task/BehospitalInfoTask.java
  56. 69 0
      src/main/java/com/diagbot/task/DoctorAdviceTask.java
  57. 68 0
      src/main/java/com/diagbot/task/HomeDiagnoseInfoTask.java
  58. 69 0
      src/main/java/com/diagbot/task/HomeOperationInfoTask.java
  59. 68 0
      src/main/java/com/diagbot/task/HomePageTask.java
  60. 69 0
      src/main/java/com/diagbot/task/MedicalRecordContentTask.java
  61. 69 0
      src/main/java/com/diagbot/task/MedicalRecordTask.java
  62. 66 0
      src/main/java/com/diagbot/task/MedicalRecordTypeTask.java
  63. 68 0
      src/main/java/com/diagbot/util/ReadProperties.java
  64. 703 0
      src/main/java/com/diagbot/util/TZDBConn.java
  65. 44 0
      src/main/java/com/diagbot/vo/data/ABasDeptInfoVO.java
  66. 38 0
      src/main/java/com/diagbot/vo/data/ABasDoctorInfoVO.java
  67. 134 0
      src/main/java/com/diagbot/vo/data/ABehospitalInfoVO.java
  68. 128 0
      src/main/java/com/diagbot/vo/data/ADoctorAdviceVO.java
  69. 41 0
      src/main/java/com/diagbot/vo/data/AHomeDiagnoseVO.java
  70. 76 0
      src/main/java/com/diagbot/vo/data/AHomeOperationVO.java
  71. 17 0
      src/main/java/com/diagbot/vo/data/AHomePageIngVO.java
  72. 650 0
      src/main/java/com/diagbot/vo/data/AHomePageVO.java
  73. 93 0
      src/main/java/com/diagbot/vo/data/AMedCrisisVO.java
  74. 37 0
      src/main/java/com/diagbot/vo/data/AMedicalRecordContentVO.java
  75. 36 0
      src/main/java/com/diagbot/vo/data/AMedicalRecordTypeVO.java
  76. 48 0
      src/main/java/com/diagbot/vo/data/AMedicalRecordVO.java
  77. 16 0
      src/main/java/com/diagbot/vo/data/AMrContentVO.java
  78. 151 0
      src/main/java/com/diagbot/web/DataController.java
  79. 24 0
      src/main/resources/jdbc.properties
  80. 30 0
      src/main/resources/mapper/BasDeptInfoMapper.xml
  81. 47 0
      src/main/resources/mapper/BasDoctorInfoMapper.xml
  82. 84 0
      src/main/resources/mapper/BehospitalInfoMapper.xml
  83. 79 0
      src/main/resources/mapper/DoctorAdviceMapper.xml
  84. 36 0
      src/main/resources/mapper/HomeDiagnoseInfoMapper.xml
  85. 48 0
      src/main/resources/mapper/HomeOperationInfoMapper.xml
  86. 385 0
      src/main/resources/mapper/HomePageMapper.xml
  87. 54 0
      src/main/resources/mapper/MedCrisisInfoMapper.xml
  88. 27 0
      src/main/resources/mapper/MedRecordTypeMapper.xml
  89. 21 0
      src/main/resources/mapper/MedicalRecordContentMapper.xml
  90. 27 0
      src/main/resources/mapper/MedicalRecordMapper.xml

+ 43 - 0
src/main/java/com/diagbot/dto/data/ABasDeptInfoDTO.java

@@ -0,0 +1,43 @@
+package com.diagbot.dto.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.time.LocalDateTime;
+
+@Getter
+@Setter
+public class ABasDeptInfoDTO {
+    /**
+     * 科室编码(HIS导入)
+     */
+    private String deptId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    private String parentDeptId;
+
+    /**
+     * 科室名称
+     */
+    private String deptName;
+
+    /**
+     * 科室类别
+     */
+    private String deptType;
+
+    /**
+     * 首字母拼音
+     */
+    private String spell;
+
+    /**
+     * 区域类别(门诊、工作站、住院等)
+     */
+    private String station;
+
+}

+ 40 - 0
src/main/java/com/diagbot/dto/data/ABasDoctorInfoDTO.java

@@ -0,0 +1,40 @@
+package com.diagbot.dto.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.time.LocalDateTime;
+
+@Getter
+@Setter
+public class ABasDoctorInfoDTO {
+    /**
+     * HIS导入的医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院导入科室ID
+     */
+    private String deptId;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 职称
+     */
+    private String professor;
+    /**
+     * 职业医师资格
+     */
+    private String occup;
+
+}

+ 111 - 0
src/main/java/com/diagbot/dto/data/ABehospitalInfoDTO.java

@@ -0,0 +1,111 @@
+package com.diagbot.dto.data;
+
+import java.util.Date;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class ABehospitalInfoDTO{
+
+	/**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 医院ID
+     */
+    private String hospitalId;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 性别
+     */
+    private String sex;
+
+    /**
+     * 出生日期
+     */
+    private String birthday;
+
+    /**
+     * 档案号
+     */
+    private String fileCode;
+
+    /**
+     * 病区编码
+     */
+    private String wardCode;
+
+    /**
+     * 病区名称
+     */
+    private String wardName;
+
+    /**
+     * 住院科室ID
+     */
+    private String behDeptId;
+
+    /**
+     * 住院科室名称
+     */
+    private String behDeptName;
+
+    /**
+     * 床位号
+     */
+    private String bedCode;
+
+    /**
+     * 床位名称
+     */
+    private String bedName;
+
+    /**
+     * 医保类别
+     */
+    private String insuranceName;
+
+    /**
+     * 职业
+     */
+    private String jobType;
+
+    /**
+     * 入院时间
+     */
+    private String behospitalDate;
+
+    /**
+     * 出院时间
+     */
+    private String leaveHospitalDate;
+
+    /**
+     * 疾病ICD编码
+     */
+    private String diagnoseIcd;
+
+    /**
+     * 疾病名称
+     */
+    private String diagnose;
+
+    /**
+     * 医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 医生姓名
+     */
+    private String doctorName;
+}

+ 131 - 0
src/main/java/com/diagbot/dto/data/ADoctorAdviceDTO.java

@@ -0,0 +1,131 @@
+package com.diagbot.dto.data;
+
+import java.util.Date;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class ADoctorAdviceDTO {
+
+	/**
+     * 病人医嘱ID
+     */
+    private String doctorAdviceId;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 医生开单判别
+     */
+    private String orderDoctorName;
+
+    /**
+     * 医嘱频率判别
+     */
+    private String frequency;
+
+    /**
+     * 父类医嘱ID
+     */
+    private String parentTypeId;
+
+    /**
+     * 医嘱类型判别(嘱托长嘱、长期医嘱等)
+     */
+    private String doctorAdviceType;
+
+    /**
+     * 一次使用数量
+     */
+    private String usageNum;
+
+    /**
+     * 一次用量单位
+     */
+    private String usageUnit;
+
+    /**
+     * 医嘱单次剂量
+     */
+    private String dose;
+
+    /**
+     * 单次剂量单位
+     */
+    private String doseUnit;
+
+    /**
+     * 给药方式
+     */
+    private String medModeType;
+
+    /**
+     * 医嘱频率
+     */
+    private String daFrequency;
+
+    /**
+     * 医嘱处理类型
+     */
+    private String daDealType;
+
+    /**
+     * 医嘱开始时间
+     */
+    private String daStartDate;
+
+    /**
+     * 医嘱项目名称
+     */
+    private String daItemName;
+
+    /**
+     * 医嘱状态判别
+     */
+    private String daStatus;
+
+    /**
+     * 医嘱结束时间
+     */
+    private String daStopDate;
+
+    /**
+     * 医嘱同组序号
+     */
+    private String daGroupNo;
+
+    /**
+     * 医嘱处方类型(检验、描述医嘱、膳食、西药、护理等)
+     */
+    private String daPrescriptionType;
+
+    /**
+     * 医嘱领药类型
+     */
+    private String daMedType;
+
+    /**
+     * 医生嘱托
+     */
+    private String doctorNotice;
+
+    /**
+     * 开单医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 开单医生姓名
+     */
+    private String doctorName;
+}

+ 43 - 0
src/main/java/com/diagbot/dto/data/AHomeDiagnoseDTO.java

@@ -0,0 +1,43 @@
+package com.diagbot.dto.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Setter
+@Getter
+public class AHomeDiagnoseDTO {
+	/**
+     * 病案首页ID
+     */
+    private String homePageId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 诊断序号
+     */
+    private String diagnoseOrderNo;
+
+    /**
+     * 诊断类别(主要诊断、其他诊断)
+     */
+    private String diagnoseType;
+
+    /**
+     * 诊断判别(主、次)
+     */
+    private String diagnoseTypeShort;
+
+    private String diagnoseName;
+
+    private String behospitalType;
+
+    private String leaveHospitalType;
+
+    private String pathologyDiagnose;
+
+    private String icdCode;
+}

+ 79 - 0
src/main/java/com/diagbot/dto/data/AHomeOperationDTO.java

@@ -0,0 +1,79 @@
+package com.diagbot.dto.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Setter
+@Getter
+public class AHomeOperationDTO {
+	/**
+     * 病案首页ID
+     */
+    private String homePageId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 手术序号
+     */
+    private String operationOrderNo;
+
+    /**
+     * 手术日期
+     */
+    private String operationDate;
+
+    /**
+     * 手术编码
+     */
+    private String operationCode;
+
+    /**
+     * 手术医生ID
+     */
+    private String operationDoctorId;
+
+    /**
+     * 一助医生ID
+     */
+    private String firstAssistantId;
+
+    /**
+     * 二助医生ID
+     */
+    private String secondAssistantId;
+
+    /**
+     * 切口等级
+     */
+    private String cutLevel;
+
+    /**
+     * 愈合等级
+     */
+    private String healingLevel;
+
+    /**
+     * 手术名称
+     */
+    private String operationName;
+
+    /**
+     * 手术级别
+     */
+    private String operationLevel;
+
+    /**
+     * 麻醉方式(全麻、局麻、静脉麻醉)
+     */
+    private String anaesthesiaName;
+
+    /**
+     * 拟手术名称
+     */
+    private String shamOperationName;
+
+}

+ 652 - 0
src/main/java/com/diagbot/dto/data/AHomePageDTO.java

@@ -0,0 +1,652 @@
+package com.diagbot.dto.data;
+
+import java.util.List;
+
+import com.diagbot.vo.data.AHomeDiagnoseVO;
+import com.diagbot.vo.data.AHomeOperationVO;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class AHomePageDTO {
+	/**
+     * 病案首页编号
+     */
+    private String homePageId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人住院序号
+     */
+    private String behospitalCode;
+
+    /**
+     * 组织机构id
+     */
+    private String hospitalCode;
+
+    /**
+     * 医疗机构名称
+     */
+    private String hospitalName;
+
+    /**
+     * 医疗机构代码
+     */
+    private String orgCode;
+
+    /**
+     * 医疗付费方式
+     */
+    private String payType;
+
+    /**
+     * 健康卡号
+     */
+    private String healthCard;
+
+    /**
+     * 住院次数
+     */
+    private String behospitalNum;
+
+    /**
+     * 病案号
+     */
+    private String fileCode;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 性别
+     */
+    private String sex;
+
+    /**
+     * 出生日期
+     */
+    private String birthday;
+
+    /**
+     * 年龄
+     */
+    private String age;
+
+    /**
+     * 年龄单位
+     */
+    private String ageUnit;
+
+    /**
+     * 国籍
+     */
+    private String nationality;
+
+    /**
+     * 新生儿出生月数
+     */
+    private String newbornMonth;
+
+    /**
+     * 新生儿出生天数
+     */
+    private String newbornDay;
+
+    /**
+     * 新生儿出生体重
+     */
+    private String newbornWeight;
+
+    /**
+     * 新生儿入院体重
+     */
+    private String newbornBehospitalWeight;
+
+    /**
+     * 出生地
+     */
+    private String bornAddress;
+
+    /**
+     * 籍贯
+     */
+    private String bornPlace;
+
+    /**
+     * 民族
+     */
+    private String nation;
+
+    /**
+     * 身份证号
+     */
+    private String identityCardNo;
+
+    /**
+     * 职业
+     */
+    private String jobType;
+
+    /**
+     * 婚姻
+     */
+    private String marriage;
+
+    /**
+     * 现住址
+     */
+    private String curAddress;
+
+    /**
+     * 现住址电话
+     */
+    private String curPhone;
+
+    /**
+     * 现住址邮编
+     */
+    private String curPostCode;
+
+    /**
+     * 户口地址
+     */
+    private String residenceAddress;
+
+    /**
+     * 户口地址邮编
+     */
+    private String residencePostCode;
+
+    /**
+     * 工作单位
+     */
+    private String workAddress;
+
+    /**
+     * 工作单位电话
+     */
+    private String workPhone;
+
+    /**
+     * 工作单位邮编
+     */
+    private String workPostCode;
+
+    /**
+     * 联系人姓名
+     */
+    private String contactName;
+
+    /**
+     * 联系人关系
+     */
+    private String contactRelation;
+
+    /**
+     * 联系人地址
+     */
+    private String contactAddress;
+
+    /**
+     * 联系人电话
+     */
+    private String contactPhone;
+
+    /**
+     * 入院途径
+     */
+    private String behospitalWay;
+
+    /**
+     * 入院时间
+     */
+    private String behospitalDate;
+
+    /**
+     * 入院科别
+     */
+    private String behospitalDept;
+
+    /**
+     * 入院病房
+     */
+    private String behospitalWard;
+
+    /**
+     * 入院床位序号
+     */
+    private String behospitalBedId;
+
+    /**
+     * 入院床位号码
+     */
+    private String behospitalBedCode;
+
+    /**
+     * 转科科别
+     */
+    private String changeDept;
+
+    /**
+     * 出院时间
+     */
+    private String leaveHospitalDate;
+
+    /**
+     * 出院科别
+     */
+    private String leaveHospitalDept;
+
+    /**
+     * 出院病房
+     */
+    private String leaveHospitalWard;
+
+    /**
+     * 出院床位序号
+     */
+    private String leaveHospitalBedId;
+
+    /**
+     * 出院床位号码
+     */
+    private String leaveHospitalBedCode;
+
+    /**
+     * 实际住院天数
+     */
+    private String behospitalDayNum;
+
+    /**
+     * 门急诊诊断
+     */
+    private String outpatientEmrDiagnose;
+
+    /**
+     * 门急诊诊断编码
+     */
+    private String outpatientEmrDiagnoseCode;
+
+    /**
+     * 损伤中毒因素
+     */
+    private String poisonFactor;
+
+    /**
+     * 损伤中毒因素编码
+     */
+    private String poisonFactorCode;
+
+    /**
+     * 病理诊断
+     */
+    private String pathologyDiagnose;
+
+    /**
+     * 病理诊断编码
+     */
+    private String pathologyDiagnoseCode;
+
+    /**
+     * 病理诊断编号
+     */
+    private String pathologyDiagnoseId;
+
+    /**
+     * 药物过敏
+     */
+    private String isMedAllergy;
+
+    /**
+     * 过敏药物
+     */
+    private String medAllergyName;
+
+    /**
+     * 死亡患者尸检
+     */
+    private String autopsy;
+
+    /**
+     * 血型
+     */
+    private String bloodType;
+
+    /**
+     * Rh
+     */
+    private String rh;
+
+    /**
+     * 科主任
+     */
+    private String deptDirector;
+
+    /**
+     * 主任医师
+     */
+    private String directorDoctor;
+
+    /**
+     * 主治医师
+     */
+    private String attendingDoctor;
+
+    /**
+     * 住院医师
+     */
+    private String behospitalDoctor;
+
+    /**
+     * 责任护士
+     */
+    private String responseNurse;
+
+    /**
+     * 进修医师
+     */
+    private String studyDoctor;
+
+    /**
+     * 实习医师
+     */
+    private String practiceDoctor;
+
+    /**
+     * 编码员
+     */
+    private String encodeMan;
+
+    /**
+     * 病案质量
+     */
+    private String homePageQuality;
+
+    /**
+     * 质控医师
+     */
+    private String qcDoctor;
+
+    /**
+     * 质控护士
+     */
+    private String qcNurse;
+
+    /**
+     * 质控日期
+     */
+    private String qcDate;
+
+    /**
+     * 离院方式
+     */
+    private String leaveHospitalType;
+
+    /**
+     * 接收机构名称
+     */
+    private String acceptOrgCode;
+
+    /**
+     * 31天内再住院计划
+     */
+    private String againBehospitalPlan;
+
+    /**
+     * 再住院目的
+     */
+    private String againBehospitalGoal;
+
+    /**
+     * 颅脑损伤患者昏迷前天数
+     */
+    private String tbiBeforeDay;
+
+    /**
+     * 颅脑损伤患者昏迷前小时
+     */
+    private String tbiBeforeHour;
+
+    /**
+     * 颅脑损伤患者昏迷前分钟
+     */
+    private String tbiBeforeMinute;
+
+    /**
+     * 颅脑损伤患者昏迷后天数
+     */
+    private String tbiAfterDay;
+
+    /**
+     * 颅脑损伤患者昏迷后小时
+     */
+    private String tbiAfterHour;
+
+    /**
+     * 颅脑损伤患者昏迷后分钟
+     */
+    private String tbiAfterMinute;
+
+    /**
+     * 总费用
+     */
+    private String totalFee;
+
+    /**
+     * 自付金额
+     */
+    private String ownFee;
+
+    /**
+     * 一般医疗服务费
+     */
+    private String generalFee;
+
+    /**
+     * 一般治疗服务费
+     */
+    private String serviceFee;
+
+    /**
+     * 护理费
+     */
+    private String nurseFee;
+
+    /**
+     * 其他费用
+     */
+    private String otherFee;
+
+    /**
+     * 病理诊断费
+     */
+    private String pathologyFee;
+
+    /**
+     * 实验室诊断费
+     */
+    private String labFee;
+
+    /**
+     * 影像学诊断费
+     */
+    private String pacsFee;
+
+    /**
+     * 临床诊断项目费
+     */
+    private String clinicDiagnoseFee;
+
+    /**
+     * 非手术治疗项目费
+     */
+    private String notOperationFee;
+
+    /**
+     * 临床物理治疗费
+     */
+    private String clinicPhysicFee;
+
+    /**
+     * 手术治疗费
+     */
+    private String operationTreatFee;
+
+    /**
+     * 麻醉费
+     */
+    private String anaesthesiaFee;
+
+    /**
+     * 手术费
+     */
+    private String operationFee;
+
+    /**
+     * 康复类
+     */
+    private String healthTypeFee;
+
+    /**
+     * 中医治疗费
+     */
+    private String chnTreatFee;
+
+    /**
+     * 西药费
+     */
+    private String westernMedFee;
+
+    /**
+     * 抗菌药物费用
+     */
+    private String antibiosisFee;
+
+    /**
+     * 中成药费
+     */
+    private String chnMedFee;
+
+    /**
+     * 中草药费
+     */
+    private String chnHerbFee;
+
+    /**
+     * 血费
+     */
+    private String bloodFee;
+
+    /**
+     * 白蛋白类制品费
+     */
+    private String albumenFee;
+
+    /**
+     * 球蛋白类制品费
+     */
+    private String globulinFee;
+
+    /**
+     * 凝血因子类制品费
+     */
+    private String bloodFactorFee;
+
+    /**
+     * 细胞因子类制品费
+     */
+    private String cellFactorFee;
+
+    /**
+     * 检查用一次性医用材料费
+     */
+    private String checkMaterialFee;
+
+    /**
+     * 治疗用一次性医用材料费
+     */
+    private String treatMaterialFee;
+
+    /**
+     * 手术用一次性医用材料费
+     */
+    private String operationMaterialFee;
+
+    /**
+     * 其他类其他费
+     */
+    private String otherTypeFee;
+
+    /**
+     * 单病种管理
+     */
+    private String singleDiagManage;
+
+    /**
+     * 临床路径管理
+     */
+    private String clinicPathwayManage;
+
+    /**
+     * 门诊与住院
+     */
+    private String isOutpatientBehospital;
+
+    /**
+     * 入院与出院
+     */
+    private String isLeaveBehospital;
+
+    /**
+     * 术前与术后
+     */
+    private String isOperationBeforeAfter;
+
+    /**
+     * 临床与病理
+     */
+    private String isClinicPathology;
+
+    /**
+     * 放射与病理
+     */
+    private String isRadiatePathology;
+
+    /**
+     * 病人抢救次数
+     */
+    private String rescueNum;
+
+    /**
+     * 病人抢救成功次数
+     */
+    private String rescueSuccessNum;
+
+    /**
+     * 是否为自动出院
+     */
+    private String isAutoLeavehospital;
+
+    /**
+     * 转归情况
+     */
+    private String returnToType;
+    /**
+     * 出院诊断
+     */
+    private List<AHomeDiagnoseVO> leaveDiags;
+
+    /**
+     * 手术情况
+     */
+    private List<AHomeOperationVO> operations;
+
+}

+ 92 - 0
src/main/java/com/diagbot/dto/data/AMedCrisisDTO.java

@@ -0,0 +1,92 @@
+package com.diagbot.dto.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+@Getter
+@Setter
+public class AMedCrisisDTO {
+    private String recId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 记录类型
+     */
+    private String recType;
+
+    /**
+     * 危急值ID
+     */
+    private String crisisId;
+
+    /**
+     * 危急值名称
+     */
+    private String crisisName;
+
+    /**
+     * 开单科室ID
+     */
+    private String deptId;
+
+    /**
+     * 开单科室名称
+     */
+    private String deptName;
+
+    /**
+     * 开单医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 开单医生姓名
+     */
+    private String doctorName;
+
+    /**
+     * 危急结果值
+     */
+    private String crisisValue;
+
+    /**
+     * 危急值描述
+     */
+    private String crisisDesc;
+
+    /**
+     * 危急值状态
+     */
+    private String crisisStatus;
+
+    /**
+     * 参考上限
+     */
+    private String crisisTopValue;
+
+    /**
+     * 参考下限
+     */
+    private String crisisLowerValue;
+
+    /**
+     * 送检时间
+     */
+    private String sendDate;
+
+    /**
+     * 报告时间
+     */
+    private String repDate;
+}

+ 40 - 0
src/main/java/com/diagbot/dto/data/AMedicalRecordContentDTO.java

@@ -0,0 +1,40 @@
+package com.diagbot.dto.data;
+
+import java.sql.Blob;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class AMedicalRecordContentDTO {
+	/**
+     * 病历ID
+     */
+    private String recId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 文书内容(blob)
+     */
+    private Blob contentBlob;
+
+    /**
+     * 病历文本(文本)
+     */
+    private String contentText;
+
+    /**
+     * html文本信息
+     */
+    private String htmlText;
+
+    /**
+     * xml文本信息
+     */
+    private String xmlText;
+}

+ 48 - 0
src/main/java/com/diagbot/dto/data/AMedicalRecordDTO.java

@@ -0,0 +1,48 @@
+package com.diagbot.dto.data;
+
+import com.diagbot.vo.data.AMedicalRecordContentVO;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+@Getter
+@Setter
+public class AMedicalRecordDTO {
+	private String recId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 组织机构代码
+     */
+    private String orgCode;
+
+    /**
+     * 病历类别编号
+     */
+    private String recTypeId;
+
+    /**
+     * 病历日期
+     */
+    private String recDate;
+
+    /**
+     * 病历标题
+     */
+    private String recTitle;
+
+    /**
+     * 病历内容
+     */
+    private List<AMedicalRecordContentVO> contents;
+}

+ 38 - 0
src/main/java/com/diagbot/dto/data/AMedicalRecordTypeDTO.java

@@ -0,0 +1,38 @@
+package com.diagbot.dto.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class AMedicalRecordTypeDTO {
+	/**
+     * 类别ID
+     */
+    private String typeId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 类别名称
+     */
+    private String typeName;
+
+    /**
+     * 上级类别
+     */
+    private String parentTypeId;
+
+    /**
+     * 服务对象(全院、科室、个人)
+     */
+    private String objName;
+
+    /**
+     * 拼音
+     */
+    private String spell;
+}

+ 17 - 0
src/main/java/com/diagbot/dto/data/AMrContentDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto.data;
+
+import com.diagbot.vo.data.AMedicalRecordVO;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+import java.util.Map;
+
+@Getter
+@Setter
+public class AMrContentDTO {
+
+    private List<AMedicalRecordVO> records;
+
+    private Map<String,Object> map;
+}

+ 7 - 6
src/main/java/com/diagbot/entity/BasDeptInfo.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
 
 import java.time.LocalDateTime;
 import java.io.Serializable;
+import java.util.Date;
 
 /**
  * <p>
@@ -59,12 +60,12 @@ public class BasDeptInfo implements Serializable {
     /**
      * 记录创建时间
      */
-    private LocalDateTime gmtCreate;
+    private Date gmtCreate;
 
     /**
      * 记录修改时间,如果时间是1970年则表示纪录未修改
      */
-    private LocalDateTime gmtModified;
+    private Date gmtModified;
 
     /**
      * 创建人,0表示无创建人值
@@ -132,18 +133,18 @@ public class BasDeptInfo implements Serializable {
     public void setIsDeleted(String isDeleted) {
         this.isDeleted = isDeleted;
     }
-    public LocalDateTime getGmtCreate() {
+    public Date getGmtCreate() {
         return gmtCreate;
     }
 
-    public void setGmtCreate(LocalDateTime gmtCreate) {
+    public void setGmtCreate(Date gmtCreate) {
         this.gmtCreate = gmtCreate;
     }
-    public LocalDateTime getGmtModified() {
+    public Date getGmtModified() {
         return gmtModified;
     }
 
-    public void setGmtModified(LocalDateTime gmtModified) {
+    public void setGmtModified(Date gmtModified) {
         this.gmtModified = gmtModified;
     }
     public String getCreator() {

+ 171 - 0
src/main/java/com/diagbot/entity/BasDoctorInfo.java

@@ -0,0 +1,171 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-17
+ */
+public class BasDoctorInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * HIS导入的医生ID
+     */
+    @TableId(value = "doctor_id",type = IdType.INPUT)
+    private String doctorId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院导入科室ID
+     */
+    private String deptId;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 职称
+     */
+    private String professor;
+
+    /**
+     * 职业医师资格
+     */
+    private String occup;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    public String getDoctorId() {
+        return doctorId;
+    }
+
+    public void setDoctorId(String doctorId) {
+        this.doctorId = doctorId;
+    }
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+    public String getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(String deptId) {
+        this.deptId = deptId;
+    }
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+    public String getProfessor() {
+        return professor;
+    }
+
+    public void setProfessor(String professor) {
+        this.professor = professor;
+    }
+    public String getOccup() {
+        return occup;
+    }
+
+    public void setOccup(String occup) {
+        this.occup = occup;
+    }
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    @Override
+    public String toString() {
+        return "BasDoctorInfo{" +
+                "doctorId=" + doctorId +
+                ", hospitalId=" + hospitalId +
+                ", deptId=" + deptId +
+                ", name=" + name +
+                ", professor=" + professor +
+                ", occup=" + occup +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                "}";
+    }
+}

+ 13 - 12
src/main/java/com/diagbot/entity/MedCrisisInfo.java

@@ -3,6 +3,7 @@ package com.diagbot.entity;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.io.Serializable;
+import java.util.Date;
 
 /**
  * <p>
@@ -91,12 +92,12 @@ public class MedCrisisInfo implements Serializable {
     /**
      * 送检时间
      */
-    private LocalDate sendDate;
+    private Date sendDate;
 
     /**
      * 报告时间
      */
-    private LocalDate repDate;
+    private Date repDate;
 
     /**
      * 是否删除,N:未删除,Y:删除
@@ -106,12 +107,12 @@ public class MedCrisisInfo implements Serializable {
     /**
      * 记录创建时间
      */
-    private LocalDateTime gmtCreate;
+    private Date gmtCreate;
 
     /**
      * 记录修改时间,如果时间是1970年则表示纪录未修改
      */
-    private LocalDateTime gmtModified;
+    private Date gmtModified;
 
     /**
      * 创建人,0表示无创建人值
@@ -228,18 +229,18 @@ public class MedCrisisInfo implements Serializable {
     public void setCrisisLowerValue(String crisisLowerValue) {
         this.crisisLowerValue = crisisLowerValue;
     }
-    public LocalDate getSendDate() {
+    public Date getSendDate() {
         return sendDate;
     }
 
-    public void setSendDate(LocalDate sendDate) {
+    public void setSendDate(Date sendDate) {
         this.sendDate = sendDate;
     }
-    public LocalDate getRepDate() {
+    public Date getRepDate() {
         return repDate;
     }
 
-    public void setRepDate(LocalDate repDate) {
+    public void setRepDate(Date repDate) {
         this.repDate = repDate;
     }
     public String getIsDeleted() {
@@ -249,18 +250,18 @@ public class MedCrisisInfo implements Serializable {
     public void setIsDeleted(String isDeleted) {
         this.isDeleted = isDeleted;
     }
-    public LocalDateTime getGmtCreate() {
+    public Date getGmtCreate() {
         return gmtCreate;
     }
 
-    public void setGmtCreate(LocalDateTime gmtCreate) {
+    public void setGmtCreate(Date gmtCreate) {
         this.gmtCreate = gmtCreate;
     }
-    public LocalDateTime getGmtModified() {
+    public Date getGmtModified() {
         return gmtModified;
     }
 
-    public void setGmtModified(LocalDateTime gmtModified) {
+    public void setGmtModified(Date gmtModified) {
         this.gmtModified = gmtModified;
     }
     public String getCreator() {

+ 1 - 1
src/main/java/com/diagbot/entity/MedicalRecord.java

@@ -53,7 +53,7 @@ public class MedicalRecord implements Serializable {
     /**
      * 病历日期
      */
-    private String recDate;
+    private Date recDate;
 
     /**
      * 病历标题

+ 101 - 0
src/main/java/com/diagbot/facade/data/ABasDeptInfoFacade.java

@@ -0,0 +1,101 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ABasDeptInfoDTO;
+import com.diagbot.entity.BasDeptInfo;
+import com.diagbot.service.impl.BasDeptInfoServiceImpl;
+import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.data.ABasDeptInfoVO;
+import com.diagbot.util.BeanUtil;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+@Component
+public class ABasDeptInfoFacade extends BasDeptInfoServiceImpl{
+
+    @Autowired
+    @Qualifier("basDeptInfoServiceImpl")
+    private BasDeptInfoServiceImpl basDeptInfoService;
+
+    private TZDBConn tzDBConn = new TZDBConn();
+
+    /**
+     * 同步前一天科室的信息
+     */
+    public void executeDept() {
+        String sql="select * from hi_deptinfo where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
+        List<BasDeptInfo> basDeptInfoList = tzDBConn.getDeptInfo(sql);
+        execute(basDeptInfoList);
+    }
+
+    /**
+     * 同步历史数据
+     */
+    public void executeDeptPast(){
+        String sql="select * from hi_deptinfo where cjcxrq>=dateadd(day,-1,getdate()) and cjcxrq<=getdate()";
+        List<BasDeptInfo> basDeptInfoList = tzDBConn.getDeptInfo(sql);
+        execute(basDeptInfoList);
+    }
+
+    /**
+     * 通过接口同步数据
+     * @param list
+     * @return
+     */
+    public RespDTO<List<ABasDeptInfoDTO>> executeDept(List<ABasDeptInfoVO> list) {
+        if(list!=null && list.size()>0){
+            List<BasDeptInfo> basDeptInfoList=Lists.newArrayList();
+            List<ABasDeptInfoDTO> basDeptInfoDtoList=Lists.newArrayList();
+            basDeptInfoList=BeanUtil.listCopyTo(list,BasDeptInfo.class);
+            basDeptInfoDtoList=BeanUtil.listCopyTo(list,ABasDeptInfoDTO.class);
+
+            //循环验证数据有效性
+            for (BasDeptInfo basDeptInfo:basDeptInfoList) {
+                if("".equals(basDeptInfo.getDeptId())) {
+                    return RespDTO.onError("请输入科室编码!");
+                }else if(basDeptInfo.getHospitalId()==null){
+                    return RespDTO.onError("请输入医院编码!");
+                }else if("".equals(basDeptInfo.getDeptName())){
+                    return RespDTO.onError("请输入科室名称!");
+                }
+            }
+            execute(basDeptInfoList);
+            return RespDTO.onSuc(basDeptInfoDtoList);
+        }else {
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    public void execute(List<BasDeptInfo> basDeptInfoList){
+        long startTime=System.currentTimeMillis();
+        List<BasDeptInfo> addE=Lists.newArrayList();
+        List<BasDeptInfo> updateE=Lists.newArrayList();
+        basDeptInfoList.stream().forEach(s -> {
+            BasDeptInfo basDeptInfo =this.getOne(new QueryWrapper<BasDeptInfo>()
+            .eq("dept_id", s.getDeptId())
+            .eq("hospital_id", s.getHospitalId()));
+            if (basDeptInfo != null) {
+                s.setGmtModified(new Date());
+                updateE.add(s);
+            } else {
+                s.setGmtCreate(new Date());
+                addE.add(s);
+            }
+        });
+        if(updateE.size()>0){
+            basDeptInfoService.updateBatchByKey(updateE);
+        }
+        if(addE.size()>0){
+            basDeptInfoService.saveBatch(addE);
+        }
+
+        long endTime=System.currentTimeMillis();
+        System.out.println("程序运行时间: "+(endTime - startTime)+"ms");
+    }
+}

+ 96 - 0
src/main/java/com/diagbot/facade/data/ABasDoctorInfoFacade.java

@@ -0,0 +1,96 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ABasDoctorInfoDTO;
+import com.diagbot.entity.BasDoctorInfo;
+import com.diagbot.service.impl.BasDoctorInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.data.ABasDoctorInfoVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+@Component
+public class ABasDoctorInfoFacade extends BasDoctorInfoServiceImpl {
+    @Autowired
+    @Qualifier("basDoctorInfoServiceImpl")
+    private BasDoctorInfoServiceImpl basDoctorInfoService;
+
+    private TZDBConn tzDBConn = new TZDBConn();
+
+    /**
+     * 同步历史数据
+     */
+    public void executeDoctorPast() {
+        String sql="select * from gi_userinfo";
+        List<BasDoctorInfo> basDeptInfoList = tzDBConn.getBasDoctorInfo(sql);
+        execute(basDeptInfoList);
+
+    }
+    /**
+     * 同步前一天医生信息
+     */
+    public void executeDoctor() {
+        String sql="select * from gi_userinfo";
+        List<BasDoctorInfo> basDeptInfoList = tzDBConn.getBasDoctorInfo(sql);
+        execute(basDeptInfoList);
+    }
+    /**
+     * 从接口接收医生信息
+     * @param list
+     * @return
+     */
+    public RespDTO<List<ABasDoctorInfoDTO>> executeDoctor(List<ABasDoctorInfoVO> list) {
+        if(list!=null && list.size()>0){
+            List<BasDoctorInfo> basDoctorInfoList=Lists.newArrayList();
+            List<ABasDoctorInfoDTO> basDoctorDtoList=Lists.newArrayList();
+            basDoctorInfoList=BeanUtil.listCopyTo(list,BasDoctorInfo.class);
+            basDoctorDtoList=BeanUtil.listCopyTo(list,ABasDoctorInfoDTO.class);
+            //循环验证数据有效性
+            for (BasDoctorInfo basDoctorInfo:basDoctorInfoList) {
+                if("".equals(basDoctorInfo.getDoctorId())) {
+                    return RespDTO.onError("请输入医生编码!");
+                }else if(basDoctorInfo.getHospitalId()==null){
+                    return RespDTO.onError("请输入医院编码!");
+                }
+            }
+            execute(basDoctorInfoList);
+            return RespDTO.onSuc(basDoctorDtoList);
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    public void execute(List<BasDoctorInfo> basDoctorInfoList){
+        long startTime=System.currentTimeMillis();
+        List<BasDoctorInfo> addE=Lists.newArrayList();
+        List<BasDoctorInfo> updateE=Lists.newArrayList();
+        basDoctorInfoList.stream().forEach(s -> {
+            BasDoctorInfo basDoctorInfo =this.baseMapper.selectOne(new QueryWrapper<BasDoctorInfo>()
+                    .eq("doctor_id", s.getDoctorId())
+                    .eq("hospital_id", s.getHospitalId()));
+            if (basDoctorInfo != null) {
+                s.setGmtModified(new Date());
+                updateE.add(s);
+            } else {
+                s.setGmtCreate(new Date());
+                addE.add(s);
+            }
+        });
+        if(updateE.size()>0){
+            basDoctorInfoService.updateBatchByKey(updateE);
+        }
+        if(addE.size()>0){
+            basDoctorInfoService.saveBatch(addE);
+        }
+
+        long endTime=System.currentTimeMillis();
+        System.out.println("程序运行时间: "+(endTime - startTime)+"ms");
+    }
+}

+ 171 - 0
src/main/java/com/diagbot/facade/data/ABehospitalInfoFacade.java

@@ -0,0 +1,171 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ABehospitalInfoDTO;
+import com.diagbot.entity.*;
+import com.diagbot.facade.QcAbnormalFacade;
+import com.diagbot.facade.QcTypeFacade;
+import com.diagbot.service.impl.BehospitalInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.data.ABehospitalInfoVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+@Component
+public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
+
+    @Autowired
+    @Qualifier("behospitalInfoServiceImpl")
+    private BehospitalInfoServiceImpl behospitalInfoService;
+
+    @Autowired
+    private QcTypeFacade qcTypeFacade;
+
+    @Autowired
+    private AMedicalRecordFacade aMedicalRecordFacade;
+
+    @Autowired
+    private QcAbnormalFacade qcAbnormalFacade;
+
+    private TZDBConn tzDBConn = new TZDBConn();
+
+    /**
+     * 终末质控-同步前一天的入院记录
+     */
+    public void executeBehospital() {
+        //String sql="select * from br_inpatientinfo where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
+        String sql="select * from br_inpatientinfo where cjcxrq>=(select CONVERT(varchar,GETDATE()-2,23)) and cjcxrq<(select CONVERT(varchar,GETDATE(),23)) ORDER BY cjcxrq DESC";
+        List<BehospitalInfo> behospitalInfoList = tzDBConn.getBehospitalInfo(sql);
+        execute(behospitalInfoList);
+    }
+
+    /**
+     * 同步前一天的入院记录
+     */
+    public void executeBehospitalPast() {
+        String sql="select * from br_inpatientinfo where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
+        List<BehospitalInfo> behospitalInfoList = tzDBConn.getBehospitalInfo(sql);
+        execute(behospitalInfoList);
+    }
+
+
+    /**
+     * 通过接口更新病人住院记录信息
+     * @param list
+     * @return
+     */
+    public RespDTO<List<ABehospitalInfoDTO>> executeBehospital(List<ABehospitalInfoVO> list) {
+        if(list!=null && list.size()>0) {
+            List<BehospitalInfo> behospitalInfoList = Lists.newArrayList();
+            List<ABehospitalInfoDTO> behospitalInfoDtoList = Lists.newArrayList();
+            list.stream().forEach(s->{
+                BehospitalInfo behospitalInfo=new BehospitalInfo();
+                BeanUtil.copyProperties(s,behospitalInfo);
+                if(StringUtil.isNotBlank(s.getBirthday())) {
+                    behospitalInfo.setBirthday(DateUtil.parseDate(s.getBirthday()));
+                }
+                if(StringUtil.isNotBlank(s.getLeaveHospitalDate())) {
+                    behospitalInfo.setLeaveHospitalDate(DateUtil.parseDateTime(s.getLeaveHospitalDate()));
+                }
+                if(StringUtil.isNotBlank(s.getBehospitalDate())){
+                    behospitalInfo.setBehospitalDate(DateUtil.parseDateTime(s.getBehospitalDate()));
+                }
+                behospitalInfoList.add(behospitalInfo);
+
+            });
+
+            //循环验证数据有效性
+            for (BehospitalInfo behospitalInfo:behospitalInfoList) {
+                if("".equals(behospitalInfo.getBehospitalCode())) {
+                    return RespDTO.onError("请输入病人住院编码!");
+                }else if(behospitalInfo.getHospitalId()==null){
+                    return RespDTO.onError("请输入医院编码!");
+                }else if("".equals(behospitalInfo.getBehDeptId())){
+                    return RespDTO.onError("请输入住院科室编码!");
+                }else if("".equals(behospitalInfo.getBehDeptName())){
+                    return RespDTO.onError("请输入住院科室名称!");
+                }
+            }
+            execute(behospitalInfoList);
+            behospitalInfoDtoList = BeanUtil.listCopyTo(list, ABehospitalInfoDTO.class);
+            return RespDTO.onSuc(behospitalInfoDtoList);
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    public void execute(List<BehospitalInfo> behospitalInfoList){
+        List<BehospitalInfo> addE = Lists.newLinkedList();
+        List<BehospitalInfo> updateE = Lists.newLinkedList();
+        behospitalInfoList.stream().forEach(s -> {
+            BehospitalInfo behospitalInfo = this.getOne(new QueryWrapper<BehospitalInfo>()
+            .eq("behospital_code", s.getBehospitalCode())
+            .eq("hospital_id", s.getHospitalId()));
+            if (behospitalInfo != null) {
+                s.setGmtModified(new Date());
+                s.setQcTypeId(initQcTypeId(s));
+                updateE.add(s);
+            } else {
+                s.setGmtCreate(new Date());
+                s.setQcTypeId(initQcTypeId(s));
+                addE.add(s);
+            }
+        });
+        if(addE.size()>0){
+            behospitalInfoService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            behospitalInfoService.updateBatchByKey(updateE);
+        }
+
+    }
+
+    /**
+     * 初始化QcTypeId
+     * @param s
+     * @return
+     */
+    private Long initQcTypeId(BehospitalInfo s){
+        Long qcTypeId=Long.valueOf("0");
+        MedicalRecord medicalRecord = aMedicalRecordFacade.getOne(new QueryWrapper<MedicalRecord>()
+                .eq("behospital_code", s.getBehospitalCode())
+                .eq("hospital_id", s.getHospitalId())
+                .eq("mode_id", Long.valueOf("1")));
+        if(medicalRecord!=null){
+            QcType qcType=qcTypeFacade.getOne(new QueryWrapper<QcType>()
+                    .eq("name",medicalRecord.getRecTitle())
+                    .eq("hospital_id", s.getHospitalId()));
+            if(qcType!=null){
+                qcTypeId=qcType.getId();
+            }else{
+                //新增类型到qc_type表中
+                QcType qctype=new QcType();
+                qctype.setHospitalId(s.getHospitalId());
+                qctype.setName(medicalRecord.getRecTitle());
+                qctype.setGmtCreate(new Date());
+
+                Long id=qcTypeFacade.saveT(qctype);
+                qcTypeId=id;
+
+                //新增类型到监测表中
+                QcAbnormal qcAbnormal=new QcAbnormal();
+                qcAbnormal.setHospitalId(s.getHospitalId());
+                qcAbnormal.setBehospitalCode(s.getBehospitalCode());
+                qcAbnormal.setType(2);
+                qcAbnormal.setDescription(medicalRecord.getRecTitle());
+                qcAbnormal.setGmtCreate(new Date());
+                qcAbnormalFacade.getBaseMapper().insert(qcAbnormal);
+            }
+        }
+        return qcTypeId;
+    }
+}

+ 109 - 0
src/main/java/com/diagbot/facade/data/ADoctorAdviceFacade.java

@@ -0,0 +1,109 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.ADoctorAdviceDTO;
+import com.diagbot.entity.DoctorAdvice;
+import com.diagbot.service.impl.DoctorAdviceServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.data.ADoctorAdviceVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+@Component
+public class ADoctorAdviceFacade extends DoctorAdviceServiceImpl{
+
+    @Autowired
+    @Qualifier("doctorAdviceServiceImpl")
+    private DoctorAdviceServiceImpl doctorAdviceService;
+
+    private TZDBConn tzDBConn = new TZDBConn();
+
+    /**
+     * 终末质控-同步前一天的入院病人医嘱信息
+     */
+    public void executeDoctorAdvice() {
+        //String sql="select * from br_doctadvice where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
+        String sql="select * from br_doctadvice where BRZYID in (select BRZYID from br_inpatientinfo where cjcxrq>=(select CONVERT(varchar,GETDATE()-2,23)) and cjcxrq<(select CONVERT(varchar,GETDATE(),23)) and requestflag='1')";
+        List<DoctorAdvice> doctorAdviceList = tzDBConn.getDoctorAdvice(sql);
+        execute(doctorAdviceList);
+    }
+
+    public void executeDoctorAdvicePast() {
+        String sql="select * from br_doctadvice where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
+        List<DoctorAdvice> doctorAdviceList = tzDBConn.getDoctorAdvice(sql);
+        execute(doctorAdviceList);
+    }
+    /**
+     * 数据引擎-通过接口更新医生医嘱信息
+     * @param list
+     * @return
+     */
+    public RespDTO<List<ADoctorAdviceDTO>> executeDoctorAdvice(List<ADoctorAdviceVO> list) {
+        if(list!=null && list.size()>0){
+            //循环验证数据有效性
+            for (ADoctorAdviceVO doctorAdvice:list) {
+                if("".equals(doctorAdvice.getDoctorAdviceId())) {
+                    return RespDTO.onError("请输入病人医嘱编码!");
+                }else if(doctorAdvice.getHospitalId()==null){
+                    return RespDTO.onError("请输入医院编码!");
+                }else if("".equals(doctorAdvice.getBehospitalCode())){
+                    return RespDTO.onError("请输入病人住院编码!");
+                }
+            }
+            //初始、格式化数据
+            List<DoctorAdvice> doctorAdviceList=Lists.newArrayList();
+            List<ADoctorAdviceDTO> doctorAdviceDtoList=Lists.newArrayList();
+            list.stream().forEach(s->{
+                DoctorAdvice doctorAdvice=new DoctorAdvice();
+                BeanUtil.copyProperties(s,doctorAdvice);
+                if(StringUtil.isNotBlank(s.getDaStartDate())){
+                    doctorAdvice.setDaStartDate(DateUtil.parseDateTime(s.getDaStartDate()));
+                }
+                if(StringUtil.isNotBlank(s.getDaStopDate())){
+                    doctorAdvice.setDaStopDate(DateUtil.parseDateTime(s.getDaStopDate()));
+                }
+                doctorAdviceList.add(doctorAdvice);
+            });
+            execute(doctorAdviceList);
+            doctorAdviceDtoList=BeanUtil.listCopyTo(list,ADoctorAdviceDTO.class);
+            return RespDTO.onSuc(doctorAdviceDtoList);
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    public void execute(List<DoctorAdvice> doctorAdviceList){
+        List<DoctorAdvice> addE = Lists.newLinkedList();
+        List<DoctorAdvice> updateE = Lists.newLinkedList();
+        if (doctorAdviceList != null && doctorAdviceList.size() > 0) {
+            doctorAdviceList.stream().forEach(s -> {
+                DoctorAdvice doctorAdvice = this.getOne(new QueryWrapper<DoctorAdvice>()
+                        .eq("doctor_advice_id", s.getDoctorAdviceId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code",s.getBehospitalCode()));
+                if (doctorAdvice != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            doctorAdviceService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            doctorAdviceService.updateBatchByKey(updateE);
+        }
+    }
+}

+ 85 - 0
src/main/java/com/diagbot/facade/data/AHomeDiagnoseInfoFacade.java

@@ -0,0 +1,85 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.AHomeDiagnoseDTO;
+import com.diagbot.entity.HomeDiagnoseInfo;
+import com.diagbot.service.impl.HomeDiagnoseInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.data.AHomeDiagnoseVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+@Component
+public class AHomeDiagnoseInfoFacade extends HomeDiagnoseInfoServiceImpl{
+
+    @Autowired
+    @Qualifier("homeDiagnoseInfoServiceImpl")
+    private HomeDiagnoseInfoServiceImpl homeDiagnoseInfoService;
+
+    private TZDBConn tzDBConn = new TZDBConn();
+
+    /**
+     * 终末质控-定时同步病案首页诊断
+     */
+    public void executeHomeDiagnose() {
+        //String sql="select * from br_recdiagnose where BASYID in (select BASYID from br_rechome where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate())";//今年的数据
+        //前一天的数据
+        String sql="select * from br_recdiagnose where BASYID in (select BASYID from br_rechome where cjcxrq>=(select CONVERT(varchar,GETDATE()-1,23)) and cjcxrq<(select CONVERT(varchar,GETDATE(),23)))";
+        List<HomeDiagnoseInfo> homeDiagnoseList = tzDBConn.getHomeDiagnose(sql);
+        execute(homeDiagnoseList);
+    }
+
+    /**
+     * 数据引擎-通过接口更新病案首页诊断
+     * @param list
+     * @return
+     */
+    public RespDTO<List<AHomeDiagnoseDTO>> executeHomeDiagnose(List<AHomeDiagnoseVO> list) {
+        if(list!=null && list.size()>0){
+            List<HomeDiagnoseInfo> homeDiagnoseList=Lists.newArrayList();
+            List<AHomeDiagnoseDTO> homeDiagnoseDtoList=Lists.newArrayList();
+
+            homeDiagnoseList=BeanUtil.listCopyTo(list,HomeDiagnoseInfo.class);
+            homeDiagnoseDtoList=BeanUtil.listCopyTo(list,AHomeDiagnoseDTO.class);
+            execute(homeDiagnoseList);
+            return RespDTO.onSuc(homeDiagnoseDtoList);
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    public void execute(List<HomeDiagnoseInfo> homeDiagnoseList){
+        List<HomeDiagnoseInfo> addE = Lists.newLinkedList();
+        List<HomeDiagnoseInfo> updateE = Lists.newLinkedList();
+        if (homeDiagnoseList != null && homeDiagnoseList.size() > 0) {
+            homeDiagnoseList.stream().forEach(s -> {
+                if(s.getHomePageId()!=null && !"".equals(s.getDiagnoseOrderNo())){
+                    HomeDiagnoseInfo diagnoseInfo = this.getOne(new QueryWrapper<HomeDiagnoseInfo>()
+                            .eq("home_page_id", s.getHomePageId())
+                            .eq("hospital_id", s.getHospitalId())
+                            .eq("diagnose_order_no", s.getDiagnoseOrderNo()));
+                    if (diagnoseInfo != null) {
+                        s.setGmtModified(new Date());
+                        updateE.add(s);
+                    } else {
+                        s.setGmtCreate(new Date());
+                        addE.add(s);
+                    }
+                }
+            });
+        }
+        if(addE.size()>0){
+            homeDiagnoseInfoService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            homeDiagnoseInfoService.updateBatchByKey(updateE);
+        }
+    }
+}

+ 88 - 0
src/main/java/com/diagbot/facade/data/AHomeOperationInfoFacade.java

@@ -0,0 +1,88 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.data.AHomeOperationDTO;
+import com.diagbot.entity.HomeOperationInfo;
+import com.diagbot.service.impl.HomeOperationInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.data.AHomeOperationVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+@Component
+public class AHomeOperationInfoFacade extends HomeOperationInfoServiceImpl{
+
+    @Autowired
+    @Qualifier("homeOperationInfoServiceImpl")
+    private HomeOperationInfoServiceImpl homeOperationInfoService;
+
+    private TZDBConn tzDBConn = new TZDBConn();
+
+    /**
+     * 终末质控-同步前一天数据
+     */
+    public void executeHomeOperation() {
+        //String sql="select * from br_recoperation where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
+        //前一天数据
+        String sql="select * from br_recoperation where cjcxrq>=(select CONVERT(varchar,GETDATE()-2,23)) and cjcxrq<(select CONVERT(varchar,GETDATE(),23))";
+        List<HomeOperationInfo> homeOperationList = tzDBConn.getHomeOperation(sql);
+        execute(homeOperationList);
+    }
+
+    /**
+     * 终末质控-通过接口更新病案首页手术
+     * @param list
+     * @return
+     */
+    public List<AHomeOperationDTO> executeHomeOperation(List<AHomeOperationVO> list) {
+        List<HomeOperationInfo> homeOperationList=Lists.newArrayList();
+        List<AHomeOperationDTO> homeOperationDtoList=Lists.newArrayList();
+        if(list!=null && list.size()>0){
+            list.stream().forEach(s->{
+                HomeOperationInfo homeOperationInfo=new HomeOperationInfo();
+                BeanUtil.copyProperties(s,homeOperationInfo);
+                homeOperationInfo.setOperationDate(DateUtil.parseDateTime(s.getOperationDate()));
+                homeOperationList.add(homeOperationInfo);
+            });
+            homeOperationDtoList=BeanUtil.listCopyTo(list,AHomeOperationDTO.class);
+            execute(homeOperationList);
+        }
+        return homeOperationDtoList;
+    }
+
+    public void execute(List<HomeOperationInfo> homeOperationList){
+        List<HomeOperationInfo> addE = Lists.newLinkedList();
+        List<HomeOperationInfo> updateE = Lists.newLinkedList();
+        if (homeOperationList != null && homeOperationList.size() > 0) {
+            homeOperationList.stream().forEach(s -> {
+                if(s.getHomePageId()!=null && !"".equals(s.getOperationOrderNo())) {
+                    QueryWrapper<HomeOperationInfo> queryWrapper = new QueryWrapper<>();
+                    queryWrapper.eq("home_page_id", s.getHomePageId());
+                    queryWrapper.eq("hospital_id", s.getHospitalId());
+                    queryWrapper.eq("operation_order_no", s.getOperationOrderNo());
+                    HomeOperationInfo operationInfo = this.getOne(queryWrapper);
+                    if (operationInfo != null) {
+                        s.setGmtModified(new Date());
+                        updateE.add(s);
+                    } else {
+                        s.setGmtCreate(new Date());
+                        addE.add(s);
+                    }
+                }
+            });
+        }
+        if(addE.size()>0){
+            homeOperationInfoService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            homeOperationInfoService.updateBatchByKey(updateE);
+        }
+    }
+}

+ 265 - 0
src/main/java/com/diagbot/facade/data/AHomePageFacade.java

@@ -0,0 +1,265 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.AnalyzeRunDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.AHomePageDTO;
+import com.diagbot.entity.HomePage;
+import com.diagbot.facade.BehospitalInfoFacade;
+import com.diagbot.service.impl.HomePageServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.ReadProperties;
+import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.AnalyzeRunVO;
+import com.diagbot.vo.data.AHomeDiagnoseVO;
+import com.diagbot.vo.data.AHomeOperationVO;
+import com.diagbot.vo.data.AHomePageIngVO;
+import com.diagbot.vo.data.AHomePageVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class AHomePageFacade extends HomePageServiceImpl{
+
+    @Autowired
+    @Qualifier("homePageServiceImpl")
+    private HomePageServiceImpl homePageService;
+
+    @Autowired
+    private AHomeDiagnoseInfoFacade aHomeDiagnoseInfoFacade;
+
+    @Autowired
+    private AHomeOperationInfoFacade aHomeOperationInfoFacade;
+
+    @Autowired
+    private BehospitalInfoFacade behospitalInfoFacade;
+
+    @Autowired
+    private ReadProperties readProperties;
+
+    private TZDBConn tzDBConn = new TZDBConn();
+
+    /*public static void main(String[] args){
+        int mod=Math.floorMod(5012,500);
+        int div=Math.floorDiv(5012,500);
+        if(mod!=0){
+            div+=1;
+        }
+        System.out.println(mod+"---"+div);
+        for (int i = 0; i < div; i++) {
+            System.out.println((i*500)+"---"+(i+1)*500);
+        }
+    }*/
+
+    /**
+     * 同步前一天病案首页
+     */
+    public void executeHomePage() {
+        //String sql="select * from br_rechome where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
+        //同步前一天的数据
+        String sql="select * from br_rechome where cjcxrq>=(select CONVERT(varchar,GETDATE()-2,23)) and cjcxrq<(select CONVERT(varchar,GETDATE(),23))";
+        List<HomePage> homePageList = tzDBConn.getHomePage(sql);
+        /*
+        int mod=Math.floorMod(homePageList.size(),500);
+        int div=Math.floorDiv(homePageList.size(),500);
+        for (int i = 0; i <= homePageList.size(); i++) {
+            System.out.println((i-1)*500+"---"+(i*500));
+            homePageList=homePageList.subList((i*500),(i+1)*500);
+            execute(homePageList);
+        }
+        */
+        execute(homePageList);
+    }
+
+    /**
+     * 运行质控-验证数据有效性
+     * @param aHomePageIngVO
+     * @return
+     */
+    public RespDTO<Map<String, Object>> executeHomePageIng(AHomePageIngVO aHomePageIngVO){
+        if(aHomePageIngVO.getHomePages()!=null && aHomePageIngVO.getHomePages().size()>0){
+            //验证数据有效性
+            for (AHomePageVO aHomePageVO:aHomePageIngVO.getHomePages()) {
+                if("".equals(aHomePageVO.getHomePageId())) {
+                    return RespDTO.onError("请输入病案首页编号!");
+                }else if(aHomePageVO.getHospitalId()==null){
+                    return RespDTO.onError("请输入医院编码!");
+                }else if("".equals(aHomePageVO.getBehospitalCode())){
+                    return RespDTO.onError("请输入病人住院编码!");
+                }
+                //出院诊断
+                if(aHomePageVO.getLeaveDiags()!=null && aHomePageVO.getLeaveDiags().size()>0){
+                    for (AHomeDiagnoseVO aHomeDiagnoseVO:aHomePageVO.getLeaveDiags()){
+                        if("".equals(aHomeDiagnoseVO.getHomePageId())) {
+                            return RespDTO.onError("出院诊断未输入病案首页编号!");
+                        }else if(aHomeDiagnoseVO.getHospitalId()==null){
+                            return RespDTO.onError("出院诊断未输入医院编码!");
+                        }else if("".equals(aHomeDiagnoseVO.getDiagnoseOrderNo())){
+                            return RespDTO.onError("出院诊断未输入顺序号!");
+                        }
+                    }
+                };
+
+                //住院手术
+                if(aHomePageVO.getOperations()!=null && aHomePageVO.getOperations().size()>0){
+                    for (AHomeOperationVO aHomeOperationVO:aHomePageVO.getOperations()){
+                        if("".equals(aHomeOperationVO.getHomePageId())) {
+                            return RespDTO.onError("住院手术未输入病案首页编号!");
+                        }else if(aHomeOperationVO.getHospitalId()==null){
+                            return RespDTO.onError("住院手术未输入医院编码!");
+                        }else if("".equals(aHomeOperationVO.getOperationOrderNo())){
+                            return RespDTO.onError("住院手术未输入顺序号!");
+                        }
+                    }
+                }
+            }
+
+            //装载数据
+            updateHomePageIng(aHomePageIngVO);
+            //评分后返回结构体
+            return homePageIng(aHomePageIngVO);
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    /**
+     * 更新数据到数据库
+     * @param aHomePageIngVO
+     */
+    private void updateHomePageIng(AHomePageIngVO aHomePageIngVO){
+        List<HomePage> homePageList=Lists.newArrayList();
+        aHomePageIngVO.getHomePages().stream().forEach(s->{
+            //初始化入参
+            HomePage homePage=new HomePage();
+            BeanUtil.copyProperties(s,homePage);
+            homePage.setBirthday(DateUtil.parseDate(s.getBirthday()));
+            homePageList.add(homePage);
+
+            //初始化诊断和手术,并同步到数据库
+            aHomeDiagnoseInfoFacade.executeHomeDiagnose(s.getLeaveDiags());//首页诊断
+            aHomeOperationInfoFacade.executeHomeOperation(s.getOperations());//首页手术
+        });
+        execute(homePageList);
+    }
+
+    /**
+     * 评分后返回结构体
+     * @param aHomePageIngVO
+     * @return
+     */
+    private RespDTO<Map<String, Object>> homePageIng(AHomePageIngVO aHomePageIngVO){
+        String behospitalCode =aHomePageIngVO.getHomePages().get(0).getBehospitalCode();
+        Long hospitalId=aHomePageIngVO.getHomePages().get(0).getHospitalId();
+        Long modeId=Long.valueOf("6");//病案首页默认为6
+        if(aHomePageIngVO.getDockModeType().equals("1")){
+            //页面模式
+            String url=readProperties.getProcessQcUrl()+"?behospitalCode="+behospitalCode+"&hospitalId="+hospitalId+"&modeId="+modeId;
+            Map<String,Object> map=new HashMap<String,Object>();
+            map.put("url",url);
+            return RespDTO.onSuc(map);
+        }else if(aHomePageIngVO.getDockModeType().equals("2")){
+            AnalyzeRunVO analyzeRunVO=new AnalyzeRunVO();
+            analyzeRunVO.setBehospitalCode(behospitalCode);
+            analyzeRunVO.setHospitalId(hospitalId);
+            analyzeRunVO.setModeId(modeId);
+            AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
+            Map<String,Object> map=new HashMap<String,Object>();
+            if(analyzeRunDTO.getMsgDTOList().size()>0){
+                map.put("analyze",analyzeRunDTO.getMsgDTOList());
+            }
+            return RespDTO.onSuc(map);
+        }else{
+            //页面模式+接口引擎模式
+            String url=readProperties.getProcessQcUrl()+"?behospitalCode="+behospitalCode+"&hospitalId="+hospitalId+"&modeId="+modeId;
+
+            AnalyzeRunVO analyzeRunVO=new AnalyzeRunVO();
+            analyzeRunVO.setBehospitalCode(behospitalCode);
+            analyzeRunVO.setHospitalId(hospitalId);
+            analyzeRunVO.setModeId(modeId);
+            AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
+            Map<String,Object> map=new HashMap<String,Object>();
+            if(analyzeRunDTO.getMsgDTOList().size()>0){
+                map.put("url",url);
+                map.put("analyze",analyzeRunDTO.getMsgDTOList());
+            }
+            return RespDTO.onSuc(map);
+        }
+    }
+
+
+    /**
+     * 终末质控-通过接口更新病案首页
+     * @param list
+     * @return
+     */
+    public RespDTO<List<AHomePageDTO>> executeHomePage(List<AHomePageVO> list) {
+        if(list!=null && list.size()>0){
+            //循环验证数据有效性
+            for (AHomePageVO aHomePageVO:list) {
+                if("".equals(aHomePageVO.getHomePageId())) {
+                    return RespDTO.onError("请输入病案首页编号!");
+                }else if(aHomePageVO.getHospitalId()==null){
+                    return RespDTO.onError("请输入医院编码!");
+                }else if("".equals(aHomePageVO.getBehospitalCode())){
+                    return RespDTO.onError("请输入病人住院编码!");
+                }
+            }
+            //装载数据
+            List<HomePage> homePageList=Lists.newArrayList();
+            list.stream().forEach(s->{
+                //初始化入参
+                HomePage homePage=new HomePage();
+                BeanUtil.copyProperties(s,homePage);
+                homePage.setBirthday(DateUtil.parseDate(s.getBirthday()));
+                homePage.setBehospitalDate(DateUtil.parseDateTime(s.getBehospitalDate()));
+                homePage.setLeaveHospitalDate(DateUtil.parseDateTime(s.getLeaveHospitalDate()));
+                homePage.setQcDate(DateUtil.parseDateTime(s.getQcDate()));
+                homePageList.add(homePage);
+            });
+            execute(homePageList);
+            List<AHomePageDTO> homePageDtoList=BeanUtil.listCopyTo(list,AHomePageDTO.class);
+            return RespDTO.onSuc(homePageDtoList);
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    /**
+     * 病案首页
+     * @param homePageList
+     */
+    public void execute(List<HomePage> homePageList){
+        List<HomePage> addE = Lists.newLinkedList();
+        List<HomePage> updateE = Lists.newLinkedList();
+        if (homePageList != null && homePageList.size() > 0) {
+            homePageList.stream().forEach(s -> {
+                HomePage homePage = this.getOne(new QueryWrapper<HomePage>()
+                        .eq("home_page_id", s.getHomePageId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code", s.getBehospitalCode()));
+                if (homePage != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            homePageService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            homePageService.updateBatchByKey(updateE);
+        }
+    }
+}

+ 84 - 0
src/main/java/com/diagbot/facade/data/AMedCrisisFacade.java

@@ -0,0 +1,84 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.AMedCrisisDTO;
+import com.diagbot.entity.MedCrisisInfo;
+import com.diagbot.service.impl.MedCrisisInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.vo.data.AMedCrisisVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+@Component
+public class AMedCrisisFacade extends MedCrisisInfoServiceImpl{
+
+    @Autowired
+    @Qualifier("medCrisisInfoServiceImpl")
+    private MedCrisisInfoServiceImpl medCrisisInfoService;
+
+    public RespDTO<List<AMedCrisisDTO>> executeMedCrisis(List<AMedCrisisVO> list) {
+        if(list!=null && list.size()>0){
+            //循环验证数据有效性
+            for (AMedCrisisVO aMedCrisisVO:list) {
+                if("".equals(aMedCrisisVO.getRecId())){
+                    return RespDTO.onError("请输入文书编码!");
+                }else if("".equals(aMedCrisisVO.getBehospitalCode())) {
+                    return RespDTO.onError("请输入病人住院编码!");
+                }else if(aMedCrisisVO.getHospitalId()==null){
+                    return RespDTO.onError("请输入医院编码!");
+                }else if("".equals(aMedCrisisVO.getRecType())){
+                    return RespDTO.onError("请输入危急值类型!");
+                }
+            }
+
+            List<MedCrisisInfo> medCrisisList=Lists.newArrayList();
+            list.stream().forEach(s->{
+                MedCrisisInfo medCrisisInfo=new MedCrisisInfo();
+                BeanUtil.copyProperties(s,medCrisisInfo);
+                medCrisisInfo.setRepDate(DateUtil.parseDateTime(s.getRepDate()));
+                medCrisisInfo.setSendDate(DateUtil.parseDateTime(s.getSendDate()));
+                medCrisisList.add(medCrisisInfo);
+            });
+            execute(medCrisisList);
+
+            List<AMedCrisisDTO> medCrisisDtoList=BeanUtil.listCopyTo(list,AMedCrisisDTO.class);
+            return RespDTO.onSuc(medCrisisDtoList);
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    public void execute(List<MedCrisisInfo> medCrisisList){
+        List<MedCrisisInfo> addE = Lists.newLinkedList();
+        List<MedCrisisInfo> updateE = Lists.newLinkedList();
+        if (medCrisisList != null && medCrisisList.size() > 0) {
+            medCrisisList.stream().forEach(s -> {
+                MedCrisisInfo medCrisisInfo = this.getOne(new QueryWrapper<MedCrisisInfo>()
+                .eq("rec_id", s.getRecId())
+                .eq("hospital_id", s.getHospitalId())
+                .eq("behospital_code", s.getBehospitalCode())
+                .eq("rec_type", s.getRecType()));
+                if (medCrisisInfo != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            medCrisisInfoService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            medCrisisInfoService.updateBatchByKey(updateE);
+        }
+    }
+}

+ 89 - 0
src/main/java/com/diagbot/facade/data/AMedRecordTypeFacade.java

@@ -0,0 +1,89 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.AMedicalRecordTypeDTO;
+import com.diagbot.entity.MedRecordType;
+import com.diagbot.service.impl.MedRecordTypeServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.data.AMedicalRecordTypeVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+@Component
+public class AMedRecordTypeFacade extends MedRecordTypeServiceImpl {
+
+    @Autowired
+    @Qualifier("medRecordTypeServiceImpl")
+    private MedRecordTypeServiceImpl medRecordTypeService;
+
+    private TZDBConn tzDBConn = new TZDBConn();
+
+    /**
+     * 终末质控-同步前一天变更的模板类型
+     */
+    public void executeMRType() {
+        //String sql="select * from ar_medirecclass where SFZFPB='1'";
+        String sql="select * from ar_medirecclass where SFZFPB='1' and cjcxrq>=(select CONVERT(varchar,GETDATE()-2,23)) and cjcxrq<(select CONVERT(varchar,GETDATE(),23))";
+        List<MedRecordType> medRecordTypeList = tzDBConn.getMedicalRecordType(sql);
+        execute(medRecordTypeList);
+    }
+    /**
+     * 数据引擎-通过接口更新病人住院记录信息
+     * @param list
+     * @return
+     */
+    public RespDTO<List<AMedicalRecordTypeDTO>> executeMRType(List<AMedicalRecordTypeVO> list) {
+        if(list!=null && list.size()>0){
+            //循环验证数据有效性
+            for (AMedicalRecordTypeVO medRecordType:list) {
+                if("".equals(medRecordType.getTypeId())) {
+                    return RespDTO.onError("请输入文书类型编码!");
+                }else if(medRecordType.getHospitalId()==null){
+                    return RespDTO.onError("请输入医院编码!");
+                }else if("".equals(medRecordType.getTypeName())){
+                    return RespDTO.onError("请文书类型名称!");
+                }
+            }
+            List<MedRecordType> medRecordTypeList=Lists.newArrayList();
+            List<AMedicalRecordTypeDTO> medRecordTypeDtoList=Lists.newArrayList();
+            medRecordTypeList=BeanUtil.listCopyTo(list,MedRecordType.class);
+            medRecordTypeDtoList=BeanUtil.listCopyTo(list,AMedicalRecordTypeDTO.class);
+            execute(medRecordTypeList);
+            return RespDTO.onSuc(medRecordTypeDtoList);
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    public void execute(List<MedRecordType> medRecordTypeList){
+        List<MedRecordType> addE = Lists.newLinkedList();
+        List<MedRecordType> updateE = Lists.newLinkedList();
+        if (medRecordTypeList != null && medRecordTypeList.size() != 0) {
+            medRecordTypeList.stream().forEach(s -> {
+                MedRecordType mrType = this.getOne(new QueryWrapper<MedRecordType>()
+                        .eq("type_id", s.getTypeId())
+                        .eq("hospital_id", s.getHospitalId()));
+                if (mrType != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            medRecordTypeService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            medRecordTypeService.updateBatchByKey(updateE);
+        }
+    }
+}

+ 78 - 0
src/main/java/com/diagbot/facade/data/AMedicalRecordContentFacade.java

@@ -0,0 +1,78 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.AMedicalRecordContentDTO;
+import com.diagbot.entity.MedicalRecordContent;
+import com.diagbot.service.impl.MedicalRecordContentServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.data.AMedicalRecordContentVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.*;
+
+@Component
+public class AMedicalRecordContentFacade extends MedicalRecordContentServiceImpl{
+
+    @Qualifier("medicalRecordContentServiceImpl")
+    @Autowired
+    private MedicalRecordContentServiceImpl medicalRecordContentService;
+
+    private TZDBConn tzDBConn = new TZDBConn();
+
+    /**
+     * 终末质控-同步前一天的病历详细记录
+     */
+    public void executeMrRecordContent() {
+        //String sql="select * from mr_mrcontent  where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
+        String sql="select BLJLID,BLJLNR from mr_mrcontent  where cjcxrq>=(select CONVERT(varchar,GETDATE()-2,23)) and cjcxrq<(select CONVERT(varchar,GETDATE(),23)) ORDER BY cjcxrq DESC";
+        List<MedicalRecordContent> mrContentList = tzDBConn.getMedicalRecordContent(sql);
+        execute(mrContentList);
+    }
+
+    /**
+     * 数据引擎-通过接口更新病历内容
+     * @param list
+     * @return
+     */
+    public RespDTO<List<AMedicalRecordContentDTO>> executeMrRecordContent(List<AMedicalRecordContentVO> list) {
+        if(list!=null && list.size()>0) {
+            List<MedicalRecordContent> mrContentList=BeanUtil.listCopyTo(list,MedicalRecordContent.class);
+            List<AMedicalRecordContentDTO> mrContentDtoList=BeanUtil.listCopyTo(list,AMedicalRecordContentDTO.class);
+            execute(mrContentList);
+            return RespDTO.onSuc(mrContentDtoList);
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    public void execute(List<MedicalRecordContent> mrContentList){
+        List<MedicalRecordContent> addE = Lists.newLinkedList();
+        List<MedicalRecordContent> updateE = Lists.newLinkedList();
+        if (mrContentList != null && mrContentList.size() > 0) {
+            mrContentList.stream().forEach(s -> {
+                QueryWrapper<MedicalRecordContent> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("rec_id", s.getRecId());
+                queryWrapper.eq("hospital_id", s.getHospitalId());
+                MedicalRecordContent mrContent = this.getOne(queryWrapper);
+                if (mrContent != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            medicalRecordContentService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            medicalRecordContentService.updateBatchByKey(updateE);
+        }
+    }
+}

+ 299 - 0
src/main/java/com/diagbot/facade/data/AMedicalRecordFacade.java

@@ -0,0 +1,299 @@
+package com.diagbot.facade.data;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.AnalyzeRunDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.AMedicalRecordDTO;
+import com.diagbot.dto.data.AMrContentDTO;
+import com.diagbot.entity.*;
+import com.diagbot.facade.BehospitalInfoFacade;
+import com.diagbot.facade.ModelHospitalFacade;
+import com.diagbot.facade.QcTypeFacade;
+import com.diagbot.service.impl.MedicalRecordServiceImpl;
+import com.diagbot.service.impl.QcAbnormalServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.ReadProperties;
+import com.diagbot.util.TZDBConn;
+import com.diagbot.vo.AnalyzeRunVO;
+import com.diagbot.vo.data.AMedicalRecordVO;
+import com.diagbot.vo.data.AMrContentVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Component
+public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
+
+    @Autowired
+    @Qualifier("medicalRecordServiceImpl")
+    private MedicalRecordServiceImpl medicalRecordService;
+
+    @Autowired
+    private ModelHospitalFacade modelHospitalFacade;
+
+    @Autowired
+    private AMedicalRecordContentFacade aMedicalRecordContentFacade;
+
+    @Autowired
+    private BehospitalInfoFacade behospitalInfoFacade;
+
+    @Autowired
+    @Qualifier("qcAbnormalServiceImpl")
+    private QcAbnormalServiceImpl qcAbnormalService;
+
+    @Autowired
+    private QcTypeFacade qcTypeFacade;
+
+    @Autowired
+    private ReadProperties readProperties;
+
+    private TZDBConn tzDBConn = new TZDBConn();
+
+    /**
+     * 终末质控-同步前一天的病历记录
+     */
+    public void executeMrRecord() {
+        //String sql="select * from mr_medicalrecords  where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
+        String sql="select * from mr_medicalrecords  where cjcxrq>=(select CONVERT(varchar,GETDATE()-2,23)) and cjcxrq<(select CONVERT(varchar,GETDATE(),23)) ORDER BY cjcxrq DESC";
+        List<MedicalRecord> medicalRecordList = tzDBConn.getMedicalRecord(sql);
+        execute(medicalRecordList);
+    }
+
+    /**
+     * 终末质控-通过接口更新病历记录
+     * @param list
+     * @return
+     */
+    public RespDTO<List<AMedicalRecordDTO>> executeMrRecord(List<AMedicalRecordVO> list) {
+        if(list!=null && list.size()>0) {
+            //循环验证数据有效性
+            for (AMedicalRecordVO aMedicalRecordVO : list) {
+                if ("".equals(aMedicalRecordVO.getRecId())) {
+                    return RespDTO.onError("请输入文书序号!");
+                } else if (aMedicalRecordVO.getHospitalId() == null) {
+                    return RespDTO.onError("请输入医院编码!");
+                } else if ("".equals(aMedicalRecordVO.getBehospitalCode())) {
+                    return RespDTO.onError("请输入病人住院编码!");
+                }
+            }
+
+            //装载数据
+            List<MedicalRecord> medicalRecordList = Lists.newArrayList();
+            list.stream().forEach(s->{
+                MedicalRecord medicalRecord=new MedicalRecord();
+                BeanUtil.copyProperties(s,medicalRecord);
+                medicalRecord.setRecDate(DateUtil.parseDateTime(s.getRecDate()));
+                medicalRecordList.add(medicalRecord);
+            });
+            execute(medicalRecordList);
+
+            List<AMedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(list, AMedicalRecordDTO.class);
+            return RespDTO.onSuc(medicalRecordDTOList);
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    /**
+     * 运行质控-通过接口更新病历记录
+     * @param aMrContentVO
+     * @return
+     */
+    public RespDTO<Map<String, Object>> executeMrRecordIng(AMrContentVO aMrContentVO) {
+        if(aMrContentVO.getRecords()!=null && aMrContentVO.getRecords().size()>0){
+            AMrContentDTO aMrContentDTO=new AMrContentDTO();
+            //循环验证数据有效性
+            for (AMedicalRecordVO aMedicalRecordVO : aMrContentVO.getRecords()) {
+                if ("".equals(aMedicalRecordVO.getRecId())) {
+                    return RespDTO.onError("请输入文书序号!");
+                } else if (aMedicalRecordVO.getHospitalId() == null) {
+                    return RespDTO.onError("请输入医院编码!");
+                } else if ("".equals(aMedicalRecordVO.getBehospitalCode())) {
+                    return RespDTO.onError("请输入病人住院编码!");
+                } else if ("".equals(aMedicalRecordVO.getRecTypeId())) {
+                    return RespDTO.onError("请输入病历类别编号!");
+                } else if ("".equals(aMedicalRecordVO.getRecTitle())) {
+                    return RespDTO.onError("请输入病历标题!");
+                } else if (aMedicalRecordVO.getContents() == null || aMedicalRecordVO.getContents().size() == 0) {
+                    return RespDTO.onError("请输入文书详情!");
+                }
+            }
+            //更新文书信息
+            executeMrRecord(aMrContentVO.getRecords());
+
+            aMrContentVO.getRecords().stream().forEach(s -> {
+                //更新文书详情
+                aMedicalRecordContentFacade.executeMrRecordContent(s.getContents());
+            });
+
+            //评分后返回结构体
+            return mrIng(aMrContentVO);
+
+        }else{
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
+    /**
+     * 评分后返回结构体
+     * @param aMrContentVO
+     * @return
+     */
+    private RespDTO<Map<String, Object>> mrIng(AMrContentVO aMrContentVO){
+        String behospitalCode =aMrContentVO.getRecords().get(0).getBehospitalCode();
+        Long hospitalId=aMrContentVO.getRecords().get(0).getHospitalId();
+        MedicalRecord medicalRecord=new MedicalRecord();
+        BeanUtil.copyProperties(aMrContentVO.getRecords().get(0),medicalRecord);
+        Long modeId=initModeId(medicalRecord);
+        if(aMrContentVO.getDockModeType().equals("1")){
+            if(modeId==0 || modeId==null){
+                return RespDTO.onError("无对应的文书类型");
+            }
+            //页面模式
+            String url=readProperties.getProcessQcUrl()+"?behospitalCode="+behospitalCode+"&hospitalId="+hospitalId+"&modeId="+modeId;
+            Map<String,Object> map=new HashMap<String,Object>();
+            map.put("url",url);
+            return RespDTO.onSuc(map);
+        }else if(aMrContentVO.getDockModeType().equals("2")){
+            AnalyzeRunVO analyzeRunVO=new AnalyzeRunVO();
+            analyzeRunVO.setBehospitalCode(behospitalCode);
+            analyzeRunVO.setHospitalId(hospitalId);
+            analyzeRunVO.setModeId(modeId);
+            AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
+            Map<String,Object> map=new HashMap<String,Object>();
+            if(analyzeRunDTO.getMsgDTOList().size()>0){
+                map.put("analyze",analyzeRunDTO.getMsgDTOList());
+            }
+            //接口引擎模式
+            return RespDTO.onSuc(map);
+        }else{
+            if(modeId==0 || modeId==null){
+                return RespDTO.onError("无对应的文书类型");
+            }
+            //页面模式
+            String url=readProperties.getProcessQcUrl()+"?behospitalCode="+behospitalCode+"&hospitalId="+hospitalId+"&modeId="+modeId;
+
+            AnalyzeRunVO analyzeRunVO=new AnalyzeRunVO();
+            analyzeRunVO.setBehospitalCode(behospitalCode);
+            analyzeRunVO.setHospitalId(hospitalId);
+            analyzeRunVO.setModeId(modeId);
+            AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
+            Map<String,Object> map=new HashMap<String,Object>();
+            if(analyzeRunDTO.getMsgDTOList().size()>0){
+                map.put("url",url);
+                map.put("analyze",analyzeRunDTO.getMsgDTOList());
+            }
+            return RespDTO.onSuc(map);
+        }
+    }
+
+    public void execute(List<MedicalRecord> medicalRecordList){
+        List<MedicalRecord> addE = Lists.newLinkedList();
+        List<MedicalRecord> updateE = Lists.newLinkedList();
+        List<BehospitalInfo> behospitalInfoList=Lists.newLinkedList();
+        List<QcAbnormal> qcAbnormalList = Lists.newLinkedList();
+        if (medicalRecordList != null && medicalRecordList.size() > 0) {
+            medicalRecordList.stream().forEach(s -> {
+                //初始化mode_id
+                Long modeId=initModeId(s);
+                if(modeId==Long.valueOf("0")){
+                    //新增类型到监测表中
+                    QcAbnormal qcAbnormal=new QcAbnormal();
+                    qcAbnormal.setHospitalId(s.getHospitalId());
+                    qcAbnormal.setBehospitalCode(s.getBehospitalCode());
+                    qcAbnormal.setType(1);
+                    qcAbnormal.setDescription(s.getRecTitle());
+                    qcAbnormal.setGmtCreate(new Date());
+                    qcAbnormalList.add(qcAbnormal);
+                }else if(modeId==Long.valueOf("1")){
+
+                    BehospitalInfo behospitalInfo = behospitalInfoFacade.getOne(new QueryWrapper<BehospitalInfo>()
+                            .eq("behospital_code", s.getBehospitalCode())
+                            .eq("hospital_id", s.getHospitalId()));
+                    if(behospitalInfo!=null){
+                        //如果病人住院信息存在,更新对应的qc_type_id
+                        Long qcTypeId=Long.valueOf("0");
+                        QcType qcType=qcTypeFacade.getOne(new QueryWrapper<QcType>()
+                                .eq("name",s.getRecTitle())
+                                .eq("hospital_id", s.getHospitalId()));
+                        if(qcType!=null){
+                            behospitalInfo.setQcTypeId(qcType.getId());
+                        }else{
+                            //新增类型到qc_type表中
+                            QcType qctype=new QcType();
+                            qctype.setHospitalId(s.getHospitalId());
+                            qctype.setName(s.getRecTitle());
+                            qctype.setGmtCreate(new Date());
+
+                            Long id=qcTypeFacade.saveT(qctype);
+                            behospitalInfo.setQcTypeId(id);
+
+                            //新增类型到监测表中
+                            QcAbnormal qcAbnormal=new QcAbnormal();
+                            qcAbnormal.setHospitalId(s.getHospitalId());
+                            qcAbnormal.setBehospitalCode(s.getBehospitalCode());
+                            qcAbnormal.setType(2);
+                            qcAbnormal.setDescription(s.getRecTitle());
+                            qcAbnormal.setGmtCreate(new Date());
+                            qcAbnormalService.getBaseMapper().insert(qcAbnormal);
+                        }
+                        behospitalInfoList.add(behospitalInfo);
+                    }
+                }
+                s.setModeId(modeId);
+                //新增或修改
+                MedicalRecord mRecord = this.getOne(new QueryWrapper<MedicalRecord>()
+                        .eq("rec_id", s.getRecId())
+                        .eq("hospital_id", s.getHospitalId())
+                        .eq("behospital_code", s.getBehospitalCode()));
+                if (mRecord != null) {
+                    s.setGmtModified(new Date());
+                    updateE.add(s);
+                } else {
+                    s.setGmtCreate(new Date());
+                    addE.add(s);
+                }
+            });
+        }
+        if(addE.size()>0){
+            medicalRecordService.saveBatch(addE);
+        }
+        if(updateE.size()>0){
+            medicalRecordService.updateBatchByKey(updateE);
+        }
+        if(qcAbnormalList.size()>0){
+            qcAbnormalService.saveBatch(qcAbnormalList);
+        }
+        if(behospitalInfoList.size()>0){
+            behospitalInfoFacade.updateBatchByKey(behospitalInfoList);
+        }
+    }
+
+
+    /**
+     * 初始化模型ID
+     * @param medicalRecord
+     * @return
+     */
+    private Long initModeId(MedicalRecord medicalRecord){
+        Long modeId=Long.valueOf("0");
+        QueryWrapper<ModelHospital> wrapper = new QueryWrapper<>();
+        wrapper.eq("hospital_id",medicalRecord.getHospitalId());
+        wrapper.eq("hospital_model_name",medicalRecord.getRecTitle());
+        ModelHospital mode=modelHospitalFacade.getOne(wrapper);
+        if(mode!=null){
+            modeId=mode.getStandModelId();
+        }else{
+            modeId=Long.valueOf("0");
+        }
+        return modeId;
+    }
+
+}

+ 2 - 0
src/main/java/com/diagbot/mapper/BasDeptInfoMapper.java

@@ -29,4 +29,6 @@ public interface BasDeptInfoMapper extends BaseMapper<BasDeptInfo> {
      * @return
      */
     List<DeptBaseDTO> getDeptByUser(FilterVO filterVO);
+
+    void updateBatchByKey(List<BasDeptInfo> list);
 }

+ 20 - 0
src/main/java/com/diagbot/mapper/BasDoctorInfoMapper.java

@@ -0,0 +1,20 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.BasDoctorInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-17
+ */
+public interface BasDoctorInfoMapper extends BaseMapper<BasDoctorInfo> {
+
+    public void updateBatchByKey(List<BasDoctorInfo> list);
+
+}

+ 6 - 0
src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java

@@ -208,4 +208,10 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @return
      */
     public List<ExportExcelDTO> exportQcresultByDept(ExportQcresultVO exportQcresultVO);
+
+    /**
+     * 根据两个主键-批量修改
+     * @param list
+     */
+    public void updateBatchByKey(List<BehospitalInfo> list);
 }

+ 3 - 1
src/main/java/com/diagbot/mapper/DoctorAdviceMapper.java

@@ -3,6 +3,8 @@ package com.diagbot.mapper;
 import com.diagbot.entity.DoctorAdvice;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * <p>
  * 病人医嘱 Mapper 接口
@@ -12,5 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @since 2020-04-13
  */
 public interface DoctorAdviceMapper extends BaseMapper<DoctorAdvice> {
-
+    public void updateBatchByKey(List<DoctorAdvice> list);
 }

+ 4 - 0
src/main/java/com/diagbot/mapper/HomeDiagnoseInfoMapper.java

@@ -3,6 +3,8 @@ package com.diagbot.mapper;
 import com.diagbot.entity.HomeDiagnoseInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * <p>
  *  Mapper 接口
@@ -13,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface HomeDiagnoseInfoMapper extends BaseMapper<HomeDiagnoseInfo> {
 
+    public void updateBatchByKey(List<HomeDiagnoseInfo> list);
+
 }

+ 4 - 0
src/main/java/com/diagbot/mapper/HomeOperationInfoMapper.java

@@ -3,6 +3,8 @@ package com.diagbot.mapper;
 import com.diagbot.entity.HomeOperationInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * <p>
  *  Mapper 接口
@@ -13,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface HomeOperationInfoMapper extends BaseMapper<HomeOperationInfo> {
 
+    public void updateBatchByKey(List<HomeOperationInfo> list);
+
 }

+ 7 - 0
src/main/java/com/diagbot/mapper/HomePageMapper.java

@@ -52,4 +52,11 @@ public interface HomePageMapper extends BaseMapper<HomePage> {
      * @return
      */
     public IPage<AverageStatisticsDTO> getAverageFeePage(@Param("filterPageByAverageVO") FilterPageByAverageVO filterPageByAverageVO);
+
+    /**
+     * 根据病案首页编码、医院编码、病人住院ID-批量更新
+     * @param list
+     */
+    public void updateBatchByKey(List<HomePage> list);
+
 }

+ 4 - 0
src/main/java/com/diagbot/mapper/MedCrisisInfoMapper.java

@@ -3,6 +3,8 @@ package com.diagbot.mapper;
 import com.diagbot.entity.MedCrisisInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * <p>
  * 危急值信息 Mapper 接口
@@ -13,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface MedCrisisInfoMapper extends BaseMapper<MedCrisisInfo> {
 
+    public void updateBatchByKey(List<MedCrisisInfo> list);
+
 }

+ 4 - 0
src/main/java/com/diagbot/mapper/MedRecordTypeMapper.java

@@ -3,6 +3,8 @@ package com.diagbot.mapper;
 import com.diagbot.entity.MedRecordType;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * <p>
  *  Mapper 接口
@@ -13,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface MedRecordTypeMapper extends BaseMapper<MedRecordType> {
 
+    public void updateBatchByKey(List<MedRecordType> list);
+
 }

+ 4 - 0
src/main/java/com/diagbot/mapper/MedicalRecordContentMapper.java

@@ -3,6 +3,8 @@ package com.diagbot.mapper;
 import com.diagbot.entity.MedicalRecordContent;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * <p>
  *  Mapper 接口
@@ -13,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface MedicalRecordContentMapper extends BaseMapper<MedicalRecordContent> {
 
+    public void updateBatchByKey(List<MedicalRecordContent> list);
+
 }

+ 2 - 0
src/main/java/com/diagbot/mapper/MedicalRecordMapper.java

@@ -18,4 +18,6 @@ import java.util.List;
 public interface MedicalRecordMapper extends BaseMapper<MedicalRecord> {
 
     public List<RecordContentDTO> getRecordContent(RecordContentVO recordContentVO);
+
+    public void updateBatchByKey(List<MedicalRecord> list);
 }

+ 16 - 0
src/main/java/com/diagbot/service/BasDoctorInfoService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.BasDoctorInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-17
+ */
+public interface BasDoctorInfoService extends IService<BasDoctorInfo> {
+
+}

+ 9 - 0
src/main/java/com/diagbot/service/impl/BasDeptInfoServiceImpl.java

@@ -43,4 +43,13 @@ public class BasDeptInfoServiceImpl extends ServiceImpl<BasDeptInfoMapper, BasDe
     public List<DeptBaseDTO> getDeptByUser(FilterVO filterVO) {
         return baseMapper.getDeptByUser(filterVO);
     }
+
+
+    /**
+     * 根据科室编码,医院编码,批量修改
+     * @param list
+     */
+    public void updateBatchByKey(List<BasDeptInfo> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
 }

+ 29 - 0
src/main/java/com/diagbot/service/impl/BasDoctorInfoServiceImpl.java

@@ -0,0 +1,29 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.BasDoctorInfo;
+import com.diagbot.mapper.BasDoctorInfoMapper;
+import com.diagbot.service.BasDoctorInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-17
+ */
+@Service
+public class BasDoctorInfoServiceImpl extends ServiceImpl<BasDoctorInfoMapper, BasDoctorInfo> implements BasDoctorInfoService {
+    /**
+     * 根据医生编码和医院编码,批量更新
+     * @param list
+     */
+    public void updateBatchByKey(List<BasDoctorInfo> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
+
+}

+ 1 - 0
src/main/java/com/diagbot/service/impl/BasHospitalInfoServiceImpl.java

@@ -17,4 +17,5 @@ import org.springframework.stereotype.Service;
 @Service
 public class BasHospitalInfoServiceImpl extends ServiceImpl<BasHospitalInfoMapper, BasHospitalInfo> implements BasHospitalInfoService {
 
+
 }

+ 8 - 0
src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java

@@ -281,4 +281,12 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public List<ExportExcelDTO> exportQcresultByDept(ExportQcresultVO exportQcresultVO) {
         return baseMapper.exportQcresultByDept(exportQcresultVO);
     }
+
+    /**
+     * 根据编码、医院编码批量更新
+     * @param list
+     */
+    public void updateBatchByKey(List<BehospitalInfo> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
 }

+ 9 - 1
src/main/java/com/diagbot/service/impl/DoctorAdviceServiceImpl.java

@@ -6,6 +6,8 @@ import com.diagbot.service.DoctorAdviceService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * <p>
  * 病人医嘱 服务实现类
@@ -16,5 +18,11 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class DoctorAdviceServiceImpl extends ServiceImpl<DoctorAdviceMapper, DoctorAdvice> implements DoctorAdviceService {
-
+    /**
+     * 根据医嘱ID和医院编码-批量更新数据
+     * @param list
+     */
+    public void updateBatchByKey(List<DoctorAdvice> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
 }

+ 8 - 1
src/main/java/com/diagbot/service/impl/HomeDiagnoseInfoServiceImpl.java

@@ -5,6 +5,7 @@ import com.diagbot.mapper.HomeDiagnoseInfoMapper;
 import com.diagbot.service.HomeDiagnoseInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
+import java.util.List;
 
 /**
  * <p>
@@ -16,5 +17,11 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class HomeDiagnoseInfoServiceImpl extends ServiceImpl<HomeDiagnoseInfoMapper, HomeDiagnoseInfo> implements HomeDiagnoseInfoService {
-
+    /**
+     * 根据病案首页编码、医院编码、手术序号批量更新
+     * @param list
+     */
+    public void updateBatchByKey(List<HomeDiagnoseInfo> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
 }

+ 8 - 1
src/main/java/com/diagbot/service/impl/HomeOperationInfoServiceImpl.java

@@ -6,6 +6,7 @@ import com.diagbot.service.HomeOperationInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
 /**
  * <p>
  *  服务实现类
@@ -16,5 +17,11 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class HomeOperationInfoServiceImpl extends ServiceImpl<HomeOperationInfoMapper, HomeOperationInfo> implements HomeOperationInfoService {
-
+    /**
+     * 根据病案首页编码、医院编码、手术序号批量更新
+     * @param list
+     */
+    public void updateBatchByKey(List<HomeOperationInfo> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
 }

+ 8 - 0
src/main/java/com/diagbot/service/impl/HomePageServiceImpl.java

@@ -67,4 +67,12 @@ public class HomePageServiceImpl extends ServiceImpl<HomePageMapper, HomePage> i
     public IPage<AverageStatisticsDTO> getAverageFeePage(@Param("filterPageByAverageVO") FilterPageByAverageVO filterPageByAverageVO) {
         return baseMapper.getAverageFeePage(filterPageByAverageVO);
     }
+
+    /**
+     * 根据病案首页编码、医院编码、病人住院ID-批量更新
+     * @param list
+     */
+    public void updateBatchByKey(List<HomePage> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
 }

+ 8 - 0
src/main/java/com/diagbot/service/impl/MedCrisisInfoServiceImpl.java

@@ -6,6 +6,7 @@ import com.diagbot.service.MedCrisisInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
 /**
  * <p>
  * 危急值信息 服务实现类
@@ -17,4 +18,11 @@ import org.springframework.stereotype.Service;
 @Service
 public class MedCrisisInfoServiceImpl extends ServiceImpl<MedCrisisInfoMapper, MedCrisisInfo> implements MedCrisisInfoService {
 
+    /**
+     * 根据编码、医院编码、病人住院ID-批量更新
+     * @param list
+     */
+    public void updateBatchByKey(List<MedCrisisInfo> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
 }

+ 8 - 2
src/main/java/com/diagbot/service/impl/MedRecordTypeServiceImpl.java

@@ -5,7 +5,7 @@ import com.diagbot.mapper.MedRecordTypeMapper;
 import com.diagbot.service.MedRecordTypeService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
-
+import java.util.List;
 /**
  * <p>
  *  服务实现类
@@ -16,5 +16,11 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class MedRecordTypeServiceImpl extends ServiceImpl<MedRecordTypeMapper, MedRecordType> implements MedRecordTypeService {
-
+    /**
+     * 根据医院编码、文书类型编码批量更新
+     * @param list
+     */
+    public void updateBatchByKey(List<MedRecordType> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
 }

+ 8 - 1
src/main/java/com/diagbot/service/impl/MedicalRecordContentServiceImpl.java

@@ -5,6 +5,7 @@ import com.diagbot.mapper.MedicalRecordContentMapper;
 import com.diagbot.service.MedicalRecordContentService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
+import java.util.List;
 
 /**
  * <p>
@@ -16,5 +17,11 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class MedicalRecordContentServiceImpl extends ServiceImpl<MedicalRecordContentMapper, MedicalRecordContent> implements MedicalRecordContentService {
-
+    /**
+     * 根据文书编码、医院编码
+     * @param list
+     */
+    public void updateBatchByKey(List<MedicalRecordContent> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
 }

+ 8 - 0
src/main/java/com/diagbot/service/impl/MedicalRecordServiceImpl.java

@@ -25,4 +25,12 @@ public class MedicalRecordServiceImpl extends ServiceImpl<MedicalRecordMapper, M
     public List<RecordContentDTO> getRecordContent(RecordContentVO recordContentVO) {
         return baseMapper.getRecordContent(recordContentVO);
     }
+
+    /**
+     * 根据文书编码、医院编码、病人住院编码
+     * @param list
+     */
+    public void updateBatchByKey(List<MedicalRecord> list){
+        this.baseMapper.updateBatchByKey(list);
+    }
 }

+ 15 - 0
src/main/java/com/diagbot/service/impl/QcTypeServiceImpl.java

@@ -1,5 +1,6 @@
 package com.diagbot.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.QcTypePageDTO;
 import com.diagbot.entity.QcType;
@@ -23,4 +24,18 @@ public class QcTypeServiceImpl extends ServiceImpl<QcTypeMapper, QcType> impleme
     public IPage<QcTypePageDTO> getList(QcTypePageVO qcTypePageVO) {
         return baseMapper.getList(qcTypePageVO);
     }
+
+    /**
+     * 保存,并返回ID
+     * @param qcType
+     * @return
+     */
+    public Long saveT(QcType qcType){
+        this.baseMapper.insert(qcType);
+        QueryWrapper<QcType> qWrapper =new QueryWrapper<>();
+        qWrapper.eq("name",qcType.getName());
+        qWrapper.eq("hospital_id", qcType.getHospitalId());
+        QcType entity=this.baseMapper.selectOne(qWrapper);
+        return entity.getId();
+    }
 }

+ 69 - 0
src/main/java/com/diagbot/task/BasDeptInfoTask.java

@@ -0,0 +1,69 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.diagbot.facade.data.ABasDeptInfoFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class BasDeptInfoTask implements SchedulingConfigurer{
+
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+	private ABasDeptInfoFacade aBasDeptInfoFacade;
+    
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    //aBasDeptInfoFacade.executeDept();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK011"));
+                String cron = "0 0/1 * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 68 - 0
src/main/java/com/diagbot/task/BasDoctorInfoTask.java

@@ -0,0 +1,68 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.diagbot.facade.data.ABasDoctorInfoFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class BasDoctorInfoTask implements SchedulingConfigurer{
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+	private ABasDoctorInfoFacade aBasDoctorInfoFacade;
+    
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    //aBasDoctorInfoFacade.executeDoctor();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK010"));
+                String cron = "0 0/1 * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 68 - 0
src/main/java/com/diagbot/task/BehospitalInfoTask.java

@@ -0,0 +1,68 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.diagbot.facade.data.ABehospitalInfoFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class BehospitalInfoTask implements SchedulingConfigurer{
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+	private ABehospitalInfoFacade aBehospitalInfoFacade;
+
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    aBehospitalInfoFacade.executeBehospital();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK008"));
+                String cron = "0 0/1 * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 69 - 0
src/main/java/com/diagbot/task/DoctorAdviceTask.java

@@ -0,0 +1,69 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.diagbot.facade.data.ADoctorAdviceFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class DoctorAdviceTask implements SchedulingConfigurer{
+
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+	private ADoctorAdviceFacade aDoctorAdviceFacade;
+    
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    aDoctorAdviceFacade.executeDoctorAdvice();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK009"));
+                String cron = "0 0/1 * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 68 - 0
src/main/java/com/diagbot/task/HomeDiagnoseInfoTask.java

@@ -0,0 +1,68 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.diagbot.facade.data.AHomeDiagnoseInfoFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class HomeDiagnoseInfoTask implements SchedulingConfigurer{
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+   	private AHomeDiagnoseInfoFacade aHomeDiagnoseInfoFacade;
+    
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    aHomeDiagnoseInfoFacade.executeHomeDiagnose();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK003"));
+                String cron = "0 0/1 * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 69 - 0
src/main/java/com/diagbot/task/HomeOperationInfoTask.java

@@ -0,0 +1,69 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.diagbot.facade.*;
+import com.diagbot.facade.data.AHomeOperationInfoFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class HomeOperationInfoTask implements SchedulingConfigurer{
+
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+   	private AHomeOperationInfoFacade aHomeOperationInfoFacade;
+    
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    aHomeOperationInfoFacade.executeHomeOperation();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK004"));
+                String cron = "0 0/1 * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 68 - 0
src/main/java/com/diagbot/task/HomePageTask.java

@@ -0,0 +1,68 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.diagbot.facade.data.AHomePageFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class HomePageTask implements SchedulingConfigurer{
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+   	private AHomePageFacade aHomePageFacade;
+    
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    aHomePageFacade.executeHomePage();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK002"));
+                String cron = "0 0/1 * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 69 - 0
src/main/java/com/diagbot/task/MedicalRecordContentTask.java

@@ -0,0 +1,69 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.diagbot.facade.data.AMedicalRecordContentFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class MedicalRecordContentTask implements SchedulingConfigurer{
+
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+   	private AMedicalRecordContentFacade aMedicalRecordContentFacade;
+    
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    aMedicalRecordContentFacade.executeMrRecordContent();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK007"));
+                String cron = "0 0/1 * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 69 - 0
src/main/java/com/diagbot/task/MedicalRecordTask.java

@@ -0,0 +1,69 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.diagbot.facade.data.AMedicalRecordFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class MedicalRecordTask implements SchedulingConfigurer{
+
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+   	private AMedicalRecordFacade aMedicalRecordFacade;
+    
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    aMedicalRecordFacade.executeMrRecord();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK006"));
+                String cron = "0 0/1 * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 66 - 0
src/main/java/com/diagbot/task/MedicalRecordTypeTask.java

@@ -0,0 +1,66 @@
+package com.diagbot.task;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.data.AMedRecordTypeFacade;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class MedicalRecordTypeTask implements SchedulingConfigurer {
+    @Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+    private AMedRecordTypeFacade aMedRecordTypeFacade;
+
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    aMedRecordTypeFacade.executeMRType();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK005"));
+                String cron = "0 0/1 * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 68 - 0
src/main/java/com/diagbot/util/ReadProperties.java

@@ -0,0 +1,68 @@
+package com.diagbot.util;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.stereotype.Component;
+
+@Component
+@PropertySource(value={"classpath:jdbc.properties"})
+public class ReadProperties {
+
+	@Value(value="${remote.address.ver}")
+	public String remoteAddressVer;
+	
+	@Value(value="${remote.address.hor}")
+	public String remoteAddressHor;
+	
+	@Value(value="${jdbc.driverClassName}")
+	public String jdbcDriverClassName;
+	
+	@Value(value="${jdbc.url}")
+	public String jdbcUrl;
+	
+	@Value(value="${jdbc.username}")
+	public String jdbcUsername;
+	
+	@Value(value="${jdbc.password}")
+	public String jdbcPassword;
+
+	@Value(value="${process.qc.url}")
+	public String processQcUrl;
+
+	public String getRemoteAddressVer() {
+		return remoteAddressVer;
+	}
+
+	public String getRemoteAddressHor() {
+		return remoteAddressHor;
+	}
+
+	@Value(value="${his.patient.url}")
+	public String hisPatientUrl;
+
+
+
+
+	public String getHisPatientUrl() {
+		return hisPatientUrl;
+	}
+
+	public String getJdbcDriverClassName() {
+		return jdbcDriverClassName;
+	}
+
+	public String getJdbcUrl() {
+		return jdbcUrl;
+	}
+
+	public String getJdbcUsername() {
+		return jdbcUsername;
+	}
+
+	public String getJdbcPassword() {
+		return jdbcPassword;
+	}
+	
+	public String getProcessQcUrl(){return processQcUrl;}
+	
+}

+ 703 - 0
src/main/java/com/diagbot/util/TZDBConn.java

@@ -0,0 +1,703 @@
+package com.diagbot.util;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Date;
+import java.util.List;
+import java.util.ResourceBundle;
+
+import javax.print.DocFlavor.STRING;
+
+import com.diagbot.entity.BasDeptInfo;
+import com.diagbot.entity.BasDoctorInfo;
+import com.diagbot.entity.BehospitalInfo;
+import com.diagbot.entity.DoctorAdvice;
+import com.diagbot.entity.HomeDiagnoseInfo;
+import com.diagbot.entity.HomeOperationInfo;
+import com.diagbot.entity.HomePage;
+import com.diagbot.entity.MedRecordType;
+import com.diagbot.entity.MedicalRecord;
+import com.diagbot.entity.MedicalRecordContent;
+import com.google.common.collect.Lists;
+
+public class TZDBConn {
+	private static final String DRIVER = getValue("jdbc.driverClassName");
+    private static final String URL = getValue("jdbc.url");
+    private static final String USERNAME = getValue("jdbc.username");
+    private static final String PASSWORD = getValue("jdbc.password");
+
+	public static final Long HOSPITAL_ID=Long.valueOf("3");//1:长兴,2:邵逸夫,3:台州市立医院
+    
+    private static Connection connection = null;
+    private static PreparedStatement sta = null;
+	private static ResultSet rs = null;
+	
+	/**
+     * 读取属性文件中的信息
+     *
+     * @param key
+     * @return
+     */
+    private static String getValue(String key) {
+        // 资源包绑定
+        ResourceBundle bundle = ResourceBundle.getBundle("jdbc");
+        return bundle.getString(key);
+    }
+    
+    /**
+	 * 加载驱动程序
+	 */
+	static {
+		try {
+			Class.forName(DRIVER);
+		} catch (ClassNotFoundException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	/**
+	 * @return 连接对象
+	 */
+	public Connection getConnection() {
+		try {
+			connection = DriverManager.getConnection(URL,USERNAME,PASSWORD);
+		} catch (SQLException e) {
+			e.printStackTrace();
+		}
+		return connection;
+	}
+	
+	/**
+	 * @param sql sql语句
+	 * @param obj 参数
+	 * @return 数据集合
+	 */
+	public ResultSet Query(String sql,Object...obj){
+		connection=getConnection();
+		try {
+			sta=connection.prepareStatement(sql);
+			if(obj!=null){
+				for(int i=0;i<obj.length;i++){
+					sta.setObject(i+1, obj[i]);
+				}
+			}
+			rs=sta.executeQuery();
+		} catch (SQLException e) {
+			e.printStackTrace();
+		}
+		return rs;
+	}
+	
+	/**
+	 * 关闭资源
+	 */
+	public void close() {
+		try {
+			if (rs != null) {
+				rs.close();
+			}
+		} catch (SQLException e) {
+			e.printStackTrace();
+		} finally {
+			try {
+				if (sta != null) {
+					sta.close();
+				}
+			} catch (SQLException e2) {
+				e2.printStackTrace();
+			} finally {
+				if (connection != null) {
+					try {
+						connection.close();
+					} catch (SQLException e) {
+						e.printStackTrace();
+					}
+				}
+			}
+		}
+	}
+	
+	/**
+	 * 医生信息
+	 * @return
+	 */
+	public List<BasDoctorInfo> getBasDoctorInfo(String sql) {
+		List<BasDoctorInfo> basDoctorInfoList=Lists.newLinkedList();
+		TZDBConn dbconn=new TZDBConn();
+		try {
+			rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				BasDoctorInfo basDoctorInfo=new BasDoctorInfo();
+				basDoctorInfo.setDoctorId(rs.getString("YHRYBH"));//医生ID
+				basDoctorInfo.setHospitalId(HOSPITAL_ID);//医院ID
+				//basDoctorInfoVO.setDeptId(rs.getString("ZZKSID"));//科室ID
+				basDoctorInfo.setName(rs.getString("YHRYMC"));//医生姓名
+				basDoctorInfo.setProfessor(rs.getString("YHRYZC"));//职称
+
+				basDoctorInfoList.add(basDoctorInfo);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+		
+		return basDoctorInfoList;
+	}
+	
+	/**
+	 * 从视图中获取医院科室数据,根据修改时间同步数据
+	 * @return
+	 */
+	public List<BasDeptInfo> getDeptInfo(String sql) {
+		List<BasDeptInfo> basDeptInfoList=Lists.newLinkedList();
+		try {
+			TZDBConn dbconn=new TZDBConn();
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				BasDeptInfo basDeptInfo=new BasDeptInfo();
+				basDeptInfo.setDeptId(rs.getString("ZZKSDM"));//科室编码
+				basDeptInfo.setHospitalId(HOSPITAL_ID);//医院ID
+				basDeptInfo.setDeptName(rs.getString("ZZKSMC"));//科室名称
+				//basDeptInfoVO.setDeptType(rs.getString("ZZKSLB"));//科室类别
+				basDeptInfo.setSpell(rs.getString("HZSRM1"));//首字母拼音
+				//basDeptInfoVO.setStation(rs.getString("FLKSID"));//区域类别
+
+				basDeptInfoList.add(basDeptInfo);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+		return basDeptInfoList;
+	}
+	
+	/**
+	 * 病案诊断
+	 * @return
+	 */
+	public List<HomeDiagnoseInfo> getHomeDiagnose(String sql){
+		List<HomeDiagnoseInfo> homeDiagnoseVOList=Lists.newLinkedList();
+		try {
+			TZDBConn dbconn=new TZDBConn();
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				HomeDiagnoseInfo homeDiagnose=new HomeDiagnoseInfo();
+				homeDiagnose.setHomePageId(rs.getString("BASYID"));//病案首页ID
+				homeDiagnose.setHospitalId(HOSPITAL_ID);//医院ID
+				homeDiagnose.setDiagnoseOrderNo(rs.getString("BAZDXH"));//诊断序号
+				homeDiagnose.setDiagnoseName(rs.getString("ZDJBMC"));//诊断名称
+				homeDiagnose.setDiagnoseType(rs.getString("ZDLBDM"));//诊断类别
+				homeDiagnose.setDiagnoseTypeShort(rs.getString("ZCZDPB"));//诊断判别
+				homeDiagnose.setBehospitalType(rs.getString("RYQKBM"));//入院情况
+				//homeDiagnoseVO.setLeaveHospitalType(rs.getString("RYQKBM"));//出院情况
+				//homeDiagnoseVO.setPathologyDiagnose(rs.getString("BASYID"));//病理号
+				homeDiagnose.setIcdCode(rs.getString("ICDM"));//诊断编码
+
+				homeDiagnoseVOList.add(homeDiagnose);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+		
+		return homeDiagnoseVOList;
+	}
+	
+	/**
+	 * 病案手术
+	 * @return
+	 */
+	public List<HomeOperationInfo> getHomeOperation(String sql) {
+		List<HomeOperationInfo> homeOperationVOList=Lists.newLinkedList();
+		try {
+			TZDBConn dbconn=new TZDBConn();
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				HomeOperationInfo homeOperationVO=new HomeOperationInfo();
+				homeOperationVO.setHomePageId(rs.getString("BASYID"));//病案首页ID
+				homeOperationVO.setHospitalId(HOSPITAL_ID);//医院ID
+				homeOperationVO.setOperationOrderNo(rs.getString("BRSSXH"));//手术序号
+				homeOperationVO.setOperationDate(rs.getDate("BRSSRQ"));//手术日期
+				homeOperationVO.setOperationCode(rs.getString("SSDMID"));//手术编码
+				homeOperationVO.setOperationDoctorId(rs.getString("SSYSID"));//手术医生
+				homeOperationVO.setFirstAssistantId(rs.getString("YZHSID"));//一助医生
+				homeOperationVO.setSecondAssistantId(rs.getString("EZHSID"));//二助医生
+				homeOperationVO.setCutLevel(rs.getString("QKDJDM"));//切口等级
+				homeOperationVO.setHealingLevel(rs.getString("QKDJDM"));//愈合等级
+				homeOperationVO.setOperationName(rs.getString("BRSSMC"));//手术名称
+				homeOperationVO.setOperationLevel(rs.getString("SSJBID"));//手术级别
+				homeOperationVO.setAnaesthesiaName(rs.getString("MZFFMC"));//麻醉方式
+				homeOperationVO.setShamOperationName(rs.getString("NSSMC"));//拟手术名称
+				
+				homeOperationVOList.add(homeOperationVO);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+		List<HomeOperationInfo> homeOperationList=BeanUtil.listCopyTo(homeOperationVOList, HomeOperationInfo.class);
+		return homeOperationList;
+	}
+	
+	/**
+	 * 从视图获取病案首页信息
+	 * 获取近几个月的数据
+	 */
+	public List<HomePage> getHomePage(String sql) {
+		List<HomePage> homePageList=Lists.newLinkedList();
+		try {
+			TZDBConn dbconn=new TZDBConn();
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				HomePage homePageVO=new HomePage();
+				homePageVO.setHomePageId(rs.getString("BASYID"));//病案首页ID
+				homePageVO.setHospitalId(HOSPITAL_ID);//医院ID
+				homePageVO.setBehospitalCode(rs.getString("BRZYID"));//病人住院序号
+				homePageVO.setHospitalCode(rs.getString("ZZJGID"));//组织机构id
+				homePageVO.setHospitalName(rs.getString("ZZJGMC"));//医疗机构名称
+				homePageVO.setOrgCode(rs.getString("ZZJGBH"));//医疗机构代码
+				homePageVO.setPayType(rs.getString("YLFKLB"));//医疗付费方式
+				homePageVO.setHealthCard(rs.getString("BRJKKH"));//健康卡号
+				homePageVO.setBehospitalNum(rs.getString("BRZYCS"));//住院次数
+				homePageVO.setFileCode(rs.getString("BRBABH"));//病案号
+				homePageVO.setName(rs.getString("BRBAXM"));//姓名
+				homePageVO.setSex(rs.getString("BRBAXB"));//性别
+				homePageVO.setBirthday(rs.getDate("BRCSRQ"));//出生日期
+				homePageVO.setAge(rs.getString("BRDQNL").equals("-")?null:rs.getString("BRDQNL"));//病人年龄
+				homePageVO.setAgeUnit(rs.getString("BRNLDW"));//年龄单位
+				homePageVO.setNationality(rs.getString("BRBAGJ"));//国籍
+				homePageVO.setNewbornMonth(rs.getString("YENLYS"));//新生儿出生月数
+				homePageVO.setNewbornDay(rs.getString("YENLTS"));//新生儿出生天数
+				homePageVO.setNewbornWeight(rs.getString("YECSTZ"));//新生儿出生体重
+				homePageVO.setNewbornBehospitalWeight(rs.getString("YERYTZ"));//新生儿入院体重
+				homePageVO.setBornAddress(rs.getString("BRCSDZ"));//出生地
+				homePageVO.setBornPlace(rs.getString("BRBAJG"));//籍贯
+				homePageVO.setNation(rs.getString("BRBAMZ"));//民族
+				homePageVO.setIdentityCardNo(rs.getString("BRSFZH"));//身份证号
+				homePageVO.setJobType(rs.getString("BRBASF"));//职业
+				homePageVO.setMarriage(rs.getString("BRHYZK"));//婚姻
+				homePageVO.setCurAddress(rs.getString("BRLXDZ"));//现住址
+				homePageVO.setCurPhone(rs.getString("BRLXDH"));//现住址电话
+				homePageVO.setCurPostCode(rs.getString("LXDZYB"));//现住址邮编
+				homePageVO.setResidenceAddress(rs.getString("BRHKDZ"));//户口地址
+				homePageVO.setResidencePostCode(rs.getString("HKDZYB"));//户口地址邮编
+				homePageVO.setWorkAddress(rs.getString("GZDWMC"));//工作单位
+				homePageVO.setWorkPhone(rs.getString("GZDWDH"));//工作单位电话
+				homePageVO.setWorkPostCode(rs.getString("GZDWYB"));//工作单位邮编
+				homePageVO.setContactName(rs.getString("LXRYXM"));//联系人姓名
+				homePageVO.setContactRelation(rs.getString("LXRYGX"));//联系人关系
+				homePageVO.setContactAddress(rs.getString("LXRYDZ"));//联系人地址
+				homePageVO.setContactPhone(rs.getString("LXRYDH"));//联系人电话
+				homePageVO.setBehospitalWay(rs.getString("RYLYDM"));//入院途径
+				homePageVO.setBehospitalDate(rs.getDate("BRRYRQ"));//入院时间
+				homePageVO.setBehospitalDept(rs.getString("RYKSID"));//入院科室
+				homePageVO.setBehospitalWard(rs.getString("RYBQID"));//入院病房
+				homePageVO.setBehospitalBedId(rs.getString("RYCWID"));//入院床位序号
+				homePageVO.setBehospitalBedCode(rs.getString("RYCWHM"));//入院床位号码
+				homePageVO.setChangeDept(rs.getString("BRZKKB"));//转科科别
+				homePageVO.setLeaveHospitalDate(rs.getDate("BRCYRQ"));//出院时间
+				homePageVO.setLeaveHospitalDept(rs.getString("CYKSID"));//出院科别
+				homePageVO.setLeaveHospitalWard(rs.getString("CYBQID"));//出院病房
+				homePageVO.setLeaveHospitalBedId(rs.getString("CYCWID"));//出院床位序号
+				homePageVO.setLeaveHospitalBedCode(rs.getString("CYCWHM"));//出院床位号码
+				homePageVO.setBehospitalDayNum(rs.getString("SJZYTS"));//实际住院天数
+				homePageVO.setOutpatientEmrDiagnose(rs.getString("BRMZZD"));//门急诊诊断
+				homePageVO.setOutpatientEmrDiagnoseCode(rs.getString("MZZDDM"));//门急诊诊断编码
+				homePageVO.setPoisonFactor(rs.getString("SSZDYSMC"));//损伤中毒因素
+				homePageVO.setPoisonFactorCode(rs.getString("SSZDYSBM"));//损伤中毒因素编码
+				homePageVO.setPathologyDiagnose(rs.getString("BLZDMC"));//病理诊断
+				homePageVO.setPathologyDiagnoseCode(rs.getString("BLZDBM"));//病理诊断编码
+				homePageVO.setPathologyDiagnoseId(rs.getString("BLZDBH"));//病理诊断编号
+				homePageVO.setIsMedAllergy(rs.getString("YWYWGM"));//药物过敏
+				homePageVO.setMedAllergyName(rs.getString("BRGMYW"));//过敏药物
+				homePageVO.setAutopsy(rs.getString("BRSFSJ"));//死亡患者尸检
+				homePageVO.setBloodType(rs.getString("BRBAXX"));//血型
+				homePageVO.setRh(rs.getString("BRBARH"));//Rh
+				homePageVO.setDeptDirector(rs.getString("KZR"));//科主任
+				homePageVO.setDirectorDoctor(rs.getString("ZRYS"));//主任医师
+				homePageVO.setAttendingDoctor(rs.getString("ZZYS"));//主治医师
+				homePageVO.setBehospitalDoctor(rs.getString("ZYYS"));//住院医师
+				homePageVO.setResponseNurse(rs.getString("ZRHS"));//责任护士
+				homePageVO.setStudyDoctor(rs.getString("JXYS"));//进修医师
+				homePageVO.setPracticeDoctor(rs.getString("SXYS"));//实习医师
+				homePageVO.setEncodeMan(rs.getString("BMY"));//编码员
+				homePageVO.setHomePageQuality(rs.getString("BRBAZL"));//病案质量
+				homePageVO.setQcDoctor(rs.getString("BAZKYS"));//质控医师
+				homePageVO.setQcNurse(rs.getString("BAZKHS"));//质控护士
+				if(!"".equals(rs.getString("BAZKRQ"))){
+					homePageVO.setQcDate(DateUtil.parseDate(rs.getString("BAZKRQ"),DateUtil.DATE_TIME_FORMAT));//质控日期
+				}
+				homePageVO.setLeaveHospitalType(rs.getString("BRLYFS"));//离院方式
+				homePageVO.setAcceptOrgCode(rs.getString("ZYJGMC"));//接收机构名称
+				homePageVO.setAgainBehospitalPlan(rs.getString("SSYZZY"));//31天内再住院计划
+				homePageVO.setAgainBehospitalGoal(rs.getString("SSYZZYMD"));//再住院目的
+				homePageVO.setTbiBeforeDay(rs.getString("RYQHMTS"));//颅脑损伤患者昏迷前天数
+				homePageVO.setTbiBeforeHour(rs.getString("RYQHMXS"));//颅脑损伤患者昏迷前小时
+				homePageVO.setTbiBeforeMinute(rs.getString("RYQHMFZ"));//颅脑损伤患者昏迷前分钟
+				homePageVO.setTbiAfterDay(rs.getString("RYQHMFZ"));//颅脑损伤患者昏迷后天数
+				homePageVO.setTbiAfterHour(rs.getString("RYHHMXS"));//颅脑损伤患者昏迷后小时
+				homePageVO.setTbiAfterMinute(rs.getString("RYQHMFZ"));//颅脑损伤患者昏迷后分钟
+				homePageVO.setTotalFee(rs.getString("ZFY"));//总费用
+				homePageVO.setOwnFee(rs.getString("ZFJE"));//自付金额
+				homePageVO.setGeneralFee(rs.getString("YBYLFWF"));//一般医疗服务费
+				homePageVO.setServiceFee(rs.getString("YBZLCZF"));//一般治疗服务费
+				homePageVO.setNurseFee(rs.getString("HLF"));//护理费
+				//homePageVO.setOtherFee(rs.getString("QTFY"));//其他费用
+				homePageVO.setPathologyFee(rs.getString("BLZDF"));//病理诊断费
+				homePageVO.setLabFee(rs.getString("SYSZDF"));//实验室诊断费
+				homePageVO.setPacsFee(rs.getString("YXXZDF"));//影像学诊断费
+				homePageVO.setClinicDiagnoseFee(rs.getString("LCZDXMF"));//临床诊断项目费
+				homePageVO.setNotOperationFee(rs.getString("FSSZLXMF"));//非手术治疗项目费
+				homePageVO.setClinicPhysicFee(rs.getString("LCWLZLF"));//临床物理治疗费
+				homePageVO.setOperationTreatFee(rs.getString("SSZLF"));//手术治疗费
+				homePageVO.setAnaesthesiaFee(rs.getString("MZF"));//麻醉费
+				homePageVO.setOperationFee(rs.getString("SSF"));//手术费
+				homePageVO.setHealthTypeFee(rs.getString("KFF"));//康复类
+				homePageVO.setChnTreatFee(rs.getString("ZYZLF"));//中医治疗费
+				homePageVO.setWesternMedFee(rs.getString("XYF"));//西药费
+				homePageVO.setAntibiosisFee(rs.getString("KJYWF"));//抗菌药物费用
+				homePageVO.setChnMedFee(rs.getString("ZCYF"));//中成药费
+				homePageVO.setChnHerbFee(rs.getString("CYF"));//中草药费
+				homePageVO.setBloodFee(rs.getString("XF"));//血费
+				homePageVO.setAlbumenFee(rs.getString("BDBLZPF"));//白蛋白类制品费
+				homePageVO.setGlobulinFee(rs.getString("QDBLZPF"));//球蛋白类制品费
+				homePageVO.setBloodFactorFee(rs.getString("NXYZLZPF"));//凝血因子类制品费
+				homePageVO.setCellFactorFee(rs.getString("XBYZLZPF"));//细胞因子类制品费
+				homePageVO.setCheckMaterialFee(rs.getString("JCYYCXYYCLF"));//检查用一次性医用材料费
+				homePageVO.setTreatMaterialFee(rs.getString("ZLYYCXYYCLF"));//治疗用一次性医用材料费
+				homePageVO.setOperationMaterialFee(rs.getString("SSYYCXYYCLF"));//手术用一次性医用材料费
+				homePageVO.setOtherTypeFee(rs.getString("QTF"));//其他类其他费
+				homePageVO.setSingleDiagManage(rs.getString("DBZGL"));//单病种管理
+				homePageVO.setClinicPathwayManage(rs.getString("SSLCLJGL"));//临床路径管理
+				homePageVO.setIsOutpatientBehospital(rs.getString("MZZYFH"));//门诊与住院
+				homePageVO.setIsLeaveBehospital(rs.getString("RYCYFH"));//入院与出院
+				homePageVO.setIsOperationBeforeAfter(rs.getString("SQSHFH"));//术前与术后
+				homePageVO.setIsClinicPathology(rs.getString("LCBLFH"));//临床与病理
+				homePageVO.setIsRadiatePathology(rs.getString("FSBLFH"));//放射与病理
+				homePageVO.setRescueSuccessNum(rs.getString("BRQJCS"));//病人抢救次数
+				homePageVO.setRescueSuccessNum(rs.getString("QJCGCS"));//病人抢救成功次数
+				homePageVO.setIsAutoLeavehospital(rs.getString("ZDCYPB"));//是否为自动出院
+				homePageVO.setReturnToType(rs.getString("CYQKDM"));//转归情况HomePage homePageVO=new HomePage();
+				homePageVO.setHomePageId(rs.getString("BASYID"));//病案首页ID
+				homePageVO.setHospitalId(Long.valueOf("3"));//医院ID
+				homePageVO.setBehospitalCode(rs.getString("BRZYID"));//病人住院序号
+				homePageVO.setHospitalCode(rs.getString("ZZJGID"));//组织机构id
+				homePageVO.setHospitalName(rs.getString("ZZJGMC"));//医疗机构名称
+				homePageVO.setOrgCode(rs.getString("ZZJGBH"));//医疗机构代码
+				homePageVO.setPayType(rs.getString("YLFKLB"));//医疗付费方式
+				homePageVO.setHealthCard(rs.getString("BRJKKH"));//健康卡号
+				homePageVO.setBehospitalNum(rs.getString("BRZYCS"));//住院次数
+				homePageVO.setFileCode(rs.getString("BRBABH"));//病案号
+				homePageVO.setName(rs.getString("BRBAXM"));//姓名
+				homePageVO.setSex(rs.getString("BRBAXB"));//性别
+				homePageVO.setBirthday(rs.getDate("BRCSRQ"));//出生日期
+				homePageVO.setAge(rs.getString("BRDQNL"));//病人年龄
+				homePageVO.setAgeUnit(rs.getString("BRNLDW"));//年龄单位
+				homePageVO.setNationality(rs.getString("BRBAGJ"));//国籍
+				homePageVO.setNewbornMonth(rs.getString("YENLYS"));//新生儿出生月数
+				homePageVO.setNewbornDay(rs.getString("YENLTS"));//新生儿出生天数
+				homePageVO.setNewbornWeight(rs.getString("YECSTZ"));//新生儿出生体重
+				homePageVO.setNewbornBehospitalWeight(rs.getString("YERYTZ"));//新生儿入院体重
+				homePageVO.setBornAddress(rs.getString("BRCSDZ"));//出生地
+				homePageVO.setBornPlace(rs.getString("BRBAJG"));//籍贯
+				homePageVO.setNation(rs.getString("BRBAMZ"));//民族
+				homePageVO.setIdentityCardNo(rs.getString("BRSFZH"));//身份证号
+				homePageVO.setJobType(rs.getString("BRBASF"));//职业
+				homePageVO.setMarriage(rs.getString("BRHYZK"));//婚姻
+				homePageVO.setCurAddress(rs.getString("BRLXDZ"));//现住址
+				homePageVO.setCurPhone(rs.getString("BRLXDH"));//现住址电话
+				homePageVO.setCurPostCode(rs.getString("LXDZYB"));//现住址邮编
+				homePageVO.setResidenceAddress(rs.getString("BRHKDZ"));//户口地址
+				homePageVO.setResidencePostCode(rs.getString("HKDZYB"));//户口地址邮编
+				homePageVO.setWorkAddress(rs.getString("GZDWMC"));//工作单位
+				homePageVO.setWorkPhone(rs.getString("GZDWDH"));//工作单位电话
+				homePageVO.setWorkPostCode(rs.getString("GZDWYB"));//工作单位邮编
+				homePageVO.setContactName(rs.getString("LXRYXM"));//联系人姓名
+				homePageVO.setContactRelation(rs.getString("LXRYGX"));//联系人关系
+				homePageVO.setContactAddress(rs.getString("LXRYDZ"));//联系人地址
+				homePageVO.setContactPhone(rs.getString("LXRYDH"));//联系人电话
+				homePageVO.setBehospitalWay(rs.getString("RYLYDM"));//入院途径
+				homePageVO.setBehospitalDate(rs.getDate("BRRYRQ"));//入院时间
+				homePageVO.setBehospitalDept(rs.getString("RYKSID"));//入院科室
+				homePageVO.setBehospitalWard(rs.getString("RYBQID"));//入院病房
+				homePageVO.setBehospitalBedId(rs.getString("RYCWID"));//入院床位序号
+				homePageVO.setBehospitalBedCode(rs.getString("RYCWHM"));//入院床位号码
+				homePageVO.setChangeDept(rs.getString("BRZKKB"));//转科科别
+				homePageVO.setLeaveHospitalDate(rs.getDate("BRCYRQ"));//出院时间
+				homePageVO.setLeaveHospitalDept(rs.getString("CYKSID"));//出院科别
+				homePageVO.setLeaveHospitalWard(rs.getString("CYBQID"));//出院病房
+				homePageVO.setLeaveHospitalBedId(rs.getString("CYCWID"));//出院床位序号
+				homePageVO.setLeaveHospitalBedCode(rs.getString("CYCWHM"));//出院床位号码
+				homePageVO.setBehospitalDayNum(rs.getString("SJZYTS"));//实际住院天数
+				homePageVO.setOutpatientEmrDiagnose(rs.getString("BRMZZD"));//门急诊诊断
+				homePageVO.setOutpatientEmrDiagnoseCode(rs.getString("MZZDDM"));//门急诊诊断编码
+				homePageVO.setPoisonFactor(rs.getString("SSZDYSMC"));//损伤中毒因素
+				homePageVO.setPoisonFactorCode(rs.getString("SSZDYSBM"));//损伤中毒因素编码
+				homePageVO.setPathologyDiagnose(rs.getString("BLZDMC"));//病理诊断
+				homePageVO.setPathologyDiagnoseCode(rs.getString("BLZDBM"));//病理诊断编码
+				homePageVO.setPathologyDiagnoseId(rs.getString("BLZDBH"));//病理诊断编号
+				homePageVO.setIsMedAllergy(rs.getString("YWYWGM"));//药物过敏
+				homePageVO.setMedAllergyName(rs.getString("BRGMYW"));//过敏药物
+				homePageVO.setAutopsy(rs.getString("BRSFSJ"));//死亡患者尸检
+				homePageVO.setBloodType(rs.getString("BRBAXX"));//血型
+				homePageVO.setRh(rs.getString("BRBARH"));//Rh
+				homePageVO.setDeptDirector(rs.getString("KZR"));//科主任
+				homePageVO.setDirectorDoctor(rs.getString("ZRYS"));//主任医师
+				homePageVO.setAttendingDoctor(rs.getString("ZZYS"));//主治医师
+				homePageVO.setBehospitalDoctor(rs.getString("ZYYS"));//住院医师
+				homePageVO.setResponseNurse(rs.getString("ZRHS"));//责任护士
+				homePageVO.setStudyDoctor(rs.getString("JXYS"));//进修医师
+				homePageVO.setPracticeDoctor(rs.getString("SXYS"));//实习医师
+				homePageVO.setEncodeMan(rs.getString("BMY"));//编码员
+				homePageVO.setHomePageQuality(rs.getString("BRBAZL"));//病案质量
+				homePageVO.setQcDoctor(rs.getString("BAZKYS"));//质控医师
+				homePageVO.setQcNurse(rs.getString("BAZKHS"));//质控护士
+				if(!"".equals(rs.getString("BAZKRQ"))){
+					homePageVO.setQcDate(DateUtil.parseDate(rs.getString("BAZKRQ"),DateUtil.DATE_TIME_FORMAT));//质控日期
+				}
+				homePageVO.setLeaveHospitalType(rs.getString("BRLYFS"));//离院方式
+				homePageVO.setAcceptOrgCode(rs.getString("ZYJGMC"));//接收机构名称
+				homePageVO.setAgainBehospitalPlan(rs.getString("SSYZZY"));//31天内再住院计划
+				homePageVO.setAgainBehospitalGoal(rs.getString("SSYZZYMD"));//再住院目的
+				homePageVO.setTbiBeforeDay(rs.getString("RYQHMTS"));//颅脑损伤患者昏迷前天数
+				homePageVO.setTbiBeforeHour(rs.getString("RYQHMXS"));//颅脑损伤患者昏迷前小时
+				homePageVO.setTbiBeforeMinute(rs.getString("RYQHMFZ"));//颅脑损伤患者昏迷前分钟
+				homePageVO.setTbiAfterDay(rs.getString("RYQHMFZ"));//颅脑损伤患者昏迷后天数
+				homePageVO.setTbiAfterHour(rs.getString("RYHHMXS"));//颅脑损伤患者昏迷后小时
+				homePageVO.setTbiAfterMinute(rs.getString("RYQHMFZ"));//颅脑损伤患者昏迷后分钟
+				homePageVO.setTotalFee(rs.getString("ZFY"));//总费用
+				homePageVO.setOwnFee(rs.getString("ZFJE"));//自付金额
+				homePageVO.setGeneralFee(rs.getString("YBYLFWF"));//一般医疗服务费
+				homePageVO.setServiceFee(rs.getString("YBZLCZF"));//一般治疗服务费
+				homePageVO.setNurseFee(rs.getString("HLF"));//护理费
+				//homePageVO.setOtherFee(rs.getString("QTFY"));//其他费用
+				homePageVO.setPathologyFee(rs.getString("BLZDF"));//病理诊断费
+				homePageVO.setLabFee(rs.getString("SYSZDF"));//实验室诊断费
+				homePageVO.setPacsFee(rs.getString("YXXZDF"));//影像学诊断费
+				homePageVO.setClinicDiagnoseFee(rs.getString("LCZDXMF"));//临床诊断项目费
+				homePageVO.setNotOperationFee(rs.getString("FSSZLXMF"));//非手术治疗项目费
+				homePageVO.setClinicPhysicFee(rs.getString("LCWLZLF"));//临床物理治疗费
+				homePageVO.setOperationTreatFee(rs.getString("SSZLF"));//手术治疗费
+				homePageVO.setAnaesthesiaFee(rs.getString("MZF"));//麻醉费
+				homePageVO.setOperationFee(rs.getString("SSF"));//手术费
+				homePageVO.setHealthTypeFee(rs.getString("KFF"));//康复类
+				homePageVO.setChnTreatFee(rs.getString("ZYZLF"));//中医治疗费
+				homePageVO.setWesternMedFee(rs.getString("XYF"));//西药费
+				homePageVO.setAntibiosisFee(rs.getString("KJYWF"));//抗菌药物费用
+				homePageVO.setChnMedFee(rs.getString("ZCYF"));//中成药费
+				homePageVO.setChnHerbFee(rs.getString("CYF"));//中草药费
+				homePageVO.setBloodFee(rs.getString("XF"));//血费
+				homePageVO.setAlbumenFee(rs.getString("BDBLZPF"));//白蛋白类制品费
+				homePageVO.setGlobulinFee(rs.getString("QDBLZPF"));//球蛋白类制品费
+				homePageVO.setBloodFactorFee(rs.getString("NXYZLZPF"));//凝血因子类制品费
+				homePageVO.setCellFactorFee(rs.getString("XBYZLZPF"));//细胞因子类制品费
+				homePageVO.setCheckMaterialFee(rs.getString("JCYYCXYYCLF"));//检查用一次性医用材料费
+				homePageVO.setTreatMaterialFee(rs.getString("ZLYYCXYYCLF"));//治疗用一次性医用材料费
+				homePageVO.setOperationMaterialFee(rs.getString("SSYYCXYYCLF"));//手术用一次性医用材料费
+				homePageVO.setOtherTypeFee(rs.getString("QTF"));//其他类其他费
+				homePageVO.setSingleDiagManage(rs.getString("DBZGL"));//单病种管理
+				homePageVO.setClinicPathwayManage(rs.getString("SSLCLJGL"));//临床路径管理
+				homePageVO.setIsOutpatientBehospital(rs.getString("MZZYFH"));//门诊与住院
+				homePageVO.setIsLeaveBehospital(rs.getString("RYCYFH"));//入院与出院
+				homePageVO.setIsOperationBeforeAfter(rs.getString("SQSHFH"));//术前与术后
+				homePageVO.setIsClinicPathology(rs.getString("LCBLFH"));//临床与病理
+				homePageVO.setIsRadiatePathology(rs.getString("FSBLFH"));//放射与病理
+				homePageVO.setRescueSuccessNum(rs.getString("BRQJCS"));//病人抢救次数
+				homePageVO.setRescueSuccessNum(rs.getString("QJCGCS"));//病人抢救成功次数
+				homePageVO.setIsAutoLeavehospital(rs.getString("ZDCYPB"));//是否为自动出院
+				homePageVO.setReturnToType(rs.getString("CYQKDM"));//转归情况
+
+				homePageList.add(homePageVO);
+				
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+		return homePageList;
+	}
+	
+	/**
+	 * 获取病历信息
+	 * @return
+	 */
+	public List<BehospitalInfo> getBehospitalInfo(String sql) {
+		List<BehospitalInfo> behospitalInfoList=Lists.newLinkedList();
+		try {
+			TZDBConn dbconn=new TZDBConn();
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				BehospitalInfo behospitalInfo=new BehospitalInfo();
+				behospitalInfo.setBehospitalCode(rs.getString("BRZYID"));//病人住院ID
+				behospitalInfo.setHospitalId(HOSPITAL_ID);//医院ID
+				behospitalInfo.setName(rs.getString("BRDAXM"));//姓名
+				behospitalInfo.setSex(rs.getString("BRDAXB").equals("M")?"男":"女");//性别
+				behospitalInfo.setBirthday(rs.getDate("BRCSRQ"));//出生日期
+				behospitalInfo.setFileCode(rs.getString("BRDABH"));//档案号
+				behospitalInfo.setWardCode(rs.getString("ZYBQID"));//病区编码
+				behospitalInfo.setWardName(rs.getString("ZYBQMC"));//病区名称
+				behospitalInfo.setBehDeptId(rs.getString("ZYKSID"));//住院科室ID
+				behospitalInfo.setBehDeptName(rs.getString("ZYKSMC"));//住院科室名称
+				behospitalInfo.setBedCode(rs.getString("ZYCWID"));//床位号
+				behospitalInfo.setBedName(rs.getString("ZYCWHM"));//床位名称
+				behospitalInfo.setInsuranceName(rs.getString("BRLBID"));//医保类别
+				behospitalInfo.setJobType(rs.getString("BRXZID"));//职业
+				behospitalInfo.setBehospitalDate(rs.getDate("BRRYRQ"));//入院时间
+				behospitalInfo.setLeaveHospitalDate(rs.getDate("BRCYRQ"));//出院时间
+				behospitalInfo.setDiagnoseIcd(rs.getString("JBDMID"));//疾病ICD编码
+				behospitalInfo.setDiagnose(rs.getString("JBMSXX"));//疾病名称
+				behospitalInfo.setDoctorId(rs.getString("ZZYSID"));//医生ID
+				behospitalInfo.setDoctorName(rs.getString("ZZYSXM"));//医生姓名
+				
+				behospitalInfoList.add(behospitalInfo);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+		
+		return behospitalInfoList;
+	}
+	
+	/**
+	 * 从视图中获取医嘱信息
+	 * @return
+	 */
+	public List<DoctorAdvice> getDoctorAdvice(String sql){
+		List<DoctorAdvice> doctorAdviceList=Lists.newLinkedList();
+		try {
+			TZDBConn dbconn=new TZDBConn();
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				DoctorAdvice doctorAdviceVO=new DoctorAdvice();
+				doctorAdviceVO.setDoctorAdviceId(rs.getString("BRYZID"));//病人医嘱ID
+				doctorAdviceVO.setHospitalId(HOSPITAL_ID);//医院ID
+				doctorAdviceVO.setBehospitalCode(rs.getString("BRZYID"));//病人ID
+				doctorAdviceVO.setOrderDoctorName(rs.getString("YSKDPB"));//医生开单判别
+				doctorAdviceVO.setFrequency(rs.getString("YZPLPB"));//医嘱频率判别
+				doctorAdviceVO.setParentTypeId(rs.getString("FLYZID"));//父类医嘱ID
+				doctorAdviceVO.setDoctorAdviceType(rs.getString("YZLXPB"));//医嘱类型判别
+				doctorAdviceVO.setUsageNum(rs.getString("YCSYSL"));//一次使用数量
+				doctorAdviceVO.setUsageUnit(rs.getString("YCYLDW"));//一次用量单位
+				doctorAdviceVO.setDose(rs.getString("YZDCJL"));//医嘱单次剂量
+				doctorAdviceVO.setDoseUnit(rs.getString("DCJLDW"));//单次剂量单位
+				doctorAdviceVO.setMedModeType(rs.getString("GYFSID"));//给药方式
+				doctorAdviceVO.setDaFrequency(rs.getString("YZPLID"));//医嘱频率
+				doctorAdviceVO.setDaDealType(rs.getString("YZCLLX"));//医嘱处理类型
+				doctorAdviceVO.setDaStartDate(rs.getDate("YZKSSJ"));//医嘱开始时间
+				doctorAdviceVO.setDaItemName(rs.getString("YZXMMC"));//医嘱项目名称
+				doctorAdviceVO.setDaStatus(rs.getString("YZZTPB"));//医嘱状态判别
+				doctorAdviceVO.setDaStopDate(rs.getDate("YZJSSJ"));//医嘱结束时间
+				doctorAdviceVO.setDaGroupNo(rs.getString("YZTZXH"));//医嘱同组序号
+				doctorAdviceVO.setDaPrescriptionType(rs.getString("YZCFLX"));//医嘱处方类型
+				doctorAdviceVO.setDaMedType(rs.getString("YZLYLX"));//医嘱领药类型
+				doctorAdviceVO.setDoctorNotice(rs.getString("YSZTSM"));//医生嘱托
+				doctorAdviceVO.setDoctorId(rs.getString("KDYSID"));//开单医生ID
+				doctorAdviceVO.setDoctorName(rs.getString("KDYSMC"));//开单医生姓名
+
+				doctorAdviceList.add(doctorAdviceVO);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+		return doctorAdviceList;
+	}
+
+	/**
+	 * 从视图中获取病历记录
+	 * @return
+	 */
+	public List<MedicalRecord> getMedicalRecord(String sql){
+		List<MedicalRecord> medicalRecordList=Lists.newLinkedList();
+		try {
+			TZDBConn dbconn=new TZDBConn();
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				MedicalRecord medicalRecord=new MedicalRecord();
+				medicalRecord.setRecId(rs.getString("BLJLID"));
+				medicalRecord.setHospitalId(HOSPITAL_ID);//医院ID
+				medicalRecord.setBehospitalCode(rs.getString("BRZYID"));//病人住院ID
+				medicalRecord.setOrgCode(rs.getString("ZZJGDM"));//组织机构代码
+				medicalRecord.setRecTypeId(rs.getString("BLMBID"));//对应his模板ID
+
+				medicalRecord.setRecDate(rs.getString("BCJLSJ")!=null?DateUtil.parseDateTime(rs.getString("BCJLSJ")):null);//病历日期
+				medicalRecord.setRecTitle(rs.getString("BLJLMC"));//病历标题
+				medicalRecord.setModeId(Long.valueOf(rs.getString("BLLBID")));//对应his类别ID
+				
+				medicalRecordList.add(medicalRecord);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+		
+		return medicalRecordList;
+	}
+	
+	/**
+	 * 从视图中获取文书内容
+	 * @return
+	 */
+	public List<MedicalRecordContent> getMedicalRecordContent(String sql){
+		List<MedicalRecordContent> mrContentList=Lists.newLinkedList();
+		try {
+			TZDBConn dbconn=new TZDBConn();
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				MedicalRecordContent mrContent=new MedicalRecordContent();
+				mrContent.setHospitalId(HOSPITAL_ID);
+				mrContent.setRecId(rs.getString("BLJLID"));
+				//mrContent.setHtmlText(rs.getString("HTMLSJ"));
+				mrContent.setXmlText(rs.getString("BLJLNR"));
+
+				mrContentList.add(mrContent);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+		return mrContentList;
+	}
+	
+	/**
+	 * 从视图中获取文书类型
+	 * @return
+	 */
+	public List<MedRecordType> getMedicalRecordType(String sql){
+		List<MedRecordType> mrTypeList=Lists.newLinkedList();
+		try {
+			TZDBConn dbconn=new TZDBConn();
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				MedRecordType mrType=new MedRecordType();
+				mrType.setTypeId(rs.getString("BLLBID"));
+				mrType.setHospitalId(HOSPITAL_ID);
+				mrType.setTypeName(rs.getString("BLLBMC"));
+				mrType.setParentTypeId(rs.getString("SJLBID"));
+				mrType.setObjName(rs.getString("BLLBFW"));
+				mrType.setSpell(rs.getString("HZSRM1"));
+				mrTypeList.add(mrType);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally {
+			close();
+		}
+
+		return mrTypeList;
+	}
+	
+}

+ 44 - 0
src/main/java/com/diagbot/vo/data/ABasDeptInfoVO.java

@@ -0,0 +1,44 @@
+package com.diagbot.vo.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.time.LocalDateTime;
+
+@Getter
+@Setter
+public class ABasDeptInfoVO {
+    /**
+     * 科室编码(HIS导入)
+     */
+    private String deptId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    private String parentDeptId;
+
+    /**
+     * 科室名称
+     */
+    private String deptName;
+
+    /**
+     * 科室类别
+     */
+    private String deptType;
+
+    /**
+     * 首字母拼音
+     */
+    private String spell;
+
+    /**
+     * 区域类别(门诊、工作站、住院等)
+     */
+    private String station;
+
+
+}

+ 38 - 0
src/main/java/com/diagbot/vo/data/ABasDoctorInfoVO.java

@@ -0,0 +1,38 @@
+package com.diagbot.vo.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class ABasDoctorInfoVO {
+    /**
+     * HIS导入的医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院导入科室ID
+     */
+    private String deptId;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 职称
+     */
+    private String professor;
+    /**
+     * 职业医师资格
+     */
+    private String occup;
+
+}

+ 134 - 0
src/main/java/com/diagbot/vo/data/ABehospitalInfoVO.java

@@ -0,0 +1,134 @@
+package com.diagbot.vo.data;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class ABehospitalInfoVO {
+    /**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 性别(男,女)
+     */
+    private String sex;
+
+    /**
+     * 出生日期
+     */
+    private String birthday;
+
+    /**
+     * 档案号
+     */
+    private String fileCode;
+
+    /**
+     * 质控类型
+     */
+    private Long qcTypeId;
+
+    /**
+     * 病区编码
+     */
+    private String wardCode;
+
+    /**
+     * 病区名称
+     */
+    private String wardName;
+
+    /**
+     * 住院科室ID
+     */
+    private String behDeptId;
+
+    /**
+     * 住院科室名称
+     */
+    private String behDeptName;
+
+    /**
+     * 床位号
+     */
+    private String bedCode;
+
+    /**
+     * 床位名称
+     */
+    private String bedName;
+
+    /**
+     * 医保类别
+     */
+    private String insuranceName;
+
+    /**
+     * 职业
+     */
+    private String jobType;
+
+    /**
+     * 入院时间
+     */
+    private String behospitalDate;
+
+    /**
+     * 出院时间
+     */
+    private String leaveHospitalDate;
+
+    /**
+     * 疾病ICD编码
+     */
+    private String diagnoseIcd;
+
+    /**
+     * 疾病名称
+     */
+    private String diagnose;
+
+    /**
+     * 住院医生ID
+     */
+    private String behDoctorId;
+
+    /**
+     * 住院医生姓名
+     */
+    private String behDoctorName;
+
+    /**
+     * 主治医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 主治医生姓名
+     */
+    private String doctorName;
+
+    /**
+     * 主任医生ID
+     */
+    private String directorDoctorId;
+
+    /**
+     * 主任医生姓名
+     */
+    private String directorDoctorName;
+
+}

+ 128 - 0
src/main/java/com/diagbot/vo/data/ADoctorAdviceVO.java

@@ -0,0 +1,128 @@
+package com.diagbot.vo.data;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class ADoctorAdviceVO {
+    /**
+     * 病人医嘱ID
+     */
+    private String doctorAdviceId;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 医生开单判别
+     */
+    private String orderDoctorName;
+
+    /**
+     * 医嘱频率判别
+     */
+    private String frequency;
+
+    /**
+     * 父类医嘱ID
+     */
+    private String parentTypeId;
+
+    /**
+     * 医嘱类型判别(嘱托长嘱、长期医嘱等)
+     */
+    private String doctorAdviceType;
+
+    /**
+     * 一次使用数量
+     */
+    private String usageNum;
+
+    /**
+     * 一次用量单位
+     */
+    private String usageUnit;
+
+    /**
+     * 医嘱单次剂量
+     */
+    private String dose;
+
+    /**
+     * 单次剂量单位
+     */
+    private String doseUnit;
+
+    /**
+     * 给药方式
+     */
+    private String medModeType;
+
+    /**
+     * 医嘱频率
+     */
+    private String daFrequency;
+
+    /**
+     * 医嘱处理类型
+     */
+    private String daDealType;
+
+    /**
+     * 医嘱开始时间
+     */
+    private String daStartDate;
+
+    /**
+     * 医嘱项目名称
+     */
+    private String daItemName;
+
+    /**
+     * 医嘱状态判别
+     */
+    private String daStatus;
+
+    /**
+     * 医嘱结束时间
+     */
+    private String daStopDate;
+
+    /**
+     * 医嘱同组序号
+     */
+    private String daGroupNo;
+
+    /**
+     * 医嘱处方类型(检验、描述医嘱、膳食、西药、护理等)
+     */
+    private String daPrescriptionType;
+
+    /**
+     * 医嘱领药类型
+     */
+    private String daMedType;
+
+    /**
+     * 医生嘱托
+     */
+    private String doctorNotice;
+
+    /**
+     * 开单医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 开单医生姓名
+     */
+    private String doctorName;
+}

+ 41 - 0
src/main/java/com/diagbot/vo/data/AHomeDiagnoseVO.java

@@ -0,0 +1,41 @@
+package com.diagbot.vo.data;
+
+import lombok.Data;
+
+@Data
+public class AHomeDiagnoseVO {
+    /**
+     * 病案首页ID
+     */
+    private String homePageId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 诊断序号
+     */
+    private String diagnoseOrderNo;
+
+    /**
+     * 诊断类别(主要诊断、其他诊断)
+     */
+    private String diagnoseType;
+
+    /**
+     * 诊断判别(主、次)
+     */
+    private String diagnoseTypeShort;
+
+    private String diagnoseName;
+
+    private String behospitalType;
+
+    private String leaveHospitalType;
+
+    private String pathologyDiagnose;
+
+    private String icdCode;
+}

+ 76 - 0
src/main/java/com/diagbot/vo/data/AHomeOperationVO.java

@@ -0,0 +1,76 @@
+package com.diagbot.vo.data;
+
+import lombok.Data;
+
+@Data
+public class AHomeOperationVO {
+    /**
+     * 病案首页ID
+     */
+    private String homePageId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 手术序号
+     */
+    private String operationOrderNo;
+
+    /**
+     * 手术日期
+     */
+    private String operationDate;
+
+    /**
+     * 手术编码
+     */
+    private String operationCode;
+
+    /**
+     * 手术医生ID
+     */
+    private String operationDoctorId;
+
+    /**
+     * 一助医生ID
+     */
+    private String firstAssistantId;
+
+    /**
+     * 二助医生ID
+     */
+    private String secondAssistantId;
+
+    /**
+     * 切口等级
+     */
+    private String cutLevel;
+
+    /**
+     * 愈合等级
+     */
+    private String healingLevel;
+
+    /**
+     * 手术名称
+     */
+    private String operationName;
+
+    /**
+     * 手术级别
+     */
+    private String operationLevel;
+
+    /**
+     * 麻醉方式(全麻、局麻、静脉麻醉)
+     */
+    private String anaesthesiaName;
+
+    /**
+     * 拟手术名称
+     */
+    private String shamOperationName;
+}

+ 17 - 0
src/main/java/com/diagbot/vo/data/AHomePageIngVO.java

@@ -0,0 +1,17 @@
+package com.diagbot.vo.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import java.util.List;
+
+@Getter
+@Setter
+public class AHomePageIngVO {
+
+    @NotBlank(message = "对接模式类型编码不能为空")
+    private String dockModeType;//对接模式类型编码,1:页面模式,2:接口引擎模式
+
+    private List<AHomePageVO> homePages;
+}

+ 650 - 0
src/main/java/com/diagbot/vo/data/AHomePageVO.java

@@ -0,0 +1,650 @@
+package com.diagbot.vo.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+@Getter
+@Setter
+public class AHomePageVO {
+    /**
+     * 病案首页编号
+     */
+    private String homePageId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人住院序号
+     */
+    private String behospitalCode;
+
+    /**
+     * 组织机构id
+     */
+    private String hospitalCode;
+
+    /**
+     * 医疗机构名称
+     */
+    private String hospitalName;
+
+    /**
+     * 医疗机构代码
+     */
+    private String orgCode;
+
+    /**
+     * 医疗付费方式
+     */
+    private String payType;
+
+    /**
+     * 健康卡号
+     */
+    private String healthCard;
+
+    /**
+     * 住院次数
+     */
+    private String behospitalNum;
+
+    /**
+     * 病案号
+     */
+    private String fileCode;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 性别
+     */
+    private String sex;
+
+    /**
+     * 出生日期
+     */
+    private String birthday;
+
+    /**
+     * 年龄
+     */
+    private String age;
+
+    /**
+     * 年龄单位
+     */
+    private String ageUnit;
+
+    /**
+     * 国籍
+     */
+    private String nationality;
+
+    /**
+     * 新生儿出生月数
+     */
+    private String newbornMonth;
+
+    /**
+     * 新生儿出生天数
+     */
+    private String newbornDay;
+
+    /**
+     * 新生儿出生体重
+     */
+    private String newbornWeight;
+
+    /**
+     * 新生儿入院体重
+     */
+    private String newbornBehospitalWeight;
+
+    /**
+     * 出生地
+     */
+    private String bornAddress;
+
+    /**
+     * 籍贯
+     */
+    private String bornPlace;
+
+    /**
+     * 民族
+     */
+    private String nation;
+
+    /**
+     * 身份证号
+     */
+    private String identityCardNo;
+
+    /**
+     * 职业
+     */
+    private String jobType;
+
+    /**
+     * 婚姻
+     */
+    private String marriage;
+
+    /**
+     * 现住址
+     */
+    private String curAddress;
+
+    /**
+     * 现住址电话
+     */
+    private String curPhone;
+
+    /**
+     * 现住址邮编
+     */
+    private String curPostCode;
+
+    /**
+     * 户口地址
+     */
+    private String residenceAddress;
+
+    /**
+     * 户口地址邮编
+     */
+    private String residencePostCode;
+
+    /**
+     * 工作单位
+     */
+    private String workAddress;
+
+    /**
+     * 工作单位电话
+     */
+    private String workPhone;
+
+    /**
+     * 工作单位邮编
+     */
+    private String workPostCode;
+
+    /**
+     * 联系人姓名
+     */
+    private String contactName;
+
+    /**
+     * 联系人关系
+     */
+    private String contactRelation;
+
+    /**
+     * 联系人地址
+     */
+    private String contactAddress;
+
+    /**
+     * 联系人电话
+     */
+    private String contactPhone;
+
+    /**
+     * 入院途径
+     */
+    private String behospitalWay;
+
+    /**
+     * 入院时间
+     */
+    private String behospitalDate;
+
+    /**
+     * 入院科别
+     */
+    private String behospitalDept;
+
+    /**
+     * 入院病房
+     */
+    private String behospitalWard;
+
+    /**
+     * 入院床位序号
+     */
+    private String behospitalBedId;
+
+    /**
+     * 入院床位号码
+     */
+    private String behospitalBedCode;
+
+    /**
+     * 转科科别
+     */
+    private String changeDept;
+
+    /**
+     * 出院时间
+     */
+    private String leaveHospitalDate;
+
+    /**
+     * 出院科别
+     */
+    private String leaveHospitalDept;
+
+    /**
+     * 出院病房
+     */
+    private String leaveHospitalWard;
+
+    /**
+     * 出院床位序号
+     */
+    private String leaveHospitalBedId;
+
+    /**
+     * 出院床位号码
+     */
+    private String leaveHospitalBedCode;
+
+    /**
+     * 实际住院天数
+     */
+    private String behospitalDayNum;
+
+    /**
+     * 门急诊诊断
+     */
+    private String outpatientEmrDiagnose;
+
+    /**
+     * 门急诊诊断编码
+     */
+    private String outpatientEmrDiagnoseCode;
+
+    /**
+     * 损伤中毒因素
+     */
+    private String poisonFactor;
+
+    /**
+     * 损伤中毒因素编码
+     */
+    private String poisonFactorCode;
+
+    /**
+     * 病理诊断
+     */
+    private String pathologyDiagnose;
+
+    /**
+     * 病理诊断编码
+     */
+    private String pathologyDiagnoseCode;
+
+    /**
+     * 病理诊断编号
+     */
+    private String pathologyDiagnoseId;
+
+    /**
+     * 药物过敏
+     */
+    private String isMedAllergy;
+
+    /**
+     * 过敏药物
+     */
+    private String medAllergyName;
+
+    /**
+     * 死亡患者尸检
+     */
+    private String autopsy;
+
+    /**
+     * 血型
+     */
+    private String bloodType;
+
+    /**
+     * Rh
+     */
+    private String rh;
+
+    /**
+     * 科主任
+     */
+    private String deptDirector;
+
+    /**
+     * 主任医师
+     */
+    private String directorDoctor;
+
+    /**
+     * 主治医师
+     */
+    private String attendingDoctor;
+
+    /**
+     * 住院医师
+     */
+    private String behospitalDoctor;
+
+    /**
+     * 责任护士
+     */
+    private String responseNurse;
+
+    /**
+     * 进修医师
+     */
+    private String studyDoctor;
+
+    /**
+     * 实习医师
+     */
+    private String practiceDoctor;
+
+    /**
+     * 编码员
+     */
+    private String encodeMan;
+
+    /**
+     * 病案质量
+     */
+    private String homePageQuality;
+
+    /**
+     * 质控医师
+     */
+    private String qcDoctor;
+
+    /**
+     * 质控护士
+     */
+    private String qcNurse;
+
+    /**
+     * 质控日期
+     */
+    private String qcDate;
+
+    /**
+     * 离院方式
+     */
+    private String leaveHospitalType;
+
+    /**
+     * 接收机构名称
+     */
+    private String acceptOrgCode;
+
+    /**
+     * 31天内再住院计划
+     */
+    private String againBehospitalPlan;
+
+    /**
+     * 再住院目的
+     */
+    private String againBehospitalGoal;
+
+    /**
+     * 颅脑损伤患者昏迷前天数
+     */
+    private String tbiBeforeDay;
+
+    /**
+     * 颅脑损伤患者昏迷前小时
+     */
+    private String tbiBeforeHour;
+
+    /**
+     * 颅脑损伤患者昏迷前分钟
+     */
+    private String tbiBeforeMinute;
+
+    /**
+     * 颅脑损伤患者昏迷后天数
+     */
+    private String tbiAfterDay;
+
+    /**
+     * 颅脑损伤患者昏迷后小时
+     */
+    private String tbiAfterHour;
+
+    /**
+     * 颅脑损伤患者昏迷后分钟
+     */
+    private String tbiAfterMinute;
+
+    /**
+     * 总费用
+     */
+    private String totalFee;
+
+    /**
+     * 自付金额
+     */
+    private String ownFee;
+
+    /**
+     * 一般医疗服务费
+     */
+    private String generalFee;
+
+    /**
+     * 一般治疗服务费
+     */
+    private String serviceFee;
+
+    /**
+     * 护理费
+     */
+    private String nurseFee;
+
+    /**
+     * 其他费用
+     */
+    private String otherFee;
+
+    /**
+     * 病理诊断费
+     */
+    private String pathologyFee;
+
+    /**
+     * 实验室诊断费
+     */
+    private String labFee;
+
+    /**
+     * 影像学诊断费
+     */
+    private String pacsFee;
+
+    /**
+     * 临床诊断项目费
+     */
+    private String clinicDiagnoseFee;
+
+    /**
+     * 非手术治疗项目费
+     */
+    private String notOperationFee;
+
+    /**
+     * 临床物理治疗费
+     */
+    private String clinicPhysicFee;
+
+    /**
+     * 手术治疗费
+     */
+    private String operationTreatFee;
+
+    /**
+     * 麻醉费
+     */
+    private String anaesthesiaFee;
+
+    /**
+     * 手术费
+     */
+    private String operationFee;
+
+    /**
+     * 康复类
+     */
+    private String healthTypeFee;
+
+    /**
+     * 中医治疗费
+     */
+    private String chnTreatFee;
+
+    /**
+     * 西药费
+     */
+    private String westernMedFee;
+
+    /**
+     * 抗菌药物费用
+     */
+    private String antibiosisFee;
+
+    /**
+     * 中成药费
+     */
+    private String chnMedFee;
+
+    /**
+     * 中草药费
+     */
+    private String chnHerbFee;
+
+    /**
+     * 血费
+     */
+    private String bloodFee;
+
+    /**
+     * 白蛋白类制品费
+     */
+    private String albumenFee;
+
+    /**
+     * 球蛋白类制品费
+     */
+    private String globulinFee;
+
+    /**
+     * 凝血因子类制品费
+     */
+    private String bloodFactorFee;
+
+    /**
+     * 细胞因子类制品费
+     */
+    private String cellFactorFee;
+
+    /**
+     * 检查用一次性医用材料费
+     */
+    private String checkMaterialFee;
+
+    /**
+     * 治疗用一次性医用材料费
+     */
+    private String treatMaterialFee;
+
+    /**
+     * 手术用一次性医用材料费
+     */
+    private String operationMaterialFee;
+
+    /**
+     * 其他类其他费
+     */
+    private String otherTypeFee;
+
+    /**
+     * 单病种管理
+     */
+    private String singleDiagManage;
+
+    /**
+     * 临床路径管理
+     */
+    private String clinicPathwayManage;
+
+    /**
+     * 门诊与住院
+     */
+    private String isOutpatientBehospital;
+
+    /**
+     * 入院与出院
+     */
+    private String isLeaveBehospital;
+
+    /**
+     * 术前与术后
+     */
+    private String isOperationBeforeAfter;
+
+    /**
+     * 临床与病理
+     */
+    private String isClinicPathology;
+
+    /**
+     * 放射与病理
+     */
+    private String isRadiatePathology;
+
+    /**
+     * 病人抢救次数
+     */
+    private String rescueNum;
+
+    /**
+     * 病人抢救成功次数
+     */
+    private String rescueSuccessNum;
+
+    /**
+     * 是否为自动出院
+     */
+    private String isAutoLeavehospital;
+
+    /**
+     * 转归情况
+     */
+    private String returnToType;
+
+    /**
+     * 出院诊断
+     */
+    private List<AHomeDiagnoseVO> leaveDiags;
+
+    /**
+     * 手术情况
+     */
+    private List<AHomeOperationVO> operations;
+}

+ 93 - 0
src/main/java/com/diagbot/vo/data/AMedCrisisVO.java

@@ -0,0 +1,93 @@
+package com.diagbot.vo.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+@Getter
+@Setter
+public class AMedCrisisVO {
+    private String recId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 记录类型
+     */
+    private String recType;
+
+    /**
+     * 危急值ID
+     */
+    private String crisisId;
+
+    /**
+     * 危急值名称
+     */
+    private String crisisName;
+
+    /**
+     * 开单科室ID
+     */
+    private String deptId;
+
+    /**
+     * 开单科室名称
+     */
+    private String deptName;
+
+    /**
+     * 开单医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 开单医生姓名
+     */
+    private String doctorName;
+
+    /**
+     * 危急结果值
+     */
+    private String crisisValue;
+
+    /**
+     * 危急值描述
+     */
+    private String crisisDesc;
+
+    /**
+     * 危急值状态
+     */
+    private String crisisStatus;
+
+    /**
+     * 参考上限
+     */
+    private String crisisTopValue;
+
+    /**
+     * 参考下限
+     */
+    private String crisisLowerValue;
+
+    /**
+     * 送检时间
+     */
+    private String sendDate;
+
+    /**
+     * 报告时间
+     */
+    private String repDate;
+
+}

+ 37 - 0
src/main/java/com/diagbot/vo/data/AMedicalRecordContentVO.java

@@ -0,0 +1,37 @@
+package com.diagbot.vo.data;
+
+import java.sql.Blob;
+import lombok.Data;
+
+@Data
+public class AMedicalRecordContentVO {
+    /**
+     * 病历ID
+     */
+    private String recId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 文书内容(blob)
+     */
+    private Blob contentBlob;
+
+    /**
+     * 病历文本(文本)
+     */
+    private String contentText;
+
+    /**
+     * html文本信息
+     */
+    private String htmlText;
+
+    /**
+     * xml文本信息
+     */
+    private String xmlText;
+}

+ 36 - 0
src/main/java/com/diagbot/vo/data/AMedicalRecordTypeVO.java

@@ -0,0 +1,36 @@
+package com.diagbot.vo.data;
+
+import lombok.Data;
+
+@Data
+public class AMedicalRecordTypeVO {
+	/**
+     * 类别ID
+     */
+    private String typeId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 类别名称
+     */
+    private String typeName;
+
+    /**
+     * 上级类别
+     */
+    private String parentTypeId;
+
+    /**
+     * 服务对象(全院、科室、个人)
+     */
+    private String objName;
+
+    /**
+     * 拼音
+     */
+    private String spell;
+}

+ 48 - 0
src/main/java/com/diagbot/vo/data/AMedicalRecordVO.java

@@ -0,0 +1,48 @@
+package com.diagbot.vo.data;
+
+import java.util.List;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class AMedicalRecordVO {
+
+	private String recId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 组织机构代码
+     */
+    private String orgCode;
+
+    /**
+     * 病历类别编号
+     */
+    private String recTypeId;
+
+    /**
+     * 病历日期
+     */
+    private String recDate;
+
+    /**
+     * 病历标题
+     */
+    private String recTitle;
+
+    /**
+     * 病历内容
+     */
+    private List<AMedicalRecordContentVO> contents;
+}

+ 16 - 0
src/main/java/com/diagbot/vo/data/AMrContentVO.java

@@ -0,0 +1,16 @@
+package com.diagbot.vo.data;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import java.util.List;
+
+@Getter
+@Setter
+public class AMrContentVO {
+    @NotBlank(message = "对接模式类型编码不能为空")
+    private String dockModeType;//对接模式类型编码,1:页面模式,2:接口引擎模式
+
+    private List<AMedicalRecordVO> records;
+}

+ 151 - 0
src/main/java/com/diagbot/web/DataController.java

@@ -0,0 +1,151 @@
+package com.diagbot.web;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.data.*;
+import com.diagbot.facade.data.*;
+import com.diagbot.vo.data.*;
+import io.swagger.annotations.ApiOperation;
+import jdk.nashorn.internal.ir.annotations.Ignore;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+import io.swagger.annotations.Api;
+
+import javax.validation.Valid;
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/qc/data")
+@Api(value = "对接接口API", tags = { "对接接口API" })
+public class DataController {
+
+    @Autowired
+    private ABasDoctorInfoFacade aBasDoctorInfoFacade;
+
+    @Autowired
+    private ABasDeptInfoFacade aBasDeptInfoFacade;
+
+    @Autowired
+    private AMedRecordTypeFacade aMedRecordTypeFacade;
+
+    @Autowired
+    private ABehospitalInfoFacade aBehospitalInfoFacade;
+
+    @Autowired
+    private ADoctorAdviceFacade aDoctorAdviceFacade;
+
+    @Autowired
+    private AHomePageFacade aHomePageFacade;
+
+    @Autowired
+    private AHomeDiagnoseInfoFacade aHomeDiagnoseInfoFacade;
+
+    @Autowired
+    private AHomeOperationInfoFacade aHomeOperationInfoFacade;
+
+    @Autowired
+    private AMedCrisisFacade aMedCrisisFacade;
+
+    @Autowired
+    private AMedicalRecordFacade aMedicalRecordFacade;
+
+    @Autowired
+    private AMedicalRecordContentFacade aMedicalRecordContentFacade;
+
+    @ApiOperation(value = "数据引擎-获取医院所有在职医生的基本信息")
+    @PostMapping("/sendDoctorInfos")
+    @SysLogger("sendDoctorInfos")
+    public RespDTO<List<ABasDoctorInfoDTO>> sendDoctorInfos(@RequestBody List<ABasDoctorInfoVO> list){
+        return aBasDoctorInfoFacade.executeDoctor(list);
+    }
+
+    @ApiOperation(value = "数据引擎-获取医院所有有效科室的基本信息")
+    @PostMapping("/sendDeptInfos")
+    @SysLogger("sendDeptInfos")
+    public RespDTO<List<ABasDeptInfoDTO>> sendDeptInfos(@RequestBody List<ABasDeptInfoVO> list){
+        return aBasDeptInfoFacade.executeDept(list);
+    }
+
+    @ApiOperation(value = "数据引擎-获取医院所有文书模板基本信息")
+    @PostMapping("/sendRecordTypes")
+    @SysLogger("sendRecordTypes")
+    public RespDTO<List<AMedicalRecordTypeDTO>> sendRecordTypes(@RequestBody List<AMedicalRecordTypeVO> list){
+        return aMedRecordTypeFacade.executeMRType(list);
+    }
+
+    @ApiOperation(value = "运行质控-评分-文书信息")
+    @PostMapping("/sendMrRecordIng")
+    @SysLogger("sendMrRecordIng")
+    public RespDTO<Map<String, Object>> sendMrRecordIng(@Valid @RequestBody AMrContentVO aMrContentVO){
+        return aMedicalRecordFacade.executeMrRecordIng(aMrContentVO);
+    }
+
+    @ApiOperation(value = "终末质控-文书信息")
+    @PostMapping("/sendMrRecord")
+    @SysLogger("sendMrRecord")
+    public RespDTO<List<AMedicalRecordDTO>> sendMrRecord(@RequestBody List<AMedicalRecordVO> list){
+        return aMedicalRecordFacade.executeMrRecord(list);
+    }
+
+    @ApiOperation(value = "终末质控-文书详情")
+    @PostMapping("/sendMrContent")
+    @SysLogger("sendMrContent")
+    public RespDTO<List<AMedicalRecordContentDTO>> sendMrContent(@RequestBody List<AMedicalRecordContentVO> list){
+        return aMedicalRecordContentFacade.executeMrRecordContent(list);
+    }
+
+    @ApiOperation(value = "数据引擎-获取医院病人住院记录信息")
+    @PostMapping("/sendPatientInfo")
+    @SysLogger("sendPatientInfo")
+    public RespDTO<List<ABehospitalInfoDTO>> sendPatientInfo(@RequestBody List<ABehospitalInfoVO> list){
+        return aBehospitalInfoFacade.executeBehospital(list);
+    }
+
+    @ApiOperation(value = "数据引擎-获取医院医生医嘱信息")
+    @PostMapping("/sendDoctorAdvice")
+    @SysLogger("sendDoctorAdvice")
+    public RespDTO<List<ADoctorAdviceDTO>> sendDoctorAdvice(@RequestBody List<ADoctorAdviceVO> list){
+        return aDoctorAdviceFacade.executeDoctorAdvice(list);
+    }
+
+    @ApiOperation(value = "运行质控-获取病案首页")
+    @PostMapping("/sendHomePageIng")
+    @SysLogger("sendHomePageIng")
+    public RespDTO<Map<String, Object>> sendHomePageIng(@Valid @RequestBody AHomePageIngVO aHomePageIngVO){
+        return aHomePageFacade.executeHomePageIng(aHomePageIngVO);
+    }
+
+    @ApiOperation(value = "终末质控-获取病案首页")
+    @PostMapping("/sendHomePage")
+    @SysLogger("sendHomePage")
+    public RespDTO<List<AHomePageDTO>> sendHomePage(@RequestBody List<AHomePageVO> list){
+        return aHomePageFacade.executeHomePage(list);
+    }
+
+    @ApiOperation(value = "终末质控-获取病案首页诊断")
+    @PostMapping("/sendHomeDiagnose")
+    @SysLogger("sendHomeDiagnose")
+    public RespDTO<List<AHomeDiagnoseDTO>> sendHomeDiagnose(@RequestBody List<AHomeDiagnoseVO> list){
+        return aHomeDiagnoseInfoFacade.executeHomeDiagnose(list);
+    }
+
+    @ApiOperation(value = "终末质控-获取病案首页手术")
+    @PostMapping("/sendHomeOperation")
+    @SysLogger("sendHomeOperation")
+    public RespDTO<List<AHomeOperationDTO>> sendHomeOperation(@RequestBody List<AHomeOperationVO> list){
+        return RespDTO.onSuc(aHomeOperationInfoFacade.executeHomeOperation(list));
+    }
+
+    @ApiOperation(value = "数据引擎-获取危急值")
+    @PostMapping("/sendCrisis")
+    @SysLogger("sendCrisis")
+    public RespDTO<List<AMedCrisisDTO>> sendCrisis(@RequestBody List<AMedCrisisVO> list){
+        return aMedCrisisFacade.executeMedCrisis(list);
+    }
+
+}

+ 24 - 0
src/main/resources/jdbc.properties

@@ -0,0 +1,24 @@
+#\u6570\u636e\u5e93\u914d\u7f6e
+#jdbc.driverClassName=com.mysql.jdbc.Driver
+#jdbc.url=jdbc:mysql://127.0.0.1:3306/diagbot-app?useUnicode=true&characterEncoding=UTF-8
+#jdbc.username=root
+#jdbc.password=root
+
+#jdbc.driverClassName=oracle.jdbc.OracleDriver
+#jdbc.url=jdbc:oracle:thin:@192.168.2.246:1521/ORCL
+#jdbc.username=ETRACKMRQC
+#jdbc.password=ETRACKMRQC
+
+jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
+jdbc.url=jdbc:sqlserver://192.168.100.39\\tzmhemr;DatabaseName=bigemr
+jdbc.username=zjlt
+jdbc.password=zjlt@2020
+
+#\u6570\u636e\u670d\u52a1\u6a21\u5f0f
+remote.address.ver=http://192.18.101.207:2030/index.html
+remote.address.hor=http://192.18.101.207:2030/indexHorizontal.html
+
+process.qc.url=http://192.168.100.157:1489/index.html
+
+#his\u65b9\u60a3\u8005\u63a5\u53e3\u5730\u5740
+his.patient.url=

+ 30 - 0
src/main/resources/mapper/BasDeptInfoMapper.xml

@@ -76,4 +76,34 @@
             AND a.hospital_id = #{hospitalId}
         </if>
     </select>
+
+    <update id="updateBatchByKey">
+        <foreach collection="list" item="item"  separator=";">
+            update bas_dept_info
+            <set>
+                <if test="item.parentDeptId != null">
+                    parent_dept_id = #{item.parentDeptId},
+                </if>
+                <if test="item.deptName != null">
+                    dept_name = #{item.deptName},
+                </if>
+                <if test="item.deptType != null">
+                    dept_type = #{item.deptType},
+                </if>
+                <if test="item.spell != null">
+                    spell = #{item.spell},
+                </if>
+                <if test="item.station != null">
+                    station = #{item.station},
+                </if>
+                <if test="item.gmtModified != null">
+                    gmt_modified = #{item.gmtModified},
+                </if>
+                <if test="item.modifier != null">
+                    modifier = #{item.modifier},
+                </if>
+            </set>
+            where dept_id = #{item.deptId} and hospital_id = #{item.hospitalId}
+        </foreach>
+    </update>
 </mapper>

+ 47 - 0
src/main/resources/mapper/BasDoctorInfoMapper.xml

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.BasDoctorInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.BasDoctorInfo">
+        <id column="doctor_id" property="doctorId" />
+        <result column="hospital_id" property="hospitalId" />
+        <result column="dept_id" property="deptId" />
+        <result column="name" property="name" />
+        <result column="professor" property="professor" />
+        <result column="occup" property="occup" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+    </resultMap>
+
+    <update id="updateBatchByKey">
+        <foreach collection="list" item="item"  separator=";">
+            update bas_doctor_info
+            <set>
+                <if test="item.deptId != null">
+                    dept_id = #{item.deptId},
+                </if>
+                <if test="item.name != null">
+                    name = #{item.name},
+                </if>
+                <if test="item.professor != null">
+                    professor = #{item.professor},
+                </if>
+                <if test="item.occup != null">
+                    occup = #{item.occup},
+                </if>
+                <if test="item.gmtModified != null">
+                    gmt_modified = #{item.gmtModified},
+                </if>
+                <if test="item.modifier != null">
+                    modifier = #{item.modifier},
+                </if>
+            </set>
+            where doctor_id = #{item.doctorId} and hospital_id = #{item.hospitalId}
+        </foreach>
+    </update>
+
+</mapper>

+ 84 - 0
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -2493,4 +2493,88 @@
         t1.behospitalCode,
         t1.casesName
     </select>
+
+    <update id="updateBatchByKey">
+        <foreach collection="list" item="item"  separator=";">
+            update med_behospital_info
+            <set>
+                <if test="item.name != null">
+                    name = #{item.name},
+                </if>
+                <if test="item.sex != null">
+                    sex = #{item.sex},
+                </if>
+                <if test="item.birthday != null">
+                    birthday = #{item.birthday},
+                </if>
+                <if test="item.fileCode != null">
+                    file_code = #{item.fileCode},
+                </if>
+                <if test="item.qcTypeId != null">
+                    qc_type_id = #{item.qcTypeId},
+                </if>
+                <if test="item.wardCode != null">
+                    ward_code = #{item.wardCode},
+                </if>
+                <if test="item.wardName != null">
+                    ward_name = #{item.wardName},
+                </if>
+                <if test="item.behDeptId != null">
+                    beh_dept_id = #{item.behDeptId},
+                </if>
+                <if test="item.behDeptName != null">
+                    beh_dept_name = #{item.behDeptName},
+                </if>
+                <if test="item.bedCode != null">
+                    bed_code = #{item.bedCode},
+                </if>
+                <if test="item.bedName != null">
+                    bed_name = #{item.bedName},
+                </if>
+                <if test="item.insuranceName != null">
+                    insurance_name = #{item.insuranceName},
+                </if>
+                <if test="item.jobType != null">
+                    job_type = #{item.jobType},
+                </if>
+                <if test="item.behospitalDate != null">
+                    behospital_date = #{item.behospitalDate},
+                </if>
+                <if test="item.leaveHospitalDate != null">
+                    leave_hospital_date = #{item.leaveHospitalDate},
+                </if>
+                <if test="item.diagnoseIcd != null">
+                    diagnose_icd = #{item.diagnoseIcd},
+                </if>
+                <if test="item.diagnose != null">
+                    diagnose = #{item.diagnose},
+                </if>
+                <if test="item.behDoctorId != null">
+                    beh_doctor_id = #{item.behDoctorId},
+                </if>
+                <if test="item.behDoctorName != null">
+                    beh_doctor_name = #{item.behDoctorName},
+                </if>
+                <if test="item.doctorId != null">
+                    doctor_id = #{item.doctorId},
+                </if>
+                <if test="item.doctorName != null">
+                    doctor_name = #{item.doctorName},
+                </if>
+                <if test="item.directorDoctorId != null">
+                    director_doctor_id = #{item.directorDoctorId},
+                </if>
+                <if test="item.directorDoctorName != null">
+                    director_doctor_name = #{item.directorDoctorName},
+                </if>
+                <if test="item.gmtModified != null">
+                    gmt_modified = #{item.gmtModified},
+                </if>
+                <if test="item.modifier != null">
+                    modifier = #{item.modifier},
+                </if>
+            </set>
+            where behospital_code = #{item.behospitalCode} and hospital_id = #{item.hospitalId}
+        </foreach>
+    </update>
 </mapper>

+ 79 - 0
src/main/resources/mapper/DoctorAdviceMapper.xml

@@ -35,4 +35,83 @@
         <result column="modifier" property="modifier" />
     </resultMap>
 
+
+    <update id="updateBatchByKey">
+        <foreach collection="list" item="item"  separator=";">
+            update med_doctor_advice
+            <set>
+                <if test="item.orderDoctorName != null">
+                    order_doctor_name = #{item.orderDoctorName},
+                </if>
+                <if test="item.frequency != null">
+                    frequency = #{item.frequency},
+                </if>
+                <if test="item.parentTypeId != null">
+                    parent_type_id = #{item.parentTypeId},
+                </if>
+                <if test="item.doctorAdviceType != null">
+                    doctor_advice_type = #{item.doctorAdviceType},
+                </if>
+                <if test="item.usageNum != null">
+                    usage_num = #{item.usageNum},
+                </if>
+                <if test="item.usageUnit != null">
+                    usage_unit = #{item.usageUnit},
+                </if>
+                <if test="item.dose != null">
+                    dose = #{item.dose},
+                </if>
+                <if test="item.doseUnit != null">
+                    dose_unit = #{item.doseUnit},
+                </if>
+                <if test="item.medModeType != null">
+                    med_mode_type = #{item.medModeType},
+                </if>
+                <if test="item.daFrequency != null">
+                    da_frequency = #{item.daFrequency},
+                </if>
+                <if test="item.daDealType != null">
+                    da_deal_type = #{item.daDealType},
+                </if>
+                <if test="item.daStartDate != null">
+                    da_start_date = #{item.daStartDate},
+                </if>
+                <if test="item.daItemName != null">
+                    da_item_name = #{item.daItemName},
+                </if>
+                <if test="item.daStatus != null">
+                    da_status = #{item.daStatus},
+                </if>
+                <if test="item.daStopDate != null">
+                    da_stop_date = #{item.daStopDate},
+                </if>
+                <if test="item.daGroupNo != null">
+                    da_group_no = #{item.daGroupNo},
+                </if>
+                <if test="item.daPrescriptionType != null">
+                    da_prescription_type = #{item.daPrescriptionType},
+                </if>
+                <if test="item.daMedType != null">
+                    da_med_type = #{item.daMedType},
+                </if>
+                <if test="item.doctorNotice != null">
+                    doctor_notice = #{item.doctorNotice},
+                </if>
+                <if test="item.doctorId != null">
+                    doctor_id = #{item.doctorId},
+                </if>
+                <if test="item.doctorName != null">
+                    doctor_name = #{item.doctorName},
+                </if>
+                <if test="item.gmtModified != null">
+                    gmt_modified = #{item.gmtModified},
+                </if>
+                <if test="item.modifier != null">
+                    modifier = #{item.modifier},
+                </if>
+            </set>
+            where doctor_advice_id = #{item.doctorAdviceId} and hospital_id = #{item.hospitalId} and behospital_code = #{item.behospitalCode}
+        </foreach>
+    </update>
+
 </mapper>

+ 36 - 0
src/main/resources/mapper/HomeDiagnoseInfoMapper.xml

@@ -21,4 +21,40 @@
         <result column="modifier" property="modifier" />
     </resultMap>
 
+    <update id="updateBatchByKey">
+        <foreach collection="list" item="item"  separator=";">
+            update med_home_diagnose_info
+            <set>
+                <if test="item.diagnoseType != null">
+                    diagnose_type = #{item.diagnoseType},
+                </if>
+                <if test="item.diagnoseTypeShort != null">
+                    diagnose_type_short = #{item.diagnoseTypeShort},
+                </if>
+                <if test="item.diagnoseName != null">
+                    diagnose_name = #{item.diagnoseName},
+                </if>
+                <if test="item.behospitalType != null">
+                    behospital_type = #{item.behospitalType},
+                </if>
+                <if test="item.leaveHospitalType != null">
+                    leave_hospital_type = #{item.leaveHospitalType},
+                </if>
+                <if test="item.pathologyDiagnose != null">
+                    pathology_diagnose = #{item.pathologyDiagnose},
+                </if>
+                <if test="item.icdCode != null">
+                    icd_code = #{item.icdCode},
+                </if>
+                <if test="item.gmtModified != null">
+                    gmt_modified = #{item.gmtModified},
+                </if>
+                <if test="item.modifier != null">
+                    modifier = #{item.modifier},
+                </if>
+            </set>
+            where home_page_id = #{item.homePageId} and hospital_id = #{item.hospitalId} and diagnose_order_no = #{item.diagnoseOrderNo}
+        </foreach>
+    </update>
+
 </mapper>

+ 48 - 0
src/main/resources/mapper/HomeOperationInfoMapper.xml

@@ -25,4 +25,52 @@
         <result column="modifier" property="modifier" />
     </resultMap>
 
+    <update id="updateBatchByKey">
+        <foreach collection="list" item="item"  separator=";">
+            update med_home_operation_info
+            <set>
+                <if test="item.operationDate != null">
+                    operation_date = #{item.operationDate},
+                </if>
+                <if test="item.operationCode != null">
+                    operation_code = #{item.operationCode},
+                </if>
+                <if test="item.operationDoctorId != null">
+                    operation_doctor_id = #{item.operationDoctorId},
+                </if>
+                <if test="item.firstAssistantId != null">
+                    first_assistant_id = #{item.firstAssistantId},
+                </if>
+                <if test="item.secondAssistantId != null">
+                    second_assistant_id = #{item.secondAssistantId},
+                </if>
+                <if test="item.cutLevel != null">
+                    cut_level = #{item.cutLevel},
+                </if>
+                <if test="item.healingLevel != null">
+                    healing_level = #{item.healingLevel},
+                </if>
+                <if test="item.operationName != null">
+                    operation_name = #{item.operationName},
+                </if>
+                <if test="item.operationLevel != null">
+                    operation_level = #{item.operationLevel},
+                </if>
+                <if test="item.anaesthesiaName != null">
+                    anaesthesia_name = #{item.anaesthesiaName},
+                </if>
+                <if test="item.shamOperationName != null">
+                    sham_operation_name = #{item.shamOperationName},
+                </if>
+                <if test="item.gmtModified != null">
+                    gmt_modified = #{item.gmtModified},
+                </if>
+                <if test="item.modifier != null">
+                    modifier = #{item.modifier},
+                </if>
+            </set>
+            where home_page_id = #{item.homePageId} and hospital_id = #{item.hospitalId} and operation_order_no = #{item.operationOrderNo}
+        </foreach>
+    </update>
+
 </mapper>

+ 385 - 0
src/main/resources/mapper/HomePageMapper.xml

@@ -451,4 +451,389 @@
         t.lastYearAverageValue DESC)
         t1
     </select>
+
+    <update id="updateBatchByKey">
+        <foreach collection="list" item="item"  separator=";">
+            update med_home_page
+            <set>
+                <if test="item.hospitalCode != null">
+                    hospital_code = #{item.hospitalCode},
+                </if>
+                <if test="item.hospitalName != null">
+                    hospital_name = #{item.hospitalName},
+                </if>
+                <if test="item.orgCode != null">
+                    org_code = #{item.orgCode},
+                </if>
+                <if test="item.payType != null">
+                    pay_type = #{item.payType},
+                </if>
+                <if test="item.healthCard != null">
+                    health_card = #{item.healthCard},
+                </if>
+                <if test="item.behospitalNum != null">
+                    behospital_num = #{item.behospitalNum},
+                </if>
+                <if test="item.fileCode != null">
+                    file_code = #{item.fileCode},
+                </if>
+                <if test="item.name != null">
+                    name = #{item.name},
+                </if>
+                <if test="item.sex != null">
+                    sex = #{item.sex},
+                </if>
+                <if test="item.birthday != null">
+                    birthday = #{item.birthday},
+                </if>
+                <if test="item.age != null">
+                    age = #{item.age},
+                </if>
+                <if test="item.ageUnit != null">
+                    age_unit = #{item.ageUnit},
+                </if>
+                <if test="item.nationality != null">
+                    nationality = #{item.nationality},
+                </if>
+                <if test="item.newbornMonth != null">
+                    newborn_month = #{item.newbornMonth},
+                </if>
+                <if test="item.newbornDay != null">
+                    newborn_day = #{item.newbornDay},
+                </if>
+                <if test="item.newbornWeight != null">
+                    newborn_weight = #{item.newbornWeight},
+                </if>
+                <if test="item.newbornBehospitalWeight != null">
+                    newborn_behospital_weight = #{item.newbornBehospitalWeight},
+                </if>
+                <if test="item.bornAddress != null">
+                    born_address = #{item.bornAddress},
+                </if>
+                <if test="item.bornPlace != null">
+                    born_place = #{item.bornPlace},
+                </if>
+                <if test="item.nation != null">
+                    nation = #{item.nation},
+                </if>
+                <if test="item.identityCardNo != null">
+                    identity_card_no = #{item.identityCardNo},
+                </if>
+                <if test="item.jobType != null">
+                    job_type = #{item.jobType},
+                </if>
+                <if test="item.marriage != null">
+                    marriage = #{item.marriage},
+                </if>
+                <if test="item.curAddress != null">
+                    cur_address = #{item.curAddress},
+                </if>
+                <if test="item.curPhone != null">
+                    cur_phone = #{item.curPhone},
+                </if>
+                <if test="item.curPostCode != null">
+                    cur_post_code = #{item.curPostCode},
+                </if>
+                <if test="item.residenceAddress != null">
+                    residence_address = #{item.residenceAddress},
+                </if>
+                <if test="item.residencePostCode != null">
+                    residence_post_code = #{item.residencePostCode},
+                </if>
+                <if test="item.workAddress != null">
+                    work_address = #{item.workAddress},
+                </if>
+                <if test="item.workPhone != null">
+                    work_phone = #{item.workPhone},
+                </if>
+                <if test="item.workPostCode != null">
+                    work_post_code = #{item.workPostCode},
+                </if>
+                <if test="item.contactName != null">
+                    contact_name = #{item.contactName},
+                </if>
+                <if test="item.contactRelation != null">
+                    contact_relation = #{item.contactRelation},
+                </if>
+                <if test="item.contactAddress != null">
+                    contact_address = #{item.contactAddress},
+                </if>
+                <if test="item.contactPhone != null">
+                    contact_phone = #{item.contactPhone},
+                </if>
+                <if test="item.behospitalWay != null">
+                    behospital_way = #{item.behospitalWay},
+                </if>
+                <if test="item.behospitalDate != null">
+                    behospital_date = #{item.behospitalDate},
+                </if>
+                <if test="item.behospitalDept != null">
+                    behospital_dept = #{item.behospitalDept},
+                </if>
+                <if test="item.behospitalWard != null">
+                    behospital_ward = #{item.behospitalWard},
+                </if>
+                <if test="item.behospitalBedId != null">
+                    behospital_bed_id = #{item.behospitalBedId},
+                </if>
+                <if test="item.behospitalBedCode != null">
+                    behospital_bed_code = #{item.behospitalBedCode},
+                </if>
+                <if test="item.changeDept != null">
+                    change_dept = #{item.changeDept},
+                </if>
+                <if test="item.leaveHospitalDate != null">
+                    leave_hospital_date = #{item.leaveHospitalDate},
+                </if>
+                <if test="item.leaveHospitalDept != null">
+                    leave_hospital_dept = #{item.leaveHospitalDept},
+                </if>
+                <if test="item.leaveHospitalWard != null">
+                    leave_hospital_ward = #{item.leaveHospitalWard},
+                </if>
+                <if test="item.leaveHospitalBedId != null">
+                    leave_hospital_bed_id = #{item.leaveHospitalBedId},
+                </if>
+                <if test="item.leaveHospitalBedCode != null">
+                    leave_hospital_bed_code = #{item.leaveHospitalBedCode},
+                </if>
+                <if test="item.behospitalDayNum != null">
+                    behospital_day_num = #{item.behospitalDayNum},
+                </if>
+                <if test="item.outpatientEmrDiagnose != null">
+                    outpatient_emr_diagnose = #{item.outpatientEmrDiagnose},
+                </if>
+                <if test="item.outpatientEmrDiagnoseCode != null">
+                    outpatient_emr_diagnose_code = #{item.outpatientEmrDiagnoseCode},
+                </if>
+                <if test="item.poisonFactor != null">
+                    poison_factor = #{item.poisonFactor},
+                </if>
+                <if test="item.poisonFactorCode != null">
+                    poison_factor_code = #{item.poisonFactorCode},
+                </if>
+                <if test="item.pathologyDiagnose != null">
+                    pathology_diagnose = #{item.pathologyDiagnose},
+                </if>
+                <if test="item.pathologyDiagnoseCode != null">
+                    pathology_diagnose_code = #{item.pathologyDiagnoseCode},
+                </if>
+                <if test="item.pathologyDiagnoseId != null">
+                    pathology_diagnose_id = #{item.pathologyDiagnoseId},
+                </if>
+                <if test="item.isMedAllergy != null">
+                    is_med_allergy = #{item.isMedAllergy},
+                </if>
+                <if test="item.medAllergyName != null">
+                    med_allergy_name = #{item.medAllergyName},
+                </if>
+                <if test="item.autopsy != null">
+                    autopsy = #{item.autopsy},
+                </if>
+                <if test="item.bloodType != null">
+                    blood_type = #{item.bloodType},
+                </if>
+                <if test="item.rh != null">
+                    rh = #{item.rh},
+                </if>
+                <if test="item.deptDirector != null">
+                    dept_director = #{item.deptDirector},
+                </if>
+                <if test="item.directorDoctor != null">
+                    director_doctor = #{item.directorDoctor},
+                </if>
+                <if test="item.attendingDoctor != null">
+                    attending_doctor = #{item.attendingDoctor},
+                </if>
+                <if test="item.behospitalDoctor != null">
+                    behospital_doctor = #{item.behospitalDoctor},
+                </if>
+                <if test="item.responseNurse != null">
+                    response_nurse = #{item.responseNurse},
+                </if>
+                <if test="item.studyDoctor != null">
+                    study_doctor = #{item.studyDoctor},
+                </if>
+                <if test="item.practiceDoctor != null">
+                    practice_doctor = #{item.practiceDoctor},
+                </if>
+                <if test="item.encodeMan != null">
+                    encode_man = #{item.encodeMan},
+                </if>
+                <if test="item.homePageQuality != null">
+                    home_page_quality = #{item.homePageQuality},
+                </if>
+                <if test="item.qcDoctor != null">
+                    qc_doctor = #{item.qcDoctor},
+                </if>
+                <if test="item.qcNurse != null">
+                    qc_nurse = #{item.qcNurse},
+                </if>
+                <if test="item.qcDate != null">
+                    qc_date = #{item.qcDate},
+                </if>
+                <if test="item.leaveHospitalType != null">
+                    leave_hospital_type = #{item.leaveHospitalType},
+                </if>
+                <if test="item.acceptOrgCode != null">
+                    accept_org_code = #{item.acceptOrgCode},
+                </if>
+                <if test="item.againBehospitalPlan != null">
+                    again_behospital_plan = #{item.againBehospitalPlan},
+                </if>
+                <if test="item.againBehospitalGoal != null">
+                    again_behospital_goal = #{item.againBehospitalGoal},
+                </if>
+                <if test="item.tbiBeforeDay != null">
+                    tbi_before_day = #{item.tbiBeforeDay},
+                </if>
+                <if test="item.tbiBeforeHour != null">
+                    tbi_before_hour = #{item.tbiBeforeHour},
+                </if>
+                <if test="item.tbiBeforeMinute != null">
+                    tbi_before_minute = #{item.tbiBeforeMinute},
+                </if>
+                <if test="item.tbiAfterDay != null">
+                    tbi_after_day = #{item.tbiAfterDay},
+                </if>
+                <if test="item.tbiAfterHour != null">
+                    tbi_after_hour = #{item.tbiAfterHour},
+                </if>
+                <if test="item.tbiAfterMinute != null">
+                    tbi_after_minute = #{item.tbiAfterMinute},
+                </if>
+                <if test="item.totalFee != null">
+                    total_fee = #{item.totalFee},
+                </if>
+                <if test="item.ownFee != null">
+                    own_fee = #{item.ownFee},
+                </if>
+                <if test="item.generalFee != null">
+                    general_fee = #{item.generalFee},
+                </if>
+                <if test="item.serviceFee != null">
+                    service_fee = #{item.serviceFee},
+                </if>
+                <if test="item.nurseFee != null">
+                    nurse_fee = #{item.nurseFee},
+                </if>
+                <if test="item.otherFee != null">
+                    other_fee = #{item.otherFee},
+                </if>
+                <if test="item.pathologyFee != null">
+                    pathology_fee = #{item.pathologyFee},
+                </if>
+                <if test="item.labFee != null">
+                    lab_fee = #{item.labFee},
+                </if>
+                <if test="item.pacsFee != null">
+                    pacs_fee = #{item.pacsFee},
+                </if>
+                <if test="item.clinicDiagnoseFee != null">
+                    clinic_diagnose_fee = #{item.clinicDiagnoseFee},
+                </if>
+                <if test="item.notOperationFee != null">
+                    not_operation_fee = #{item.notOperationFee},
+                </if>
+                <if test="item.clinicPhysicFee != null">
+                    clinic_physic_fee = #{item.clinicPhysicFee},
+                </if>
+                <if test="item.operationTreatFee != null">
+                    operation_treat_fee = #{item.operationTreatFee},
+                </if>
+                <if test="item.anaesthesiaFee != null">
+                    anaesthesia_fee = #{item.anaesthesiaFee},
+                </if>
+                <if test="item.operationFee != null">
+                    operation_fee = #{item.operationFee},
+                </if>
+                <if test="item.healthTypeFee != null">
+                    health_type_fee = #{item.healthTypeFee},
+                </if>
+                <if test="item.chnTreatFee != null">
+                    chn_treat_fee = #{item.chnTreatFee},
+                </if>
+                <if test="item.westernMedFee != null">
+                    western_med_fee = #{item.westernMedFee},
+                </if>
+                <if test="item.antibiosisFee != null">
+                    antibiosis_fee = #{item.antibiosisFee},
+                </if>
+                <if test="item.chnMedFee != null">
+                    chn_med_fee = #{item.chnMedFee},
+                </if>
+                <if test="item.chnHerbFee != null">
+                    chn_herb_fee = #{item.chnHerbFee},
+                </if>
+                <if test="item.bloodFee != null">
+                    blood_fee = #{item.bloodFee},
+                </if>
+                <if test="item.albumenFee != null">
+                    albumen_fee = #{item.albumenFee},
+                </if>
+                <if test="item.globulinFee != null">
+                    globulin_fee = #{item.globulinFee},
+                </if>
+                <if test="item.bloodFactorFee != null">
+                    blood_factor_fee = #{item.bloodFactorFee},
+                </if>
+                <if test="item.cellFactorFee != null">
+                    cell_factor_fee = #{item.cellFactorFee},
+                </if>
+                <if test="item.checkMaterialFee != null">
+                    check_material_fee = #{item.checkMaterialFee},
+                </if>
+                <if test="item.treatMaterialFee != null">
+                    treat_material_fee = #{item.treatMaterialFee},
+                </if>
+                <if test="item.operationMaterialFee != null">
+                    operation_material_fee = #{item.operationMaterialFee},
+                </if>
+                <if test="item.otherTypeFee != null">
+                    other_type_fee = #{item.otherTypeFee},
+                </if>
+                <if test="item.singleDiagManage != null">
+                    single_diag_manage = #{item.singleDiagManage},
+                </if>
+                <if test="item.clinicPathwayManage != null">
+                    clinic_pathway_manage = #{item.clinicPathwayManage},
+                </if>
+                <if test="item.isOutpatientBehospital != null">
+                    is_outpatient_behospital = #{item.isOutpatientBehospital},
+                </if>
+                <if test="item.isLeaveBehospital != null">
+                    is_leave_behospital = #{item.isLeaveBehospital},
+                </if>
+                <if test="item.isOperationBeforeAfter != null">
+                    is_operation_before_after = #{item.isOperationBeforeAfter},
+                </if>
+                <if test="item.isClinicPathology != null">
+                    is_clinic_pathology = #{item.isClinicPathology},
+                </if>
+                <if test="item.isRadiatePathology != null">
+                    is_radiate_pathology = #{item.isRadiatePathology},
+                </if>
+                <if test="item.rescueNum != null">
+                    rescue_num = #{item.rescueNum},
+                </if>
+                <if test="item.rescueSuccessNum != null">
+                    rescue_success_num = #{item.rescueSuccessNum},
+                </if>
+                <if test="item.isAutoLeavehospital != null">
+                    is_auto_leavehospital = #{item.isAutoLeavehospital},
+                </if>
+                <if test="item.returnToType != null">
+                    return_to_type = #{item.returnToType},
+                </if>
+
+                <if test="item.gmtModified != null">
+                    gmt_modified = #{item.gmtModified},
+                </if>
+                <if test="item.modifier != null">
+                    modifier = #{item.modifier},
+                </if>
+            </set>
+            where home_page_id = #{item.homePageId} and hospital_id = #{item.hospitalId} and behospital_code = #{item.behospitalCode}
+        </foreach>
+    </update>
 </mapper>

+ 54 - 0
src/main/resources/mapper/MedCrisisInfoMapper.xml

@@ -28,4 +28,58 @@
         <result column="modifier" property="modifier" />
     </resultMap>
 
+    <update id="updateBatchByKey">
+        <foreach collection="list" item="item"  separator=";">
+            update med_crisis_info
+            <set>
+                <if test="item.crisisId != null">
+                    crisis_id = #{item.crisisId},
+                </if>
+                <if test="item.crisisName != null">
+                    crisis_name = #{item.crisisName},
+                </if>
+                <if test="item.deptId != null">
+                    dept_id = #{item.deptId},
+                </if>
+                <if test="item.deptName != null">
+                    dept_name = #{item.deptName},
+                </if>
+                <if test="item.doctorId != null">
+                    doctor_id = #{item.doctorId},
+                </if>
+                <if test="item.doctorName != null">
+                    doctor_name = #{item.doctorName},
+                </if>
+                <if test="item.crisisValue != null">
+                    crisis_value = #{item.crisisValue},
+                </if>
+                <if test="item.crisisDesc != null">
+                    crisis_desc = #{item.crisisDesc},
+                </if>
+                <if test="item.crisisStatus != null">
+                    crisis_status = #{item.crisisStatus},
+                </if>
+                <if test="item.crisisTopValue != null">
+                    crisis_top_value = #{item.crisisTopValue},
+                </if>
+                <if test="item.crisisLowerValue != null">
+                    crisis_lower_value = #{item.crisisLowerValue},
+                </if>
+                <if test="item.sendDate != null">
+                    send_date = #{item.sendDate},
+                </if>
+                <if test="item.repDate != null">
+                    rep_date = #{item.repDate},
+                </if>
+                <if test="item.gmtModified != null">
+                    gmt_modified = #{item.gmtModified},
+                </if>
+                <if test="item.modifier != null">
+                    modifier = #{item.modifier},
+                </if>
+            </set>
+            where rec_id = #{item.recId} and hospital_id = #{item.hospitalId} and behospital_code = #{item.behospitalCode} and rec_type = #{item.recType}
+        </foreach>
+    </update>
+
 </mapper>

+ 27 - 0
src/main/resources/mapper/MedRecordTypeMapper.xml

@@ -18,4 +18,31 @@
         <result column="modifier" property="modifier" />
     </resultMap>
 
+    <update id="updateBatchByKey">
+        <foreach collection="list" item="item"  separator=";">
+            update med_record_type
+            <set>
+                <if test="item.typeName != null">
+                    type_name = #{item.typeName},
+                </if>
+                <if test="item.parentTypeId != null">
+                    parent_type_id = #{item.parentTypeId},
+                </if>
+                <if test="item.objName != null">
+                    obj_name = #{item.objName},
+                </if>
+                <if test="item.spell != null">
+                    spell = #{item.spell},
+                </if>
+                <if test="item.gmtModified != null">
+                    gmt_modified = #{item.gmtModified},
+                </if>
+                <if test="item.modifier != null">
+                    modifier = #{item.modifier},
+                </if>
+            </set>
+            where type_id = #{item.typeId} and hospital_id = #{item.hospitalId}
+        </foreach>
+    </update>
+
 </mapper>

+ 21 - 0
src/main/resources/mapper/MedicalRecordContentMapper.xml

@@ -15,4 +15,25 @@
         <result column="modifier" property="modifier" />
     </resultMap>
 
+    <update id="updateBatchByKey">
+        <foreach collection="list" item="item"  separator=";">
+            update med_medical_record_content
+            <set>
+                <if test="item.htmlText != null">
+                    html_text = #{item.htmlText},
+                </if>
+                <if test="item.xmlText != null">
+                    xml_text = #{item.xmlText},
+                </if>
+                <if test="item.gmtModified != null">
+                    gmt_modified = #{item.gmtModified},
+                </if>
+                <if test="item.modifier != null">
+                    modifier = #{item.modifier},
+                </if>
+            </set>
+            where rec_id = #{item.recId} and hospital_id = #{item.hospitalId}
+        </foreach>
+    </update>
+
 </mapper>

+ 27 - 0
src/main/resources/mapper/MedicalRecordMapper.xml

@@ -32,4 +32,31 @@
         and t1.behospital_code = #{behospitalCode}
     </select>
 
+    <update id="updateBatchByKey">
+        <foreach collection="list" item="item"  separator=";">
+            update med_medical_record
+            <set>
+                <if test="item.orgCode != null">
+                    org_code = #{item.orgCode},
+                </if>
+                <if test="item.recTypeId != null">
+                    rec_type_id = #{item.recTypeId},
+                </if>
+                <if test="item.recDate != null">
+                    rec_date = #{item.recDate},
+                </if>
+                <if test="item.recTitle != null">
+                    rec_title = #{item.recTitle},
+                </if>
+                <if test="item.gmtModified != null">
+                    gmt_modified = #{item.gmtModified},
+                </if>
+                <if test="item.modifier != null">
+                    modifier = #{item.modifier},
+                </if>
+            </set>
+            where rec_id = #{item.recId} and hospital_id = #{item.hospitalId} and behospital_code = #{item.behospitalCode}
+        </foreach>
+    </update>
+
 </mapper>