Commit a162c3711202b947125f8092a09db805317808cd

Authored by wtt
1 parent 8ce8f9a0e3

update

Showing 7 changed files with 291 additions and 6 deletions

platform-common/src/main/java/com/lyms/platform/common/enums/BabyAutoDiagnoseEnums.java View file @ a162c37
... ... @@ -22,7 +22,8 @@
22 22 pf(8, "Apgar评分"),
23 23 zxfz(9, "窒息分钟"),
24 24 ts(10, "胎数"),
25   - tz(11, "体重");
  25 + tz(11, "体重"),
  26 + xhdb(12, "血红蛋白");
26 27  
27 28 private int id;
28 29 private String title;
platform-dal/src/main/java/com/lyms/platform/pojo/MaternalDeliverModel.java View file @ a162c37
... ... @@ -540,6 +540,8 @@
540 540 private String babyGender;
541 541 //新生儿重量
542 542 private String babyWeight;
  543 + //新生儿血红蛋白,自动诊断使用
  544 + private String babyXhdb;
543 545 //新生儿生长
544 546 private String babyHeight;
545 547 //畸形 0非畸形 1畸形
... ... @@ -721,6 +723,13 @@
721 723  
722 724 public Baby() {
723 725  
  726 + }
  727 + public String getBabyXhdb() {
  728 + return babyXhdb;
  729 + }
  730 +
  731 + public void setBabyXhdb(String babyXhdb) {
  732 + this.babyXhdb = babyXhdb;
724 733 }
725 734  
726 735 public String getBabyQX() {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyAutoDiagnoseRiskController.java View file @ a162c37
... ... @@ -7,6 +7,7 @@
7 7 import com.lyms.platform.operate.web.facade.BabyAutoDiagnoseRiskFacade;
8 8 import com.lyms.platform.operate.web.request.AntExManagerQueryRequest;
9 9 import com.lyms.platform.operate.web.request.BabyAutoRiskInfoRequest;
  10 +import com.lyms.platform.operate.web.request.LisResultModelRequest;
10 11 import com.lyms.platform.pojo.AutoBabyRiskRecord;
11 12 import org.apache.commons.lang.StringUtils;
12 13 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -18,6 +19,7 @@
18 19  
19 20 import javax.servlet.http.HttpServletRequest;
20 21 import javax.validation.Valid;
  22 +import java.util.List;
21 23  
22 24 /**
23 25 * 儿童自动诊断 控制层
... ... @@ -84,6 +86,14 @@
84 86 }
85 87  
86 88  
87   -
  89 + /**
  90 + * 对接系统:血红蛋白自动诊断高危因素
  91 + */
  92 + @RequestMapping(method = RequestMethod.POST, value = "/saveLisBabyData")
  93 + @ResponseBody
  94 + public BaseResponse saveLisBabyData(@Valid @RequestBody List<LisResultModelRequest> lisResultModelRequests) {
  95 + BaseResponse baseResponse = autoDiagnoseRiskFacade.saveLisBabyData(lisResultModelRequests);
  96 + return baseResponse;
  97 + }
88 98 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyAutoDiagnoseRiskFacade.java View file @ a162c37
... ... @@ -12,10 +12,7 @@
12 12 import com.lyms.platform.common.utils.DateUtil;
13 13 import com.lyms.platform.common.utils.ExceptionUtils;
14 14 import com.lyms.platform.common.utils.JsonUtil;
15   -import com.lyms.platform.operate.web.request.AntExManagerQueryRequest;
16   -import com.lyms.platform.operate.web.request.BabyAutoRiskInfoRequest;
17   -import com.lyms.platform.operate.web.request.BabyAutoRiskRequest;
18   -import com.lyms.platform.operate.web.request.MatDeliverAddRequest;
  15 +import com.lyms.platform.operate.web.request.*;
19 16 import com.lyms.platform.pojo.*;
20 17 import com.lyms.platform.query.*;
21 18 import net.sf.json.JSONArray;
... ... @@ -167,6 +164,7 @@
167 164 if (type == 0) {
168 165 MatDeliverQuery deliverQuery = new MatDeliverQuery();
169 166 deliverQuery.setParentId(babyAutoRiskRequest.getParentId());
  167 + deliverQuery.setYn(YnEnums.YES.getId());
170 168 List <MaternalDeliverModel> maternalDeliverModels = matDeliverService.query(deliverQuery);
171 169 if (CollectionUtils.isNotEmpty(maternalDeliverModels)) {
172 170 maternalDeliverModel = maternalDeliverModels.get(0);
173 171  
... ... @@ -434,7 +432,31 @@
434 432 }
435 433 }
436 434  
  435 + /*血红蛋白 12 */
  436 + if (isEnableItem(status, BabyAutoDiagnoseEnums.BabyDiagnoseEnums.xhdb.getId()) && maternalDeliverModel.getBaby() != null) {
  437 + List <MaternalDeliverModel.Baby> baby = maternalDeliverModel.getBaby();
  438 + if (CollectionUtils.isNotEmpty(baby)) {
  439 + MaternalDeliverModel.Baby baby1 = baby.get(ii);
  440 + if (baby1 != null) {
  441 + //配置是g,儿童建档和检查是kg
  442 + String babyXhdb = baby1.getBabyXhdb();
  443 + if (type == 2 && StringUtils.isNotEmpty(baby1.getBabyXhdb())) {
  444 + Double bXhdb = Double.parseDouble(baby1.getBabyXhdb());
  445 + babyXhdb = bXhdb.toString();
  446 + }
  447 + List <DiagnoseItemModel> items = mapItems.get(BabyAutoDiagnoseEnums.BabyDiagnoseEnums.xhdb.getId());
  448 + if (CollectionUtils.isNotEmpty(items) && StringUtils.isNotEmpty(babyXhdb)) {
  449 + for (DiagnoseItemModel item : items) {
  450 + if (compare(item, babyXhdb) && CollectionUtils.isNotEmpty(item.getRiskIds())) {
  451 + list.addAll(item.getRiskIds());
  452 + }
  453 + }
  454 + }
  455 + }
  456 + }
  457 + }
437 458  
  459 +
438 460 }
439 461  
440 462 if (list.size() > 0) {
... ... @@ -887,6 +909,62 @@
887 909 }
888 910 }
889 911 }
  912 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  913 + }
  914 +
  915 + /**
  916 + * 1 根据传入的list 信息查询对应的儿保检查
  917 + *
  918 + * 2 判断是否有血红蛋白值,如果有就不执行
  919 + *
  920 + * 3 没有值,根据血红蛋白值获取,高危因素
  921 + *
  922 + * 4 没有值,更新儿保检查高危因素(累加高危)
  923 + *
  924 + */
  925 + public BaseResponse saveLisBabyData( List<LisResultModelRequest> lisResultModelRequests) {
  926 +
  927 + for (LisResultModelRequest modelRequest: lisResultModelRequests) {
  928 +
  929 + if(StringUtils.isEmpty(modelRequest.getHospitalId()) || StringUtils.isEmpty(modelRequest.getVcCardNo())){
  930 + continue;
  931 + }
  932 + BabyModelQuery babyQuery = new BabyModelQuery();
  933 + babyQuery.setYn(YnEnums.YES.getId());
  934 + babyQuery.setHospitalId(modelRequest.getHospitalId());//查询上传医院儿童档案
  935 + babyQuery.setVcCardNo(modelRequest.getVcCardNo());
  936 + List <BabyModel> builds = babyBookbuildingService.queryBabyBuildByCond(babyQuery);
  937 + if (CollectionUtils.isNotEmpty(builds)) {
  938 + BabyModel babyModel = builds.get(0);
  939 + if(babyModel ==null && StringUtils.isEmpty(babyModel.getId())){
  940 + continue;
  941 + }
  942 + //获取最新的儿保检查
  943 + BabyCheckModelQuery query = new BabyCheckModelQuery();
  944 + query.setYn(YnEnums.YES.getId());
  945 + query.setBuildId(babyModel.getId());
  946 + List <BabyCheckModel> babyCheckModels = babyCheckService.queryBabyCheckRecord(query);
  947 + if (CollectionUtils.isNotEmpty(babyCheckModels)) {
  948 + BabyCheckModel babyCheckModel = babyCheckModels.get(0);
  949 + if(babyCheckModel ==null && StringUtils.isEmpty(babyCheckModel.getId())){
  950 + continue;
  951 + }
  952 + //获取当前儿保检查,诊断或高危因素
  953 + Set <String> setbabyModel = new HashSet <>();
  954 + List <String> babyModelList = JsonUtil.toList(babyCheckModel.getDiagnose(), String.class);
  955 + // 血红蛋白值,根据自动诊断规则,生成高危因素。并且将血红蛋白赋值儿保检查
  956 + //待续。。。。。
  957 + babyModelList.add("");
  958 +
  959 + setbabyModel.addAll(babyModelList);
  960 + JSONArray jsonArray = JSONArray.fromObject(setbabyModel);
  961 + mongoTemplate.updateFirst(new Query(Criteria.where("id").is(babyModel.getId())), Update.update("diagnose", jsonArray.toString()).set("highRisk",1), BabyModel.class);
  962 +
  963 + }
  964 + }
  965 +
  966 + }
  967 +
890 968 return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
891 969 }
892 970  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java View file @ a162c37
... ... @@ -665,6 +665,7 @@
665 665 List babys = new ArrayList();
666 666 MatDeliverAddRequest.Baby baby = new MatDeliverAddRequest.Baby();
667 667 baby.setBabyWeight(model.getWeight());
  668 + baby.setBabyXhdb(model.getHemoglobin());//血红蛋白
668 669 babys.add(baby);
669 670 babyAutoRiskRequest.setBabies(babys);
670 671 babyAutoRiskRequest.setHospitalId(model.getHospitalId());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/LisResultModelRequest.java View file @ a162c37
  1 +package com.lyms.platform.operate.web.request;
  2 +
  3 +/**
  4 + * lis检查结果返回实体类
  5 + *
  6 + */
  7 +public class LisResultModelRequest {
  8 +
  9 + // 血红蛋白
  10 + private String xhdb;
  11 + private String lisId;
  12 + private String title;
  13 + private String type;
  14 + private String vcCardNo;
  15 + private String name;
  16 +
  17 + private String publish_Time;
  18 + private String sex;
  19 + private String age;
  20 +
  21 +
  22 + // 单位
  23 + private String unit;
  24 + //检验时间
  25 + private String CHECK_TIME;
  26 + //报告发布时间
  27 + private String PUBLISH_TIME;
  28 +
  29 + //身份证
  30 + private String cardNo;
  31 + //手机号
  32 + private String phone;
  33 + //机构id
  34 + private String hospitalId;
  35 +
  36 + public String getXhdb() {
  37 + return xhdb;
  38 + }
  39 +
  40 + public void setXhdb(String xhdb) {
  41 + this.xhdb = xhdb;
  42 + }
  43 +
  44 + public String getUnit() {
  45 + return unit;
  46 + }
  47 +
  48 + public void setUnit(String unit) {
  49 + this.unit = unit;
  50 + }
  51 +
  52 + public String getCHECK_TIME() {
  53 + return CHECK_TIME;
  54 + }
  55 +
  56 + public void setCHECK_TIME(String CHECK_TIME) {
  57 + this.CHECK_TIME = CHECK_TIME;
  58 + }
  59 +
  60 + public String getPUBLISH_TIME() {
  61 + return PUBLISH_TIME;
  62 + }
  63 +
  64 + public void setPUBLISH_TIME(String PUBLISH_TIME) {
  65 + this.PUBLISH_TIME = PUBLISH_TIME;
  66 + }
  67 +
  68 + public String getVcCardNo() {
  69 + return vcCardNo;
  70 + }
  71 +
  72 + public void setVcCardNo(String vcCardNo) {
  73 + this.vcCardNo = vcCardNo;
  74 + }
  75 +
  76 + public String getCardNo() {
  77 + return cardNo;
  78 + }
  79 +
  80 + public void setCardNo(String cardNo) {
  81 + this.cardNo = cardNo;
  82 + }
  83 +
  84 + public String getPhone() {
  85 + return phone;
  86 + }
  87 +
  88 + public void setPhone(String phone) {
  89 + this.phone = phone;
  90 + }
  91 +
  92 + public String getHospitalId() {
  93 + return hospitalId;
  94 + }
  95 +
  96 + public void setHospitalId(String hospitalId) {
  97 + this.hospitalId = hospitalId;
  98 + }
  99 +
  100 + public String getLisId() {
  101 + return lisId;
  102 + }
  103 +
  104 + public void setLisId(String lisId) {
  105 + this.lisId = lisId;
  106 + }
  107 +
  108 + public String getTitle() {
  109 + return title;
  110 + }
  111 +
  112 + public void setTitle(String title) {
  113 + this.title = title;
  114 + }
  115 +
  116 + public String getType() {
  117 + return type;
  118 + }
  119 +
  120 + public void setType(String type) {
  121 + this.type = type;
  122 + }
  123 +
  124 + public String getName() {
  125 + return name;
  126 + }
  127 +
  128 + public void setName(String name) {
  129 + this.name = name;
  130 + }
  131 +
  132 + public String getPublish_Time() {
  133 + return publish_Time;
  134 + }
  135 +
  136 + public void setPublish_Time(String publish_Time) {
  137 + this.publish_Time = publish_Time;
  138 + }
  139 +
  140 + public String getSex() {
  141 + return sex;
  142 + }
  143 +
  144 + public void setSex(String sex) {
  145 + this.sex = sex;
  146 + }
  147 +
  148 + public String getAge() {
  149 + return age;
  150 + }
  151 +
  152 + public void setAge(String age) {
  153 + this.age = age;
  154 + }
  155 +
  156 + @Override
  157 + public String toString() {
  158 + return "LisResultModel{" +
  159 + "xhdb='" + xhdb + '\'' +
  160 + ", lisId='" + lisId + '\'' +
  161 + ", title='" + title + '\'' +
  162 + ", type='" + type + '\'' +
  163 + ", vcCardNo='" + vcCardNo + '\'' +
  164 + ", name='" + name + '\'' +
  165 + ", publish_Time='" + publish_Time + '\'' +
  166 + ", sex='" + sex + '\'' +
  167 + ", age='" + age + '\'' +
  168 + ", unit='" + unit + '\'' +
  169 + ", CHECK_TIME='" + CHECK_TIME + '\'' +
  170 + ", PUBLISH_TIME='" + PUBLISH_TIME + '\'' +
  171 + ", cardNo='" + cardNo + '\'' +
  172 + ", phone='" + phone + '\'' +
  173 + ", hospitalId='" + hospitalId + '\'' +
  174 + '}';
  175 + }
  176 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatDeliverAddRequest.java View file @ a162c37
... ... @@ -1207,6 +1207,8 @@
1207 1207 private String babyGender;
1208 1208 //新生儿重量
1209 1209 private String babyWeight;
  1210 + //新生儿血红蛋白,自动诊断使用
  1211 + private String babyXhdb;
1210 1212 //新生儿生长
1211 1213 private String babyHeight;
1212 1214 //畸形 0非畸形 1畸形
1213 1215  
... ... @@ -1400,7 +1402,14 @@
1400 1402 this.otherInfo = otherInfo;
1401 1403 }
1402 1404  
  1405 + public String getBabyXhdb() {
  1406 + return babyXhdb;
  1407 + }
1403 1408  
  1409 + public void setBabyXhdb(String babyXhdb) {
  1410 + this.babyXhdb = babyXhdb;
  1411 + }
  1412 +
1404 1413 @Override
1405 1414 public MaternalDeliverModel.Baby convertToDataModel() {
1406 1415 MaternalDeliverModel.Baby baby = new MaternalDeliverModel.Baby();
... ... @@ -1414,6 +1423,7 @@
1414 1423 }
1415 1424 baby.setBabyHealthy(babyHealthy);
1416 1425 baby.setBabyWeight(babyWeight);
  1426 + baby.setBabyXhdb(babyXhdb);
1417 1427 baby.setBabyHeight(babyHeight);
1418 1428 baby.setDeformity(deformity);
1419 1429 baby.setPregnancyOut(pregnancyOut);