Commit dbbfa141bb8b7d57710905d2ac1a40473855d020
1 parent
71577ce449
Exists in
master
and in
6 other branches
修改电子病历
Showing 1 changed file with 54 additions and 41 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/WorkHR.java
View file @
dbbfa14
... | ... | @@ -89,7 +89,20 @@ |
89 | 89 | antExQuery.setYn(YnEnums.YES.getId()); |
90 | 90 | antExQuery.setHospitalId(null); |
91 | 91 | stopWatch.start("cap antex count"); |
92 | - List<AntenatalExaminationModel> ant = antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); | |
92 | + AntExChuQuery antExChuQuery1 = new AntExChuQuery(); | |
93 | + antExChuQuery1.setPid(patients.getPid()); | |
94 | + antExChuQuery1.setYn(YnEnums.YES.getId()); | |
95 | + stopWatch.start("query antexc list"); | |
96 | + List<AntExChuModel> chu = antExService.queryAntExChu(antExChuQuery1); | |
97 | + stopWatch.stop(); | |
98 | + //初诊为空就不用查复诊 | |
99 | + List<AntenatalExaminationModel> ant =null; | |
100 | + if(CollectionUtils.isNotEmpty(chu)){ | |
101 | + stopWatch.start("query antex list"); | |
102 | + ant=antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); | |
103 | + stopWatch.stop(); | |
104 | + } | |
105 | + | |
93 | 106 | int i = 0; |
94 | 107 | if (CollectionUtils.isNotEmpty(ant)) { |
95 | 108 | //复诊次数 |
96 | 109 | |
97 | 110 | |
... | ... | @@ -108,21 +121,19 @@ |
108 | 121 | } |
109 | 122 | } |
110 | 123 | } else { |
111 | - AntExChuQuery antExChuQuery1 = new AntExChuQuery(); | |
112 | - antExChuQuery1.setPid(patients.getPid()); | |
113 | - antExChuQuery1.setYn(YnEnums.YES.getId()); | |
114 | - List<AntExChuModel> chu = antExService.queryAntExChu(antExChuQuery1); | |
115 | - for (AntExChuModel a : chu) { | |
116 | - try { | |
117 | - if (StringUtils.isNotEmpty(a.getHospitalId())) { | |
118 | - Organization og = organizationService.getOrganization(Integer.valueOf(a.getHospitalId())); | |
119 | - if (null != og) { | |
120 | - riskPatientsResult.setCurrentCh(og.getName()); | |
121 | - break; | |
124 | + if(CollectionUtils.isNotEmpty(chu)){ | |
125 | + for (AntExChuModel a : chu) { | |
126 | + try { | |
127 | + if (StringUtils.isNotEmpty(a.getHospitalId())) { | |
128 | + Organization og = organizationService.getOrganization(Integer.valueOf(a.getHospitalId())); | |
129 | + if (null != og) { | |
130 | + riskPatientsResult.setCurrentCh(og.getName()); | |
131 | + break; | |
132 | + } | |
122 | 133 | } |
134 | + } catch (Exception e) { | |
135 | + riskPatientsResult.setCurrentCh(""); | |
123 | 136 | } |
124 | - } catch (Exception e) { | |
125 | - riskPatientsResult.setCurrentCh(""); | |
126 | 137 | } |
127 | 138 | } |
128 | 139 | } |
129 | 140 | |
130 | 141 | |
131 | 142 | |
132 | 143 | |
... | ... | @@ -130,20 +141,18 @@ |
130 | 141 | riskPatientsResult.setbTime(DateUtil.getyyyy_MM_dd(patients.getBookbuildingDate())); |
131 | 142 | antExChuQuery.setPid(patients.getPid()); |
132 | 143 | antExChuQuery.setYn(YnEnums.YES.getId()); |
144 | + | |
133 | 145 | //初诊次数 |
134 | - antExChuQuery.setHospitalId(null); | |
135 | - int b = antExService.queryAntExChuCount(antExChuQuery.convertToQuery()); | |
136 | - antExQuery.setHospitalId(hospital); | |
146 | + int b = CollectionUtils.isEmpty(chu)?0:chu.size(); | |
137 | 147 | //本院的复诊记录 |
138 | - int chi = antExService.queryAntenatalExaminationCount(antExQuery.convertToQuery()); | |
139 | - antExChuQuery.setHospitalId(hospital); | |
148 | + int chi = count(ant,hospital); | |
140 | 149 | //本院的初诊记录 |
141 | - int chb = antExService.queryAntExChuCount(antExChuQuery.convertToQuery()); | |
150 | + int chb = countAntChu(chu,hospital); | |
151 | + | |
142 | 152 | riskPatientsResult.setcTimes(i + b); |
143 | 153 | riskPatientsResult.setcHTimes(chi + chb); |
144 | 154 | String nextCheckTime = ""; |
145 | 155 | stopWatch.stop(); |
146 | - stopWatch.start("query antex count"); | |
147 | 156 | if(null!=patients.getNextCheckTime()){ |
148 | 157 | nextCheckTime = DateUtil.getyyyy_MM_dd(patients.getNextCheckTime()); |
149 | 158 | } |
... | ... | @@ -156,7 +165,6 @@ |
156 | 165 | } |
157 | 166 | } |
158 | 167 | |
159 | - stopWatch.stop(); | |
160 | 168 | //注册地址 |
161 | 169 | riskPatientsResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService)); |
162 | 170 | riskPatientsResult.setAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); |
163 | 171 | |
164 | 172 | |
165 | 173 | |
... | ... | @@ -222,28 +230,33 @@ |
222 | 230 | return dataList; |
223 | 231 | } |
224 | 232 | |
225 | - public static void main(String[] args) { | |
226 | - List level = new ArrayList(); | |
227 | - Map map = new HashMap(); | |
228 | - String name = "黄色预警"; | |
229 | - if (name.indexOf("预警") > -1) { | |
230 | - name = name.replace("预警", ""); | |
233 | + //统计复查里面的本院检查数 | |
234 | + private int count( List<AntenatalExaminationModel> list,String hospital){ | |
235 | + int count =0; | |
236 | + if(CollectionUtils.isEmpty(list)||StringUtils.isEmpty(hospital)){ | |
237 | + return count; | |
231 | 238 | } |
232 | - map.put("name", name); | |
233 | - map.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name)); | |
234 | - | |
235 | - Map map1 = new HashMap(); | |
236 | - String name1 = "绿色预警"; | |
237 | - if (name.indexOf("预警") > -1) { | |
238 | - name1 = name1.replace("预警", ""); | |
239 | + for(AntenatalExaminationModel model:list){ | |
240 | + if(hospital.equals(model.getHospitalId())){ | |
241 | + count++; | |
242 | + } | |
239 | 243 | } |
240 | - map1.put("name", name1); | |
241 | - map1.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name1)); | |
242 | - level.add(map1); | |
244 | + return count; | |
245 | + } | |
243 | 246 | |
244 | - level.add(map); | |
245 | - System.out.print(HighScoreResult.filter(level)); | |
246 | - ; | |
247 | + | |
248 | + //统计复查里面的本院检查数 | |
249 | + private int countAntChu( List<AntExChuModel> list,String hospital){ | |
250 | + int count =0; | |
251 | + if(CollectionUtils.isEmpty(list)||StringUtils.isEmpty(hospital)){ | |
252 | + return count; | |
253 | + } | |
254 | + for(AntExChuModel model:list){ | |
255 | + if(hospital.equals(model.getHospitalId())){ | |
256 | + count++; | |
257 | + } | |
258 | + } | |
259 | + return count; | |
247 | 260 | } |
248 | 261 | } |