From 856e14495f3923a8516b432245cd58ed6e148608 Mon Sep 17 00:00:00 2001 From: zhangchao Date: Sun, 7 Jul 2024 18:09:17 +0800 Subject: [PATCH] =?UTF-8?q?#fix:=E5=A4=A7=E5=90=8C=E9=A2=84=E7=BA=A6?= =?UTF-8?q?=E5=BB=BA=E6=A1=A3=E4=BC=98=E5=8C=96=EF=BC=8C=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=B8=BA=E9=A2=84=E7=BA=A6=E5=BB=BA=E6=A1=A3=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E4=B8=BA=E6=AD=A3=E5=BC=8F=E5=BB=BA=E6=A1=A3?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E5=BB=BA=E6=A1=A3=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/service/YunBookbuildingService.java | 9 ++- .../operate/web/controller/RemoteController.java | 43 ++++++++++---- .../web/facade/AntenatalExaminationFacade.java | 4 +- .../operate/web/facade/BookbuildingFacade.java | 20 ++++--- .../platform/operate/web/facade/PatientFacade.java | 2 +- .../operate/web/request/AntExcAddRequest.java | 10 ++++ .../web/request/YunBookbuildingAddRequest.java | 9 +++ .../platform/operate/web/vo/ArchiveHistoryDTO.java | 67 ++++++++++++++++++++++ .../lyms/platform/operate/web/vo/ArchiveUsers.java | 41 +++++++++++++ 9 files changed, 184 insertions(+), 21 deletions(-) diff --git a/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/YunBookbuildingService.java b/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/YunBookbuildingService.java index bfcbcd3..21c05d6 100644 --- a/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/YunBookbuildingService.java +++ b/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/YunBookbuildingService.java @@ -32,7 +32,13 @@ public class YunBookbuildingService { //孕妇建档时生成孕检追访信息 public Patients addPregnantBookbuilding(Patients patient) { - return yunBookBuildingDao.addYunBookbuilding(patient); + if (StringUtils.isNotEmpty(patient.getId())){ + update(patient,patient.getId()); + return patient; + }else { + return yunBookBuildingDao.addYunBookbuilding(patient); + } + } public void deletePregnantById(String id) { Patients obj = new Patients(); @@ -75,6 +81,7 @@ public class YunBookbuildingService { patientsQuery.mysqlBuild(yunBookBuildingDao.queryPatientCount(query)); query.start(patientsQuery.getOffset()).end(patientsQuery.getLimit()); } + System.out.println(query.convertToMongoQuery().toString()); return yunBookBuildingDao.queryPatientWithQuery(query.addOrder(Sort.Direction.DESC, "created")); } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RemoteController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RemoteController.java index 283e8de..b1bb3d3 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RemoteController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RemoteController.java @@ -509,20 +509,24 @@ public class RemoteController extends BaseController { ArchiveHistoryDTO archiveHistory = JsonUtil.jkstr2Obj(archiveHistoryDTO, ArchiveHistoryDTO.class); final String idCard = archiveUsers.getIdCard(); - final String assistUserId = archiveUsers.getAssistUserId(); + final String assistUserId = StringUtils.isNotEmpty(archiveUsers.getAssistUserId())?archiveUsers.getAssistUserId():getArchiveId(); //组装建档保存参数 YunBookbuildingAddRequest request = new YunBookbuildingAddRequest(); + request.setWxType(1); request.setHospitalId(archiveUsers.getHospitalId()); request.setPregnantName(archiveUsers.getName()); request.setPregnantCertificateNum(idCard); request.setPregnantCertificateTypeId("70ae1d93-2964-46bc-83fa-bec9ff605b1c");//身份证 request.setBirthday(DateUtil.getBirthFromIdCard(archiveUsers.getIdCard())); request.setPregnantPhone(archiveUsers.getPhone()); - request.setChildbirthAddr(resort.getAddress()); - request.setChildbirthProvinceId(resort.getProvinceId()); - request.setChildbirthCityId(resort.getCityId()); - request.setChildbirthAreaId(resort.getDistrictId()); - request.setChildbirthStreetId(resort.getStreetId()); + if (resort!=null){ + request.setChildbirthAddr(resort.getAddress()); + request.setChildbirthProvinceId(resort.getProvinceId()); + request.setChildbirthCityId(resort.getCityId()); + request.setChildbirthAreaId(resort.getDistrictId()); + request.setChildbirthStreetId(resort.getStreetId()); + } + request.setReqHusband(false); request.setLastMenstrualPeriod(archiveHistory.getLastMenses()); @@ -542,15 +546,18 @@ public class RemoteController extends BaseController { request.setContactPhone(archiveUsers.getContactPhone()); final String cDueWeek = request.getcDueWeek(); final String lastMenses = archiveHistory.getLastMenses(); - - BaseObjectResponse baseObjectResponse = bookbuildingFacade.addPregnantBookbuilding(request, Integer.valueOf(archiveUsers.getAssistUserId()), false); - System.out.println("confirmArchive return :"+JsonUtil.obj2JsonString(baseObjectResponse)); + final String hospitalId=request.getHospitalId(); + BaseObjectResponse baseObjectResponse = bookbuildingFacade.addPregnantBookbuilding(request,StringUtils.isNotEmpty(archiveUsers.getAssistUserId())?Integer.valueOf(archiveUsers.getAssistUserId()):null , false); + //System.out.println("confirmArchive return :"+JsonUtil.obj2JsonString(baseObjectResponse)); if(baseObjectResponse.getErrorcode()==ErrorCodeConstants.SUCCESS){ new Thread(new Runnable() { @Override public void run() { System.out.println("start auto generate antexc......"); try { + if ("2100002419".equals(hospitalId)){ + return; + } //查询预约建档信息 ArchiveDataQuery query = new ArchiveDataQuery(); query.setIdCard(idCard); @@ -569,6 +576,7 @@ public class RemoteController extends BaseController { List patientsList = patientsService.queryPatient(patientsQuery); Patients patients = patientsList.get(0); + AntExcAddRequest antExcAddRequest = new AntExcAddRequest(); antExcAddRequest.setOperaterUserId(assistUserId); antExcAddRequest.setPid(patients.getPid()); @@ -579,7 +587,7 @@ public class RemoteController extends BaseController { antExcAddRequest.setLastMenses(lastMenses); antExcAddRequest.setProdDoctor(assistUserId); antExcAddRequest.setcDueWeek(cDueWeek); - + antExcAddRequest.setHospitalId(hospitalId); if (isNotNull(history.get("bp"))) { String bp = JsonUtil.obj2JsonString(history.get("bp")); antExcAddRequest.setBp(JsonUtil.str2Obj(bp, Map.class)); @@ -736,6 +744,21 @@ public class RemoteController extends BaseController { } + private static String getArchiveId(){ + Random random = new Random(); + int randomNumber = random.nextInt(8); // 生成0到8之间的随机整数 + List list=new ArrayList<>(); + list.add("2100006789"); + list.add("2100006791"); + list.add("2100006793"); + list.add("2100006794"); + list.add("2100006795"); + list.add("2100006796"); + list.add("2100006797"); + list.add("2100006798"); + return list.get(randomNumber); + } + @RequestMapping(value = "/womanBookArchive",method = RequestMethod.POST) public void womanBookArchive(HttpServletResponse response, diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java index 3014d8b..c970875 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java @@ -745,8 +745,8 @@ public class AntenatalExaminationFacade { */ public BaseResponse addOneAnetExChu(final AntExcAddRequest excAddRequest, final Integer userId) { StopWatch stopWatch = new StopWatch("addOneAnetExChu"); - - final String hospitalId = autoMatchFacade.getHospitalId(userId); + String hId= autoMatchFacade.getHospitalId(userId); + final String hospitalId = StringUtils.isNotEmpty(hId)?hId:excAddRequest.getHospitalId(); if ("216".equals(hospitalId) && "yin".equals(excAddRequest.getRh())) { diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java index b4d0c06..7a9daca 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java @@ -233,7 +233,7 @@ public class BookbuildingFacade { * @return */ public BaseObjectResponse addPregnantBookbuilding( - YunBookbuildingAddRequest yunRequest, Integer uId, boolean isSync) { + final YunBookbuildingAddRequest yunRequest, Integer uId, boolean isSync) { // if (yunRequest.getBooksuifangDoctor()!=null){ // yunRequest.setBooksuifangDoctor(JSON.toJSONString(yunRequest.getBooksuifangDoctor())); // } @@ -261,12 +261,15 @@ public class BookbuildingFacade { patientsQuery.setHospitalId(yunRequest.getHospitalId()); patientsQuery.setBuildTypeEq(0); patientsQuery.setDueStatus(0); - + String id=null; if (yunRequest.getPregnantCertificateNum() != null) { patientsQuery.setCardNo(yunRequest.getPregnantCertificateNum()); - patientsQuery.setHospitalId(null); + // patientsQuery.setHospitalId(null); //判断该身份证号码是否有孕妇建档 在该医院 List patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); + if (CollectionUtils.isNotEmpty(patients)){ + id=patients.get(0).getId(); + } if (yunRequest.getLastMenstrualPeriod() != null && !yunRequest.getLastMenstrualPeriod().equals("")) {//todowtt if (CollectionUtils.isNotEmpty(patients) && patients.get(0).getLastMenses().getTime() < DateUtil.parseYMD(yunRequest.getLastMenstrualPeriod()).getTime()) { br.setErrorcode(ErrorCodeConstants.DATA_EXIST); @@ -362,6 +365,7 @@ public class BookbuildingFacade { } Patients patient = getPatientsData(yunRequest); + patient.setId(id); patient.setYyzyfmHospitalId(yunRequest.getYyzyfmHospitalId()); patient.setNextCheckTime(DateUtil.parseYMD(yunRequest.getNextCheckTime())); @@ -486,7 +490,7 @@ public class BookbuildingFacade { patientsService.validata(p); //这个逻辑代码已经无用处,后续删除, cfl 20230928 TODO - if (p.getType() != null && p.getType() == 1) { + /* if (p.getType() != null && p.getType() == 1) { Organization organization = organizationService.getOrganization(Integer.valueOf(yunRequest.getHospitalId())); if (null != organization) { AreaCodeQuery areaCodeQuery = new AreaCodeQuery(); @@ -522,7 +526,7 @@ public class BookbuildingFacade { } } } - } + }*/ //建档开通增值服务 if (CollectionUtils.isNotEmpty(yunRequest.getSerInfos())) { @@ -590,7 +594,9 @@ public class BookbuildingFacade { List list = archiveDataServicer.query(query, Sort.Direction.DESC, "created"); ArchiveData archiveData = new ArchiveData(); - archiveData.setBuildDate(new Date()); + if(yunRequest.getWxType()==null){ + archiveData.setBuildDate(new Date()); + } archiveData.setId(tempP.getHospitalId() + ":" + tempP.getCardNo()); if (CollectionUtils.isNotEmpty(list)) { @@ -630,7 +636,7 @@ public class BookbuildingFacade { postQuery.setAreaTiters(patients.getChildExtAddrs()); List postVisitHospitalModels = postVisitHospitalService.queryPostVisitHospitalModel(postQuery); if (CollectionUtils.isNotEmpty(postVisitHospitalModels)) { - System.out.println("setTrackHospitalId===" + postVisitHospitalModels.get(0).getPostHosptial()); + // System.out.println("setTrackHospitalId===" + postVisitHospitalModels.get(0).getPostHosptial()); patients.setTrackHospitalId(postVisitHospitalModels.get(0).getPostHosptial()); } } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java index 4626ed7..5e9ae34 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java @@ -3314,7 +3314,7 @@ public class PatientFacade extends BaseServiceImpl { patientsQuery.setDueStatus(null==patientManagerRequest.getDueStatus() ? null : patientManagerRequest.getDueStatus()); patientsQuery.setType(patientManagerRequest.getType()); patientsQuery.setHighRiskFileCode(patientManagerRequest.getHighRiskFileCode()); - //System.out.println(patientsQuery.convertToQuery().convertToMongoQuery().toString()); + System.out.println(patientsQuery.convertToQuery().convertToMongoQuery().toString()); List patientsList = patientsService.queryPatient(patientsQuery); List patientManagerQueryModelList = new ArrayList <>(); if (CollectionUtils.isNotEmpty(patientsList)) { diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/AntExcAddRequest.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/AntExcAddRequest.java index 27bc630..e742a55 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/AntExcAddRequest.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/AntExcAddRequest.java @@ -565,6 +565,16 @@ public class AntExcAddRequest implements IBasicRequestConvert { private String symptoms;//高危手册症状与体征 private String otherCheck;//高危手册其他检查项 + private String hospitalId; + + public String getHospitalId() { + return hospitalId; + } + + public void setHospitalId(String hospitalId) { + this.hospitalId = hospitalId; + } + public String getOther() { return other; } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/YunBookbuildingAddRequest.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/YunBookbuildingAddRequest.java index b3570c4..799e82b 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/YunBookbuildingAddRequest.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/YunBookbuildingAddRequest.java @@ -95,6 +95,15 @@ public class YunBookbuildingAddRequest { private String dept; private String lowerHairOgr;//母子手册发放机构 + private Integer wxType;//小程序预约建档 + + public Integer getWxType() { + return wxType; + } + + public void setWxType(Integer wxType) { + this.wxType = wxType; + } public String getLowerHairOgr() { return lowerHairOgr; diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/vo/ArchiveHistoryDTO.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/vo/ArchiveHistoryDTO.java index ae8fa65..80e5c27 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/vo/ArchiveHistoryDTO.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/vo/ArchiveHistoryDTO.java @@ -64,6 +64,11 @@ public class ArchiveHistoryDTO { private Integer feritin; // 糖尿病 private Integer diabetes; + //用药史 + private String oldMedication; + + + //传染病史 private Map infectDiseases; @@ -74,6 +79,13 @@ public class ArchiveHistoryDTO { private Integer abortionZR; // 自然流产次数 private Integer abortionRG; // 人工流产次数 private Integer yaowu; // 药物流产 + //大同医院专属 + private String yongyaoshi;//用药史 + private Integer gongwaiyun;//宫外孕 + private Integer danshuangtai;//是否单双胎 1是 0否 + private Integer taishu;//胎数 + private Integer fuzhurenshen;//是否辅助妊娠 1是 0否 + private String fuzhufangshi;//辅助方式 /* //月经周期开始天数 private String mensStartDay; //月经周期结束天数 @@ -95,6 +107,14 @@ public class ArchiveHistoryDTO { this.mensEndDay = mensEndDay; }*/ + public String getOldMedication() { + return oldMedication; + } + + public void setOldMedication(String oldMedication) { + this.oldMedication = oldMedication; + } + public Integer getPlanedProd() { return planedProd; } @@ -281,4 +301,51 @@ public class ArchiveHistoryDTO { this.cestationInfo = cestationInfo; } + public String getYongyaoshi() { + return yongyaoshi; + } + + public void setYongyaoshi(String yongyaoshi) { + this.yongyaoshi = yongyaoshi; + } + + public Integer getGongwaiyun() { + return gongwaiyun; + } + + public void setGongwaiyun(Integer gongwaiyun) { + this.gongwaiyun = gongwaiyun; + } + + public Integer getDanshuangtai() { + return danshuangtai; + } + + public void setDanshuangtai(Integer danshuangtai) { + this.danshuangtai = danshuangtai; + } + + public Integer getTaishu() { + return taishu; + } + + public void setTaishu(Integer taishu) { + this.taishu = taishu; + } + + public Integer getFuzhurenshen() { + return fuzhurenshen; + } + + public void setFuzhurenshen(Integer fuzhurenshen) { + this.fuzhurenshen = fuzhurenshen; + } + + public String getFuzhufangshi() { + return fuzhufangshi; + } + + public void setFuzhufangshi(String fuzhufangshi) { + this.fuzhufangshi = fuzhufangshi; + } } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/vo/ArchiveUsers.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/vo/ArchiveUsers.java index 103eb65..a9f1102 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/vo/ArchiveUsers.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/vo/ArchiveUsers.java @@ -52,9 +52,50 @@ public class ArchiveUsers { private String contactName; //联系人电话 private String contactPhone; + //大同医院是否为职工 1为职工 0为非职工 + private Integer userType; + //大同同医院所属科室 + private String dept; + //大同新增产检医生ID + private Integer lastCheckEmployeeId; + //母子健康手册发放地 + private String lowerHairOgr; + + public Integer getUserType() { + return userType; + } + + public void setUserType(Integer userType) { + this.userType = userType; + } + + public String getDept() { + return dept; + } + + public void setDept(String dept) { + this.dept = dept; + } + + public Integer getLastCheckEmployeeId() { + return lastCheckEmployeeId; + } + + public void setLastCheckEmployeeId(Integer lastCheckEmployeeId) { + this.lastCheckEmployeeId = lastCheckEmployeeId; + } + + public String getLowerHairOgr() { + return lowerHairOgr; + } + + public void setLowerHairOgr(String lowerHairOgr) { + this.lowerHairOgr = lowerHairOgr; + } + public String getQhdjdheight() { return qhdjdheight; } -- 1.8.3.1