Commit aefa23cd29d329e4b90908525cd00f2e61678239

Authored by liquanyu
1 parent 9ab5ba4246

医生端小程序

Showing 3 changed files with 220 additions and 2 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntenatalExaminationController.java View file @ aefa23c
... ... @@ -522,7 +522,7 @@
522 522 @ResponseBody
523 523 @TokenRequired
524 524 public BaseResponse getActualReport(@RequestParam String checkTime, HttpServletRequest request) {
525   - return antExRecordFacade.getActualReport(checkTime,getUserId(request));
  525 + return antExRecordFacade.getActualReport(checkTime, getUserId(request));
526 526 }
527 527  
528 528 /**
... ... @@ -568,6 +568,18 @@
568 568 return baseResponse;
569 569 }
570 570  
  571 +
  572 + /**
  573 + * 获取孕妇的医生端小程序孕妇信息
  574 + * @param id
  575 + * @param request
  576 + * @return
  577 + */
  578 + @RequestMapping(method = RequestMethod.GET, value = "/antex/getDoctorWxPatientInfo/{id}")
  579 + @ResponseBody
  580 + public BaseResponse getDoctorWxPatientInfo(@PathVariable String id, HttpServletRequest request) {
  581 + return antenatalExaminationFacade.getDoctorWxPatientInfo(id);
  582 + }
571 583  
572 584 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ aefa23c
... ... @@ -2842,6 +2842,7 @@
2842 2842 }
2843 2843  
2844 2844  
  2845 +
2845 2846 public class SortIn {
2846 2847  
2847 2848 public SortIn(Patients patients) {
... ... @@ -3214,7 +3215,7 @@
3214 3215 }
3215 3216 Patients patients = null;
3216 3217 List<Patients> list = patientsService.queryPatient1(patientsQuery, "created");
3217   - System.out.println("分娩查询"+patientsQuery.convertToQuery().convertToMongoQuery().toString());
  3218 + System.out.println("分娩查询" + patientsQuery.convertToQuery().convertToMongoQuery().toString());
3218 3219 if (CollectionUtils.isNotEmpty(list)) {
3219 3220 for(Patients pat : list) {
3220 3221 if (StringUtils.isEmpty(pat.getSource()))
... ... @@ -5911,6 +5912,21 @@
5911 5912 mongoTemplate.updateFirst(updateQuery, update, AutoRiskRecord.class);
5912 5913 }
5913 5914 return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  5915 + }
  5916 +
  5917 +
  5918 +
  5919 + public BaseResponse getDoctorWxPatientInfo(String id) {
  5920 + Patients pat = patientsService.findOnePatientById(id);
  5921 + WxDoctorPatientInfoResult result = new WxDoctorPatientInfoResult();
  5922 + if (pat != null)
  5923 + {
  5924 + result.convertToResult(pat);
  5925 + HighScoreResult highScoreResult = findLastRisk(pat.getPid(), false);
  5926 + result.setRiskFactor(highScoreResult.getHighRisk());
  5927 + result.setRiskScore(highScoreResult.getScoreStr());
  5928 + }
  5929 + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(result);
5914 5930 }
5915 5931 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/WxDoctorPatientInfoResult.java View file @ aefa23c
  1 +package com.lyms.platform.operate.web.result;
  2 +
  3 +import com.lyms.platform.common.utils.DateUtil;
  4 +import com.lyms.platform.common.utils.StringUtils;
  5 +import com.lyms.platform.pojo.AntExChuModel;
  6 +import com.lyms.platform.pojo.AntenatalExaminationModel;
  7 +import com.lyms.platform.pojo.Patients;
  8 +
  9 +import java.util.ArrayList;
  10 +import java.util.Date;
  11 +import java.util.List;
  12 +import java.util.Map;
  13 +
  14 +/**
  15 + * 微信小程序医生端孕妇信息
  16 + * <p/>
  17 + * Created by Administrator on 2016/6/16 0016.
  18 + */
  19 +public class WxDoctorPatientInfoResult {
  20 +
  21 + private String id;
  22 +
  23 +
  24 + private String pid;
  25 + //名字
  26 + private String name;
  27 + //年龄
  28 + private Integer age;
  29 + //孕周
  30 + private String dueWeek;
  31 + //预产期
  32 + private String yChanQi;
  33 + //手机号
  34 + private String phone;
  35 + //高危因素
  36 + private List riskFactor;
  37 + //高危评分
  38 + private String riskScore;
  39 +
  40 + //末次月经
  41 + private String lastMenses;
  42 + //建档时间
  43 + private String buildTime;
  44 +
  45 + private String birth;
  46 + private String cardNo;
  47 +
  48 +
  49 +
  50 + public WxDoctorPatientInfoResult convertToResult(Patients patients) {
  51 + if (null != patients) {
  52 + setId(patients.getId());
  53 + try {
  54 + if (null != patients.getBirth()) {
  55 + setAge(DateUtil.getAge(patients.getBirth()));
  56 + setBirth(DateUtil.getyyyy_MM_dd(patients.getBirth()));
  57 + }
  58 + } catch (Exception e) {
  59 + }
  60 + setPid(patients.getPid());
  61 + if (null != patients.getDueDate()) {
  62 + setyChanQi(DateUtil.getyyyy_MM_dd(patients.getDueDate()));
  63 + }
  64 + setBuildTime(DateUtil.getyyyy_MM_dd(patients.getBookbuildingDate()));
  65 + setName(patients.getUsername());
  66 + setPhone(patients.getPhone());
  67 + setCardNo(patients.getCardNo());
  68 + if (null != patients.getDueStatus() && 1 == patients.getDueStatus()) {
  69 + this.dueWeek = "终止妊娠";
  70 + } else if (3 == patients.getType()) {
  71 + this.dueWeek = "已分娩";
  72 + } else {
  73 + if (null != patients.getLastMenses()) {
  74 + int days = DateUtil.daysBetween(patients.getLastMenses(), new Date());
  75 + this.dueWeek = StringUtils.dueWeek(days);
  76 + }
  77 + }
  78 + if (null != patients.getLastMenses()) {
  79 + setLastMenses(DateUtil.getyyyy_MM_dd(patients.getLastMenses()));
  80 + }
  81 +
  82 + }
  83 + return this;
  84 + }
  85 +
  86 +
  87 + public String getId() {
  88 + return id;
  89 + }
  90 +
  91 + public void setId(String id) {
  92 + this.id = id;
  93 + }
  94 +
  95 + public String getPid() {
  96 + return pid;
  97 + }
  98 +
  99 + public void setPid(String pid) {
  100 + this.pid = pid;
  101 + }
  102 +
  103 + public String getName() {
  104 + return name;
  105 + }
  106 +
  107 + public void setName(String name) {
  108 + this.name = name;
  109 + }
  110 +
  111 + public Integer getAge() {
  112 + return age;
  113 + }
  114 +
  115 + public void setAge(Integer age) {
  116 + this.age = age;
  117 + }
  118 +
  119 + public String getDueWeek() {
  120 + return dueWeek;
  121 + }
  122 +
  123 + public void setDueWeek(String dueWeek) {
  124 + this.dueWeek = dueWeek;
  125 + }
  126 +
  127 + public String getyChanQi() {
  128 + return yChanQi;
  129 + }
  130 +
  131 + public void setyChanQi(String yChanQi) {
  132 + this.yChanQi = yChanQi;
  133 + }
  134 +
  135 + public String getPhone() {
  136 + return phone;
  137 + }
  138 +
  139 + public void setPhone(String phone) {
  140 + this.phone = phone;
  141 + }
  142 +
  143 + public List getRiskFactor() {
  144 + return riskFactor;
  145 + }
  146 +
  147 + public void setRiskFactor(List riskFactor) {
  148 + this.riskFactor = riskFactor;
  149 + }
  150 +
  151 + public String getRiskScore() {
  152 + return riskScore;
  153 + }
  154 +
  155 + public void setRiskScore(String riskScore) {
  156 + this.riskScore = riskScore;
  157 + }
  158 +
  159 + public String getLastMenses() {
  160 + return lastMenses;
  161 + }
  162 +
  163 + public void setLastMenses(String lastMenses) {
  164 + this.lastMenses = lastMenses;
  165 + }
  166 +
  167 + public String getBuildTime() {
  168 + return buildTime;
  169 + }
  170 +
  171 + public void setBuildTime(String buildTime) {
  172 + this.buildTime = buildTime;
  173 + }
  174 +
  175 + public String getBirth() {
  176 + return birth;
  177 + }
  178 +
  179 + public void setBirth(String birth) {
  180 + this.birth = birth;
  181 + }
  182 +
  183 + public String getCardNo() {
  184 + return cardNo;
  185 + }
  186 +
  187 + public void setCardNo(String cardNo) {
  188 + this.cardNo = cardNo;
  189 + }
  190 +}