Commit 7e599a357841d04b99b2f48db16b9373949c6b5e
1 parent
0f1602a947
Exists in
master
and in
6 other branches
自动生成追访信息
Showing 1 changed file with 185 additions and 156 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TrackDownJobFacade.java
View file @
7e599a3
| ... | ... | @@ -145,25 +145,28 @@ |
| 145 | 145 | public void execute() { |
| 146 | 146 | int page = 0; |
| 147 | 147 | List<Patients> data = null; |
| 148 | - | |
| 149 | 148 | do { |
| 150 | - PatientsQuery patientsQuery1 = new PatientsQuery(); | |
| 151 | - patientsQuery1.setYn(YnEnums.YES.getId()); | |
| 152 | - patientsQuery1.setSort("created asc"); | |
| 153 | - patientsQuery1.setNeed("1"); | |
| 154 | - patientsQuery1.setPage(page); | |
| 155 | - patientsQuery1.setLimit(limit); | |
| 156 | - patientsQuery1.setType(1); | |
| 149 | + try { | |
| 150 | + PatientsQuery patientsQuery1 = new PatientsQuery(); | |
| 151 | + patientsQuery1.setYn(YnEnums.YES.getId()); | |
| 152 | + patientsQuery1.setSort("created asc"); | |
| 153 | + patientsQuery1.setNeed("1"); | |
| 154 | + patientsQuery1.setPage(page); | |
| 155 | + patientsQuery1.setLimit(limit); | |
| 156 | + patientsQuery1.setType(1); | |
| 157 | 157 | |
| 158 | - //查询妇女建档 | |
| 159 | - data = patientsService.queryPatient(patientsQuery1); | |
| 160 | - System.out.println("开始处理产检追访数据!一共" + patientsQuery1.getCount() + ",当前第:" + page + "页"); | |
| 161 | - if (CollectionUtils.isNotEmpty(data)) { | |
| 162 | - for (Patients model : data) { | |
| 163 | - handOneByOne(model); | |
| 158 | + //查询妇女建档 | |
| 159 | + data = patientsService.queryPatient(patientsQuery1); | |
| 160 | + System.out.println("开始处理产检追访数据!一共" + patientsQuery1.getCount() + ",当前第:" + page + "页"); | |
| 161 | + if (CollectionUtils.isNotEmpty(data)) { | |
| 162 | + for (Patients model : data) { | |
| 163 | + handOneByOne(model); | |
| 164 | + } | |
| 164 | 165 | } |
| 166 | + page++; | |
| 167 | + }catch (Exception e){ | |
| 168 | + e.printStackTrace(); | |
| 165 | 169 | } |
| 166 | - page++; | |
| 167 | 170 | } while (CollectionUtils.isNotEmpty(data) && data.size() == limit); |
| 168 | 171 | System.out.println("处理产检追访数据结束!"); |
| 169 | 172 | } |
| 170 | 173 | |
| 171 | 174 | |
| 172 | 175 | |
| ... | ... | @@ -172,33 +175,37 @@ |
| 172 | 175 | @Override |
| 173 | 176 | public void handOneByOne(Patients model) { |
| 174 | 177 | logger.info("CJTrackDownDataLoader addTrackDown by id :" + model.getId()); |
| 175 | - //添加产检追访信息 | |
| 176 | - TrackDownRecord trackDownRecord = model.build(); | |
| 177 | - //根据patient查询是否存在追访信息 | |
| 178 | - TrackDownRecordQuery downRecordQuery = new TrackDownRecordQuery(); | |
| 179 | - downRecordQuery.setParentId(model.getId()); | |
| 180 | - List<TrackDownRecord> records = trackDownRecordService.queryTrackDown(downRecordQuery); | |
| 181 | - if (CollectionUtils.isNotEmpty(records)) {//存在则跳过 | |
| 182 | - return; | |
| 183 | - } else {//不存在则查询继续查追访记录,可能来至妇女建档追访数据 | |
| 184 | - downRecordQuery = new TrackDownRecordQuery(); | |
| 185 | - downRecordQuery.setHospitalId(model.getHospitalId()); | |
| 186 | - if (StringUtils.isNotEmpty(model.getCardNo())) { | |
| 187 | - downRecordQuery.setCardNo(model.getCardNo()); | |
| 188 | - } else if (StringUtils.isNotEmpty(model.getPhone())) { | |
| 189 | - downRecordQuery.setPhone(model.getPhone()); | |
| 178 | + try { | |
| 179 | + //添加产检追访信息 | |
| 180 | + TrackDownRecord trackDownRecord = model.build(); | |
| 181 | + //根据patient查询是否存在追访信息 | |
| 182 | + TrackDownRecordQuery downRecordQuery = new TrackDownRecordQuery(); | |
| 183 | + downRecordQuery.setParentId(model.getId()); | |
| 184 | + List<TrackDownRecord> records = trackDownRecordService.queryTrackDown(downRecordQuery); | |
| 185 | + if (CollectionUtils.isNotEmpty(records)) {//存在则跳过 | |
| 186 | + return; | |
| 187 | + } else {//不存在则查询继续查追访记录,可能来至妇女建档追访数据 | |
| 188 | + downRecordQuery = new TrackDownRecordQuery(); | |
| 189 | + downRecordQuery.setHospitalId(model.getHospitalId()); | |
| 190 | + if (StringUtils.isNotEmpty(model.getCardNo())) { | |
| 191 | + downRecordQuery.setCardNo(model.getCardNo()); | |
| 192 | + } else if (StringUtils.isNotEmpty(model.getPhone())) { | |
| 193 | + downRecordQuery.setPhone(model.getPhone()); | |
| 194 | + } | |
| 195 | + records = trackDownRecordService.queryTrackDown(downRecordQuery); | |
| 196 | + if (CollectionUtils.isNotEmpty(records)) { | |
| 197 | + TrackDownRecord trackDownRecord1 = records.get(0); | |
| 198 | + trackDownRecord.setId(trackDownRecord1.getId()); | |
| 199 | + } | |
| 190 | 200 | } |
| 191 | - records = trackDownRecordService.queryTrackDown(downRecordQuery); | |
| 192 | - if (CollectionUtils.isNotEmpty(records)) { | |
| 193 | - TrackDownRecord trackDownRecord1 = records.get(0); | |
| 194 | - trackDownRecord.setId(trackDownRecord1.getId()); | |
| 201 | + int week = DateUtil.getWeek2(model.getLastMenses(), new Date()); | |
| 202 | + if (week > 20) {//不能做产前筛查追访,显示产前检查追访 | |
| 203 | + trackDownRecord.setTrackType(TrackDownDateEnums.I.getId()); | |
| 195 | 204 | } |
| 205 | + trackDownService.addOrupdateTrackDownRecord(model.getOperator(), trackDownRecord); | |
| 206 | + }catch (Exception e){ | |
| 207 | + e.printStackTrace(); | |
| 196 | 208 | } |
| 197 | - int week = DateUtil.getWeek2(model.getLastMenses(), new Date()); | |
| 198 | - if (week > 20) {//不能做产前筛查追访,显示产前检查追访 | |
| 199 | - trackDownRecord.setTrackType(TrackDownDateEnums.I.getId()); | |
| 200 | - } | |
| 201 | - trackDownService.addOrupdateTrackDownRecord(model.getOperator(), trackDownRecord); | |
| 202 | 209 | } |
| 203 | 210 | } |
| 204 | 211 | |
| 205 | 212 | |
| 206 | 213 | |
| 207 | 214 | |
| ... | ... | @@ -216,22 +223,26 @@ |
| 216 | 223 | List<PremaritalCheckup> data = null; |
| 217 | 224 | System.out.println("开始处理怀孕建档追访数据!"); |
| 218 | 225 | do { |
| 219 | - PremaritalCheckupQuery premaritalCheckupQuery = new PremaritalCheckupQuery(); | |
| 220 | - premaritalCheckupQuery.setYn(YnEnums.YES.getId()); | |
| 221 | - premaritalCheckupQuery.setSexType(1); | |
| 222 | - premaritalCheckupQuery.setSort("created asc"); | |
| 223 | - premaritalCheckupQuery.setNeed("1"); | |
| 224 | - premaritalCheckupQuery.setPage(page); | |
| 225 | - premaritalCheckupQuery.setLimit(limit); | |
| 226 | - data = premaritalCheckupService.queryPremaritalCheckup(premaritalCheckupQuery); | |
| 226 | + try { | |
| 227 | + PremaritalCheckupQuery premaritalCheckupQuery = new PremaritalCheckupQuery(); | |
| 228 | + premaritalCheckupQuery.setYn(YnEnums.YES.getId()); | |
| 229 | + premaritalCheckupQuery.setSexType(1); | |
| 230 | + premaritalCheckupQuery.setSort("created asc"); | |
| 231 | + premaritalCheckupQuery.setNeed("1"); | |
| 232 | + premaritalCheckupQuery.setPage(page); | |
| 233 | + premaritalCheckupQuery.setLimit(limit); | |
| 234 | + data = premaritalCheckupService.queryPremaritalCheckup(premaritalCheckupQuery); | |
| 227 | 235 | |
| 228 | - //查询妇女建档 | |
| 229 | - if (CollectionUtils.isNotEmpty(data)) { | |
| 230 | - for (PremaritalCheckup model : data) { | |
| 231 | - handOneByOne(model); | |
| 236 | + //查询妇女建档 | |
| 237 | + if (CollectionUtils.isNotEmpty(data)) { | |
| 238 | + for (PremaritalCheckup model : data) { | |
| 239 | + handOneByOne(model); | |
| 240 | + } | |
| 232 | 241 | } |
| 242 | + page++; | |
| 243 | + }catch (Exception e){ | |
| 244 | + e.printStackTrace(); | |
| 233 | 245 | } |
| 234 | - page++; | |
| 235 | 246 | } while (CollectionUtils.isNotEmpty(data) && data.size() == limit); |
| 236 | 247 | System.out.println("处理怀孕建档追访数据结束!"); |
| 237 | 248 | } |
| 238 | 249 | |
| 239 | 250 | |
| 240 | 251 | |
| 241 | 252 | |
| 242 | 253 | |
| ... | ... | @@ -306,44 +317,52 @@ |
| 306 | 317 | List<ResidentsArchiveModel> data = null; |
| 307 | 318 | //处理女性档案 |
| 308 | 319 | do { |
| 309 | - ResidentsArchiveQuery archiveQuery = new ResidentsArchiveQuery(); | |
| 310 | - archiveQuery.setYn(YnEnums.YES.getId()); | |
| 311 | - archiveQuery.setSex("c23779f1-cb6e-44d0-9fc8-0a990bf6184c"); | |
| 312 | - archiveQuery.setSort("created asc"); | |
| 313 | - archiveQuery.setNeed("1"); | |
| 314 | - archiveQuery.setPage(page); | |
| 315 | - archiveQuery.setLimit(limit); | |
| 316 | - //查询妇女建档 | |
| 317 | - data = residentsArchiveService.queryResident(archiveQuery); | |
| 318 | - if (CollectionUtils.isNotEmpty(data)) { | |
| 319 | - for (ResidentsArchiveModel model : data) { | |
| 320 | - //单条数据处理 | |
| 321 | - handOneByOne(model); | |
| 320 | + try { | |
| 321 | + ResidentsArchiveQuery archiveQuery = new ResidentsArchiveQuery(); | |
| 322 | + archiveQuery.setYn(YnEnums.YES.getId()); | |
| 323 | + archiveQuery.setSex("c23779f1-cb6e-44d0-9fc8-0a990bf6184c"); | |
| 324 | + archiveQuery.setSort("created asc"); | |
| 325 | + archiveQuery.setNeed("1"); | |
| 326 | + archiveQuery.setPage(page); | |
| 327 | + archiveQuery.setLimit(limit); | |
| 328 | + //查询妇女建档 | |
| 329 | + data = residentsArchiveService.queryResident(archiveQuery); | |
| 330 | + if (CollectionUtils.isNotEmpty(data)) { | |
| 331 | + for (ResidentsArchiveModel model : data) { | |
| 332 | + //单条数据处理 | |
| 333 | + handOneByOne(model); | |
| 334 | + } | |
| 322 | 335 | } |
| 336 | + page++; | |
| 337 | + }catch (Exception e){ | |
| 338 | + e.printStackTrace(); | |
| 323 | 339 | } |
| 324 | - page++; | |
| 325 | 340 | } while (CollectionUtils.isNotEmpty(data) && data.size() == limit); |
| 326 | 341 | |
| 327 | 342 | //处理男性未婚档案 |
| 328 | 343 | page = 1; |
| 329 | 344 | do { |
| 330 | - ResidentsArchiveQuery archiveQuery = new ResidentsArchiveQuery(); | |
| 331 | - archiveQuery.setYn(YnEnums.YES.getId()); | |
| 332 | - archiveQuery.setSort("created asc"); | |
| 333 | - archiveQuery.setMarriageId("d049eaaa-7265-4cdb-879f-992ab6320a3a"); | |
| 334 | - archiveQuery.setSex("5d0b782f-b61b-441b-b8c5-4bf55eece273"); | |
| 335 | - archiveQuery.setNeed("1"); | |
| 336 | - archiveQuery.setPage(page); | |
| 337 | - archiveQuery.setLimit(limit); | |
| 338 | - //查询妇女建档 | |
| 339 | - data = residentsArchiveService.queryResident(archiveQuery); | |
| 340 | - if (CollectionUtils.isNotEmpty(data)) { | |
| 341 | - for (ResidentsArchiveModel model : data) { | |
| 342 | - //单条数据处理 | |
| 343 | - handOneByOne(model); | |
| 345 | + try { | |
| 346 | + ResidentsArchiveQuery archiveQuery = new ResidentsArchiveQuery(); | |
| 347 | + archiveQuery.setYn(YnEnums.YES.getId()); | |
| 348 | + archiveQuery.setSort("created asc"); | |
| 349 | + archiveQuery.setMarriageId("d049eaaa-7265-4cdb-879f-992ab6320a3a"); | |
| 350 | + archiveQuery.setSex("5d0b782f-b61b-441b-b8c5-4bf55eece273"); | |
| 351 | + archiveQuery.setNeed("1"); | |
| 352 | + archiveQuery.setPage(page); | |
| 353 | + archiveQuery.setLimit(limit); | |
| 354 | + //查询妇女建档 | |
| 355 | + data = residentsArchiveService.queryResident(archiveQuery); | |
| 356 | + if (CollectionUtils.isNotEmpty(data)) { | |
| 357 | + for (ResidentsArchiveModel model : data) { | |
| 358 | + //单条数据处理 | |
| 359 | + handOneByOne(model); | |
| 360 | + } | |
| 344 | 361 | } |
| 362 | + page++; | |
| 363 | + }catch (Exception e){ | |
| 364 | + e.printStackTrace(); | |
| 345 | 365 | } |
| 346 | - page++; | |
| 347 | 366 | } while (CollectionUtils.isNotEmpty(data) && data.size() == limit); |
| 348 | 367 | |
| 349 | 368 | System.out.println("妇女档案生成追访数据完成!"); |
| 350 | 369 | |
| 351 | 370 | |
| 352 | 371 | |
| ... | ... | @@ -361,35 +380,38 @@ |
| 361 | 380 | // return; |
| 362 | 381 | // } |
| 363 | 382 | // } |
| 383 | + try { | |
| 384 | + if (null != model && StringUtils.isNotEmpty(model.getId())) { | |
| 385 | + PremaritalCheckupQuery premaritalCheckupQuery = new PremaritalCheckupQuery(); | |
| 386 | + premaritalCheckupQuery.setYn(YnEnums.YES.getId()); | |
| 387 | + premaritalCheckupQuery.setParentId(model.getId()); | |
| 388 | + //查询居民婚检信息 | |
| 389 | + List<PremaritalCheckup> premaritalCheckup = premaritalCheckupService.queryPremaritalCheckup(premaritalCheckupQuery); | |
| 390 | + //没有婚前检查,预备生成婚前检查追访 | |
| 391 | + if (CollectionUtils.isEmpty(premaritalCheckup)) { | |
| 392 | + //先根据医院id和证件号、手机号查询是否存在追访信息 | |
| 393 | + TrackDownRecordQuery downRecordQuery = new TrackDownRecordQuery(); | |
| 394 | + downRecordQuery.setHospitalId(model.getHospitalId()); | |
| 395 | + if (StringUtils.isNotEmpty(model.getCertificateNum())) { | |
| 396 | + downRecordQuery.setCardNo(model.getCertificateNum()); | |
| 397 | + } else if (StringUtils.isNotEmpty(model.getPhone())) { | |
| 398 | + downRecordQuery.setPhone(model.getPhone()); | |
| 399 | + } | |
| 400 | + List<TrackDownRecord> records = trackDownRecordService.queryTrackDown(downRecordQuery); | |
| 401 | + if (CollectionUtils.isNotEmpty(records)) {//存在追访信息 | |
| 402 | + return; | |
| 403 | + } | |
| 364 | 404 | |
| 365 | - if (null != model && StringUtils.isNotEmpty(model.getId())) { | |
| 366 | - PremaritalCheckupQuery premaritalCheckupQuery = new PremaritalCheckupQuery(); | |
| 367 | - premaritalCheckupQuery.setYn(YnEnums.YES.getId()); | |
| 368 | - premaritalCheckupQuery.setParentId(model.getId()); | |
| 369 | - //查询居民婚检信息 | |
| 370 | - List<PremaritalCheckup> premaritalCheckup = premaritalCheckupService.queryPremaritalCheckup(premaritalCheckupQuery); | |
| 371 | - //没有婚前检查,预备生成婚前检查追访 | |
| 372 | - if (CollectionUtils.isEmpty(premaritalCheckup)) { | |
| 373 | - //先根据医院id和证件号、手机号查询是否存在追访信息 | |
| 374 | - TrackDownRecordQuery downRecordQuery = new TrackDownRecordQuery(); | |
| 375 | - downRecordQuery.setHospitalId(model.getHospitalId()); | |
| 376 | - if (StringUtils.isNotEmpty(model.getCertificateNum())) { | |
| 377 | - downRecordQuery.setCardNo(model.getCertificateNum()); | |
| 378 | - } else if (StringUtils.isNotEmpty(model.getPhone())) { | |
| 379 | - downRecordQuery.setPhone(model.getPhone()); | |
| 405 | + TrackDownRecord record = model.build(); | |
| 406 | + if ("d75d1902-61a5-4a17-a68a-5b8a9826537b".equals(model.getMarriageId())) {//女已婚,直接进入孕妇建档追访 | |
| 407 | + record.setStatus(1); | |
| 408 | + record.setTrackType(TrackDownDateEnums.B.getId()); | |
| 409 | + } | |
| 410 | + downRecordService.addTrackDown(record); | |
| 380 | 411 | } |
| 381 | - List<TrackDownRecord> records = trackDownRecordService.queryTrackDown(downRecordQuery); | |
| 382 | - if (CollectionUtils.isNotEmpty(records)) {//存在追访信息 | |
| 383 | - return; | |
| 384 | - } | |
| 385 | - | |
| 386 | - TrackDownRecord record = model.build(); | |
| 387 | - if ("d75d1902-61a5-4a17-a68a-5b8a9826537b".equals(model.getMarriageId())) {//女已婚,直接进入孕妇建档追访 | |
| 388 | - record.setStatus(1); | |
| 389 | - record.setTrackType(TrackDownDateEnums.B.getId()); | |
| 390 | - } | |
| 391 | - downRecordService.addTrackDown(record); | |
| 392 | 412 | } |
| 413 | + }catch (Exception e){ | |
| 414 | + e.printStackTrace(); | |
| 393 | 415 | } |
| 394 | 416 | } |
| 395 | 417 | } |
| 396 | 418 | |
| 397 | 419 | |
| 398 | 420 | |
| 399 | 421 | |
| 400 | 422 | |
| 401 | 423 | |
| 402 | 424 | |
| 403 | 425 | |
| 404 | 426 | |
| ... | ... | @@ -408,66 +430,73 @@ |
| 408 | 430 | List<Patients> data = null; |
| 409 | 431 | do { |
| 410 | 432 | logger.info("CHTrackDownDataLoader execute "); |
| 411 | - //查询出满足预产期前两周的孕妇 | |
| 412 | - Date endDate = DateUtil.addDay(DateUtil.formatDate(new Date()), -60); | |
| 413 | - PatientsQuery patientsQuery = new PatientsQuery(); | |
| 414 | - patientsQuery.setFmDateStart(endDate); | |
| 415 | - patientsQuery.setFmDateEnd(new Date()); | |
| 416 | - patientsQuery.setPage(page); | |
| 417 | - patientsQuery.setLimit(limit); | |
| 418 | - patientsQuery.setYn(YnEnums.YES.getId()); | |
| 419 | - patientsQuery.setNeed("1"); | |
| 420 | - patientsQuery.setType(3); | |
| 433 | + try { | |
| 434 | + //查询出满足预产期前两周的孕妇 | |
| 435 | + Date endDate = DateUtil.addDay(DateUtil.formatDate(new Date()), -60); | |
| 436 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 437 | + patientsQuery.setFmDateStart(endDate); | |
| 438 | + patientsQuery.setFmDateEnd(new Date()); | |
| 439 | + patientsQuery.setPage(page); | |
| 440 | + patientsQuery.setLimit(limit); | |
| 441 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
| 442 | + patientsQuery.setNeed("1"); | |
| 443 | + patientsQuery.setType(3); | |
| 421 | 444 | |
| 422 | - data = patientsService.queryPatient(patientsQuery); | |
| 423 | - System.out.println("开始产后访视/产后复查追访数据!一共" + patientsQuery.getCount() + ",当前第:" + page + "页"); | |
| 424 | - //查询妇女建档 | |
| 425 | - if (CollectionUtils.isNotEmpty(data)) { | |
| 426 | - for (Patients model : data) { | |
| 427 | - handOneByOne(model); | |
| 428 | - // if (model.getId().equals("5a98f71fc07d3a2c0da220f8")) { | |
| 429 | - // } | |
| 445 | + data = patientsService.queryPatient(patientsQuery); | |
| 446 | + System.out.println("开始产后访视/产后复查追访数据!一共" + patientsQuery.getCount() + ",当前第:" + page + "页"); | |
| 447 | + //查询妇女建档 | |
| 448 | + if (CollectionUtils.isNotEmpty(data)) { | |
| 449 | + for (Patients model : data) { | |
| 450 | + handOneByOne(model); | |
| 451 | + // if (model.getId().equals("5a98f71fc07d3a2c0da220f8")) { | |
| 452 | + // } | |
| 453 | + } | |
| 430 | 454 | } |
| 455 | + page++; | |
| 456 | + }catch (Exception e){ | |
| 457 | + e.printStackTrace(); | |
| 431 | 458 | } |
| 432 | - page++; | |
| 433 | 459 | } while (CollectionUtils.isNotEmpty(data) && data.size() == limit); |
| 434 | 460 | System.out.println("产后访视/产后复查追访数据结束!"); |
| 435 | 461 | } |
| 436 | 462 | |
| 437 | 463 | @Override |
| 438 | 464 | public void handOneByOne(Patients patients) { |
| 465 | + try { | |
| 466 | + //分娩日期不为空 | |
| 467 | + //分娩距当前时间天数 | |
| 468 | + int day = DateUtil.daysBetween(patients.getFmDate(), new Date()); | |
| 469 | + if (day <= 60) {//产后60天内,可做产后访视或产后复查环节 | |
| 470 | + if (null != patients) { | |
| 471 | + TrackDownRecord trackDownRecord = patients.build(); | |
| 472 | + trackDownRecord.setTrackType(TrackDownDateEnums.F.getId()); | |
| 473 | + if (patients.getDueStatus() == 1) {//终止妊娠 | |
| 474 | + //当前孕妇是孕28周后,进入产后复查追访,否则结束流程 | |
| 475 | + int dueWeek = DateUtil.getWeek2(patients.getLastMenses(), patients.getFmDate()); | |
| 476 | + if (dueWeek >= 28) {//进入产后复查 | |
| 477 | + trackDownRecord.setTrackType(TrackDownDateEnums.J.getId()); | |
| 478 | + } else {//结束流程 | |
| 479 | + trackDownRecord.setStatus(0); | |
| 480 | + } | |
| 439 | 481 | |
| 440 | - //分娩日期不为空 | |
| 441 | - //分娩距当前时间天数 | |
| 442 | - int day = DateUtil.daysBetween(patients.getFmDate(), new Date()); | |
| 443 | - if (day <= 60) {//产后60天内,可做产后访视或产后复查环节 | |
| 444 | - if (null != patients) { | |
| 445 | - TrackDownRecord trackDownRecord = patients.build(); | |
| 446 | - trackDownRecord.setTrackType(TrackDownDateEnums.F.getId()); | |
| 447 | - if (patients.getDueStatus() == 1) {//终止妊娠 | |
| 448 | - //当前孕妇是孕28周后,进入产后复查追访,否则结束流程 | |
| 449 | - int dueWeek = DateUtil.getWeek2(patients.getLastMenses(), patients.getFmDate()); | |
| 450 | - if (dueWeek >= 28) {//进入产后复查 | |
| 482 | + } | |
| 483 | + //查询是否存在追访记录,如果有则修改,没有则新增 | |
| 484 | + TrackDownRecordQuery downRecordQuery = new TrackDownRecordQuery(); | |
| 485 | + downRecordQuery.setParentId(patients.getId()); | |
| 486 | + List<TrackDownRecord> records = downRecordService.queryTrackDown(downRecordQuery); | |
| 487 | + logger.info("CHTrackDownDataLoader addTrackDown by id :" + patients.getId()); | |
| 488 | + if (CollectionUtils.isNotEmpty(records)) { | |
| 489 | + TrackDownRecord track = records.get(0); | |
| 490 | + trackDownRecord.setId(track.getId()); | |
| 491 | + } | |
| 492 | + if (day > 42) {//不需要做产后访视追访记录,只做产后复查追访 | |
| 451 | 493 | trackDownRecord.setTrackType(TrackDownDateEnums.J.getId()); |
| 452 | - } else {//结束流程 | |
| 453 | - trackDownRecord.setStatus(0); | |
| 454 | 494 | } |
| 455 | - | |
| 495 | + trackDownService.addOrupdateTrackDownRecord(patients.getOperator(), trackDownRecord); | |
| 456 | 496 | } |
| 457 | - //查询是否存在追访记录,如果有则修改,没有则新增 | |
| 458 | - TrackDownRecordQuery downRecordQuery = new TrackDownRecordQuery(); | |
| 459 | - downRecordQuery.setParentId(patients.getId()); | |
| 460 | - List<TrackDownRecord> records = downRecordService.queryTrackDown(downRecordQuery); | |
| 461 | - logger.info("CHTrackDownDataLoader addTrackDown by id :" + patients.getId()); | |
| 462 | - if (CollectionUtils.isNotEmpty(records)) { | |
| 463 | - TrackDownRecord track = records.get(0); | |
| 464 | - trackDownRecord.setId(track.getId()); | |
| 465 | - } | |
| 466 | - if (day > 42) {//不需要做产后访视追访记录,只做产后复查追访 | |
| 467 | - trackDownRecord.setTrackType(TrackDownDateEnums.J.getId()); | |
| 468 | - } | |
| 469 | - trackDownService.addOrupdateTrackDownRecord(patients.getOperator(), trackDownRecord); | |
| 470 | 497 | } |
| 498 | + }catch (Exception e){ | |
| 499 | + e.printStackTrace(); | |
| 471 | 500 | } |
| 472 | 501 | } |
| 473 | 502 | } |