Commit cab56d96172a1035d0b2a9f3b6871d29f0ed26f2
1 parent
60f8c5fb78
Exists in
master
and in
6 other branches
产前诊断申请
Showing 2 changed files with 46 additions and 10 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/diagnosisFacaed.java
View file @
cab56d9
| 1 | 1 | package com.lyms.platform.operate.web.facade; |
| 2 | 2 | |
| 3 | -import com.lyms.platform.biz.service.ApplyOrderService; | |
| 4 | -import com.lyms.platform.biz.service.DiagnosisService; | |
| 5 | -import com.lyms.platform.biz.service.PatientsService; | |
| 6 | -import com.lyms.platform.biz.service.SieveService; | |
| 3 | +import com.lyms.platform.biz.service.*; | |
| 7 | 4 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 8 | 5 | import com.lyms.platform.common.enums.YnEnums; |
| 6 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
| 9 | 7 | import com.lyms.platform.common.result.BaseResponse; |
| 10 | 8 | import com.lyms.platform.common.utils.JsonUtil; |
| 11 | 9 | import com.lyms.platform.operate.web.result.DiagnosisResult; |
| 12 | 10 | import com.lyms.platform.operate.web.result.HighScoreResult; |
| 13 | 11 | import com.lyms.platform.permission.model.PatientService; |
| 12 | +import com.lyms.platform.pojo.AntExChuModel; | |
| 14 | 13 | import com.lyms.platform.pojo.Patients; |
| 15 | 14 | import com.lyms.platform.pojo.SieveApplyOrderModel; |
| 16 | 15 | import com.lyms.platform.pojo.SieveModel; |
| 16 | +import com.lyms.platform.query.AntExChuQuery; | |
| 17 | 17 | import com.lyms.platform.query.PatientsQuery; |
| 18 | 18 | import com.lyms.platform.query.SieveApplyOrderQuery; |
| 19 | 19 | import com.lyms.platform.query.SieveQuery; |
| ... | ... | @@ -45,6 +45,8 @@ |
| 45 | 45 | private ApplyOrderService applyOrderService; |
| 46 | 46 | @Autowired |
| 47 | 47 | private SieveService sieveService; |
| 48 | + @Autowired | |
| 49 | + private AntenatalExaminationService antenatalExaminationService; | |
| 48 | 50 | |
| 49 | 51 | |
| 50 | 52 | /** |
| 51 | 53 | |
| 52 | 54 | |
| 53 | 55 | |
| ... | ... | @@ -126,13 +128,21 @@ |
| 126 | 128 | }else{ |
| 127 | 129 | diagnosisResult.setIsCqSieve("0");//未筛查 |
| 128 | 130 | } |
| 131 | + diagnosisResult.convertToResult(pat); | |
| 132 | + diagnosisResult.setRiskFactor(highScoreResult.getHighRisk()); | |
| 133 | + diagnosisResult.setRiskScore(highScoreResult.getScoreStr()); | |
| 134 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
| 135 | + antExChuQuery.setParentId(pat.getId()); | |
| 136 | + antExChuQuery.setYn(YnEnums.YES.getId()); | |
| 129 | 137 | |
| 138 | + List<AntExChuModel> aList = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
| 139 | + if (CollectionUtils.isNotEmpty(aList)) { | |
| 140 | + AntExChuModel chuModel = aList.get(0); | |
| 141 | + diagnosisResult.setWeight(chuModel.getYqWeight()); | |
| 142 | + } | |
| 130 | 143 | |
| 131 | - | |
| 132 | 144 | } |
| 133 | - | |
| 134 | - | |
| 135 | - return null; | |
| 145 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(diagnosisResult); | |
| 136 | 146 | } |
| 137 | 147 | |
| 138 | 148 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/diagnosisResult.java
View file @
cab56d9
| 1 | 1 | package com.lyms.platform.operate.web.result; |
| 2 | 2 | |
| 3 | +import com.lyms.platform.common.utils.DateUtil; | |
| 4 | +import com.lyms.platform.common.utils.StringUtils; | |
| 5 | +import com.lyms.platform.pojo.Patients; | |
| 6 | + | |
| 7 | +import java.util.Date; | |
| 3 | 8 | import java.util.List; |
| 4 | 9 | |
| 5 | 10 | /** |
| ... | ... | @@ -224,7 +229,28 @@ |
| 224 | 229 | this.ztfeText = ztfeText; |
| 225 | 230 | } |
| 226 | 231 | |
| 227 | - public DiagnosisResult con(){ | |
| 232 | + public DiagnosisResult convertToResult(Patients patient){ | |
| 233 | + setName(patient.getUsername()); | |
| 234 | + try{ | |
| 235 | + if (null != patient.getBirth()) { | |
| 236 | + setAge(DateUtil.getAge(patient.getBirth())); | |
| 237 | + } | |
| 238 | + }catch (Exception e){ | |
| 239 | + e.printStackTrace(); | |
| 240 | + } | |
| 241 | + if (null != patient.getDueDate()) { | |
| 242 | + setyChanQi(DateUtil.getyyyy_MM_dd(patient.getDueDate())); | |
| 243 | + } | |
| 244 | + if (null != patient.getLastMenses()) { | |
| 245 | + int days = DateUtil.daysBetween(patient.getLastMenses(), new Date()); | |
| 246 | + this.dueWeek = StringUtils.dueWeek(days); | |
| 247 | + | |
| 248 | + setLastMenses(DateUtil.getyyyy_MM_dd(patient.getLastMenses())); | |
| 249 | + } | |
| 250 | + setMensStartDay(patient.getMensStartDay()); | |
| 251 | + setMensEndDay(patient.getMensEndDay()); | |
| 252 | + setMensStopStartDay(patient.getMensStopStartDay()); | |
| 253 | + setMensStopEndDay(patient.getMensStopEndDay()); | |
| 228 | 254 | |
| 229 | 255 | return this; |
| 230 | 256 | } |