Commit d232299b1068020b233498ae5f39a22a197d4e4b
1 parent
11a6a537a3
Exists in
master
and in
6 other branches
追访加入查询条件
Showing 2 changed files with 168 additions and 66 deletions
platform-dal/src/main/java/com/lyms/platform/query/TrackDownRecordQuery.java
View file @
d232299
| ... | ... | @@ -35,6 +35,7 @@ | 
| 35 | 35 | private Integer trackType; | 
| 36 | 36 | private List trackTypes; | 
| 37 | 37 | private String parentId; | 
| 38 | + private List<String> parentIds; | |
| 38 | 39 | private List<String> pids; | 
| 39 | 40 | private String hospitalId; | 
| 40 | 41 | private String residentsArchiveId; | 
| ... | ... | @@ -52,6 +53,14 @@ | 
| 52 | 53 | */ | 
| 53 | 54 | private Date lastMensesEnd; | 
| 54 | 55 | |
| 56 | + public List<String> getParentIds() { | |
| 57 | + return parentIds; | |
| 58 | + } | |
| 59 | + | |
| 60 | + public void setParentIds(List<String> parentIds) { | |
| 61 | + this.parentIds = parentIds; | |
| 62 | + } | |
| 63 | + | |
| 55 | 64 | public String getPhone() { | 
| 56 | 65 | return phone; | 
| 57 | 66 | } | 
| 58 | 67 | |
| ... | ... | @@ -253,10 +262,13 @@ | 
| 253 | 262 | condition = condition.and("parentId", parentId, MongoOper.IS); | 
| 254 | 263 | } | 
| 255 | 264 | |
| 265 | + if (null!=parentIds) { | |
| 266 | + condition = condition.and("parentId", parentIds, MongoOper.IN); | |
| 267 | + } | |
| 268 | + | |
| 256 | 269 | if (null != pids) { | 
| 257 | 270 | condition = condition.and("pid", pids, MongoOper.IN); | 
| 258 | 271 | } | 
| 259 | - | |
| 260 | 272 | |
| 261 | 273 | Criteria c1 = null; | 
| 262 | 274 | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TrackDownFacade.java
View file @
d232299
| ... | ... | @@ -8,14 +8,13 @@ | 
| 8 | 8 | import com.lyms.platform.common.result.BaseResponse; | 
| 9 | 9 | import com.lyms.platform.common.result.PageResult; | 
| 10 | 10 | import com.lyms.platform.common.result.RespBuilder; | 
| 11 | -import com.lyms.platform.common.utils.DateUtil; | |
| 12 | -import com.lyms.platform.common.utils.JsonUtil; | |
| 13 | -import com.lyms.platform.common.utils.StringUtils; | |
| 14 | -import com.lyms.platform.common.utils.SystemConfig; | |
| 11 | +import com.lyms.platform.common.utils.*; | |
| 15 | 12 | import com.lyms.platform.operate.web.request.TrackDownQueryRequest; | 
| 13 | +import com.lyms.platform.operate.web.result.HighScoreResult; | |
| 16 | 14 | import com.lyms.platform.operate.web.utils.CommonsHelper; | 
| 17 | 15 | import com.lyms.platform.pojo.*; | 
| 18 | 16 | import com.lyms.platform.query.MatDeliverQuery; | 
| 17 | +import com.lyms.platform.query.PatientsQuery; | |
| 19 | 18 | import com.lyms.platform.query.PostReviewQuery; | 
| 20 | 19 | import com.lyms.platform.query.TrackDownRecordQuery; | 
| 21 | 20 | import org.apache.commons.collections.CollectionUtils; | 
| ... | ... | @@ -49,9 +48,6 @@ | 
| 49 | 48 | public class TrackDownFacade { | 
| 50 | 49 | |
| 51 | 50 | |
| 52 | - | |
| 53 | - | |
| 54 | - | |
| 55 | 51 | /** | 
| 56 | 52 | * 构建返回字段 | 
| 57 | 53 | */ | 
| 58 | 54 | |
| ... | ... | @@ -67,10 +63,16 @@ | 
| 67 | 63 | Map build(TrackDownRecord downRecord, MongoTemplate mongoTemplate); | 
| 68 | 64 | } | 
| 69 | 65 | |
| 66 | + @Autowired | |
| 67 | + private PatientsService patientsService; | |
| 68 | + | |
| 70 | 69 | //日志调测器 | 
| 71 | 70 | private static final Logger logger = LoggerFactory.getLogger(TrackDownFacade.class); | 
| 72 | 71 | |
| 73 | 72 | @Autowired | 
| 73 | + private AntExRecordService recordService; | |
| 74 | + | |
| 75 | + @Autowired | |
| 74 | 76 | private TrackDownRecordService trackDownRecordService; | 
| 75 | 77 | |
| 76 | 78 | @Autowired | 
| ... | ... | @@ -89,8 +91,6 @@ | 
| 89 | 91 | */ | 
| 90 | 92 | @Autowired | 
| 91 | 93 | private ResidentsArchiveService residentsArchiveService; | 
| 92 | - @Autowired | |
| 93 | - private PatientsService patientsService; | |
| 94 | 94 | |
| 95 | 95 | @Autowired | 
| 96 | 96 | private PostReviewService postReviewService; | 
| ... | ... | @@ -120,6 +120,7 @@ | 
| 120 | 120 | |
| 121 | 121 | /** | 
| 122 | 122 | * 追访概况备选方案 | 
| 123 | + * | |
| 123 | 124 | * @param map | 
| 124 | 125 | * @return | 
| 125 | 126 | */ | 
| 126 | 127 | |
| 127 | 128 | |
| 128 | 129 | |
| 129 | 130 | |
| 130 | 131 | |
| 131 | 132 | |
| 132 | 133 | |
| 133 | 134 | |
| 134 | 135 | |
| 135 | 136 | |
| 136 | 137 | |
| 137 | 138 | |
| 138 | 139 | |
| 139 | 140 | |
| 140 | 141 | |
| 141 | 142 | |
| ... | ... | @@ -138,45 +139,78 @@ | 
| 138 | 139 | * @return | 
| 139 | 140 | */ | 
| 140 | 141 | private TrackDownRecordQuery convertNaviteQuery(TrackDownQueryRequest downQueryRequest, Integer userId) { | 
| 141 | - if(downQueryRequest.getStartCheckTime()!=null){//产检开始日期 | |
| 142 | 142 | |
| 143 | - } | |
| 144 | - if(downQueryRequest.getEndCheckTime()!=null){//产检结束日期 | |
| 143 | + boolean isPatient = false; | |
| 144 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
| 145 | 145 | |
| 146 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 147 | + if (downQueryRequest.getStartDueDate() != null) {//预产期开始日期 | |
| 148 | + patientsQuery.setDueDateStart(downQueryRequest.getStartFmTime()); | |
| 149 | + isPatient = true; | |
| 146 | 150 | } | 
| 147 | - if(downQueryRequest.getStartNextCheckTime()!=null){//下次产检开始日期 | |
| 148 | - | |
| 151 | + if (downQueryRequest.getStartDueDate() != null) {//预产期结束日期 | |
| 152 | + patientsQuery.setDueDateEnd(downQueryRequest.getEndFmTime()); | |
| 153 | + isPatient = true; | |
| 149 | 154 | } | 
| 150 | - if(downQueryRequest.getEndNextCheckTime()!=null){//下次产检结束日期 | |
| 151 | - | |
| 155 | + if (downQueryRequest.getStartFmTime() != null) {//分娩开始日期 | |
| 156 | + patientsQuery.setFmDateStart(downQueryRequest.getEndNextCheckTime()); | |
| 157 | + isPatient = true; | |
| 152 | 158 | } | 
| 153 | - if(downQueryRequest.getStartFmTime()!=null){//分娩开始日期 | |
| 154 | - | |
| 159 | + if (downQueryRequest.getEndFmTime() != null) {//分娩结束日期 | |
| 160 | + patientsQuery.setFmDateEnd(downQueryRequest.getEndFmTime()); | |
| 161 | + isPatient = true; | |
| 155 | 162 | } | 
| 156 | - if(downQueryRequest.getEndFmTime()!=null){//分娩结束日期 | |
| 157 | 163 | |
| 164 | + if (downQueryRequest.getIsHightRisk() != null) {//是否高危:是:排除健康,否:等于健康 | |
| 165 | + if (downQueryRequest.getIsHightRisk() == 1) {//是 | |
| 166 | + patientsQuery.setNotoRiskFactor("d42eec03-aa86-45b8-a4e0-78a0ff365fb6"); | |
| 167 | + patientsQuery.setIsHighRisk(Boolean.TRUE); | |
| 168 | + isPatient = true; | |
| 169 | + } else if (downQueryRequest.getIsHightRisk() == 1) {//否 | |
| 170 | + patientsQuery.setrFactor("d42eec03-aa86-45b8-a4e0-78a0ff365fb6"); | |
| 171 | + isPatient = true; | |
| 172 | + } | |
| 158 | 173 | } | 
| 159 | - if(downQueryRequest.getStartDueDate()!=null){//预产期开始日期 | |
| 160 | - | |
| 174 | + if (downQueryRequest.getLevel() != null) {//高危等级 | |
| 175 | + patientsQuery.setrLevel(downQueryRequest.getLevel()); | |
| 176 | + isPatient = true; | |
| 161 | 177 | } | 
| 162 | - if(downQueryRequest.getStartDueDate()!=null){//预产期结束日期 | |
| 163 | - | |
| 178 | + if (downQueryRequest.getRiskFactorId() != null) {//高危因素 | |
| 179 | + //高危统计中的自定义高危 | |
| 180 | + if ("otherRiskId".equals(downQueryRequest.getLevel())) { | |
| 181 | + patientsQuery.setNotoRiskFactor(""); | |
| 182 | + patientsQuery.setoRiskFactor("true"); | |
| 183 | + } else { | |
| 184 | + patientsQuery.setrFactorList(StringUtils.covertToList(downQueryRequest.getRiskFactorId(), String.class)); | |
| 185 | + } | |
| 186 | + isPatient = true; | |
| 164 | 187 | } | 
| 165 | - if(downQueryRequest.getIsHightRisk()!=null){//是否高危 | |
| 166 | - | |
| 188 | + if (downQueryRequest.getCheckDoctor() != null) {//产检医生 | |
| 189 | + patientsQuery.setLastCheckEmployeeId(downQueryRequest.getCheckDoctor()); | |
| 190 | + isPatient = true; | |
| 167 | 191 | } | 
| 168 | - if(downQueryRequest.getLevel()!=null){//高危等级 | |
| 169 | 192 | |
| 193 | + if (downQueryRequest.getStartCheckTime() != null) {//最后一次产检开始日期 | |
| 194 | + patientsQuery.setLastCTimeStart(downQueryRequest.getStartCheckTime()); | |
| 195 | + isPatient = true; | |
| 170 | 196 | } | 
| 171 | - if(downQueryRequest.getRiskFactorId()!=null){//高危因素 | |
| 172 | - | |
| 197 | + if (downQueryRequest.getEndCheckTime() != null) {//最后一次产检结束日期 | |
| 198 | + patientsQuery.setLastCTimeEnd(downQueryRequest.getEndCheckTime()); | |
| 199 | + isPatient = true; | |
| 173 | 200 | } | 
| 174 | - if(downQueryRequest.getCheckDoctor()!=null){//产检医生 | |
| 175 | 201 | |
| 202 | + TrackDownRecordQuery downRecordQuery = new TrackDownRecordQuery(); | |
| 203 | + if (isPatient) {//加入了高危因数查询条件 | |
| 204 | + patientsQuery.setHospitalId(hospitalId); | |
| 205 | + patientsQuery.setQueryNo(downQueryRequest.getKey()); | |
| 206 | + List<Patients> patientses = patientsService.queryPatient(patientsQuery); | |
| 207 | + List<String> pids = new ArrayList<>(); | |
| 208 | + for (Patients ps : patientses) { | |
| 209 | + pids.add(ps.getId()); | |
| 210 | + } | |
| 211 | + downRecordQuery.setParentIds(pids); | |
| 176 | 212 | } | 
| 177 | 213 | |
| 178 | - | |
| 179 | - TrackDownRecordQuery downRecordQuery = new TrackDownRecordQuery(); | |
| 180 | 214 | downRecordQuery.setAreaId(downQueryRequest.getAreaId()); | 
| 181 | 215 | downRecordQuery.setProvinceId(downQueryRequest.getProvinceId()); | 
| 182 | 216 | downRecordQuery.setCityId(downQueryRequest.getCityId()); | 
| ... | ... | @@ -201,7 +235,7 @@ | 
| 201 | 235 | downRecordQuery.setLimit(downQueryRequest.getLimit()); | 
| 202 | 236 | downRecordQuery.setNeed("1"); | 
| 203 | 237 | // downRecordQuery.setSort("modified desc"); | 
| 204 | - downRecordQuery.setHospitalId(autoMatchFacade.getHospitalId(userId)); | |
| 238 | + downRecordQuery.setHospitalId(hospitalId); | |
| 205 | 239 | return downRecordQuery; | 
| 206 | 240 | } | 
| 207 | 241 | |
| ... | ... | @@ -222,12 +256,12 @@ | 
| 222 | 256 | map.put("phone", resid.getPhone()); | 
| 223 | 257 | map.put("cardNo", resid.getCertificateNum()); | 
| 224 | 258 | map.put("age", DateUtil.getAge(resid.getBirthday())); | 
| 225 | - if (resid.getSex().equals(SystemConfig.WOMAN_ID)){ | |
| 226 | - map.put("sex",0); | |
| 227 | - }else if (resid.getSex().equals(SystemConfig.MAN_ID)){ | |
| 228 | - map.put("sex",1); | |
| 229 | - }else{ | |
| 230 | - map.put("sex",1); | |
| 259 | + if (resid.getSex().equals(SystemConfig.WOMAN_ID)) { | |
| 260 | + map.put("sex", 0); | |
| 261 | + } else if (resid.getSex().equals(SystemConfig.MAN_ID)) { | |
| 262 | + map.put("sex", 1); | |
| 263 | + } else { | |
| 264 | + map.put("sex", 1); | |
| 231 | 265 | } | 
| 232 | 266 | } else { | 
| 233 | 267 | Patients patients = patientsService.findOnePatientById(parentId); | 
| ... | ... | @@ -239,7 +273,7 @@ | 
| 239 | 273 | map.put("week", DateUtil.getWeekDesc(patients.getLastMenses(), new Date())); | 
| 240 | 274 | map.put("dueDate", DateUtil.getyyyy_MM_dd(patients.getDueDate())); /** 预产期 */ | 
| 241 | 275 | map.put("trackCount", mongoTemplate.count(Query.query(Criteria.where("parentId").is(parentId).and("trackDownDateType").is(trackType).and("yn").is(1)), TrackDown.class)); /** 访视次数 */ | 
| 242 | - map.put("sex",0); | |
| 276 | + map.put("sex", 0); | |
| 243 | 277 | map.put("fmDate", DateUtil.getyyyy_MM_dd(patients.getFmDate())); | 
| 244 | 278 | } | 
| 245 | 279 | } | 
| 246 | 280 | |
| 247 | 281 | |
| 248 | 282 | |
| ... | ... | @@ -250,13 +284,13 @@ | 
| 250 | 284 | if (null != trackType && TrackDownDateEnums.C.getId() == trackType) { | 
| 251 | 285 | trackTypes = Arrays.asList(3, 9); | 
| 252 | 286 | } else if (null != trackType && TrackDownDateEnums.D.getId() == trackType) { | 
| 253 | - trackTypes =Arrays.asList(3, 8); | |
| 287 | + trackTypes = Arrays.asList(3, 8); | |
| 254 | 288 | } else if (null != trackType && TrackDownDateEnums.F.getId() == trackType) { | 
| 255 | - trackTypes =Arrays.asList(6, 11); | |
| 289 | + trackTypes = Arrays.asList(6, 11); | |
| 256 | 290 | } else if (null != trackType && TrackDownDateEnums.G.getId() == trackType) { | 
| 257 | - trackTypes =Arrays.asList(6, 10); | |
| 291 | + trackTypes = Arrays.asList(6, 10); | |
| 258 | 292 | } else { | 
| 259 | - trackTypes = Arrays.asList(trackType); | |
| 293 | + trackTypes = Arrays.asList(trackType); | |
| 260 | 294 | } | 
| 261 | 295 | |
| 262 | 296 | //查询追访记录 | 
| ... | ... | @@ -271,7 +305,7 @@ | 
| 271 | 305 | //产后复查次数 | 
| 272 | 306 | map.put("fcCount", mongoTemplate.count(Query.query(Criteria.where("parentId").is(parentId).and("yn").is(1)), PostReviewModel.class)); | 
| 273 | 307 | //产前检查次数(初诊+复诊) | 
| 274 | - map.put("checkCount", getChuzhenCount(parentId) ); | |
| 308 | + map.put("checkCount", getChuzhenCount(parentId)); | |
| 275 | 309 | |
| 276 | 310 | //产后复查信息 | 
| 277 | 311 | PostReviewQuery postReviewQuery = new PostReviewQuery(); | 
| ... | ... | @@ -312,7 +346,7 @@ | 
| 312 | 346 | criteria.and("trackDownDateType").in(trackType); | 
| 313 | 347 | } | 
| 314 | 348 | |
| 315 | - TrackDown trackDown = mongoTemplate.findOne(Query.query(criteria).with(new Sort(Sort.Direction.DESC, "created")),TrackDown.class); | |
| 349 | + TrackDown trackDown = mongoTemplate.findOne(Query.query(criteria).with(new Sort(Sort.Direction.DESC, "created")), TrackDown.class); | |
| 316 | 350 | if (trackDown != null) { | 
| 317 | 351 | map.put("nextSieveTime", trackDown == null ? "--" : DateUtil.getyyyy_MM_dd(trackDown.getReservatDate())); // 预约预约时间 | 
| 318 | 352 | } | 
| 319 | 353 | |
| ... | ... | @@ -366,12 +400,12 @@ | 
| 366 | 400 | //查询的追访类型 | 
| 367 | 401 | trackDownRecord.setTrackType(downQueryRequest.getTrackType()); | 
| 368 | 402 | Map map = downTypeHandler.build(trackDownRecord, mongoTemplate); | 
| 369 | - if(downQueryRequest.getTrackType()==TrackDownDateEnums.D.getId()){ | |
| 370 | - if(trackType == TrackDownDateEnums.C.getId()){ | |
| 403 | + if (downQueryRequest.getTrackType() == TrackDownDateEnums.D.getId()) { | |
| 404 | + if (trackType == TrackDownDateEnums.C.getId()) { | |
| 371 | 405 | trackType = TrackDownDateEnums.D.getId(); | 
| 372 | 406 | } | 
| 373 | - }else if(downQueryRequest.getTrackType()==TrackDownDateEnums.G.getId()){ | |
| 374 | - if(trackType == TrackDownDateEnums.F.getId()){ | |
| 407 | + } else if (downQueryRequest.getTrackType() == TrackDownDateEnums.G.getId()) { | |
| 408 | + if (trackType == TrackDownDateEnums.F.getId()) { | |
| 375 | 409 | trackType = TrackDownDateEnums.G.getId(); | 
| 376 | 410 | } | 
| 377 | 411 | } | 
| ... | ... | @@ -380,6 +414,11 @@ | 
| 380 | 414 | data.add(map); | 
| 381 | 415 | } | 
| 382 | 416 | } | 
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 383 | 422 | PageResult pageResult = new PageResult(); | 
| 384 | 423 | pageResult.setCount(downRecordQuery.getPageInfo().getCount()); | 
| 385 | 424 | pageResult.setPage(downRecordQuery.getPageInfo().getPage()); | 
| ... | ... | @@ -401,7 +440,7 @@ | 
| 401 | 440 | temp.put("trackDownDateType", downRecord.getTrackType()); | 
| 402 | 441 | temp.put("residenceAddress", CommonsHelper.getFullAddress(downRecord.getProvinceRegisterId(), downRecord.getCityRegisterId(), downRecord.getAreaRegisterId(), downRecord.getAddressRegister(), basicConfigService)); /** 居住地 */ | 
| 403 | 442 | temp.put("phone", StringUtils.encryPhone(downRecord.getPhone())); | 
| 404 | - TrackDown trackDown = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(downRecord.getParentId()).and("yn").is(1).and("trackDownDateType").in(7,10)).with(new Sort(Sort.Direction.DESC, "created")), TrackDown.class); | |
| 443 | + TrackDown trackDown = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(downRecord.getParentId()).and("yn").is(1).and("trackDownDateType").in(7, 10)).with(new Sort(Sort.Direction.DESC, "created")), TrackDown.class); | |
| 405 | 444 | temp.put("age", DateUtil.getAge(downRecord.getBirth())); | 
| 406 | 445 | // 追访结果 | 
| 407 | 446 | temp.put("result", trackDown == null ? "--" : trackDown.getResult()); | 
| ... | ... | @@ -411,7 +450,6 @@ | 
| 411 | 450 | temp.put("yyTime", trackDown == null ? "--" : DateUtil.getyyyy_MM_dd(trackDown.getReservatDate())); | 
| 412 | 451 | |
| 413 | 452 | |
| 414 | - | |
| 415 | 453 | //预约复查时间默认用追访时间 | 
| 416 | 454 | temp.put("yyfcDate", trackDown == null ? "--" : DateUtil.getyyyy_MM_dd(trackDown.getReservatDate())); | 
| 417 | 455 | |
| 418 | 456 | |
| 419 | 457 | |
| 420 | 458 | |
| ... | ... | @@ -421,20 +459,20 @@ | 
| 421 | 459 | temp.put("fmDate", DateUtil.getyyyy_MM_dd(patients.getFmDate())); | 
| 422 | 460 | temp.put("scType", "--"); | 
| 423 | 461 | |
| 424 | - if(patients.getIsAutoFm()!=null&&patients.getIsAutoFm() == 1){ | |
| 462 | + if (patients.getIsAutoFm() != null && patients.getIsAutoFm() == 1) { | |
| 425 | 463 | /** 生产方式 */ | 
| 426 | 464 | temp.put("scType", "自动分娩"); | 
| 427 | - }else { | |
| 465 | + } else { | |
| 428 | 466 | MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); | 
| 429 | 467 | matDeliverQuery.setParentId(patients.getId()); | 
| 430 | 468 | matDeliverQuery.setYn(YnEnums.YES.getId()); | 
| 431 | 469 | //查询分娩记录 | 
| 432 | 470 | List<MaternalDeliverModel> list2 = matDeliverService.query(matDeliverQuery); | 
| 433 | - if(CollectionUtils.isNotEmpty(list2)){ | |
| 471 | + if (CollectionUtils.isNotEmpty(list2)) { | |
| 434 | 472 | MaternalDeliverModel maternalDeliverModel = list2.get(0); | 
| 435 | 473 | if (StringUtils.isNotEmpty(maternalDeliverModel.getDeliveryMode())) { | 
| 436 | 474 | Map<String, String> deliveryModeMap = JsonUtil.getMap(maternalDeliverModel.getDeliveryMode()); | 
| 437 | - if(deliveryModeMap.containsKey("fmfs")){ | |
| 475 | + if (deliveryModeMap.containsKey("fmfs")) { | |
| 438 | 476 | /** 生产方式 */ | 
| 439 | 477 | temp.put("scType", FmTypeEnums.getFmNameById(deliveryModeMap.get("fmfs"))); | 
| 440 | 478 | } | 
| ... | ... | @@ -455,7 +493,7 @@ | 
| 455 | 493 | PostReviewModel firstPost = list.get(list.size() - 1); | 
| 456 | 494 | /** 初次复查日期 */ | 
| 457 | 495 | temp.put("ccfcDate", firstPost.getCheckTime() == null ? "--" : DateUtil.getyyyy_MM_dd(firstPost.getCheckTime())); | 
| 458 | - if(endPost.getNextCheckTime() != null){ | |
| 496 | + if (endPost.getNextCheckTime() != null) { | |
| 459 | 497 | /** 预约复查日期 */ | 
| 460 | 498 | temp.put("yyfcDate", DateUtil.getyyyy_MM_dd(endPost.getNextCheckTime())); | 
| 461 | 499 | } | 
| 462 | 500 | |
| ... | ... | @@ -480,14 +518,14 @@ | 
| 480 | 518 | temp.put("residenceAddress", CommonsHelper.getFullAddress(downRecord.getProvinceRegisterId(), downRecord.getCityRegisterId(), downRecord.getAreaRegisterId(), downRecord.getAddressRegister(), basicConfigService)); /** 居住地 */ | 
| 481 | 519 | temp.put("phone", StringUtils.encryPhone(downRecord.getPhone())); | 
| 482 | 520 | |
| 483 | - temp.put("fmDate","--"); | |
| 484 | - temp.put("result","--"); | |
| 485 | - temp.put("trackDownTime","--"); | |
| 486 | - temp.put("yyTime","--"); | |
| 487 | - temp.put("trackCount","--"); | |
| 488 | - List<TrackDown> trackDowns = mongoTemplate.find(Query.query(Criteria.where("parentId").is(downRecord.getParentId()).and("yn").is(1).and("trackDownDateType").in(6,11)).with(new Sort(Sort.Direction.DESC, "created")), TrackDown.class); | |
| 521 | + temp.put("fmDate", "--"); | |
| 522 | + temp.put("result", "--"); | |
| 523 | + temp.put("trackDownTime", "--"); | |
| 524 | + temp.put("yyTime", "--"); | |
| 525 | + temp.put("trackCount", "--"); | |
| 526 | + List<TrackDown> trackDowns = mongoTemplate.find(Query.query(Criteria.where("parentId").is(downRecord.getParentId()).and("yn").is(1).and("trackDownDateType").in(6, 11)).with(new Sort(Sort.Direction.DESC, "created")), TrackDown.class); | |
| 489 | 527 | temp.put("age", DateUtil.getAge(downRecord.getBirth())); | 
| 490 | - if (CollectionUtils.isNotEmpty(trackDowns)&&trackDowns.get(0)!=null) { | |
| 528 | + if (CollectionUtils.isNotEmpty(trackDowns) && trackDowns.get(0) != null) { | |
| 491 | 529 | TrackDown trackDown = trackDowns.get(0); | 
| 492 | 530 | // 追访结果 | 
| 493 | 531 | temp.put("result", trackDown.getResult() == null ? "--" : trackDown.getResult()); | 
| ... | ... | @@ -501,7 +539,7 @@ | 
| 501 | 539 | Patients patients = patientsService.findOnePatientById(downRecord.getParentId()); | 
| 502 | 540 | if (patients != null) { | 
| 503 | 541 | //分娩日期 | 
| 504 | - temp.put("fmDate", patients.getFmDate()==null?"--":DateUtil.getyyyy_MM_dd(patients.getFmDate())); | |
| 542 | + temp.put("fmDate", patients.getFmDate() == null ? "--" : DateUtil.getyyyy_MM_dd(patients.getFmDate())); | |
| 505 | 543 | } | 
| 506 | 544 | return temp; | 
| 507 | 545 | } | 
| ... | ... | @@ -578,6 +616,8 @@ | 
| 578 | 616 | String hospitalId = downRecord.getHospitalId(); | 
| 579 | 617 | Patients patients = patientsService.findOnePatientById(downRecord.getParentId()); | 
| 580 | 618 | Map<String, Object> temp = new HashMap<>(); | 
| 619 | + //完善高危数据 | |
| 620 | + handHightRisk(patients,temp); | |
| 581 | 621 | temp.put("username", downRecord.getUsername()); | 
| 582 | 622 | temp.put("age", DateUtil.getAge(downRecord.getBirth())); | 
| 583 | 623 | temp.put("cardNo", StringUtils.encryCardNo(downRecord.getCardNo())); | 
| ... | ... | @@ -601,7 +641,7 @@ | 
| 601 | 641 | } else { | 
| 602 | 642 | criteria.and("trackDownDateType").in(downRecord.getTrackType()); | 
| 603 | 643 | } | 
| 604 | - TrackDown trackDown = mongoTemplate.findOne(Query.query(criteria).with(new Sort(Sort.Direction.DESC, "created")),TrackDown.class); | |
| 644 | + TrackDown trackDown = mongoTemplate.findOne(Query.query(criteria).with(new Sort(Sort.Direction.DESC, "created")), TrackDown.class); | |
| 605 | 645 | if (trackDown != null) { | 
| 606 | 646 | temp.put("result", StringUtils.isEmpty(trackDown.getResult()) ? "--" : trackDown.getResult()); // 追访结果 | 
| 607 | 647 | temp.put("trackDownTime", trackDown == null ? "--" : DateUtil.getyyyy_MM_dd(trackDown.getTrackDownDate())); // 追访时间 | 
| ... | ... | @@ -648,6 +688,56 @@ | 
| 648 | 688 | } | 
| 649 | 689 | } | 
| 650 | 690 | return temp; | 
| 691 | + } | |
| 692 | + } | |
| 693 | + | |
| 694 | + public void handHightRisk(Patients patients,Map map){ | |
| 695 | + //高危因素 | |
| 696 | + List<String> factor = patients.getRiskFactorId(); | |
| 697 | + | |
| 698 | + if (CollectionUtils.isNotEmpty(factor)) { | |
| 699 | + StringBuilder sb = new StringBuilder(56); | |
| 700 | + for (String srt : factor) { | |
| 701 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(srt)) { | |
| 702 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(srt); | |
| 703 | + if (null != basicConfig && sb.indexOf(basicConfig.getName()) == -1) { | |
| 704 | + sb.append(basicConfig.getName()).append(','); | |
| 705 | + } | |
| 706 | + } | |
| 707 | + } | |
| 708 | + if (sb.toString().endsWith(",")) { | |
| 709 | + map.put("rFactor",sb.substring(0, sb.length() - 1)); | |
| 710 | + } else { | |
| 711 | + map.put("rFactor",sb.toString()); | |
| 712 | + } | |
| 713 | + | |
| 714 | + if (!"-".equals(map.get("rFactor")) && org.apache.commons.lang.StringUtils.isNotEmpty(patients.getoRiskFactor())) { | |
| 715 | + map.put("rFactor",map.get("rFactor")+","+patients.getoRiskFactor()); | |
| 716 | + }else if (org.apache.commons.lang.StringUtils.isNotEmpty(patients.getoRiskFactor())) | |
| 717 | + { | |
| 718 | + map.put("rFactor",patients.getoRiskFactor()); | |
| 719 | + } | |
| 720 | + } | |
| 721 | + else if (org.apache.commons.lang.StringUtils.isNotEmpty(patients.getoRiskFactor())) | |
| 722 | + { | |
| 723 | + map.put("rFactor",patients.getoRiskFactor()); | |
| 724 | + } | |
| 725 | + List level = new ArrayList(); | |
| 726 | + if (StringUtils.isNotEmpty(patients.getRiskLevelId())) { | |
| 727 | + try { | |
| 728 | + List<String> list = JsonUtil.jkstr2Obj(patients.getRiskLevelId(), List.class); | |
| 729 | + for (String str : list) { | |
| 730 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(str); | |
| 731 | + if (null != basicConfig) { | |
| 732 | + Map map1 = new HashMap(); | |
| 733 | + basicConfig.replenRisk(map1); | |
| 734 | + level.add(map1); | |
| 735 | + } | |
| 736 | + } | |
| 737 | + } catch (Exception e) { | |
| 738 | + ExceptionUtils.catchException(e, "patients.getRiskLevelId error."); | |
| 739 | + } | |
| 740 | + map.put("rLevel",HighScoreResult.filter(level)); | |
| 651 | 741 | } | 
| 652 | 742 | } | 
| 653 | 743 | } |