Commit 287abe6af7ff3d5c59498c60af927a530817d0db
1 parent
ac4a977171
Exists in
luanping
#fix:新增根据威县患者ID查询患者详情的接口
Showing 2 changed files with 54 additions and 1 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientController.java
View file @
287abe6
| 1 | 1 | package com.lyms.platform.operate.web.controller; |
| 2 | 2 | |
| 3 | 3 | import com.google.common.base.Strings; |
| 4 | +import com.lyms.platform.biz.service.AntExRecordService; | |
| 4 | 5 | import com.lyms.platform.biz.service.PatientsService; |
| 5 | 6 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 6 | 7 | import com.lyms.platform.common.result.BaseResponse; |
| 7 | 8 | import com.lyms.platform.common.utils.StringUtils; |
| 9 | +import com.lyms.platform.operate.web.facade.AntExRecordFacade; | |
| 10 | +import com.lyms.platform.operate.web.request.AntExManagerQueryRequest; | |
| 11 | +import com.lyms.platform.operate.web.result.AntExManagerResult; | |
| 8 | 12 | import com.lyms.platform.operate.web.utils.CollectionUtils; |
| 9 | 13 | import com.lyms.platform.operate.web.vo.PatientsDTO; |
| 14 | +import com.lyms.platform.pojo.AntExRecordModel; | |
| 10 | 15 | import com.lyms.platform.pojo.Patients; |
| 16 | +import com.lyms.platform.query.AntExRecordQuery; | |
| 11 | 17 | import com.lyms.platform.query.PatientsQuery; |
| 12 | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| 19 | +import org.springframework.data.domain.Sort; | |
| 13 | 20 | import org.springframework.stereotype.Controller; |
| 14 | 21 | import org.springframework.web.bind.annotation.*; |
| 15 | 22 | |
| 23 | +import java.util.HashMap; | |
| 16 | 24 | import java.util.List; |
| 25 | +import java.util.Map; | |
| 17 | 26 | |
| 18 | 27 | @Controller |
| 19 | 28 | public class PatientController { |
| ... | ... | @@ -66,6 +75,11 @@ |
| 66 | 75 | } |
| 67 | 76 | return baseResponse; |
| 68 | 77 | } |
| 78 | + @Autowired | |
| 79 | + private AntExRecordFacade antExRecordFacade; | |
| 80 | + @Autowired | |
| 81 | + private AntExRecordService recordService; | |
| 82 | + | |
| 69 | 83 | @RequestMapping(method = RequestMethod.GET,value = "/xtwx/getWXPatient") |
| 70 | 84 | public BaseResponse getWxPatients(@RequestParam("patienId") String patienId){ |
| 71 | 85 | BaseResponse baseResponse=new BaseResponse(); |
| ... | ... | @@ -83,7 +97,25 @@ |
| 83 | 97 | baseResponse.setErrormsg("当前患者未建档"); |
| 84 | 98 | return baseResponse; |
| 85 | 99 | } |
| 86 | - //antex/antexrecordlist 参考这个接口返回 | |
| 100 | + | |
| 101 | + AntExRecordQuery antExRecordQuery=new AntExRecordQuery(); | |
| 102 | + antExRecordQuery.setParentId(patientsList.get(0).getId()); | |
| 103 | + List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery, Sort.Direction.DESC, "created"); | |
| 104 | + if (CollectionUtils.isEmpty(antExRecordModelList)){ | |
| 105 | + baseResponse.setErrorcode(10001); | |
| 106 | + baseResponse.setErrormsg("产检记录不存在"); | |
| 107 | + return baseResponse; | |
| 108 | + } | |
| 109 | + List<AntExManagerResult> data = antExRecordFacade.getAntExRecords(antExRecordModelList, "2100002421", false, null); | |
| 110 | + if (CollectionUtils.isNotEmpty(data)){ | |
| 111 | + AntExManagerResult antExManagerResult= data.get(0); | |
| 112 | + Map<String,Object> params=new HashMap<>(); | |
| 113 | + params.put("rLevel",antExManagerResult.getrLevel()); | |
| 114 | + params.put("riskFactor",antExManagerResult.getRiskFactor()); | |
| 115 | + params.put("nextCheckTime",antExManagerResult.getNextCheckTime()); | |
| 116 | + params.put("username",antExManagerResult.getName()); | |
| 117 | + baseResponse.setObject(params); | |
| 118 | + } | |
| 87 | 119 | return baseResponse; |
| 88 | 120 | } |
| 89 | 121 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientWxController.java
View file @
287abe6
| 1 | 1 | package com.lyms.platform.operate.web.controller; |
| 2 | 2 | |
| 3 | +import com.google.common.base.Strings; | |
| 3 | 4 | import com.lyms.platform.biz.service.*; |
| 4 | 5 | import com.lyms.platform.common.base.BaseController; |
| 5 | 6 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| ... | ... | @@ -531,6 +532,26 @@ |
| 531 | 532 | return baseResponse; |
| 532 | 533 | }*/ |
| 533 | 534 | |
| 535 | + @RequestMapping(method = RequestMethod.GET,value = "/wx/getWXPatient") | |
| 536 | + public BaseResponse getWxPatients(@RequestParam("patientId") String patientId){ | |
| 537 | + BaseResponse baseResponse=new BaseResponse(); | |
| 538 | + if (Strings.isNullOrEmpty(patientId)){ | |
| 539 | + baseResponse.setErrorcode(-1); | |
| 540 | + baseResponse.setErrormsg("参数异常"); | |
| 541 | + return baseResponse; | |
| 542 | + } | |
| 543 | + PatientsQuery patientsQuery =new PatientsQuery(); | |
| 544 | + patientsQuery.setYn(1); | |
| 545 | + patientsQuery.setPatientHId(patientId); | |
| 546 | + List<Patients> patientsList=patientsService.queryPatient(patientsQuery); | |
| 547 | + if (CollectionUtils.isEmpty(patientsList)){ | |
| 548 | + baseResponse.setErrorcode(10001); | |
| 549 | + baseResponse.setErrormsg("当前患者未建档"); | |
| 550 | + return baseResponse; | |
| 551 | + } | |
| 552 | + baseResponse.setObject(patientsList.get(0)); | |
| 553 | + return baseResponse; | |
| 554 | + } | |
| 534 | 555 | /** |
| 535 | 556 | * 查询初诊接口 |
| 536 | 557 | * |