Commit 259f09fb4c2989b0d80dffeb728ee779f317ae2a

Authored by yangfei
1 parent 58f3f3d1cc

高危转诊处理

Showing 2 changed files with 66 additions and 55 deletions

platform-dal/src/main/java/com/lyms/platform/query/ReferralApplyOrderQuery.java View file @ 259f09f
... ... @@ -59,6 +59,7 @@
59 59 //体验会员 0非会员 1会员
60 60 private Integer expVip;
61 61 private Integer serviceType;
  62 + // //申请单状态 0 已接收 1 已转出 2 建议转诊
62 63 private Integer status;
63 64 /**
64 65 * 生日
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ 259f09f
... ... @@ -269,7 +269,7 @@
269 269  
270 270  
271 271 /**
272   - * 增加一条产前检查
  272 + * 增加一条产前检查(复诊)
273 273 *
274 274 * @param antExAddRequest
275 275 * @return
... ... @@ -341,7 +341,7 @@
341 341 return new BaseResponse().setErrorcode(ErrorCodeConstants.DATA_EXIST).setErrormsg("同一天只能建一次复诊");
342 342 }
343 343  
344   - //修改申请单状态
  344 + //修改转诊申请单状态
345 345 updateApplyOrder(model, antExAddRequest.getParentId());
346 346  
347 347 final Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId());
... ... @@ -401,34 +401,6 @@
401 401  
402 402 operateLogFacade.addAddOptLog(userId, Integer.parseInt(hospitalId), model, OptActionEnums.ADD.getId(), "添加复诊");
403 403  
404   - if (null != patients.getBuildType() && patients.getBuildType() == 3) {
405   - ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery();
406   - referralApplyOrderQuery.setParentId(patients.getId());
407   - referralApplyOrderQuery.setHospitalId(hospitalId);
408   - referralApplyOrderQuery.setStatus(1);
409   - List<ReferralApplyOrderModel> orderModelList = applyOrderService.queryReferralApplyOrderWithQuery(referralApplyOrderQuery);
410   - if (CollectionUtils.isNotEmpty(orderModelList)) {
411   - String outHospitalId = orderModelList.get(0).getOutHospitalId();
412   - ReferralApplyOrderQuery referralApplyOrderQuery1 = new ReferralApplyOrderQuery();
413   - referralApplyOrderQuery1.setOutHospitalId(outHospitalId);
414   - referralApplyOrderQuery1.setTransferredHospital(hospitalId);
415   - referralApplyOrderQuery1.setPid(patients.getPid());
416   - referralApplyOrderQuery1.setStatus(1);
417   - ReferralApplyOrderModel model1 = new ReferralApplyOrderModel();
418   - //设置接收时间
419   - model1.setReceived(model.getCheckDate());
420   - model1.setRecDoctor(model.getCheckDoctor());
421   - model1.setModified(new Date());
422   - model1.setStatus(2);
423   - applyOrderService.updateByParentId(referralApplyOrderQuery1, model1);
424   - ReferralApplyOrderQuery referralApplyOrderQuery2 = new ReferralApplyOrderQuery();
425   - referralApplyOrderQuery2.setOutHospitalId(hospitalId);
426   - referralApplyOrderQuery2.setTransferredHospital(outHospitalId);
427   - referralApplyOrderQuery2.setPid(patients.getPid());
428   - referralApplyOrderQuery2.setStatus(1);
429   - applyOrderService.updateByParentId(referralApplyOrderQuery2, model1);
430   - }
431   - }
432 404 //添加复诊时添加追访信息
433 405 addTrackDownInfo(userId, patients);
434 406 }
435 407  
436 408  
437 409  
438 410  
439 411  
... ... @@ -439,39 +411,77 @@
439 411 }
440 412  
441 413  
  414 +
  415 + //修改转诊单高危及诊断信息
442 416 public void updateApplyOrder(final AntenatalExaminationModel antenatalExamination, final String parentId) {
443 417  
444 418 commonThreadPool.execute(new Runnable() {
445 419 @Override
446 420 public void run() {
  421 +
447 422 Patients patients = patientsService.findOnePatientById(parentId);
  423 + //建档类型 0 未分娩建档 1儿童建档时建档 2 自动分娩类型 3 转诊自动建档
  424 + if (null != patients.getBuildType() && patients.getBuildType() == 3) {
  425 + ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery();
  426 + referralApplyOrderQuery.setParentId(patients.getId());
  427 + //申请单状态 1 已转出 2 接收转诊
  428 + //转诊单状态为待接收状态
  429 + List<ReferralApplyOrderModel> orderModelList = applyOrderService.queryReferralApplyOrderWithQuery(referralApplyOrderQuery);
  430 + if (CollectionUtils.isNotEmpty(orderModelList)) {
  431 + ReferralApplyOrderModel referralApplyOrderModel = orderModelList.get(0);
  432 + String outHospitalId = referralApplyOrderModel.getOutHospitalId();
  433 + //查询转入申请单
  434 + ReferralApplyOrderQuery referralApplyOrderQuery1 = new ReferralApplyOrderQuery();
  435 + referralApplyOrderQuery1.setOutHospitalId(outHospitalId);
  436 + referralApplyOrderQuery1.setTransferredHospital(patients.getHospitalId());
  437 + referralApplyOrderQuery1.setPid(patients.getPid());
  438 + ReferralApplyOrderModel model1 = new ReferralApplyOrderModel();
  439 + if(referralApplyOrderModel.getStatus()==1) {
  440 + //设置接收时间
  441 + model1.setReceived(antenatalExamination.getCheckDate());
  442 + model1.setRecDoctor(antenatalExamination.getCheckDoctor());
  443 + model1.setStatus(2);
  444 + model1.setModified(new Date());
  445 + }
448 446  
449   - ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery();
450   - referralApplyOrderQuery.setParentId(parentId);
  447 + model1.setScore(NumberUtils.toInt(antenatalExamination.getRiskScore()));
  448 + //其他诊断
  449 + model1.setOtherDiagn(antenatalExamination.getDiagnosisOther());
  450 + model1.setDiagnosis(antenatalExamination.getDiagnosis());
  451 + List<String> rlevel=Collections.emptyList();
  452 + //风险等级颜色
  453 + if(StringUtils.isNotEmpty(patients.getRiskLevelId())&&!"[]".equals(patients.getRiskLevelId())){
  454 + rlevel= JsonUtil.jkstr2Obj(patients.getRiskLevelId(), List.class);
  455 + com.lyms.platform.operate.web.utils.CollectionUtils.removeDuplicate(rlevel,true);
  456 + }
  457 + model1.setrLevel(rlevel);
  458 + try {
  459 + //风险名称
  460 + model1.setrRisk(queryRiskName(patients.getRiskFactorId()));
  461 + //高危集合ID
  462 + model1.setRiskFactorId(patients.getRiskFactorId());
  463 + System.out.println("待修改转诊信息:"+model1.toString());
  464 + } catch (Exception e) {
  465 + e.printStackTrace();
  466 + }
  467 + //设置转入申请单的状态为接收
  468 + applyOrderService.updateByParentId(referralApplyOrderQuery1, model1);
451 469  
452   - ReferralApplyOrderModel referralApplyOrderModel = new ReferralApplyOrderModel();
453   - referralApplyOrderModel.setScore(NumberUtils.toInt(antenatalExamination.getRiskScore()));
454   - //其他诊断
455   - referralApplyOrderModel.setOtherDiagn(antenatalExamination.getDiagnosisOther());
456   - referralApplyOrderModel.setDiagnosis(antenatalExamination.getDiagnosis());
457   - List<String> rlevel=Collections.emptyList();
458   - //风险等级颜色
459   - if(StringUtils.isNotEmpty(patients.getRiskLevelId())&&!"[]".equals(patients.getRiskLevelId())){
460   - rlevel= JsonUtil.jkstr2Obj(patients.getRiskLevelId(), List.class);
461   - com.lyms.platform.operate.web.utils.CollectionUtils.removeDuplicate(rlevel,true);
  470 + //查询转出申请单
  471 + ReferralApplyOrderQuery referralApplyOrderQuery2 = new ReferralApplyOrderQuery();
  472 + referralApplyOrderQuery2.setOutHospitalId(patients.getHospitalId());
  473 + referralApplyOrderQuery2.setTransferredHospital(outHospitalId);
  474 + referralApplyOrderQuery2.setPid(patients.getPid());
  475 + //设置转出申请单的状态为接收
  476 + applyOrderService.updateByParentId(referralApplyOrderQuery2, model1);
  477 + System.out.println("查询转诊条件:"+referralApplyOrderQuery.convertToQuery().convertToMongoQuery());
  478 +
  479 + }
462 480 }
463   - referralApplyOrderModel.setrLevel(rlevel);
464   - try {
465   - //风险名称
466   - referralApplyOrderModel.setrRisk(queryRiskName(patients.getRiskFactorId()));
467   - //高危集合ID
468   - referralApplyOrderModel.setRiskFactorId(patients.getRiskFactorId());
469   - System.out.println("待修改转诊信息:"+referralApplyOrderModel.toString());
470   - } catch (Exception e) {
471   - e.printStackTrace();
472   - }
473   - System.out.println("查询转诊条件:"+referralApplyOrderQuery.convertToQuery().convertToMongoQuery());
474   - applyOrderService.updateByParentId(referralApplyOrderQuery, referralApplyOrderModel);
  481 +
  482 +
  483 +
  484 +
475 485 }
476 486 });
477 487