Commit e86cb3549425b8dbc138135f5afa4245bc7ce1b5
1 parent
41af146e98
Exists in
master
and in
6 other branches
继承高危因数和筛查结果
Showing 3 changed files with 123 additions and 148 deletions
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntenatalExaminationService.java
View file @
e86cb35
... | ... | @@ -104,7 +104,7 @@ |
104 | 104 | * @param type 1 初诊 2 复诊 |
105 | 105 | */ |
106 | 106 | public void updateAntExRecord(String id, int type) { |
107 | - AntExRecordModel antExRecordModel = null; | |
107 | + AntExRecordModel antExRecordModel; | |
108 | 108 | if (type == 2) { |
109 | 109 | AntenatalExaminationModel ant = findOneById(id); |
110 | 110 | antExRecordModel = antExRecordService.convert(ant); |
... | ... | @@ -119,7 +119,6 @@ |
119 | 119 | if (CollectionUtils.isNotEmpty(list)) { |
120 | 120 | antExRecordService.batchUpdate(antExRecordModel,antExRecordQuery); |
121 | 121 | } else { |
122 | -// antExRecordQuery.setfId(null); | |
123 | 122 | antExRecordQuery.setParentId(antExRecordModel.getParentId()); |
124 | 123 | antExRecordQuery.setcId(antExRecordModel.getCheckDoctor()); |
125 | 124 | Integer count = antExRecordService.count(antExRecordQuery); |
... | ... | @@ -128,7 +127,6 @@ |
128 | 127 | antExRecordService.addOneRecord(antExRecordModel); |
129 | 128 | } |
130 | 129 | } |
131 | - | |
132 | 130 | //产检节点统计孕妇范围首次计算 |
133 | 131 | handleCheckPoint(antExRecordModel.getPid()); |
134 | 132 | } |
platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
View file @
e86cb35
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
e86cb35
... | ... | @@ -274,8 +274,8 @@ |
274 | 274 | * @param antExAddRequest |
275 | 275 | * @return |
276 | 276 | */ |
277 | - public BaseResponse addOneAntEx(final AntExAddRequest antExAddRequest, Integer userId) { | |
278 | - final String hospitalId = autoMatchFacade.getHospitalId(userId); | |
277 | + public BaseResponse addOneAntEx(AntExAddRequest antExAddRequest, Integer userId) { | |
278 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
279 | 279 | AntenatalExaminationModel model = antExAddRequest.convertToDataModel(); |
280 | 280 | //表示区域的 |
281 | 281 | if (StringUtils.isNotEmpty(groupsFacade.findByCurrentUserId(hospitalId))) { |
282 | 282 | |
... | ... | @@ -288,42 +288,10 @@ |
288 | 288 | patientsService.validata(p); |
289 | 289 | } |
290 | 290 | |
291 | - //如果有:修改转诊申请单状态 | |
292 | - updateApplyOrder(model, antExAddRequest.getParentId()); | |
293 | - | |
294 | 291 | if (StringUtils.isNotEmpty(antExAddRequest.getId())) { |
295 | 292 | model.setHospitalId(hospitalId); |
296 | 293 | model.setOperator(userId); |
297 | 294 | antenatalExaminationService.updateOneAnt(model, antExAddRequest.getId()); |
298 | - commonThreadPool.execute(new Runnable() { | |
299 | - @Override | |
300 | - public void run() { | |
301 | - //更新主档案或者子档案下次预约时间冗余到patient表的数据 | |
302 | - patientsService.updateNextCheckTime(antExAddRequest.getNextCheckTime(), antExAddRequest.getParentId()); | |
303 | - | |
304 | - Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId()); | |
305 | - //最后一次产检医生 | |
306 | - patients.setLastCheckEmployeeId(antExAddRequest.getCheckDoctor()); | |
307 | - | |
308 | - patientsService.updatePatient(patients); | |
309 | - | |
310 | - //修改孕妇高危等级 | |
311 | - updateLastRisk(antExAddRequest.getParentId()); | |
312 | - | |
313 | - //修改本院最后一次定义高危时间 | |
314 | - updateLastRhTime(patients.getId(), hospitalId); | |
315 | - | |
316 | - //修改最后一次检查时间 | |
317 | - setLashCTimes(antExAddRequest.getParentId()); | |
318 | - | |
319 | - //修改数据 | |
320 | - syncMaster(antExAddRequest.getParentId(), antExAddRequest.getNextCheckTime()); | |
321 | - | |
322 | - //复诊,修改产检管理 | |
323 | - antenatalExaminationService.updateAntExRecord(antExAddRequest.getId(), 2); | |
324 | - } | |
325 | - }); | |
326 | - | |
327 | 295 | AntExQuery antExQuery = new AntExQuery(); |
328 | 296 | antExQuery.setId(antExAddRequest.getId()); |
329 | 297 | List<AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); |
330 | 298 | |
... | ... | @@ -340,13 +308,11 @@ |
340 | 308 | if (CollectionUtils.isNotEmpty(list)) { |
341 | 309 | return new BaseResponse().setErrorcode(ErrorCodeConstants.DATA_EXIST).setErrormsg("同一天只能建一次复诊"); |
342 | 310 | } |
343 | - | |
344 | - final Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId()); | |
311 | + Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId()); | |
345 | 312 | model.setPid(patients.getPid()); |
346 | 313 | |
347 | 314 | antenatalExaminationService.addOneBabyAnt(model); |
348 | 315 | |
349 | - | |
350 | 316 | /** 验证产检券是否可用 可用就改为已使用状态 */ |
351 | 317 | if (StringUtils.isNotBlank(antExAddRequest.getCouponCode()) && antExAddRequest.getCouponType() != null) { |
352 | 318 | BaseObjectResponse resp = couponService.validate(antExAddRequest.getCouponCode(), antExAddRequest.getCouponType(), autoMatchFacade.getHospitalId(userId)); |
353 | 319 | |
354 | 320 | |
355 | 321 | |
356 | 322 | |
357 | 323 | |
358 | 324 | |
359 | 325 | |
360 | 326 | |
... | ... | @@ -356,126 +322,135 @@ |
356 | 322 | couponService.use(autoMatchFacade.getHospitalId(userId), antExAddRequest.getCouponCode(), userId, model.getId()); |
357 | 323 | } |
358 | 324 | } |
359 | - | |
360 | - | |
361 | - final String antId = model.getId(); | |
362 | - | |
363 | - commonThreadPool.execute(new Runnable() { | |
364 | - @Override | |
365 | - public void run() { | |
366 | - patientsService.updateNextCheckTime(antExAddRequest.getNextCheckTime(), antExAddRequest.getParentId()); | |
367 | - | |
368 | - Patients patients1 = new Patients(); | |
369 | - patients1.setId(patients.getId()); | |
370 | - //最后一次产检医生 | |
371 | - patients1.setLastCheckEmployeeId(antExAddRequest.getCheckDoctor()); | |
372 | - | |
373 | - if (StringUtils.isNotEmpty(patients.getEnable()) && "0".equals(patients.getEnable())) { | |
374 | - patients1.setEnable("1"); | |
375 | - } | |
376 | - | |
377 | - patientsService.updatePatient(patients1); | |
378 | - | |
379 | - //修改最后一次检查时间 | |
380 | - setLashCTimes(antExAddRequest.getParentId()); | |
381 | - | |
382 | - //修改孕妇高危等级 | |
383 | - //updatePatientRiskLevel(model, patients); | |
384 | - //修改孕妇高危 | |
385 | - updateLastRisk(antExAddRequest.getParentId()); | |
386 | - | |
387 | - //修改本院最后一次定义高危 | |
388 | - updateLastRhTime(patients.getId(), hospitalId); | |
389 | - | |
390 | - //修改数据 | |
391 | - syncMaster(antExAddRequest.getParentId(), antExAddRequest.getNextCheckTime()); | |
392 | - | |
393 | - //复诊,修改产检管理 | |
394 | - antenatalExaminationService.updateAntExRecord(antId, 2); | |
395 | - } | |
396 | - }); | |
397 | - | |
398 | - | |
399 | 325 | operateLogFacade.addAddOptLog(userId, Integer.parseInt(hospitalId), model, OptActionEnums.ADD.getId(), "添加复诊"); |
400 | - | |
401 | 326 | //添加复诊时添加追访信息 |
402 | 327 | addTrackDownInfo(userId, patients); |
403 | 328 | } |
404 | - //处理自定义高危状态为已使用状态 | |
405 | - highRiskFacade.dispHospHighRiskUse(model.getOtherRisk()); | |
406 | - | |
329 | + //自动数据处理 | |
330 | + updateAutoData(model, hospitalId); | |
407 | 331 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
408 | 332 | } |
409 | 333 | |
410 | - | |
411 | - //修改转诊单高危及诊断信息 | |
412 | - public void updateApplyOrder(final AntenatalExaminationModel antenatalExamination, final String parentId) { | |
413 | - | |
334 | + public void updateAutoData(final AntenatalExaminationModel antExamModel, final String hospitalId) { | |
414 | 335 | commonThreadPool.execute(new Runnable() { |
415 | 336 | @Override |
416 | 337 | public void run() { |
338 | + try { | |
339 | + //更新主档案或者子档案下次预约时间冗余到patient表的数据 | |
340 | + patientsService.updateNextCheckTime(DateUtil.getyyyy_MM_dd(antExamModel.getNextCheckTime()), antExamModel.getParentId()); | |
341 | + } catch (Exception e) { | |
342 | + e.printStackTrace(); | |
343 | + } | |
344 | + try { | |
345 | + //修改孕妇高危等级 | |
346 | + updateLastRisk(antExamModel.getParentId()); | |
347 | + } catch (Exception e) { | |
348 | + e.printStackTrace(); | |
349 | + } | |
350 | + try { | |
351 | + //修改本院最后一次定义高危时间 | |
352 | + updateLastRhTime(antExamModel.getParentId(), hospitalId); | |
353 | + } catch (Exception e) { | |
354 | + e.printStackTrace(); | |
355 | + } | |
356 | + try { | |
357 | + //修改最后一次检查时间 | |
358 | + setLashCTimes(antExamModel.getParentId()); | |
359 | + } catch (Exception e) { | |
360 | + e.printStackTrace(); | |
361 | + } | |
362 | + try { | |
363 | + //修改数据//复诊,修改产检管理 | |
364 | + syncMaster(antExamModel.getParentId(), DateUtil.getyyyy_MM_dd(antExamModel.getNextCheckTime())); | |
365 | + } catch (Exception e) { | |
366 | + e.printStackTrace(); | |
367 | + } | |
368 | + try { | |
369 | + //如果有:修改转诊申请单状态 | |
370 | + updateApplyOrder(antExamModel, antExamModel.getParentId()); | |
371 | + } catch (Exception e) { | |
372 | + e.printStackTrace(); | |
373 | + } | |
374 | + try { | |
375 | + //处理自定义高危状态为已使用状态 | |
376 | + highRiskFacade.dispHospHighRiskUse(antExamModel.getOtherRisk()); | |
377 | + } catch (Exception e) { | |
378 | + e.printStackTrace(); | |
379 | + } | |
380 | + } | |
381 | + }); | |
382 | + } | |
417 | 383 | |
418 | - Patients patients = patientsService.findOnePatientById(parentId); | |
419 | - //建档类型 0 未分娩建档 1儿童建档时建档 2 自动分娩类型 3 转诊自动建档 | |
420 | - if (null != patients.getBuildType() && patients.getBuildType() == 3) { | |
421 | - ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery(); | |
422 | - referralApplyOrderQuery.setParentId(patients.getId()); | |
423 | - //申请单状态 1 已转出 2 接收转诊 | |
424 | - //转诊单状态为待接收状态 | |
425 | - List<ReferralApplyOrderModel> orderModelList = applyOrderService.queryReferralApplyOrderWithQuery(referralApplyOrderQuery); | |
426 | - if (CollectionUtils.isNotEmpty(orderModelList)) { | |
427 | - ReferralApplyOrderModel referralApplyOrderModel = orderModelList.get(0); | |
428 | - String outHospitalId = referralApplyOrderModel.getOutHospitalId(); | |
429 | - //查询转入申请单 | |
430 | - ReferralApplyOrderQuery referralApplyOrderQuery1 = new ReferralApplyOrderQuery(); | |
431 | - referralApplyOrderQuery1.setOutHospitalId(outHospitalId); | |
432 | - referralApplyOrderQuery1.setTransferredHospital(patients.getHospitalId()); | |
433 | - referralApplyOrderQuery1.setPid(patients.getPid()); | |
434 | - ReferralApplyOrderModel model1 = new ReferralApplyOrderModel(); | |
435 | - if (referralApplyOrderModel.getStatus() == 1) { | |
436 | - //设置接收时间 | |
437 | - model1.setReceived(antenatalExamination.getCheckDate()); | |
438 | - model1.setRecDoctor(antenatalExamination.getCheckDoctor()); | |
439 | - model1.setStatus(2); | |
440 | - model1.setModified(new Date()); | |
441 | - } | |
384 | + //修改转诊单/最后一次产检医生,高危及诊断信息 | |
385 | + public void updateApplyOrder(final AntenatalExaminationModel antenatalExamination, final String parentId) { | |
386 | + Patients patients = patientsService.findOnePatientById(parentId); | |
387 | + if (patients != null) { | |
388 | + //最后一次产检医生 | |
389 | + patients.setLastCheckEmployeeId(antenatalExamination.getCheckDoctor()); | |
390 | + //0,转诊建档,待接收 1,转诊建档,已接收 | |
391 | + if (StringUtils.isNotEmpty(patients.getEnable()) && "0".equals(patients.getEnable())) { | |
392 | + patients.setEnable("1"); | |
393 | + } | |
394 | + //更新patient表 | |
395 | + patientsService.updatePatient(patients); | |
396 | + //建档类型 0 未分娩建档 1儿童建档时建档 2 自动分娩类型 3 转诊自动建档 | |
397 | + if (null != patients.getBuildType() && patients.getBuildType() == 3) { | |
398 | + ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery(); | |
399 | + referralApplyOrderQuery.setParentId(patients.getId()); | |
400 | + //申请单状态 1 已转出 2 接收转诊 | |
401 | + //转诊单状态为待接收状态 | |
402 | + List<ReferralApplyOrderModel> orderModelList = applyOrderService.queryReferralApplyOrderWithQuery(referralApplyOrderQuery); | |
403 | + if (CollectionUtils.isNotEmpty(orderModelList)) { | |
404 | + ReferralApplyOrderModel referralApplyOrderModel = orderModelList.get(0); | |
405 | + String outHospitalId = referralApplyOrderModel.getOutHospitalId(); | |
406 | + //查询转入申请单 | |
407 | + ReferralApplyOrderQuery referralApplyOrderQuery1 = new ReferralApplyOrderQuery(); | |
408 | + referralApplyOrderQuery1.setOutHospitalId(outHospitalId); | |
409 | + referralApplyOrderQuery1.setTransferredHospital(patients.getHospitalId()); | |
410 | + referralApplyOrderQuery1.setPid(patients.getPid()); | |
411 | + ReferralApplyOrderModel model1 = new ReferralApplyOrderModel(); | |
412 | + if (referralApplyOrderModel.getStatus() == 1) { | |
413 | + //设置接收时间 | |
414 | + model1.setReceived(antenatalExamination.getCheckDate()); | |
415 | + model1.setRecDoctor(antenatalExamination.getCheckDoctor()); | |
416 | + model1.setStatus(2); | |
417 | + model1.setModified(new Date()); | |
418 | + } | |
442 | 419 | |
443 | - model1.setScore(NumberUtils.toInt(antenatalExamination.getRiskScore())); | |
444 | - //其他诊断 | |
445 | - model1.setOtherDiagn(antenatalExamination.getDiagnosisOther()); | |
446 | - model1.setDiagnosis(antenatalExamination.getDiagnosis()); | |
447 | - List<String> rlevel = Collections.emptyList(); | |
448 | - //风险等级颜色 | |
449 | - if (StringUtils.isNotEmpty(patients.getRiskLevelId()) && !"[]".equals(patients.getRiskLevelId())) { | |
450 | - rlevel = JsonUtil.jkstr2Obj(patients.getRiskLevelId(), List.class); | |
451 | - com.lyms.platform.operate.web.utils.CollectionUtils.removeDuplicate(rlevel, true); | |
452 | - } | |
453 | - model1.setrLevel(rlevel); | |
454 | - try { | |
455 | - //风险名称 | |
456 | - model1.setrRisk(queryRiskName(patients.getRiskFactorId())); | |
457 | - //高危集合ID | |
458 | - model1.setRiskFactorId(patients.getRiskFactorId()); | |
459 | - System.out.println("待修改转诊信息:" + model1.toString()); | |
460 | - } catch (Exception e) { | |
461 | - e.printStackTrace(); | |
462 | - } | |
463 | - //设置转入申请单的状态为接收 | |
464 | - applyOrderService.updateByParentId(referralApplyOrderQuery1, model1); | |
465 | - | |
466 | - //查询转出申请单 | |
467 | - ReferralApplyOrderQuery referralApplyOrderQuery2 = new ReferralApplyOrderQuery(); | |
468 | - referralApplyOrderQuery2.setOutHospitalId(patients.getHospitalId()); | |
469 | - referralApplyOrderQuery2.setTransferredHospital(outHospitalId); | |
470 | - referralApplyOrderQuery2.setPid(patients.getPid()); | |
471 | - //设置转出申请单的状态为接收 | |
472 | - applyOrderService.updateByParentId(referralApplyOrderQuery2, model1); | |
473 | - System.out.println("查询转诊条件:" + referralApplyOrderQuery.convertToQuery().convertToMongoQuery()); | |
474 | - | |
420 | + model1.setScore(NumberUtils.toInt(antenatalExamination.getRiskScore())); | |
421 | + //其他诊断 | |
422 | + model1.setOtherDiagn(antenatalExamination.getDiagnosisOther()); | |
423 | + model1.setDiagnosis(antenatalExamination.getDiagnosis()); | |
424 | + List<String> rlevel = Collections.emptyList(); | |
425 | + //风险等级颜色 | |
426 | + if (StringUtils.isNotEmpty(patients.getRiskLevelId()) && !"[]".equals(patients.getRiskLevelId())) { | |
427 | + rlevel = JsonUtil.jkstr2Obj(patients.getRiskLevelId(), List.class); | |
428 | + com.lyms.platform.operate.web.utils.CollectionUtils.removeDuplicate(rlevel, true); | |
475 | 429 | } |
430 | + model1.setrLevel(rlevel); | |
431 | + try { | |
432 | + //风险名称 | |
433 | + model1.setrRisk(queryRiskName(patients.getRiskFactorId())); | |
434 | + //高危集合ID | |
435 | + model1.setRiskFactorId(patients.getRiskFactorId()); | |
436 | + System.out.println("待修改转诊信息:" + model1.toString()); | |
437 | + } catch (Exception e) { | |
438 | + e.printStackTrace(); | |
439 | + } | |
440 | + //设置转入申请单的状态为接收 | |
441 | + applyOrderService.updateByParentId(referralApplyOrderQuery1, model1); | |
442 | + | |
443 | + //查询转出申请单 | |
444 | + ReferralApplyOrderQuery referralApplyOrderQuery2 = new ReferralApplyOrderQuery(); | |
445 | + referralApplyOrderQuery2.setOutHospitalId(patients.getHospitalId()); | |
446 | + referralApplyOrderQuery2.setTransferredHospital(outHospitalId); | |
447 | + referralApplyOrderQuery2.setPid(patients.getPid()); | |
448 | + //设置转出申请单的状态为接收 | |
449 | + applyOrderService.updateByParentId(referralApplyOrderQuery2, model1); | |
450 | + System.out.println("查询转诊条件:" + referralApplyOrderQuery.convertToQuery().convertToMongoQuery()); | |
476 | 451 | } |
477 | 452 | } |
478 | - }); | |
453 | + } | |
479 | 454 | } |
480 | 455 | |
481 | 456 | /** |
... | ... | @@ -1239,7 +1214,8 @@ |
1239 | 1214 | /** |
1240 | 1215 | * 处理自动分娩或终止妊娠的情况 |
1241 | 1216 | */ |
1242 | - private void updateAutoMatdel(List<Patients> patientses, List<Patients> list, int i, Date dueDate, List sortList, List<SortIn> listDate, Map map) { | |
1217 | + private void updateAutoMatdel(List<Patients> patientses, List<Patients> list, int i, Date dueDate, List | |
1218 | + sortList, List<SortIn> listDate, Map map) { | |
1243 | 1219 | Iterator<Patients> iterator = patientses.iterator(); |
1244 | 1220 | Organization organization = null; |
1245 | 1221 | String pid = ""; |
... | ... | @@ -2099,7 +2075,8 @@ |
2099 | 2075 | * @param type 类型 1 孕妇 3 产妇 -1 不区分 |
2100 | 2076 | * @param outHospital 是否需要查外院 |
2101 | 2077 | */ |
2102 | - public Patients findOnePatient(String cardNo, String vcCardNo, String id, List<String> hospitalId, Integer type, boolean outHospital, String pid, boolean isEnable) { | |
2078 | + public Patients findOnePatient(String cardNo, String vcCardNo, String id, List<String> hospitalId, Integer | |
2079 | + type, boolean outHospital, String pid, boolean isEnable) { | |
2103 | 2080 | PatientsQuery patientsQuery = new PatientsQuery(); |
2104 | 2081 | if (StringUtils.isNotEmpty(cardNo)) { |
2105 | 2082 | patientsQuery.setCardNo(cardNo); |