Commit 1c1a47e2560684c1a95d89f880c3545420368afb
1 parent
7836084cd4
Exists in
dev
产妇转诊
Showing 3 changed files with 134 additions and 5 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ApplyScreeningController.java
View file @
1c1a47e
| ... | ... | @@ -68,12 +68,25 @@ |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | + * 转诊详细信息查询 | |
| 72 | + * | |
| 73 | + * @return | |
| 74 | + */ | |
| 75 | + @RequestMapping(method = RequestMethod.GET, value = "/queryMedicalInfo") | |
| 76 | + @ResponseBody | |
| 77 | + public BaseResponse queryMedicalInfo(@Valid ApplyScreeningQueryRequest screeningQueryRequest, HttpServletRequest request) { | |
| 78 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 79 | + return applyScreeningFacade.queryMedicalInfo(screeningQueryRequest,loginState.getId()); | |
| 80 | + } | |
| 81 | + | |
| 82 | + /** | |
| 71 | 83 | * 转诊保存 |
| 72 | 84 | */ |
| 73 | 85 | @RequestMapping(method = RequestMethod.POST, value = "/saveChange") |
| 74 | 86 | @ResponseBody |
| 75 | - public BaseResponse saveChange(@Valid @RequestBody PatientBaseResult patientBaseResult) { | |
| 76 | - return applyScreeningFacade.saveChange(patientBaseResult); | |
| 87 | + public BaseResponse saveChange(@Valid @RequestBody PatientBaseResult patientBaseResult, HttpServletRequest request) { | |
| 88 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 89 | + return applyScreeningFacade.saveChange(patientBaseResult,loginState.getId()); | |
| 77 | 90 | } |
| 78 | 91 | |
| 79 | 92 | /** |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ApplyScreeningFacade.java
View file @
1c1a47e
| ... | ... | @@ -591,6 +591,51 @@ |
| 591 | 591 | return new BaseListResponse().setData(data).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(pageInfo); |
| 592 | 592 | } |
| 593 | 593 | |
| 594 | + public BaseResponse queryMedicalInfo(ApplyScreeningQueryRequest applyScreeningQueryRequest,Integer userId) { | |
| 595 | + PatientBaseResult patientBaseResult = new PatientBaseResult(); | |
| 596 | + MedicalRecordVo medicalRecordVo = new MedicalRecordVo(); | |
| 597 | + medicalRecordVo.setNeed("true"); | |
| 598 | + medicalRecordVo.setLimit(applyScreeningQueryRequest.getLimit()); | |
| 599 | + medicalRecordVo.setPage(applyScreeningQueryRequest.getPage()); | |
| 600 | + medicalRecordVo.setCardNo(applyScreeningQueryRequest.getCardNo()); | |
| 601 | + List<MedicalRecordVo> medicalRecordVoList = appointmentService.queryList(medicalRecordVo); | |
| 602 | + if(CollectionUtils.isNotEmpty(medicalRecordVoList)){ | |
| 603 | + MedicalRecordVo recordVo = medicalRecordVoList.get(0); | |
| 604 | + patientBaseResult.setName(recordVo.getName()); | |
| 605 | + String age1 = recordVo.getAge().substring(0,8); | |
| 606 | + Date date = DateUtil.parseYYYYMMDD(age1); | |
| 607 | + int age = DateUtil.getYearSpace(new Date(),date); | |
| 608 | + patientBaseResult.setAge(age); | |
| 609 | + patientBaseResult.setPhone(recordVo.getPhone()); | |
| 610 | + patientBaseResult.setDepartment(recordVo.getDepartment()); | |
| 611 | + patientBaseResult.setChangeTime(DateUtil.getYyyyMmDd(new Date())); | |
| 612 | + patientBaseResult.setVcCardNo(recordVo.getMdtrtId()); | |
| 613 | + patientBaseResult.setDueWeek(recordVo.getDeliveryTime()); | |
| 614 | + patientBaseResult.setCardNo(recordVo.getCardNo()); | |
| 615 | + // 查建档 | |
| 616 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 617 | + patientsQuery.setCardNo(recordVo.getCardNo()); | |
| 618 | + patientsQuery.setYn(1); | |
| 619 | + patientsQuery.setDesc("true"); | |
| 620 | + patientsQuery.setSort("created"); | |
| 621 | + List<Patients> patientsList = patientsService.queryPatient(patientsQuery); | |
| 622 | + if(CollectionUtils.isNotEmpty(patientsList)){ | |
| 623 | + Patients patients = patientsList.get(0); | |
| 624 | + // 地址 | |
| 625 | + String register = CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), | |
| 626 | + patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService); | |
| 627 | + patientBaseResult.setAddress(register); | |
| 628 | + } | |
| 629 | + | |
| 630 | + // 医生 | |
| 631 | + Users users = usersService.getUsers(userId); | |
| 632 | + if(users != null){ | |
| 633 | + patientBaseResult.setDoctor(users.getName()); | |
| 634 | + } | |
| 635 | + } | |
| 636 | + return new BaseObjectResponse().setData(patientBaseResult).setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 637 | + } | |
| 638 | + | |
| 594 | 639 | private List queryRiskListName(List l) { |
| 595 | 640 | List data = new ArrayList(); |
| 596 | 641 | for (int i = 0; i < l.size(); i++) { |
| 597 | 642 | |
| ... | ... | @@ -603,10 +648,11 @@ |
| 603 | 648 | return data; |
| 604 | 649 | } |
| 605 | 650 | |
| 606 | - public BaseResponse saveChange(PatientBaseResult patientBaseResult) { | |
| 651 | + public BaseResponse saveChange(PatientBaseResult patientBaseResult,Integer userId) { | |
| 607 | 652 | |
| 608 | 653 | ReferralApplyScreeningQuery query = new ReferralApplyScreeningQuery(); |
| 609 | - query.setParentId(patientBaseResult.getId()); | |
| 654 | + query.setCardNo(patientBaseResult.getCardNo()); | |
| 655 | + ReferralApplyScreeningModel referralApplyScreeningModel = new ReferralApplyScreeningModel(); | |
| 610 | 656 | List<ReferralApplyScreeningModel> screeningModels = |
| 611 | 657 | applyScreeningService.queryReferralApplyScreeningWithQuery(query); |
| 612 | 658 | if(CollectionUtils.isNotEmpty(screeningModels)){ |
| 613 | 659 | |
| ... | ... | @@ -616,12 +662,71 @@ |
| 616 | 662 | screeningQuery.setTransferredHospital(screeningModel.getHospitalId()); |
| 617 | 663 | screeningQuery.setPid(screeningModel.getPid()); |
| 618 | 664 | screeningQuery.setId(screeningModel.getId()); |
| 619 | - ReferralApplyScreeningModel referralApplyScreeningModel = new ReferralApplyScreeningModel(); | |
| 620 | 665 | referralApplyScreeningModel.setOutDepartment(screeningModel.getTransferredDepartment()); |
| 621 | 666 | referralApplyScreeningModel.setTransferredDepartment(patientBaseResult.getChangeDepartment()); |
| 622 | 667 | referralApplyScreeningModel.setReason(patientBaseResult.getReason()); |
| 623 | 668 | referralApplyScreeningModel.setModified(new Date()); |
| 624 | 669 | applyScreeningService.updateByParentId(screeningQuery,referralApplyScreeningModel); |
| 670 | + }else{ | |
| 671 | + referralApplyScreeningModel.setOutHospitalId("2100002419"); | |
| 672 | + referralApplyScreeningModel.setTransferredHospital("2100002419"); | |
| 673 | + referralApplyScreeningModel.setType(3); // 产妇 | |
| 674 | + referralApplyScreeningModel.setCardNo(patientBaseResult.getCardNo()); | |
| 675 | + referralApplyScreeningModel.setCreated(new Date()); | |
| 676 | + referralApplyScreeningModel.setModified(new Date()); | |
| 677 | + referralApplyScreeningModel.setName(patientBaseResult.getName()); | |
| 678 | + referralApplyScreeningModel.setStatus(1); // 待确认 | |
| 679 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 680 | + patientsQuery.setCardNo(patientBaseResult.getCardNo()); | |
| 681 | + patientsQuery.setYn(1); | |
| 682 | + patientsQuery.setDesc("true"); | |
| 683 | + patientsQuery.setSort("created"); | |
| 684 | + List<Patients> patientsList = patientsService.queryPatient(patientsQuery); | |
| 685 | + if(CollectionUtils.isNotEmpty(patientsList)){ | |
| 686 | + Patients patients = patientsList.get(0); | |
| 687 | + // 高危因素 | |
| 688 | + List level = new ArrayList(); | |
| 689 | + try { | |
| 690 | + List<String> list = JsonUtil.patientRiskLevelIdToList(patients.getRiskLevelId()); | |
| 691 | + for (String str : list) { | |
| 692 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(str); | |
| 693 | + if (null != basicConfig) { | |
| 694 | + Map map = new HashMap(); | |
| 695 | + basicConfig.replenRisk(map); | |
| 696 | + if (!level.contains(map)){ | |
| 697 | + level.add(map); | |
| 698 | + } | |
| 699 | + } | |
| 700 | + } | |
| 701 | + } catch (Exception e) { | |
| 702 | + ExceptionUtils.catchException(e, "patients.getRiskLevelId error."); | |
| 703 | + } | |
| 704 | + referralApplyScreeningModel.setrLevel(level); | |
| 705 | + // 高危风险因素 | |
| 706 | + referralApplyScreeningModel.setrRisk(queryRiskListName(patients.getRiskFactorId())); | |
| 707 | + } | |
| 708 | + | |
| 709 | + MedicalRecordVo medicalRecordVo = new MedicalRecordVo(); | |
| 710 | + medicalRecordVo.setCardNo(patientBaseResult.getCardNo()); | |
| 711 | + List<MedicalRecordVo> medicalRecordVoList = appointmentService.queryList(medicalRecordVo); | |
| 712 | + if(CollectionUtils.isNotEmpty(medicalRecordVoList)){ | |
| 713 | + MedicalRecordVo recordVo = medicalRecordVoList.get(0); | |
| 714 | + String age1 = recordVo.getAge().substring(0,8); | |
| 715 | + Date date = DateUtil.parseYYYYMMDD(age1); | |
| 716 | + int age = DateUtil.getYearSpace(new Date(),date); | |
| 717 | + referralApplyScreeningModel.setAge(age); | |
| 718 | + referralApplyScreeningModel.setPhone(recordVo.getPhone()); | |
| 719 | + referralApplyScreeningModel.setDueWeek(DateUtil.parseYMD(recordVo.getDeliveryTime())); | |
| 720 | + referralApplyScreeningModel.setDueDate(DateUtil.parseYMD(recordVo.getDeliveryTime())); | |
| 721 | + referralApplyScreeningModel.setTransferredDepartment(patientBaseResult.getChangeDepartment()); | |
| 722 | + Users users = usersService.getUsers(userId); | |
| 723 | + if(users != null){ | |
| 724 | + // 转出科室 | |
| 725 | + referralApplyScreeningModel.setOutDepartment(users.getName()); | |
| 726 | + referralApplyScreeningModel.setApplyDoctor(users.getName()); | |
| 727 | + } | |
| 728 | + } | |
| 729 | + applyScreeningService.addOneReferralApplyScreening(referralApplyScreeningModel); | |
| 625 | 730 | } |
| 626 | 731 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 627 | 732 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PatientBaseResult.java
View file @
1c1a47e
| ... | ... | @@ -86,6 +86,17 @@ |
| 86 | 86 | // 转入科室 |
| 87 | 87 | private String changeDepartment; |
| 88 | 88 | |
| 89 | + | |
| 90 | + private String cardNo; | |
| 91 | + | |
| 92 | + public String getCardNo() { | |
| 93 | + return cardNo; | |
| 94 | + } | |
| 95 | + | |
| 96 | + public void setCardNo(String cardNo) { | |
| 97 | + this.cardNo = cardNo; | |
| 98 | + } | |
| 99 | + | |
| 89 | 100 | public String getDoctor() { |
| 90 | 101 | return doctor; |
| 91 | 102 | } |