Commit 3d016c7bef2e2f7801ea38d224ecdb3667883075

Authored by liquanyu
1 parent 9e82cbe017

update

Showing 7 changed files with 473 additions and 10 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyHighRiskService.java View file @ 3d016c7
1 1 package com.lyms.hospitalapi.qhdfy;
2 2  
  3 +import com.lyms.platform.biz.service.AntenatalExaminationService;
  4 +import com.lyms.platform.biz.service.PatientsService;
  5 +import com.lyms.platform.common.enums.YnEnums;
  6 +import com.lyms.platform.common.utils.ExceptionUtils;
  7 +import com.lyms.platform.common.utils.JsonUtil;
  8 +import com.lyms.platform.common.utils.StringUtils;
  9 +import com.lyms.platform.operate.web.facade.AntenatalExaminationFacade;
  10 +import com.lyms.platform.operate.web.request.AntExAddRequest;
  11 +import com.lyms.platform.operate.web.request.AntExcAddRequest;
  12 +import com.lyms.platform.pojo.AntExChuModel;
  13 +import com.lyms.platform.pojo.AntenatalExaminationModel;
  14 +import com.lyms.platform.pojo.Patients;
  15 +import com.lyms.platform.query.AntExChuQuery;
  16 +import com.lyms.platform.query.AntExQuery;
  17 +import com.lyms.platform.query.PatientsQuery;
  18 +import org.apache.commons.collections.CollectionUtils;
  19 +import org.apache.commons.dbutils.DbUtils;
  20 +import org.apache.commons.dbutils.QueryRunner;
  21 +import org.apache.commons.dbutils.handlers.BeanListHandler;
  22 +import org.springframework.beans.factory.annotation.Autowired;
  23 +import org.springframework.stereotype.Service;
  24 +
  25 +import java.sql.Connection;
  26 +import java.text.SimpleDateFormat;
  27 +import java.util.*;
  28 +
3 29 /**
  30 + *
  31 + * 秦皇岛诊断与孕产系统的高危对应关系
  32 + *
  33 + 1.重度子痫前期、慢性高血压合并子痫前期
  34 + 重度子痫前期
  35 + 子痫前期重度
  36 + 子痫前期
  37 + 妊娠期高血压疾病-子痫前期
  38 + 慢性高血压合并子痫前期
  39 +
  40 +
  41 + 2.瘢痕子宫伴中央性前置胎盘或伴有可疑胎盘植入
  42 + 中央性前置胎盘
  43 + 中央型前置胎盘
  44 + 前置胎盘(中央性)
  45 + 前置胎盘(中央型)
  46 + 前置胎盘
  47 + 胎盘植入
  48 + 胎盘植入(粘连型)
  49 +
  50 + 3.心功能II级,轻度左心功能障碍或者EF40%~50%
  51 + 左心衰
  52 + 心衰
  53 + 右心衰
  54 + 心力衰竭
  55 + 心功能三、四级(III、IV)
  56 +
  57 + 4. 妊娠期高血压性心脏病
  58 + 妊娠期高血压型心脏病
  59 +
  60 + 5.各种原因引起的肺动脉高压(≥50mmHg),如房缺、室缺、动脉导管未闭等
  61 + 重度肺动脉高压
  62 + 肺动脉高压(重度)
  63 + 肺动脉高压(轻度)
  64 + 轻度肺动脉高压
  65 +
  66 + 6.凶险性前置胎盘、胎盘早剥
  67 + 凶险性前置胎盘
  68 + 胎盘早剥
  69 + 胎盘早剥(三级)
  70 +
  71 + 7.脑血管畸形及手术史
  72 + 脑出血
  73 + 脑血管畸形
  74 +
  75 + *
4 76 * Created by Administrator on 2021-08-18.
5 77 */
  78 +@Service
6 79 public class QhdfyHighRiskService {
7 80  
  81 + private static Map<String,String> RISK_MAP = new HashMap<>();
  82 + static {
  83 + RISK_MAP.put("重度子痫前期","4ad55348-eb85-4546-8712-ccf21bc88f7b");
  84 + RISK_MAP.put("子痫前期重度","4ad55348-eb85-4546-8712-ccf21bc88f7b");
  85 + RISK_MAP.put("子痫前期","4ad55348-eb85-4546-8712-ccf21bc88f7b");
  86 + RISK_MAP.put("妊娠期高血压疾病-子痫前期","4ad55348-eb85-4546-8712-ccf21bc88f7b");
  87 + RISK_MAP.put("慢性高血压合并子痫前期","4ad55348-eb85-4546-8712-ccf21bc88f7b");
  88 +
  89 + RISK_MAP.put("中央性前置胎盘","5a41f07c422b03d4ad2bf7e2");
  90 + RISK_MAP.put("中央型前置胎盘","5a41f07c422b03d4ad2bf7e2");
  91 + RISK_MAP.put("前置胎盘(中央性)","5a41f07c422b03d4ad2bf7e2");
  92 + RISK_MAP.put("前置胎盘(中央型)","5a41f07c422b03d4ad2bf7e2");
  93 + RISK_MAP.put("前置胎盘","5a41f07c422b03d4ad2bf7e2");
  94 + RISK_MAP.put("胎盘植入","5a41f07c422b03d4ad2bf7e2");
  95 + RISK_MAP.put("胎盘植入(粘连型)","5a41f07c422b03d4ad2bf7e2");
  96 +
  97 +
  98 + RISK_MAP.put("左心衰","5a41f83b422b03d4ad2bf7fa");
  99 + RISK_MAP.put("心衰","5a41f83b422b03d4ad2bf7fa");
  100 + RISK_MAP.put("右心衰","5a41f83b422b03d4ad2bf7fa");
  101 + RISK_MAP.put("心力衰竭","5a41f83b422b03d4ad2bf7fa");
  102 + RISK_MAP.put("心功能三、四级(III、IV)","5a41f83b422b03d4ad2bf7fa");
  103 +
  104 + RISK_MAP.put("妊娠期高血压性心脏病","5a41f9f0422b03d4ad2bf80d");
  105 +
  106 + RISK_MAP.put("重度肺动脉高压","b3c12aa2-e7fa-4958-9933-ca952ce4c5e8");
  107 + RISK_MAP.put("肺动脉高压(重度)","b3c12aa2-e7fa-4958-9933-ca952ce4c5e8");
  108 + RISK_MAP.put("肺动脉高压(轻度)","b3c12aa2-e7fa-4958-9933-ca952ce4c5e8");
  109 + RISK_MAP.put("轻度肺动脉高压","b3c12aa2-e7fa-4958-9933-ca952ce4c5e8");
  110 +
  111 + RISK_MAP.put("凶险性前置胎盘","4540fa80-b1f5-46e4-ae09-52df04760735");
  112 + RISK_MAP.put("胎盘早剥","4540fa80-b1f5-46e4-ae09-52df04760735");
  113 + RISK_MAP.put("胎盘早剥(三级)","4540fa80-b1f5-46e4-ae09-52df04760735");
  114 +
  115 +
  116 + RISK_MAP.put("脑出血","5a41fa24422b03d4ad2bf81a");
  117 + RISK_MAP.put("脑血管畸形","5a41fa24422b03d4ad2bf81a");
  118 + }
  119 +
  120 + @Autowired
  121 + private PatientsService patientsService;
  122 + @Autowired
  123 + private AntenatalExaminationFacade antenatalExaminationFacade;
  124 + @Autowired
  125 + private AntenatalExaminationService antenatalExaminationService;
  126 +
  127 +
  128 + public void autoAddRiskWork() {
  129 + SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  130 + Date start = new Date(new Date().getTime()-1000*60*60);
  131 + String startStr = fmt.format(start);
  132 + getRiskItems(startStr);
  133 + }
  134 +
  135 + public void getRiskItems(String start)
  136 + {
  137 + Connection conn = ConnTools.makeFmConnection();
  138 + Connection connHis =ConnTools.makeHisConnection();
  139 + QueryRunner queryRunner = new QueryRunner();
  140 + try {
  141 + //String sql = "select top 100 SYXH as syxh,ZYHM as zyhm,BRXM as brxm,CYKS as cyks,CYBQ,ZDYS,ZDYSDM,ZDRQ,ZDXH,ZDMC,ZDLX,ZDBM,RYBQ from JHMK_BRZDQK where CONVERT(DATETIME,ZDRQ) > CONVERT(DATETIME,'2021-08-01 00:00:00', 120)" ;
  142 + String sql = "select top 100 SYXH as syxh,ZYHM as zyhm,BRXM as brxm,ZDXH as zdxh,ZDMC as zdmc from JHMK_BRZDQK where CONVERT(DATETIME,ZDRQ) > CONVERT(DATETIME,'"+start+"', 120)" ;
  143 + ExceptionUtils.catchException("risk sql "+sql);
  144 + //查询这个时间段的诊断数据
  145 + List<RiskItem> list = queryRunner.query(conn, sql, new BeanListHandler<RiskItem>(RiskItem.class));
  146 +
  147 +// List<RiskItem> list = new ArrayList<>();
  148 +// RiskItem item1 = new RiskItem();
  149 +// item1.setZdmc("重度子痫前期");
  150 +// list.add(item1);
  151 +
  152 +
  153 + if (CollectionUtils.isNotEmpty(list))
  154 + {
  155 + for (RiskItem item : list)
  156 + {
  157 + String riskId = RISK_MAP.get(item.getZdmc());
  158 + if (StringUtils.isEmpty(item.getZdmc()) || riskId == null)
  159 + {
  160 + continue;
  161 + }
  162 + //根据每一项诊断查询对应患者的信息
  163 + String sqlHis = "select syxh,patid, blh,mzh,hzxm,sfzh from ZY_BRSYK z where z.syxh="+ item.getSyxh();
  164 + List<RiskBaseInfo> infos = queryRunner.query(connHis, sqlHis, new BeanListHandler<RiskBaseInfo>(RiskBaseInfo.class));
  165 +// List<RiskBaseInfo> infos = new ArrayList<>();
  166 +// RiskBaseInfo riskBaseInfo = new RiskBaseInfo();
  167 +// riskBaseInfo.setSfzh("fadfasfa");
  168 +// infos.add(riskBaseInfo);
  169 + if (CollectionUtils.isNotEmpty(infos))
  170 + {
  171 + RiskBaseInfo baseInfo = infos.get(0);
  172 + if (StringUtils.isNotEmpty(baseInfo.getSfzh()))
  173 + {
  174 + PatientsQuery patientsQuery = new PatientsQuery();
  175 + patientsQuery.setCardNo(baseInfo.getSfzh());
  176 + patientsQuery.setYn(YnEnums.YES.getId());
  177 + patientsQuery.setType(1);
  178 + //patientsQuery.setHospitalId("216");
  179 +
  180 + List<Patients> patientses = patientsService.queryPatient1(patientsQuery,"created");
  181 + if (CollectionUtils.isNotEmpty(patientses))
  182 + {
  183 + String pid = patientses.get(0).getPid();
  184 +
  185 + AntExQuery antExQuery = new AntExQuery();
  186 + antExQuery.setPid(pid);
  187 + antExQuery.setYn(YnEnums.YES.getId());
  188 + List <AntenatalExaminationModel> antenatalExaminationModels = antenatalExaminationService.queryLastAntenatalExamination(antExQuery.convertToQuery());
  189 + if (CollectionUtils.isNotEmpty(antenatalExaminationModels))
  190 + {
  191 + AntenatalExaminationModel model = antenatalExaminationModels.get(0);
  192 + String riskFactor = model.getRiskFactor();
  193 + if (StringUtils.isNotEmpty(riskFactor) && !"[]".equals(riskFactor) && !"[null]".equals(riskFactor))
  194 + {
  195 + List list1 = JsonUtil.toList(model.getRiskFactor(), List.class);
  196 + if (CollectionUtils.isNotEmpty(list1) && list1.contains(riskId))
  197 + {
  198 + continue;
  199 + }
  200 + else if (CollectionUtils.isNotEmpty(list1) && list1.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6"))
  201 + {
  202 + List<String> reqRisk = new ArrayList<>();
  203 + reqRisk.add(riskId);
  204 + AntExAddRequest antExAddRequest = new AntExAddRequest();
  205 + antExAddRequest.setId(model.getId());
  206 + antExAddRequest.setRiskFactor(reqRisk);
  207 + antExAddRequest.setPid(model.getPid());
  208 +
  209 + antenatalExaminationFacade.addOneAntEx(antExAddRequest, Integer.parseInt(model.getCheckDoctor()));
  210 + }
  211 + else if (CollectionUtils.isNotEmpty(list1) )
  212 + {
  213 + list1.add(riskId);
  214 + AntExAddRequest antExAddRequest = new AntExAddRequest();
  215 + antExAddRequest.setId(model.getId());
  216 + antExAddRequest.setRiskFactor(list1);
  217 + antExAddRequest.setPid(model.getPid());
  218 + antenatalExaminationFacade.addOneAntEx(antExAddRequest, Integer.parseInt(model.getCheckDoctor()));
  219 + }
  220 + }
  221 + }else
  222 + {
  223 + AntExChuQuery antExChuQuery = new AntExChuQuery();
  224 + antExChuQuery.setPid(pid);
  225 + antExChuQuery.setYn(YnEnums.YES.getId());
  226 + List<AntExChuModel> antExChu = antenatalExaminationService.queryAntExChu(antExChuQuery);
  227 + if (CollectionUtils.isNotEmpty(antExChu))
  228 + {
  229 + AntExChuModel model = antExChu.get(0);
  230 + String riskFactor = model.getHighrisk();
  231 + if (StringUtils.isNotEmpty(riskFactor) && !"[]".equals(riskFactor))
  232 + {
  233 + List list1 = JsonUtil.toList(riskFactor, List.class);
  234 + if (CollectionUtils.isNotEmpty(list1) && list1.contains(riskId))
  235 + {
  236 + continue;
  237 + }
  238 + else if (CollectionUtils.isNotEmpty(list1) && list1.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6"))
  239 + {
  240 + List<String> reqRisk = new ArrayList<>();
  241 + reqRisk.add(riskId);
  242 + AntExcAddRequest antExcAddRequest = new AntExcAddRequest();
  243 + antExcAddRequest.setId(model.getId());
  244 + antExcAddRequest.setHighrisk(reqRisk);
  245 + antExcAddRequest.setPid(model.getPid());
  246 +
  247 + antenatalExaminationFacade.addOneAnetExChu(antExcAddRequest, Integer.parseInt(model.getProdDoctor()));
  248 + }
  249 + else if (CollectionUtils.isNotEmpty(list1) )
  250 + {
  251 + list1.add(riskId);
  252 + AntExcAddRequest antExcAddRequest = new AntExcAddRequest();
  253 + antExcAddRequest.setId(model.getId());
  254 + antExcAddRequest.setHighrisk(list1);
  255 + antExcAddRequest.setPid(model.getPid());
  256 + antenatalExaminationFacade.addOneAnetExChu(antExcAddRequest, Integer.parseInt(model.getProdDoctor()));
  257 + }
  258 + }
  259 + }
  260 + }
  261 + }
  262 + }
  263 + }
  264 + }
  265 + }
  266 +
  267 +
  268 + }catch (Exception e)
  269 + {
  270 + ExceptionUtils.catchException(e,"qhd risk error.");
  271 + }finally {
  272 +// DbUtils.closeQuietly(connHis);
  273 +// DbUtils.closeQuietly(conn);
  274 + }
  275 + }
8 276 }
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/RiskBaseInfo.java View file @ 3d016c7
  1 +package com.lyms.hospitalapi.qhdfy;
  2 +
  3 +/**
  4 + * Created by Administrator on 2021-08-23.
  5 + */
  6 +public class RiskBaseInfo {
  7 + private String syxh;
  8 + private String patid;
  9 + private String blh;
  10 + private String mzh;
  11 + private String hzxm;
  12 + private String sfzh;
  13 +
  14 + public String getSyxh() {
  15 + return syxh;
  16 + }
  17 +
  18 + public void setSyxh(String syxh) {
  19 + this.syxh = syxh;
  20 + }
  21 +
  22 + public String getPatid() {
  23 + return patid;
  24 + }
  25 +
  26 + public void setPatid(String patid) {
  27 + this.patid = patid;
  28 + }
  29 +
  30 + public String getBlh() {
  31 + return blh;
  32 + }
  33 +
  34 + public void setBlh(String blh) {
  35 + this.blh = blh;
  36 + }
  37 +
  38 + public String getMzh() {
  39 + return mzh;
  40 + }
  41 +
  42 + public void setMzh(String mzh) {
  43 + this.mzh = mzh;
  44 + }
  45 +
  46 + public String getHzxm() {
  47 + return hzxm;
  48 + }
  49 +
  50 + public void setHzxm(String hzxm) {
  51 + this.hzxm = hzxm;
  52 + }
  53 +
  54 + public String getSfzh() {
  55 + return sfzh;
  56 + }
  57 +
  58 + public void setSfzh(String sfzh) {
  59 + this.sfzh = sfzh;
  60 + }
  61 +}
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/RiskItem.java View file @ 3d016c7
  1 +package com.lyms.hospitalapi.qhdfy;
  2 +
  3 +/**
  4 + * Created by Administrator on 2021-08-23.
  5 + */
  6 +public class RiskItem {
  7 + private String syxh;
  8 + private String zyhm;
  9 + private String brxm;
  10 + private String cyks;
  11 + private String cybq;
  12 + private String zdys;
  13 + private String zdysdm;
  14 + private String zdrq;
  15 + private String zdxh;
  16 + private String zdmc;
  17 + private String zdlx;
  18 + private String zdbm;
  19 + private String rybq;
  20 +
  21 + public String getSyxh() {
  22 + return syxh;
  23 + }
  24 +
  25 + public void setSyxh(String syxh) {
  26 + this.syxh = syxh;
  27 + }
  28 +
  29 + public String getZyhm() {
  30 + return zyhm;
  31 + }
  32 +
  33 + public void setZyhm(String zyhm) {
  34 + this.zyhm = zyhm;
  35 + }
  36 +
  37 + public String getBrxm() {
  38 + return brxm;
  39 + }
  40 +
  41 + public void setBrxm(String brxm) {
  42 + this.brxm = brxm;
  43 + }
  44 +
  45 + public String getCyks() {
  46 + return cyks;
  47 + }
  48 +
  49 + public void setCyks(String cyks) {
  50 + this.cyks = cyks;
  51 + }
  52 +
  53 + public String getCybq() {
  54 + return cybq;
  55 + }
  56 +
  57 + public void setCybq(String cybq) {
  58 + this.cybq = cybq;
  59 + }
  60 +
  61 + public String getZdys() {
  62 + return zdys;
  63 + }
  64 +
  65 + public void setZdys(String zdys) {
  66 + this.zdys = zdys;
  67 + }
  68 +
  69 + public String getZdysdm() {
  70 + return zdysdm;
  71 + }
  72 +
  73 + public void setZdysdm(String zdysdm) {
  74 + this.zdysdm = zdysdm;
  75 + }
  76 +
  77 + public String getZdrq() {
  78 + return zdrq;
  79 + }
  80 +
  81 + public void setZdrq(String zdrq) {
  82 + this.zdrq = zdrq;
  83 + }
  84 +
  85 + public String getZdxh() {
  86 + return zdxh;
  87 + }
  88 +
  89 + public void setZdxh(String zdxh) {
  90 + this.zdxh = zdxh;
  91 + }
  92 +
  93 + public String getZdmc() {
  94 + return zdmc;
  95 + }
  96 +
  97 + public void setZdmc(String zdmc) {
  98 + this.zdmc = zdmc;
  99 + }
  100 +
  101 + public String getZdlx() {
  102 + return zdlx;
  103 + }
  104 +
  105 + public void setZdlx(String zdlx) {
  106 + this.zdlx = zdlx;
  107 + }
  108 +
  109 + public String getZdbm() {
  110 + return zdbm;
  111 + }
  112 +
  113 + public void setZdbm(String zdbm) {
  114 + this.zdbm = zdbm;
  115 + }
  116 +
  117 + public String getRybq() {
  118 + return rybq;
  119 + }
  120 +
  121 + public void setRybq(String rybq) {
  122 + this.rybq = rybq;
  123 + }
  124 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java View file @ 3d016c7
... ... @@ -246,7 +246,7 @@
246 246 @RequestParam("page") Integer page,
247 247 @RequestParam("limit") Integer limit,
248 248 @RequestParam(value = "showDetail", defaultValue = "0") Integer showDetail,
249   - @RequestParam(value = "isShowPhone") Integer isShowPhone,
  249 + @RequestParam(value = "isShowPhone",required = false) Integer isShowPhone,
250 250 @RequestParam(value = "buildDoctor", required = false) String buildDoctor,
251 251 @RequestParam(value = "provinceId", required = false) String provinceId,
252 252 @RequestParam(value = "cityId", required = false) String cityId,
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CommonController.java View file @ 3d016c7
1 1 package com.lyms.platform.operate.web.controller;
2 2  
3 3 import com.lyms.hospitalapi.hs.HsfyFmService;
  4 +import com.lyms.hospitalapi.qhdfy.QhdfyHighRiskService;
4 5 import org.springframework.beans.factory.annotation.Autowired;
5 6 import org.springframework.stereotype.Controller;
6 7 import org.springframework.web.bind.annotation.RequestMapping;
7 8  
... ... @@ -25,11 +26,20 @@
25 26 public class CommonController extends BaseController {
26 27 @Autowired
27 28 private HsfyFmService hsfyFmService;
  29 + @Autowired
  30 + private QhdfyHighRiskService qhdfyHighRiskService;
28 31  
29 32 @RequestMapping(method = RequestMethod.GET, value = "/hsfy")
30 33 @ResponseBody
31 34 public void hsfy(@RequestParam(required = false) String idCard,@RequestParam("start") String start,@RequestParam("end") String end) {
32 35 hsfyFmService.syncByPhone(start,end,idCard);
  36 + }
  37 +
  38 +
  39 + @RequestMapping(method = RequestMethod.GET, value = "/qhdfyRisk")
  40 + @ResponseBody
  41 + public void qhdfyRisk(@RequestParam(required = false) String start) {
  42 + qhdfyHighRiskService.getRiskItems(start);
33 43 }
34 44  
35 45  
platform-transfer/src/main/java/com/lyms/platform/conn/inf/BaseConnection.java View file @ 3d016c7
... ... @@ -19,14 +19,14 @@
19 19 public void close(Connection conn, Statement sta, ResultSet rst)
20 20 {
21 21 try {
22   - if (rst != null)
23   - {
24   - rst.close();
25   - }
26   - if (sta != null)
27   - {
28   - sta.close();
29   - }
  22 +// if (sta != null)
  23 +// {
  24 +// sta.close();
  25 +// }
  26 +// if (rst != null)
  27 +// {
  28 +// rst.close();
  29 +// }
30 30 if (conn != null)
31 31 {
32 32 conn.close();
platform-transfer/src/main/java/com/lyms/platform/worker/BoneTransferWorker.java View file @ 3d016c7
... ... @@ -85,7 +85,7 @@
85 85 String response = send(map, properties.getUrl() + "/saveBone");
86 86 if (response.contains("0"))
87 87 {
88   - sta.executeUpdate("update PatientInfo set status='1' where PatientID='"+PatientID+"'");
  88 + sta.executeUpdate("update PatientInfo set status='1' where PatientID='" + PatientID + "'");
89 89 conn.commit();
90 90 }
91 91 }