Commit e3d84f7bc1158c13cef24cdd4d3101c7f2b79922

Authored by yangfei
1 parent 7c4b393dea

产检医生统计

Showing 1 changed file with 20 additions and 7 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntexDoctorStatistController.java View file @ e3d84f7
... ... @@ -187,11 +187,25 @@
187 187 //复诊集合列表
188 188 List<AntenatalExaminationModel> antenatalExaminationModels = antExService.queryAntenatalExamination(antExQuery.convertToQuery());
189 189  
  190 + //复诊:患者id
  191 + Map<String,Integer> hostNum = new HashMap<>();
  192 +
190 193 //添加初诊结果
191 194 for (AntExChuModel ac : antExChuModels) {
192 195 AntextDoctorPatient doctorPatient = resultInfo.get(ac.getParentId());
193 196 doctorPatient.setAllCjNum(doctorPatient.getAllCjNum() + 1);
194   -
  197 + if(ac.getHospitalId().equals(hospital)){//如果医院id相同,
  198 + if(hostNum.containsKey(ac.getPid())){
  199 + int num = hostNum.get(ac.getPid());
  200 + num++;
  201 + if(num>doctorPatient.getCjNum()){
  202 + doctorPatient.setCjNum(num);
  203 + }
  204 + hostNum.put(ac.getPid(),num);
  205 + }else{
  206 + hostNum.put(ac.getPid(),1);
  207 + }
  208 + }
195 209 if (ac.getCheckTime().after(doctorPatient.getCheckTime())) {
196 210 doctorPatient.setCheckTime(ac.getCheckTime());
197 211 doctorPatient.setDoctorId(ac.getProdDoctor());
198 212  
199 213  
200 214  
201 215  
... ... @@ -199,22 +213,21 @@
199 213 doctorPatient.setCheckTimeStr(DateUtil.getyyyy_MM_dd(doctorPatient.getCheckTime()));
200 214 }
201 215  
202   - //复诊:本院id+医生Id
203   - Map<String,Integer> hostNum = new HashMap<>();
204 216  
  217 +
205 218 //添加复诊结果
206 219 for (AntenatalExaminationModel aec : antenatalExaminationModels) {
207 220 AntextDoctorPatient doctorPatient = resultInfo.get(aec.getParentId());
208 221 if(aec.getHospitalId().equals(hospital)){//如果医院id相同,
209   - if(hostNum.containsKey(aec.getId())){//则当次数大于已经记录次数时进行加加,同一医院只有一次初检,所以初检不做处理
210   - int num = hostNum.get(aec.getId());
  222 + if(hostNum.containsKey(aec.getPid())){
  223 + int num = hostNum.get(aec.getPid());
211 224 num++;
212 225 if(num>doctorPatient.getCjNum()){
213 226 doctorPatient.setCjNum(num);
214 227 }
215   - hostNum.put(aec.getId(),num);
  228 + hostNum.put(aec.getPid(),num);
216 229 }else{
217   - hostNum.put(aec.getId(),1);
  230 + hostNum.put(aec.getPid(),1);
218 231 }
219 232 }
220 233