Commit 856e14495f3923a8516b432245cd58ed6e148608
1 parent
e5c1a6e2c5
Exists in
dev
#fix:大同预约建档优化,调整为预约建档直接升级为正式建档,优化建档流程
Showing 9 changed files with 184 additions and 21 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/YunBookbuildingService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RemoteController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/AntExcAddRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/YunBookbuildingAddRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/vo/ArchiveHistoryDTO.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/vo/ArchiveUsers.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/YunBookbuildingService.java
View file @
856e144
... | ... | @@ -32,7 +32,13 @@ |
32 | 32 | //孕妇建档时生成孕检追访信息 |
33 | 33 | public Patients addPregnantBookbuilding(Patients patient) { |
34 | 34 | |
35 | - return yunBookBuildingDao.addYunBookbuilding(patient); | |
35 | + if (StringUtils.isNotEmpty(patient.getId())){ | |
36 | + update(patient,patient.getId()); | |
37 | + return patient; | |
38 | + }else { | |
39 | + return yunBookBuildingDao.addYunBookbuilding(patient); | |
40 | + } | |
41 | + | |
36 | 42 | } |
37 | 43 | public void deletePregnantById(String id) { |
38 | 44 | Patients obj = new Patients(); |
... | ... | @@ -75,6 +81,7 @@ |
75 | 81 | patientsQuery.mysqlBuild(yunBookBuildingDao.queryPatientCount(query)); |
76 | 82 | query.start(patientsQuery.getOffset()).end(patientsQuery.getLimit()); |
77 | 83 | } |
84 | + System.out.println(query.convertToMongoQuery().toString()); | |
78 | 85 | return yunBookBuildingDao.queryPatientWithQuery(query.addOrder(Sort.Direction.DESC, "created")); |
79 | 86 | } |
80 | 87 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RemoteController.java
View file @
856e144
... | ... | @@ -509,20 +509,24 @@ |
509 | 509 | ArchiveHistoryDTO archiveHistory = JsonUtil.jkstr2Obj(archiveHistoryDTO, ArchiveHistoryDTO.class); |
510 | 510 | |
511 | 511 | final String idCard = archiveUsers.getIdCard(); |
512 | - final String assistUserId = archiveUsers.getAssistUserId(); | |
512 | + final String assistUserId = StringUtils.isNotEmpty(archiveUsers.getAssistUserId())?archiveUsers.getAssistUserId():getArchiveId(); | |
513 | 513 | //组装建档保存参数 |
514 | 514 | YunBookbuildingAddRequest request = new YunBookbuildingAddRequest(); |
515 | + request.setWxType(1); | |
515 | 516 | request.setHospitalId(archiveUsers.getHospitalId()); |
516 | 517 | request.setPregnantName(archiveUsers.getName()); |
517 | 518 | request.setPregnantCertificateNum(idCard); |
518 | 519 | request.setPregnantCertificateTypeId("70ae1d93-2964-46bc-83fa-bec9ff605b1c");//身份证 |
519 | 520 | request.setBirthday(DateUtil.getBirthFromIdCard(archiveUsers.getIdCard())); |
520 | 521 | request.setPregnantPhone(archiveUsers.getPhone()); |
521 | - request.setChildbirthAddr(resort.getAddress()); | |
522 | - request.setChildbirthProvinceId(resort.getProvinceId()); | |
523 | - request.setChildbirthCityId(resort.getCityId()); | |
524 | - request.setChildbirthAreaId(resort.getDistrictId()); | |
525 | - request.setChildbirthStreetId(resort.getStreetId()); | |
522 | + if (resort!=null){ | |
523 | + request.setChildbirthAddr(resort.getAddress()); | |
524 | + request.setChildbirthProvinceId(resort.getProvinceId()); | |
525 | + request.setChildbirthCityId(resort.getCityId()); | |
526 | + request.setChildbirthAreaId(resort.getDistrictId()); | |
527 | + request.setChildbirthStreetId(resort.getStreetId()); | |
528 | + } | |
529 | + | |
526 | 530 | request.setReqHusband(false); |
527 | 531 | |
528 | 532 | request.setLastMenstrualPeriod(archiveHistory.getLastMenses()); |
529 | 533 | |
... | ... | @@ -542,15 +546,18 @@ |
542 | 546 | request.setContactPhone(archiveUsers.getContactPhone()); |
543 | 547 | final String cDueWeek = request.getcDueWeek(); |
544 | 548 | final String lastMenses = archiveHistory.getLastMenses(); |
545 | - | |
546 | - BaseObjectResponse baseObjectResponse = bookbuildingFacade.addPregnantBookbuilding(request, Integer.valueOf(archiveUsers.getAssistUserId()), false); | |
547 | - System.out.println("confirmArchive return :"+JsonUtil.obj2JsonString(baseObjectResponse)); | |
549 | + final String hospitalId=request.getHospitalId(); | |
550 | + BaseObjectResponse baseObjectResponse = bookbuildingFacade.addPregnantBookbuilding(request,StringUtils.isNotEmpty(archiveUsers.getAssistUserId())?Integer.valueOf(archiveUsers.getAssistUserId()):null , false); | |
551 | + //System.out.println("confirmArchive return :"+JsonUtil.obj2JsonString(baseObjectResponse)); | |
548 | 552 | if(baseObjectResponse.getErrorcode()==ErrorCodeConstants.SUCCESS){ |
549 | 553 | new Thread(new Runnable() { |
550 | 554 | @Override |
551 | 555 | public void run() { |
552 | 556 | System.out.println("start auto generate antexc......"); |
553 | 557 | try { |
558 | + if ("2100002419".equals(hospitalId)){ | |
559 | + return; | |
560 | + } | |
554 | 561 | //查询预约建档信息 |
555 | 562 | ArchiveDataQuery query = new ArchiveDataQuery(); |
556 | 563 | query.setIdCard(idCard); |
... | ... | @@ -569,6 +576,7 @@ |
569 | 576 | List<Patients> patientsList = patientsService.queryPatient(patientsQuery); |
570 | 577 | Patients patients = patientsList.get(0); |
571 | 578 | |
579 | + | |
572 | 580 | AntExcAddRequest antExcAddRequest = new AntExcAddRequest(); |
573 | 581 | antExcAddRequest.setOperaterUserId(assistUserId); |
574 | 582 | antExcAddRequest.setPid(patients.getPid()); |
... | ... | @@ -579,7 +587,7 @@ |
579 | 587 | antExcAddRequest.setLastMenses(lastMenses); |
580 | 588 | antExcAddRequest.setProdDoctor(assistUserId); |
581 | 589 | antExcAddRequest.setcDueWeek(cDueWeek); |
582 | - | |
590 | + antExcAddRequest.setHospitalId(hospitalId); | |
583 | 591 | if (isNotNull(history.get("bp"))) { |
584 | 592 | String bp = JsonUtil.obj2JsonString(history.get("bp")); |
585 | 593 | antExcAddRequest.setBp(JsonUtil.str2Obj(bp, Map.class)); |
... | ... | @@ -734,6 +742,21 @@ |
734 | 742 | return; |
735 | 743 | } |
736 | 744 | |
745 | + } | |
746 | + | |
747 | + private static String getArchiveId(){ | |
748 | + Random random = new Random(); | |
749 | + int randomNumber = random.nextInt(8); // 生成0到8之间的随机整数 | |
750 | + List<String> list=new ArrayList<>(); | |
751 | + list.add("2100006789"); | |
752 | + list.add("2100006791"); | |
753 | + list.add("2100006793"); | |
754 | + list.add("2100006794"); | |
755 | + list.add("2100006795"); | |
756 | + list.add("2100006796"); | |
757 | + list.add("2100006797"); | |
758 | + list.add("2100006798"); | |
759 | + return list.get(randomNumber); | |
737 | 760 | } |
738 | 761 | |
739 | 762 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
856e144
... | ... | @@ -745,8 +745,8 @@ |
745 | 745 | */ |
746 | 746 | public BaseResponse addOneAnetExChu(final AntExcAddRequest excAddRequest, final Integer userId) { |
747 | 747 | StopWatch stopWatch = new StopWatch("addOneAnetExChu"); |
748 | - | |
749 | - final String hospitalId = autoMatchFacade.getHospitalId(userId); | |
748 | + String hId= autoMatchFacade.getHospitalId(userId); | |
749 | + final String hospitalId = StringUtils.isNotEmpty(hId)?hId:excAddRequest.getHospitalId(); | |
750 | 750 | |
751 | 751 | if ("216".equals(hospitalId) && "yin".equals(excAddRequest.getRh())) |
752 | 752 | { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
856e144
... | ... | @@ -233,7 +233,7 @@ |
233 | 233 | * @return |
234 | 234 | */ |
235 | 235 | public BaseObjectResponse addPregnantBookbuilding( |
236 | - YunBookbuildingAddRequest yunRequest, Integer uId, boolean isSync) { | |
236 | + final YunBookbuildingAddRequest yunRequest, Integer uId, boolean isSync) { | |
237 | 237 | // if (yunRequest.getBooksuifangDoctor()!=null){ |
238 | 238 | // yunRequest.setBooksuifangDoctor(JSON.toJSONString(yunRequest.getBooksuifangDoctor())); |
239 | 239 | // } |
240 | 240 | |
241 | 241 | |
... | ... | @@ -261,12 +261,15 @@ |
261 | 261 | patientsQuery.setHospitalId(yunRequest.getHospitalId()); |
262 | 262 | patientsQuery.setBuildTypeEq(0); |
263 | 263 | patientsQuery.setDueStatus(0); |
264 | - | |
264 | + String id=null; | |
265 | 265 | if (yunRequest.getPregnantCertificateNum() != null) { |
266 | 266 | patientsQuery.setCardNo(yunRequest.getPregnantCertificateNum()); |
267 | - patientsQuery.setHospitalId(null); | |
267 | + // patientsQuery.setHospitalId(null); | |
268 | 268 | //判断该身份证号码是否有孕妇建档 在该医院 |
269 | 269 | List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); |
270 | + if (CollectionUtils.isNotEmpty(patients)){ | |
271 | + id=patients.get(0).getId(); | |
272 | + } | |
270 | 273 | if (yunRequest.getLastMenstrualPeriod() != null && !yunRequest.getLastMenstrualPeriod().equals("")) {//todowtt |
271 | 274 | if (CollectionUtils.isNotEmpty(patients) && patients.get(0).getLastMenses().getTime() < DateUtil.parseYMD(yunRequest.getLastMenstrualPeriod()).getTime()) { |
272 | 275 | br.setErrorcode(ErrorCodeConstants.DATA_EXIST); |
... | ... | @@ -362,6 +365,7 @@ |
362 | 365 | } |
363 | 366 | |
364 | 367 | Patients patient = getPatientsData(yunRequest); |
368 | + patient.setId(id); | |
365 | 369 | patient.setYyzyfmHospitalId(yunRequest.getYyzyfmHospitalId()); |
366 | 370 | |
367 | 371 | patient.setNextCheckTime(DateUtil.parseYMD(yunRequest.getNextCheckTime())); |
... | ... | @@ -486,7 +490,7 @@ |
486 | 490 | patientsService.validata(p); |
487 | 491 | |
488 | 492 | //这个逻辑代码已经无用处,后续删除, cfl 20230928 TODO |
489 | - if (p.getType() != null && p.getType() == 1) { | |
493 | + /* if (p.getType() != null && p.getType() == 1) { | |
490 | 494 | Organization organization = organizationService.getOrganization(Integer.valueOf(yunRequest.getHospitalId())); |
491 | 495 | if (null != organization) { |
492 | 496 | AreaCodeQuery areaCodeQuery = new AreaCodeQuery(); |
... | ... | @@ -522,7 +526,7 @@ |
522 | 526 | } |
523 | 527 | } |
524 | 528 | } |
525 | - } | |
529 | + }*/ | |
526 | 530 | |
527 | 531 | //建档开通增值服务 |
528 | 532 | if (CollectionUtils.isNotEmpty(yunRequest.getSerInfos())) { |
... | ... | @@ -590,7 +594,9 @@ |
590 | 594 | List<ArchiveData> list = archiveDataServicer.query(query, Sort.Direction.DESC, "created"); |
591 | 595 | |
592 | 596 | ArchiveData archiveData = new ArchiveData(); |
593 | - archiveData.setBuildDate(new Date()); | |
597 | + if(yunRequest.getWxType()==null){ | |
598 | + archiveData.setBuildDate(new Date()); | |
599 | + } | |
594 | 600 | archiveData.setId(tempP.getHospitalId() + ":" + tempP.getCardNo()); |
595 | 601 | |
596 | 602 | if (CollectionUtils.isNotEmpty(list)) { |
... | ... | @@ -630,7 +636,7 @@ |
630 | 636 | postQuery.setAreaTiters(patients.getChildExtAddrs()); |
631 | 637 | List<PostVisitHospitalModel> postVisitHospitalModels = postVisitHospitalService.queryPostVisitHospitalModel(postQuery); |
632 | 638 | if (CollectionUtils.isNotEmpty(postVisitHospitalModels)) { |
633 | - System.out.println("setTrackHospitalId===" + postVisitHospitalModels.get(0).getPostHosptial()); | |
639 | + // System.out.println("setTrackHospitalId===" + postVisitHospitalModels.get(0).getPostHosptial()); | |
634 | 640 | patients.setTrackHospitalId(postVisitHospitalModels.get(0).getPostHosptial()); |
635 | 641 | } |
636 | 642 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
856e144
... | ... | @@ -3314,7 +3314,7 @@ |
3314 | 3314 | patientsQuery.setDueStatus(null==patientManagerRequest.getDueStatus() ? null : patientManagerRequest.getDueStatus()); |
3315 | 3315 | patientsQuery.setType(patientManagerRequest.getType()); |
3316 | 3316 | patientsQuery.setHighRiskFileCode(patientManagerRequest.getHighRiskFileCode()); |
3317 | - //System.out.println(patientsQuery.convertToQuery().convertToMongoQuery().toString()); | |
3317 | + System.out.println(patientsQuery.convertToQuery().convertToMongoQuery().toString()); | |
3318 | 3318 | List <Patients> patientsList = patientsService.queryPatient(patientsQuery); |
3319 | 3319 | List <PatientManagerQueryModel> patientManagerQueryModelList = new ArrayList <>(); |
3320 | 3320 | if (CollectionUtils.isNotEmpty(patientsList)) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/AntExcAddRequest.java
View file @
856e144
... | ... | @@ -565,6 +565,16 @@ |
565 | 565 | private String symptoms;//高危手册症状与体征 |
566 | 566 | private String otherCheck;//高危手册其他检查项 |
567 | 567 | |
568 | + private String hospitalId; | |
569 | + | |
570 | + public String getHospitalId() { | |
571 | + return hospitalId; | |
572 | + } | |
573 | + | |
574 | + public void setHospitalId(String hospitalId) { | |
575 | + this.hospitalId = hospitalId; | |
576 | + } | |
577 | + | |
568 | 578 | public String getOther() { |
569 | 579 | return other; |
570 | 580 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/YunBookbuildingAddRequest.java
View file @
856e144
... | ... | @@ -95,6 +95,15 @@ |
95 | 95 | private String dept; |
96 | 96 | |
97 | 97 | private String lowerHairOgr;//母子手册发放机构 |
98 | + private Integer wxType;//小程序预约建档 | |
99 | + | |
100 | + public Integer getWxType() { | |
101 | + return wxType; | |
102 | + } | |
103 | + | |
104 | + public void setWxType(Integer wxType) { | |
105 | + this.wxType = wxType; | |
106 | + } | |
98 | 107 | |
99 | 108 | public String getLowerHairOgr() { |
100 | 109 | return lowerHairOgr; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/vo/ArchiveHistoryDTO.java
View file @
856e144
... | ... | @@ -64,6 +64,11 @@ |
64 | 64 | private Integer feritin; |
65 | 65 | // 糖尿病 |
66 | 66 | private Integer diabetes; |
67 | + //用药史 | |
68 | + private String oldMedication; | |
69 | + | |
70 | + | |
71 | + | |
67 | 72 | //传染病史 |
68 | 73 | private Map infectDiseases; |
69 | 74 | |
... | ... | @@ -74,6 +79,13 @@ |
74 | 79 | private Integer abortionZR; // 自然流产次数 |
75 | 80 | private Integer abortionRG; // 人工流产次数 |
76 | 81 | private Integer yaowu; // 药物流产 |
82 | + //大同医院专属 | |
83 | + private String yongyaoshi;//用药史 | |
84 | + private Integer gongwaiyun;//宫外孕 | |
85 | + private Integer danshuangtai;//是否单双胎 1是 0否 | |
86 | + private Integer taishu;//胎数 | |
87 | + private Integer fuzhurenshen;//是否辅助妊娠 1是 0否 | |
88 | + private String fuzhufangshi;//辅助方式 | |
77 | 89 | /* //月经周期开始天数 |
78 | 90 | private String mensStartDay; |
79 | 91 | //月经周期结束天数 |
... | ... | @@ -95,6 +107,14 @@ |
95 | 107 | this.mensEndDay = mensEndDay; |
96 | 108 | }*/ |
97 | 109 | |
110 | + public String getOldMedication() { | |
111 | + return oldMedication; | |
112 | + } | |
113 | + | |
114 | + public void setOldMedication(String oldMedication) { | |
115 | + this.oldMedication = oldMedication; | |
116 | + } | |
117 | + | |
98 | 118 | public Integer getPlanedProd() { |
99 | 119 | return planedProd; |
100 | 120 | } |
... | ... | @@ -281,5 +301,52 @@ |
281 | 301 | this.cestationInfo = cestationInfo; |
282 | 302 | } |
283 | 303 | |
304 | + public String getYongyaoshi() { | |
305 | + return yongyaoshi; | |
306 | + } | |
307 | + | |
308 | + public void setYongyaoshi(String yongyaoshi) { | |
309 | + this.yongyaoshi = yongyaoshi; | |
310 | + } | |
311 | + | |
312 | + public Integer getGongwaiyun() { | |
313 | + return gongwaiyun; | |
314 | + } | |
315 | + | |
316 | + public void setGongwaiyun(Integer gongwaiyun) { | |
317 | + this.gongwaiyun = gongwaiyun; | |
318 | + } | |
319 | + | |
320 | + public Integer getDanshuangtai() { | |
321 | + return danshuangtai; | |
322 | + } | |
323 | + | |
324 | + public void setDanshuangtai(Integer danshuangtai) { | |
325 | + this.danshuangtai = danshuangtai; | |
326 | + } | |
327 | + | |
328 | + public Integer getTaishu() { | |
329 | + return taishu; | |
330 | + } | |
331 | + | |
332 | + public void setTaishu(Integer taishu) { | |
333 | + this.taishu = taishu; | |
334 | + } | |
335 | + | |
336 | + public Integer getFuzhurenshen() { | |
337 | + return fuzhurenshen; | |
338 | + } | |
339 | + | |
340 | + public void setFuzhurenshen(Integer fuzhurenshen) { | |
341 | + this.fuzhurenshen = fuzhurenshen; | |
342 | + } | |
343 | + | |
344 | + public String getFuzhufangshi() { | |
345 | + return fuzhufangshi; | |
346 | + } | |
347 | + | |
348 | + public void setFuzhufangshi(String fuzhufangshi) { | |
349 | + this.fuzhufangshi = fuzhufangshi; | |
350 | + } | |
284 | 351 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/vo/ArchiveUsers.java
View file @
856e144
... | ... | @@ -52,8 +52,49 @@ |
52 | 52 | private String contactName; |
53 | 53 | //联系人电话 |
54 | 54 | private String contactPhone; |
55 | + //大同医院是否为职工 1为职工 0为非职工 | |
56 | + private Integer userType; | |
57 | + //大同同医院所属科室 | |
58 | + private String dept; | |
59 | + //大同新增产检医生ID | |
60 | + private Integer lastCheckEmployeeId; | |
61 | + //母子健康手册发放地 | |
62 | + private String lowerHairOgr; | |
55 | 63 | |
56 | 64 | |
65 | + | |
66 | + | |
67 | + public Integer getUserType() { | |
68 | + return userType; | |
69 | + } | |
70 | + | |
71 | + public void setUserType(Integer userType) { | |
72 | + this.userType = userType; | |
73 | + } | |
74 | + | |
75 | + public String getDept() { | |
76 | + return dept; | |
77 | + } | |
78 | + | |
79 | + public void setDept(String dept) { | |
80 | + this.dept = dept; | |
81 | + } | |
82 | + | |
83 | + public Integer getLastCheckEmployeeId() { | |
84 | + return lastCheckEmployeeId; | |
85 | + } | |
86 | + | |
87 | + public void setLastCheckEmployeeId(Integer lastCheckEmployeeId) { | |
88 | + this.lastCheckEmployeeId = lastCheckEmployeeId; | |
89 | + } | |
90 | + | |
91 | + public String getLowerHairOgr() { | |
92 | + return lowerHairOgr; | |
93 | + } | |
94 | + | |
95 | + public void setLowerHairOgr(String lowerHairOgr) { | |
96 | + this.lowerHairOgr = lowerHairOgr; | |
97 | + } | |
57 | 98 | |
58 | 99 | public String getQhdjdheight() { |
59 | 100 | return qhdjdheight; |