Commit 4336b95741478485869deb82eaf31873234f5189

Authored by litao@lymsh.com
1 parent 8ccbb2beef

1

Showing 6 changed files with 119 additions and 6 deletions

platform-common/src/main/java/com/lyms/platform/common/enums/FetalEnums.java View file @ 4336b95
... ... @@ -24,6 +24,17 @@
24 24 return null;
25 25 }
26 26  
  27 + public static String getTitle2(String id){
  28 + if (StringUtils.isNotEmpty(id)){
  29 + for (FetalEnums fetalEnums:FetalEnums.values()){
  30 + if (fetalEnums.getId().equals(id)){
  31 + return fetalEnums.getName();
  32 + }
  33 + }
  34 + }
  35 + return "--";
  36 + }
  37 +
27 38 private FetalEnums(String name,String id){
28 39 this.name=name;
29 40 this.id=id;
platform-common/src/main/java/com/lyms/platform/common/enums/FuZhongEnums.java View file @ 4336b95
... ... @@ -13,6 +13,17 @@
13 13 this.id=id;
14 14 this.name=name;
15 15 }
  16 +
  17 + public static String getName(String id) {
  18 + FuZhongEnums[] values = FuZhongEnums.values();
  19 + for (FuZhongEnums value : values) {
  20 + if(value.getId().equals(id)) {
  21 + return value.getName();
  22 + }
  23 + }
  24 + return "--";
  25 + }
  26 +
16 27 private String id;
17 28 private String name;
18 29  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java View file @ 4336b95
... ... @@ -9,10 +9,7 @@
9 9 import com.lyms.platform.operate.web.utils.CollectionUtils;
10 10 import org.springframework.beans.factory.annotation.Autowired;
11 11 import org.springframework.stereotype.Controller;
12   -import org.springframework.web.bind.annotation.RequestMapping;
13   -import org.springframework.web.bind.annotation.RequestMethod;
14   -import org.springframework.web.bind.annotation.RequestParam;
15   -import org.springframework.web.bind.annotation.ResponseBody;
  12 +import org.springframework.web.bind.annotation.*;
16 13  
17 14 import javax.servlet.http.HttpServletRequest;
18 15 import javax.servlet.http.HttpServletResponse;
... ... @@ -30,6 +27,16 @@
30 27  
31 28 @Autowired
32 29 private IReportService reportService;
  30 +
  31 +
  32 + /**
  33 + * 聊城曲线图
  34 + */
  35 + @ResponseBody
  36 + @RequestMapping(value = "/health/{parentId}", method = RequestMethod.GET)
  37 + public BaseObjectResponse health(@PathVariable String parentId) {
  38 + return reportService.health(parentId);
  39 + }
33 40  
34 41 /**
35 42 * 建档统计
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RemoteFacade.java View file @ 4336b95
... ... @@ -52,7 +52,7 @@
52 52 if(StringUtils.isNotEmpty(bpStatus)) {
53 53 patients = (patients == null ? mongoTemplate.findById(bloodPressure.getParentId(), Patients.class) : patients);
54 54 setTempInfo(bloodPressure.getId() + ID_SEPARATOR + entry.getKey(), temp, patients,
55   - entry.getValue().get("ssy") + "/" + entry.getValue().get("szy") + "mmHg", bpStatus, "(收缩压:90-140 舒张压:60-90)", ErrorPatientEnums.BLOOD_PRESSURE, bloodPressure.getModified());
  55 + entry.getValue().get("ssy") + "/" + entry.getValue().get("szy"), bpStatus, "(收缩压:90-140 舒张压:60-90)", ErrorPatientEnums.BLOOD_PRESSURE, bloodPressure.getModified());
56 56 }
57 57 }
58 58 }
... ... @@ -132,7 +132,7 @@
132 132 if(DateUtil.parseYMD(entry.getKey()).getTime() >= yesterday.getTime()) {
133 133 if(entry.getValue() < 36D || entry.getValue() > 38.5D ) {
134 134 patients = (patients == null ? mongoTemplate.findById(tempModel.getParentId(), Patients.class) : patients);
135   - setTempInfo(tempModel.getId() + ID_SEPARATOR + entry.getKey(), temp, patients, entry.getValue() + " °C", entry.getValue() < 36D ? "低热" : "高热",
  135 + setTempInfo(tempModel.getId() + ID_SEPARATOR + entry.getKey(), temp, patients, entry.getValue() + "", entry.getValue() < 36D ? "低热" : "高热",
136 136 "(36-37.4)", ErrorPatientEnums.TEMP, tempModel.getModified());
137 137 }
138 138 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IReportService.java View file @ 4336b95
... ... @@ -103,5 +103,7 @@
103 103 void patientsExport(String provinceId, String cityId, String aredId, String streetId, Integer statistType, Integer ageType, Integer patientType, Date startDate, Date endDate, Integer userId, HttpServletResponse response);
104 104  
105 105 void patientsExport2(String provinceId, String cityId, String areaId, String streetId, Integer ageType, Integer patientType, Date startDate, Date endDate, Integer userId, HttpServletResponse response);
  106 +
  107 + BaseObjectResponse health(String parentId);
106 108 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ 4336b95
1 1 package com.lyms.platform.operate.web.service.impl;
2 2  
3 3 import com.alibaba.fastjson.JSON;
  4 +import com.alibaba.fastjson.JSONObject;
4 5 import com.lyms.hospitalapi.pojo.ReportModel;
5 6 import com.lyms.platform.biz.service.CommonService;
6 7 import com.lyms.platform.common.enums.CouponEnums;
  8 +import com.lyms.platform.common.enums.FetalEnums;
  9 +import com.lyms.platform.common.enums.FuZhongEnums;
7 10 import com.lyms.platform.common.result.BaseObjectResponse;
8 11 import com.lyms.platform.common.result.PageResult;
9 12 import com.lyms.platform.common.result.RespBuilder;
... ... @@ -587,6 +590,85 @@
587 590 }
588 591 }
589 592 ResponseUtil.responseExcel(cnames, results, response);
  593 + }
  594 +
  595 + @Override
  596 + public BaseObjectResponse health(String parentId) {
  597 + List<Map<String, Object>> restList = new ArrayList<>();
  598 + Patients p = mongoTemplate.findById(parentId, Patients.class);
  599 + AntExChuModel antExChuModel = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(parentId).and("yn").is(1).and("hospitalId").is("216")).with(new Sort(Sort.Direction.DESC, "checkTime")), AntExChuModel.class);
  600 + List<AntenatalExaminationModel> antexModels = mongoTemplate.find(Query.query(Criteria.where("parentId").is(parentId).and("yn").is(1)).with(new Sort(Sort.Direction.DESC, "checkTime")), AntenatalExaminationModel.class);
  601 +
  602 +// antExChuModels.get()
  603 +
  604 + for (AntenatalExaminationModel antexModel : antexModels) {
  605 + Map<String, Object> temp = new HashMap<>();
  606 + temp.put("checkTime", DateUtil.getyyyy_MM_dd(antexModel.getCheckDate()));
  607 + temp.put("week", DateUtil.getWeek(p.getLastMenses(), antexModel.getCheckDate()));
  608 + temp.put("weight", antexModel.getWeight());
  609 + temp.put("bp", JSONObject.parseObject(antexModel.getBp()).getString("ssy") + "/" + JSONObject.parseObject(antexModel.getBp()).getString("szy"));
  610 + temp.put("gonggao", antexModel.getGongGao());
  611 + temp.put("abdominalCircumference", antexModel.getAbdominalCircumference());// 腹围
  612 +
  613 + List<Map> tireData = antexModel.getTireData();
  614 + String fetalPosition = "";
  615 + String heartRate = "";
  616 + String fetalPresentation = "";
  617 + if(CollectionUtils.isNotEmpty(tireData)) {
  618 + for (Map tireDatum : tireData) {
  619 + fetalPosition = fetalPosition.length() > 0 ? "/" + tireDatum.get("fetalPosition") : tireDatum.get("fetalPosition") + "";
  620 + heartRate = heartRate.length() > 0 ? "/" + tireDatum.get("heartRate") : tireDatum.get("heartRate") + "";
  621 + fetalPresentation = fetalPresentation.length() > 0 ? "/" + FetalEnums.getTitle2((String) tireDatum.get("fetalPosition")) : FetalEnums.getTitle2((String) tireDatum.get("fetalPosition"));
  622 + }
  623 + } else {
  624 + fetalPosition = "--";
  625 + heartRate = "--";
  626 + fetalPresentation = "--";
  627 + }
  628 + temp.put("fetalPosition", fetalPosition); // 胎位
  629 + temp.put("heartRate", heartRate); // 胎心
  630 + temp.put("fetalPresentation", fetalPresentation); // 先露
  631 + temp.put("edema",FuZhongEnums.getName(antexModel.getEdema())); // 水肿
  632 + temp.put("urineProtein", antexModel.getUrineProtein()); // 尿蛋白
  633 + temp.put("hemoglobin", antexModel.getHemoglobin()); // 血红素
  634 + restList.add(temp);
  635 + }
  636 +
  637 + // 添加初诊list
  638 + Map<String, Object> temp = new HashMap<>();
  639 + temp.put("checkTime", DateUtil.getyyyy_MM_dd(antExChuModel.getCheckTime()));
  640 + temp.put("week", DateUtil.getWeek(p.getLastMenses(), antExChuModel.getCheckTime()));
  641 + temp.put("weight", antExChuModel.getWeight());
  642 + temp.put("bp", JSONObject.parseObject(antExChuModel.getBp()).getString("ssy") + "/" + JSONObject.parseObject(antExChuModel.getBp()).getString("szy"));
  643 + temp.put("gonggao", antExChuModel.getGonggao());
  644 + temp.put("abdominalCircumference", antExChuModel.getFuwei());// 腹围
  645 +
  646 + List<Map> tireData = antExChuModel.getPlacentas();
  647 + String fetalPosition = "";
  648 + String heartRate = "";
  649 + String fetalPresentation = "";
  650 + if(CollectionUtils.isNotEmpty(tireData)) {
  651 + for (Map tireDatum : tireData) {
  652 + fetalPosition = fetalPosition.length() > 0 ? "/" + tireDatum.get("fetalPosition") : tireDatum.get("fetalPosition") + "";
  653 + heartRate = heartRate.length() > 0 ? "/" + tireDatum.get("heartRate") : tireDatum.get("heartRate") + "";
  654 + fetalPresentation = fetalPresentation.length() > 0 ? "/" + FetalEnums.getTitle2((String) tireDatum.get("fetalPosition")) : FetalEnums.getTitle2((String) tireDatum.get("fetalPosition"));
  655 + }
  656 + } else {
  657 + fetalPosition = "--";
  658 + heartRate = "--";
  659 + fetalPresentation = "--";
  660 + }
  661 +
  662 + temp.put("fetalPosition", fetalPosition); // 胎位
  663 + temp.put("heartRate", heartRate); // 胎心
  664 + temp.put("fetalPresentation", fetalPresentation); // 先露
  665 + temp.put("edema",FuZhongEnums.getName(antExChuModel.getEdema())); // 水肿
  666 + temp.put("urineProtein", antExChuModel.getNdb()); // 尿蛋白
  667 + temp.put("hemoglobin", antExChuModel.getXhdb()); // 血红素
  668 + restList.add(temp);
  669 +
  670 +
  671 + return RespBuilder.buildSuccess(restList);
590 672 }
591 673  
592 674 private List<Patients> getPatients(String provinceId, String cityId, String aredId, String streetId,