Commit 54b597c79ddbd90d1a4129835030ddd53e66a41b
1 parent
92b8d5b3c8
Exists in
master
and in
6 other branches
更新
Showing 3 changed files with 15 additions and 8 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/IndividualCaseController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IndividualCaseService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/IndividualCaseServiceImpl.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/IndividualCaseController.java
View file @
54b597c
1 | 1 | package com.lyms.platform.operate.web.controller; |
2 | 2 | |
3 | +import javax.servlet.http.HttpServletRequest; | |
4 | +import javax.servlet.http.HttpServletResponse; | |
5 | + | |
3 | 6 | import org.springframework.beans.factory.annotation.Autowired; |
4 | 7 | import org.springframework.stereotype.Controller; |
5 | 8 | import org.springframework.web.bind.annotation.RequestMapping; |
... | ... | @@ -32,8 +35,8 @@ |
32 | 35 | @RequestMapping(method = RequestMethod.GET, value = "/highRiskList") |
33 | 36 | @ResponseBody |
34 | 37 | @TokenRequired |
35 | - public BaseResponse highRiskList(String pid) { | |
36 | - return service.highRiskList(pid); | |
38 | + public BaseResponse highRiskList(String pid, HttpServletRequest request) { | |
39 | + return service.highRiskList(pid, getUserId(request)); | |
37 | 40 | } |
38 | 41 | |
39 | 42 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IndividualCaseService.java
View file @
54b597c
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/IndividualCaseServiceImpl.java
View file @
54b597c
... | ... | @@ -18,6 +18,7 @@ |
18 | 18 | import com.lyms.platform.common.utils.DateUtil; |
19 | 19 | import com.lyms.platform.common.utils.JsonUtil; |
20 | 20 | import com.lyms.platform.common.utils.StringUtils; |
21 | +import com.lyms.platform.operate.web.facade.AutoMatchFacade; | |
21 | 22 | import com.lyms.platform.operate.web.result.IndividualCaseResult; |
22 | 23 | import com.lyms.platform.operate.web.service.IndividualCaseService; |
23 | 24 | import com.lyms.platform.operate.web.utils.CollectionUtils; |
... | ... | @@ -48,6 +49,9 @@ |
48 | 49 | @Autowired |
49 | 50 | private OrganizationService organizationService; |
50 | 51 | |
52 | + @Autowired | |
53 | + private AutoMatchFacade autoMatchFacade; | |
54 | + | |
51 | 55 | /** |
52 | 56 | * 产前妊娠风险评估记录 |
53 | 57 | * |
54 | 58 | |
55 | 59 | |
... | ... | @@ -55,16 +59,16 @@ |
55 | 59 | * @return |
56 | 60 | */ |
57 | 61 | @Override |
58 | - public BaseResponse highRiskList(String personId) { | |
59 | - | |
62 | + public BaseResponse highRiskList(String personId, Integer userId) { | |
63 | + String orgId = autoMatchFacade.getHospitalId(userId); | |
60 | 64 | List<IndividualCaseResult> results = new LinkedList<>(); |
61 | 65 | List<PersonModel> personModels = mongoTemplate.find(Query.query(Criteria.where("id").is(personId)), PersonModel.class); |
62 | 66 | if (CollectionUtils.isNotEmpty(personModels)) { |
63 | - List<Patients> patients = mongoTemplate.find(Query.query(Criteria.where("pid").is(personId)).with(new Sort(Sort.Direction.ASC, "created")), Patients.class); | |
67 | + List<Patients> patients = mongoTemplate.find(Query.query(Criteria.where("pid").is(personId).and("hospitalId").is(orgId)).with(new Sort(Sort.Direction.DESC, "lastMenses")), Patients.class); | |
64 | 68 | if (CollectionUtils.isNotEmpty(patients)) { |
65 | 69 | Patients patient = patients.get(0); |
66 | 70 | String patientId = patient.getId(); |
67 | - List<AntExChuModel> antExChuModels = mongoTemplate.find(Query.query(Criteria.where("parentId").is(patientId)), AntExChuModel.class); | |
71 | + List<AntExChuModel> antExChuModels = mongoTemplate.find(Query.query(Criteria.where("parentId").is(patientId).and("hospitalId").is(orgId)), AntExChuModel.class); | |
68 | 72 | if (CollectionUtils.isNotEmpty(antExChuModels)) { |
69 | 73 | AntExChuModel antExChuModel = antExChuModels.get(0); |
70 | 74 | String hospitalId = antExChuModel.getHospitalId(); |
... | ... | @@ -74,7 +78,7 @@ |
74 | 78 | results.add(result); |
75 | 79 | |
76 | 80 | } |
77 | - List<AntenatalExaminationModel> antenatalExaminationModels = mongoTemplate.find(Query.query(Criteria.where("parentId").is(patientId)).with(new Sort(Sort.Direction.DESC, "created")), AntenatalExaminationModel.class); | |
81 | + List<AntenatalExaminationModel> antenatalExaminationModels = mongoTemplate.find(Query.query(Criteria.where("parentId").is(patientId).and("hospitalId").is(orgId)).with(new Sort(Sort.Direction.DESC, "created")), AntenatalExaminationModel.class); | |
78 | 82 | if (CollectionUtils.isNotEmpty(antenatalExaminationModels)) { |
79 | 83 | for (AntenatalExaminationModel examinationModel : antenatalExaminationModels) { |
80 | 84 | String riskFactors = examinationModel.getRiskFactor(); |