Commit 36068873506cac056e61500bb68e9e5e3a97c6ab

Authored by wangbo
1 parent 38294292e6

妊高症报告接口提交

Showing 6 changed files with 174 additions and 12 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java View file @ 3606887
... ... @@ -3541,7 +3541,7 @@
3541 3541 PihModel pin = new PihModel();
3542 3542 //0 健康教育之孕期相关 1 饮食 2 饮食之营养指南 3 运动
3543 3543 pin.setType(1);
3544   - pin.setSymptomsType(1);
  3544 + pin.setSymptomsType(0);
3545 3545 Cell[] cells = s.getRow(i);
3546 3546 if (cells.length > 0) {
3547 3547 //遍历每行中的每列
... ... @@ -3588,7 +3588,7 @@
3588 3588 PihModel pin = new PihModel();
3589 3589 //0 健康教育之孕期相关 1 饮食 2 饮食之营养指南 3 运动
3590 3590 pin.setType(2);
3591   - pin.setSymptomsType(1);
  3591 + pin.setSymptomsType(0);
3592 3592 Cell[] cells = s1.getRow(i);
3593 3593 if (cells.length > 0) {
3594 3594 //遍历每行中的每列
... ... @@ -3635,7 +3635,7 @@
3635 3635 PihModel pih = new PihModel();
3636 3636 //0 健康教育之孕期相关 1 饮食 2 饮食之营养指南 3 运动
3637 3637 pih.setType(3);
3638   - pih.setSymptomsType(1);
  3638 + pih.setSymptomsType(0);
3639 3639 Cell[] cells = s2.getRow(i);
3640 3640 if (cells.length > 0) {
3641 3641 //遍历每行中的每列
... ... @@ -3793,7 +3793,7 @@
3793 3793 //1,阴性 2.阳性 3.可疑
3794 3794 //c1.无风险因素 2.甲亢 3.糖尿病 4.缺铁性贫血
3795 3795 pih.setType(1);
3796   - pih.setSymptomsType(3);
  3796 + pih.setSymptomsType(1);
3797 3797 Cell[] cells = s6.getRow(i);
3798 3798 if (cells.length > 0) {
3799 3799 //遍历每行中的每列
... ... @@ -3829,7 +3829,7 @@
3829 3829 //1,阴性 2.阳性 3.可疑
3830 3830 //c1.无风险因素 2.甲亢 3.糖尿病 4.缺铁性贫血
3831 3831 pih.setType(2);
3832   - pih.setSymptomsType(3);
  3832 + pih.setSymptomsType(1);
3833 3833 Cell[] cells = s7.getRow(i);
3834 3834 if (cells.length > 0) {
3835 3835 //遍历每行中的每列
... ... @@ -3865,7 +3865,7 @@
3865 3865 //1,阴性 2.阳性 3.可疑
3866 3866 //c1.无风险因素 2.甲亢 3.糖尿病 4.缺铁性贫血
3867 3867 pih.setType(3);
3868   - pih.setSymptomsType(3);
  3868 + pih.setSymptomsType(1);
3869 3869 Cell[] cells = s8.getRow(i);
3870 3870 if (cells.length > 0) {
3871 3871 //遍历每行中的每列
... ... @@ -3901,7 +3901,7 @@
3901 3901 //1,阴性 2.阳性 3.可疑
3902 3902 //c1.无风险因素 2.甲亢 3.糖尿病 4.缺铁性贫血
3903 3903 pih.setType(1);
3904   - pih.setSymptomsType(4);
  3904 + pih.setSymptomsType(3);
3905 3905 Cell[] cells = s9.getRow(i);
3906 3906 if (cells.length > 0) {
3907 3907 //遍历每行中的每列
... ... @@ -3937,7 +3937,7 @@
3937 3937 //1,阴性 2.阳性 3.可疑
3938 3938 //c1.无风险因素 2.甲亢 3.糖尿病 4.缺铁性贫血
3939 3939 pih.setType(2);
3940   - pih.setSymptomsType(4);
  3940 + pih.setSymptomsType(3);
3941 3941 Cell[] cells = s10.getRow(i);
3942 3942 if (cells.length > 0) {
3943 3943 //遍历每行中的每列
... ... @@ -3973,7 +3973,7 @@
3973 3973 //1,阴性 2.阳性 3.可疑
3974 3974 //c1.无风险因素 2.甲亢 3.糖尿病 4.缺铁性贫血
3975 3975 pih.setType(3);
3976   - pih.setSymptomsType(4);
  3976 + pih.setSymptomsType(3);
3977 3977 Cell[] cells = s11.getRow(i);
3978 3978 if (cells.length > 0) {
3979 3979 //遍历每行中的每列
platform-common/src/main/java/com/lyms/platform/common/enums/PihEnums.java View file @ 3606887
  1 +package com.lyms.platform.common.enums;
  2 +
  3 +public enum PihEnums {
  4 +
  5 + JK("4", "d42eec03-aa86-45b8-a4e0-78a0ff365fb6"),//健康
  6 + JKWXYW("2", "5aab6d3e422b03d4ad2bf840"),//甲状腺功能亢进(无需药物治疗)
  7 + JKXYYW("2", "5aab6d40422b03d4ad2bf85f"),//甲亢(需药物治疗)
  8 + TLBWXYW("1", "5aab6d3d422b03d4ad2bf83e"),//妊娠期糖尿病(无需药物治疗)
  9 + TLBBS("1", "5bbc0fff422b03d4ad2bf955"),//妊娠期糖尿病病史
  10 + TLBHBRC("1", "5aab6d3e422b03d4ad2bf83f"),//糖尿病合并妊娠(无需药物治疗)
  11 + XYYWTLB("1", "de7468e6-1bb5-4fab-ae84-78857868409a"),//需药物治疗的糖尿病
  12 + QTXPX("3", "5aab6d3e422b03d4ad2bf847"),//轻度缺铁性贫血(100-109g/L)
  13 + ZDPX("3", "5aab6d3e422b03d4ad2bf848");//中度缺铁性贫血(70-99g/L)
  14 +
  15 +
  16 + private String id;
  17 + private String HighRiskId;
  18 +
  19 + public String getId() {
  20 + return id;
  21 + }
  22 +
  23 + public String getHighRiskId() {
  24 + return HighRiskId;
  25 + }
  26 +
  27 + public static String getName(String id) {
  28 + PihEnums[] values = PihEnums.values();
  29 + for (PihEnums value : values) {
  30 + if (value.getId().equals(id)) {
  31 + return value.getHighRiskId();
  32 + }
  33 + }
  34 + return "";
  35 + }
  36 +
  37 + PihEnums(String id, String highRiskId) {
  38 + this.id = id;
  39 + HighRiskId = highRiskId;
  40 + }
  41 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/pihController.java View file @ 3606887
... ... @@ -11,6 +11,7 @@
11 11 import org.springframework.beans.factory.annotation.Autowired;
12 12 import org.springframework.stereotype.Controller;
13 13 import org.springframework.util.Assert;
  14 +import org.springframework.web.bind.annotation.PathVariable;
14 15 import org.springframework.web.bind.annotation.RequestMapping;
15 16 import org.springframework.web.bind.annotation.RequestMethod;
16 17 import org.springframework.web.bind.annotation.ResponseBody;
17 18  
... ... @@ -49,10 +50,18 @@
49 50 return RespBuilder.buildSuccess("请输入查询条件!");
50 51 }
51 52  
  53 + @RequestMapping(value = "/report/{id}", method = RequestMethod.GET)
  54 + @ResponseBody
  55 + public BaseResponse getPinReport(@PathVariable(value = "id") String id) {
  56 + return pihService.getPinReport(id);
  57 + }
  58 +
52 59 protected Integer getUserId(HttpServletRequest request) {
53 60 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
54 61 Assert.notNull(loginState, "未登录");
55 62 return loginState.getId();
56 63 }
  64 +
  65 +
57 66 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/PihService.java View file @ 3606887
... ... @@ -10,5 +10,7 @@
10 10  
11 11 public BaseResponse queyAll(String key, Integer weekStart, Integer weekEnd, Integer age, String type, Integer page, Integer limit, Integer userId);
12 12  
  13 + public BaseResponse getPinReport(String id);
  14 +
13 15 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PihServiceImpl.java View file @ 3606887
1 1 package com.lyms.platform.operate.web.service.impl;
2 2  
3 3 import com.alibaba.druid.proxy.jdbc.JdbcParameter;
  4 +import com.lyms.platform.biz.dal.IFolicAcidDao;
4 5 import com.lyms.platform.biz.service.CommonService;
  6 +import com.lyms.platform.common.enums.PihEnums;
5 7 import com.lyms.platform.common.result.BaseResponse;
6 8 import com.lyms.platform.common.result.PageResult;
7 9 import com.lyms.platform.common.result.RespBuilder;
8 10  
... ... @@ -9,8 +11,10 @@
9 11 import com.lyms.platform.common.utils.StringUtils;
10 12 import com.lyms.platform.operate.web.facade.OrganizationGroupsFacade;
11 13 import com.lyms.platform.operate.web.service.PihService;
  14 +import com.lyms.platform.operate.web.utils.CollectionUtils;
12 15 import com.lyms.platform.operate.web.utils.MongoUtil;
13 16 import com.lyms.platform.pojo.Patients;
  17 +import com.lyms.platform.pojo.PihModel;
14 18 import com.lyms.platform.pojo.PihParameterModel;
15 19 import org.springframework.beans.factory.annotation.Autowired;
16 20 import org.springframework.data.domain.Sort;
... ... @@ -33,8 +37,6 @@
33 37 @Autowired
34 38 private CommonService commonService;
35 39  
36   - @Autowired
37   - private MongoUtil mongoUtil;
38 40  
39 41 @Override
40 42 public void addPih(PihParameterModel parameterModel) {
... ... @@ -132,6 +134,115 @@
132 134 }
133 135 pageResult.setGrid(restList);
134 136 return RespBuilder.buildSuccess(pageResult);
  137 + }
  138 +
  139 + /**
  140 + * 妊高症报告
  141 + */
  142 + @Override
  143 + public BaseResponse getPinReport(String id) {
  144 + if (StringUtils.isNotEmpty(id)) {
  145 + Map<String, Object> datas = new HashMap<>();
  146 + PihParameterModel parameterModel = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(id)), PihParameterModel.class);
  147 + if (null != parameterModel) {
  148 + Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(parameterModel.getPid())), Patients.class);
  149 + if (patients != null) {
  150 + Map<String, Object> userInfo = new HashMap<>();
  151 + userInfo.put("username", patients.getUsername());
  152 + userInfo.put("week", DateUtil.getWeekDesc(patients.getLastMenses(), new Date()));
  153 + userInfo.put("age", patients.getAge());
  154 + userInfo.put("phone", patients.getPhone());
  155 + datas.put("userInfo", userInfo);
  156 + }
  157 + Map<String, Object> pihInfo = new HashMap<>();
  158 + pihInfo.put("ssyBT", parameterModel.getSsyBT() + "mmHg");
  159 + pihInfo.put("szyBT", parameterModel.getSzyBT() + "mmHg");
  160 + pihInfo.put("cvp", parameterModel.getCvp() + "(35-50mmHg)");
  161 + pihInfo.put("meanAP", parameterModel.getMeanAP() + "(85-95mmHg)");
  162 + pihInfo.put("pbpi", parameterModel.getPbpi() + "(<150)");
  163 + pihInfo.put("bsa", parameterModel.getBsa() + "m*m");
  164 + pihInfo.put("totalBloodVolume", parameterModel.getTotalBloodVolume() + "L");
  165 + pihInfo.put("sff", parameterModel.getSff() + "(0.33-0.4)");
  166 + pihInfo.put("bmi", parameterModel.getBmi() + "(<0.24)");
  167 + pihInfo.put("cardiacOutput", parameterModel.getCardiacOutput() + "L/min");
  168 + pihInfo.put("wzzl", parameterModel.getWzzl() + "(0.9-1.4)PRU");
  169 + pihInfo.put("aestheticVolume", parameterModel.getAestheticVolume() + "(60-100)ml");
  170 + pihInfo.put("cl", parameterModel.getCl() + "2.5-4L/(m*m*min)");
  171 + pihInfo.put("cardiacIndex", parameterModel.getCardiacIndex() + "40-60ml/(m*m)");
  172 + pihInfo.put("compliance", parameterModel.getCompliance() + "(1.2-2)ml/mmHg");
  173 + pihInfo.put("heartRate", parameterModel.getHeartRate() + "bpm");
  174 + pihInfo.put("cbf", parameterModel.getCbf());
  175 + pihInfo.put("bloodViscosity", parameterModel.getBloodViscosity() + "(3.8-4.5CP)");
  176 + pihInfo.put("arTime", parameterModel.getArTime() + "(20-33S)");
  177 + datas.put("pinInfo", pihInfo);
  178 + int week = DateUtil.getWeek2(patients.getLastMenses(), new Date());
  179 + if (StringUtils.isNotEmpty(parameterModel.getParameterResult())) {
  180 + List<PihModel> pihModels = mongoTemplate.find(Query.query(Criteria.where("symptomsType").is(0).and("type").is(Integer.valueOf(parameterModel.getParameterResult()))), PihModel.class);
  181 + if (CollectionUtils.isNotEmpty(pihModels)) {
  182 + Map<String, Object> InfoMap = new HashMap<>();
  183 + for (PihModel pih : pihModels) {
  184 + if (week >= pih.getStartWeek() && week <= pih.getEndWeek()) {
  185 + InfoMap.put("unscramble", pih.getUnscramble());
  186 + InfoMap.put("check", pih.getCheck());
  187 + InfoMap.put("diet", pih.getDiet());
  188 + InfoMap.put("lifeStyle", pih.getLifeStyle());
  189 + }
  190 + }
  191 + datas.put("Info", InfoMap);
  192 + }
  193 + }
  194 + List<String> risk = patients.getRiskFactorId();
  195 + if (CollectionUtils.isNotEmpty(risk)) {
  196 + Map<String, Object> map = new TreeMap();
  197 + for (String r : risk) {
  198 + if (StringUtils.isNotEmpty(r)) {
  199 + if (r.equals(PihEnums.TLBBS.getHighRiskId()) || r.equals(PihEnums.TLBHBRC.getHighRiskId()) ||
  200 + r.equals(PihEnums.TLBWXYW.getHighRiskId()) || r.equals(PihEnums.XYYWTLB.getHighRiskId())) {
  201 + map.put("1", "糖尿病");
  202 + }
  203 + if (r.equals(PihEnums.JKWXYW.getHighRiskId()) || r.equals(PihEnums.JKXYYW.getHighRiskId())) {
  204 + map.put("2", "甲亢");
  205 + }
  206 + if (r.equals(PihEnums.QTXPX.getHighRiskId()) || r.equals(PihEnums.ZDPX.getHighRiskId())) {
  207 + map.put("3", "贫血");
  208 + }
  209 + }
  210 + }
  211 + if (map.size() != 0 && null != map) {
  212 + if (StringUtils.isNotEmpty(parameterModel.getParameterResult())) {
  213 + //获取map中的第一个元素
  214 + String str = this.getKeyOrNull(map);
  215 + List<PihModel> pihModels = mongoTemplate.find(Query.query(Criteria.where("symptomsType").is(Integer.valueOf(str)).and("type").is(Integer.valueOf(parameterModel.getParameterResult()))), PihModel.class);
  216 + if (CollectionUtils.isNotEmpty(pihModels)) {
  217 + for (PihModel pih : pihModels) {
  218 + if (week >= pih.getStartWeek() && week <= pih.getEndWeek()) {
  219 + Map<String, Object> riskMap = new HashMap();
  220 + riskMap.put("title", "生活习惯、饮食建议指导");
  221 + riskMap.put("lifeStyle", pih.getLifeStyle());
  222 + datas.put("risk", riskMap);
  223 + }
  224 + }
  225 + }
  226 +
  227 + }
  228 + }
  229 + }
  230 + }
  231 + return RespBuilder.buildSuccess(datas);
  232 + }
  233 + return RespBuilder.buildSuccess("请选择一条记录");
  234 + }
  235 +
  236 +
  237 + private String getKeyOrNull(Map<String, Object> map) {
  238 + String obj = null;
  239 + for (Map.Entry<String, Object> entry : map.entrySet()) {
  240 + obj = entry.getKey();
  241 + if (obj != null) {
  242 + break;
  243 + }
  244 + }
  245 + return obj;
135 246 }
136 247  
137 248 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TemporaryBloodServiceImpl.java View file @ 3606887
... ... @@ -315,7 +315,6 @@
315 315 if (StringUtils.isNotEmpty(weight) && StringUtils.isNotEmpty(height) && StringUtils.isNotEmpty(bregmatic)) {
316 316 //Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(bloodPressure.getParentId())), Patients.class);
317 317 Integer weeks = DateUtil.getWeek(bloodModel.getLastMenses(), bloodModel.getModified());
318   - System.out.println("孕周:" + weeks);
319 318 Map paMap = new HashMap();
320 319 // paMap.put("vcCardNo", patients.getVcCardNo());
321 320 paMap.put("username", bloodModel.getUserName());