Commit a609c6e9120e8ba1e28047d2813f1ce5e4149a2c

Authored by liquanyu
1 parent 9f9a202ba0

血糖查询

Showing 3 changed files with 36 additions and 4 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BloodSugarController.java View file @ a609c6e
... ... @@ -113,6 +113,18 @@
113 113  
114 114  
115 115 /**
  116 + * 医生端查看数据
  117 + * @param patientId
  118 + * @return
  119 + */
  120 + @ResponseBody
  121 + @RequestMapping(value = "/doctorWx/{patientId}", method = RequestMethod.GET)
  122 + public BaseResponse getDoctorWx(@PathVariable String patientId) {
  123 + return bloodSugarService.getDoctorWx(patientId);
  124 + }
  125 +
  126 +
  127 + /**
116 128 * 院内系统血糖报告
117 129 * @param patientId
118 130 * @return
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IBloodSugarService.java View file @ a609c6e
... ... @@ -41,5 +41,7 @@
41 41 BaseResponse addDiabetesRecord(DiabetesRecordModel model);
42 42  
43 43 BaseResponse queryDiabetesRecord(String patientId);
  44 +
  45 + BaseResponse getDoctorWx(String patientId);
44 46 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java View file @ a609c6e
... ... @@ -188,11 +188,11 @@
188 188  
189 189 private String getBloodSugarStatus(Integer type, String bloodSugar) {
190 190 if (type == BloodSugarEnums.A.getId()) {
191   - return Double.parseDouble(bloodSugar) > 5.6D ? "高血糖" : Double.parseDouble(bloodSugar) < 3.3D ? "低血糖" : "正常";
192   - } else if (type == BloodSugarEnums.A.getId() || type == BloodSugarEnums.D.getId() || type == BloodSugarEnums.F.getId()) {
193   - return Double.parseDouble(bloodSugar) > 5.8D ? "高血糖" : Double.parseDouble(bloodSugar) < 3.3D ? "低血糖" : "正常";
  191 + return Double.parseDouble(bloodSugar) > 5.3D ? "高血糖" : Double.parseDouble(bloodSugar) < 3.3D ? "低血糖" : "正常";
  192 + } else if (type == BloodSugarEnums.D.getId() || type == BloodSugarEnums.F.getId()) {
  193 + return Double.parseDouble(bloodSugar) > 5.3D ? "高血糖" : Double.parseDouble(bloodSugar) < 3.3D ? "低血糖" : "正常";
194 194 } else if (type == BloodSugarEnums.H.getId()) {
195   - return Double.parseDouble(bloodSugar) > 7.8D ? "高血糖" : Double.parseDouble(bloodSugar) < 6.1D ? "低血糖" : "正常";
  195 + return Double.parseDouble(bloodSugar) > 6.7D ? "高血糖" : Double.parseDouble(bloodSugar) < 4.4D ? "低血糖" : "正常";
196 196 } else {
197 197 return Double.parseDouble(bloodSugar) > 6.7D ? "高血糖" : Double.parseDouble(bloodSugar) < 4.4D ? "低血糖" : "正常";
198 198 }
... ... @@ -1591,6 +1591,24 @@
1591 1591 }
1592 1592 }
1593 1593 return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(list);
  1594 + }
  1595 +
  1596 + @Override
  1597 + public BaseResponse getDoctorWx(String patientId) {
  1598 + Patients pat = patientsService.findOnePatientById(patientId);
  1599 + List<BloodSugar> bloodSugars = mongoTemplate.find(Query.query(Criteria.where("pid").is(pat.getPid()).and("yn").is(1)).with(new Sort(Sort.Direction.DESC, "created")), BloodSugar.class);
  1600 + List<Map<String, Object>> restList = new ArrayList<>();
  1601 + if(CollectionUtils.isNotEmpty(bloodSugars)) {
  1602 + for (BloodSugar bloodSugar : bloodSugars) {
  1603 + Map<String, Object> temp = new HashMap<>();
  1604 + temp.put("createTime", bloodSugar.getCreatYmdDate());
  1605 + temp.put("bloodSugar", bloodSugar.getBloodSugar());
  1606 + temp.put("bloodSugarType", BloodSugarEnums.getName(bloodSugar.getBloodSugarType()));
  1607 + temp.put("status", getBloodSugarStatus(bloodSugar.getBloodSugarType(), bloodSugar.getBloodSugar()));
  1608 + restList.add(temp);
  1609 + }
  1610 + }
  1611 + return RespBuilder.buildSuccess(restList);
1594 1612 }
1595 1613 }