Commit 1a7a276c983050452391f095d57c013701385937
1 parent
b1e20da468
Exists in
master
修改产检删除
Showing 3 changed files with 89 additions and 18 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
View file @
1a7a276
1 | 1 | package com.lyms.platform.operate.web.facade; |
2 | 2 | |
3 | -import com.lyms.platform.biz.service.AntExRecordService; | |
4 | -import com.lyms.platform.biz.service.BasicConfigService; | |
5 | -import com.lyms.platform.biz.service.PatientsService; | |
3 | +import com.lyms.platform.biz.service.*; | |
6 | 4 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
7 | 5 | import com.lyms.platform.common.enums.RiskDefaultTypeEnum; |
8 | 6 | import com.lyms.platform.common.enums.YnEnums; |
9 | 7 | |
10 | 8 | |
... | ... | @@ -21,13 +19,17 @@ |
21 | 19 | import com.lyms.platform.permission.model.Users; |
22 | 20 | import com.lyms.platform.permission.service.UsersService; |
23 | 21 | import com.lyms.platform.pojo.AntExRecordModel; |
22 | +import com.lyms.platform.pojo.AntenatalExaminationModel; | |
24 | 23 | import com.lyms.platform.pojo.BasicConfig; |
25 | 24 | import com.lyms.platform.pojo.Patients; |
25 | +import com.lyms.platform.query.AntExChuQuery; | |
26 | +import com.lyms.platform.query.AntExQuery; | |
26 | 27 | import com.lyms.platform.query.AntExRecordQuery; |
27 | 28 | import com.lyms.platform.query.PatientsQuery; |
28 | 29 | import org.apache.commons.collections.CollectionUtils; |
29 | 30 | import org.apache.commons.lang.math.NumberUtils; |
30 | 31 | import org.springframework.beans.factory.annotation.Autowired; |
32 | +import org.springframework.data.domain.Sort; | |
31 | 33 | import org.springframework.stereotype.Component; |
32 | 34 | |
33 | 35 | import java.util.*; |
... | ... | @@ -49,6 +51,10 @@ |
49 | 51 | private PatientsService patientsService; |
50 | 52 | @Autowired |
51 | 53 | private BasicConfigService basicConfigService; |
54 | + @Autowired | |
55 | + private CommonService commonService; | |
56 | + @Autowired | |
57 | + private AntenatalExaminationService antExService; | |
52 | 58 | |
53 | 59 | public void syncAntRecordToList(String hospitalId) { |
54 | 60 | recordService.syncAntRecordToList(hospitalId); |
55 | 61 | |
56 | 62 | |
... | ... | @@ -69,12 +75,65 @@ |
69 | 75 | antExRecordQuery.setName(antExManagerQueryRequest.getName()); |
70 | 76 | antExRecordQuery.setPhone(antExManagerQueryRequest.getPhone()); |
71 | 77 | |
72 | - List<AntExManagerResult> data =new ArrayList<>(); | |
78 | + List<AntExManagerResult> data = new ArrayList<>(); | |
73 | 79 | List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery); |
74 | 80 | if (CollectionUtils.isNotEmpty(antExRecordModelList)) { |
81 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
82 | + AntExQuery antExQuery = new AntExQuery(); | |
75 | 83 | for (AntExRecordModel e : antExRecordModelList) { |
76 | 84 | AntExManagerResult antExManagerResult = new AntExManagerResult(); |
77 | 85 | antExManagerResult.convertToResult(e); |
86 | + //登记人 | |
87 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(e.getBuildDoctor())) { | |
88 | + if (NumberUtils.isNumber(e.getBuildDoctor())) { | |
89 | + Users users = usersService.getUsers(NumberUtils.toInt(e.getBuildDoctor())); | |
90 | + if (null != users) { | |
91 | + antExManagerResult.setlName(users.getName()); | |
92 | + } else { | |
93 | + antExManagerResult.setlName(e.getBuildDoctor()); | |
94 | + } | |
95 | + } else { | |
96 | + antExManagerResult.setlName(e.getBuildDoctor()); | |
97 | + } | |
98 | + } | |
99 | + //产检医生 | |
100 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(e.getCheckDoctor())) { | |
101 | + if (NumberUtils.isNumber(e.getBuildDoctor())) { | |
102 | + Users users = usersService.getUsers(NumberUtils.toInt(e.getCheckDoctor())); | |
103 | + if (null != users) { | |
104 | + antExManagerResult.setCheckDoctor(users.getName()); | |
105 | + } else { | |
106 | + antExManagerResult.setCheckDoctor(e.getCheckDoctor()); | |
107 | + } | |
108 | + } else { | |
109 | + antExManagerResult.setCheckDoctor(e.getCheckDoctor()); | |
110 | + } | |
111 | + } | |
112 | + | |
113 | + antExQuery.setPid(e.getPid()); | |
114 | + antExQuery.setYn(YnEnums.YES.getId()); | |
115 | + antExQuery.setHospitalId(null); | |
116 | + antExChuQuery.setPid(e.getPid()); | |
117 | + antExChuQuery.setYn(YnEnums.YES.getId()); | |
118 | + antExChuQuery.setHospitalId(null); | |
119 | + | |
120 | + | |
121 | + int i = antExService.queryAntenatalExaminationCount(antExQuery.convertToQuery()); | |
122 | + antExChuQuery.setHospitalId(null); | |
123 | + int b = antExService.queryAntExChuCount(antExChuQuery.convertToQuery()); | |
124 | + antExQuery.setHospitalId(hospitalId); | |
125 | + //本院的复诊记录 | |
126 | + int chi = antExService.queryAntenatalExaminationCount(antExQuery.convertToQuery()); | |
127 | + antExChuQuery.setHospitalId(hospitalId); | |
128 | + //本院的初诊记录 | |
129 | + int chb = antExService.queryAntExChuCount(antExChuQuery.convertToQuery()); | |
130 | + antExManagerResult.settTimes(i + b); | |
131 | + antExManagerResult.setChTimes(chi + chb); | |
132 | + | |
133 | + //高危因素 | |
134 | + antExManagerResult.setrLevel(commonService.findRiskLevel(e.gethLevel())); | |
135 | + antExManagerResult.setRiskFactor(commonService.resloveFactor(e.gethRisk())); | |
136 | + | |
78 | 137 | data.add(antExManagerResult); |
79 | 138 | } |
80 | 139 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntExManagerResult.java
View file @
1a7a276
... | ... | @@ -2,16 +2,18 @@ |
2 | 2 | |
3 | 3 | import com.lyms.platform.common.base.IBasicResultConvert; |
4 | 4 | import com.lyms.platform.common.utils.DateUtil; |
5 | +import com.lyms.platform.common.utils.StringUtils; | |
5 | 6 | import com.lyms.platform.pojo.AntExChuModel; |
6 | 7 | import com.lyms.platform.pojo.AntExRecordModel; |
7 | 8 | import com.lyms.platform.pojo.AntenatalExaminationModel; |
8 | 9 | import com.lyms.platform.pojo.Patients; |
9 | 10 | |
10 | 11 | import java.util.List; |
12 | +import java.util.Map; | |
11 | 13 | |
12 | 14 | /** |
13 | - * 产检管理列表 | |
14 | - * | |
15 | + * 产检管理列表 | |
16 | + * <p/> | |
15 | 17 | * Created by Administrator on 2016/12/19 0019. |
16 | 18 | */ |
17 | 19 | public class AntExManagerResult { |
18 | 20 | |
... | ... | @@ -27,9 +29,10 @@ |
27 | 29 | private String age; |
28 | 30 | //产检孕周 |
29 | 31 | private String cDueWeek; |
30 | - | |
32 | + //风险等级 | |
33 | + private List<Map> rLevel; | |
31 | 34 | //高危因素 |
32 | - private List riskFactor; | |
35 | + private String riskFactor; | |
33 | 36 | //高危评分 |
34 | 37 | private String riskScore; |
35 | 38 | //本院产检次数 |
36 | 39 | |
... | ... | @@ -48,16 +51,28 @@ |
48 | 51 | //联系电话 |
49 | 52 | private String phone; |
50 | 53 | |
51 | - public AntexListResult convertToResult(AntExRecordModel e) { | |
54 | + public List<Map> getrLevel() { | |
55 | + return rLevel; | |
56 | + } | |
57 | + | |
58 | + public void setrLevel(List<Map> rLevel) { | |
59 | + this.rLevel = rLevel; | |
60 | + } | |
61 | + | |
62 | + public AntExManagerResult convertToResult(AntExRecordModel e) { | |
52 | 63 | setParentId(e.getParentId()); |
53 | 64 | setId(e.getId()); |
54 | 65 | setCheckTime(DateUtil.getyyyy_MM_dd(e.getCheckTime())); |
55 | 66 | setName(e.getName()); |
56 | 67 | setAge(DateUtil.getAge(e.getBrith()) + ""); |
57 | 68 | setPhone(e.getPhone()); |
58 | - int days=DateUtil.getDays(e.getCheckTime(),e.getLastMenses()); | |
59 | -// setcDueWeek(e.getCheckTime()); | |
60 | - return null; | |
69 | + setBarCode(e.getBarCode()); | |
70 | + int days = DateUtil.getDays(e.getCheckTime(), e.getLastMenses()); | |
71 | + setcDueWeek(StringUtils.dueWeek(days)); | |
72 | + setDueDate(DateUtil.getyyyy_MM_dd(e.getDueDate())); | |
73 | + setRiskScore(e.gethScore() + ""); | |
74 | + setNextCheckTime(DateUtil.getyyyy_MM_dd(e.getNextCheckTime())); | |
75 | + return this; | |
61 | 76 | } |
62 | 77 | |
63 | 78 | public String getId() { |
64 | 79 | |
... | ... | @@ -116,11 +131,11 @@ |
116 | 131 | this.cDueWeek = cDueWeek; |
117 | 132 | } |
118 | 133 | |
119 | - public List getRiskFactor() { | |
134 | + public String getRiskFactor() { | |
120 | 135 | return riskFactor; |
121 | 136 | } |
122 | 137 | |
123 | - public void setRiskFactor(List riskFactor) { | |
138 | + public void setRiskFactor(String riskFactor) { | |
124 | 139 | this.riskFactor = riskFactor; |
125 | 140 | } |
126 | 141 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/WorkHR.java
View file @
1a7a276
... | ... | @@ -216,10 +216,7 @@ |
216 | 216 | riskPatientsResult.setServiceStatus(ServiceStatusEnums.getNameById(patients.getServiceStatus())); |
217 | 217 | riskPatientsResult.setcTime(nextCheckTime); |
218 | 218 | stopWatch.start("query findLastRisk"); |
219 | - /*HighScoreResult highScoreResult = antenatalExaminationFacade.findLastRisk(patients.getPid(), true); | |
220 | - riskPatientsResult.setrFactor(highScoreResult.gethighRiskStr()); | |
221 | - riskPatientsResult.setrLevel(highScoreResult.filter(highScoreResult.getLevel())); | |
222 | - riskPatientsResult.sethScore(highScoreResult.getScore());*/ | |
219 | + | |
223 | 220 | //高危因素 |
224 | 221 | List<String> factor = patients.getRiskFactorId(); |
225 | 222 |