From 5151655ace2dff643333d885f35b39bebd21bf57 Mon Sep 17 00:00:00 2001 From: jiangjiazhi Date: Sun, 14 Aug 2016 12:26:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=BE=E7=BD=AEparentid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/facade/AntenatalExaminationFacade.java | 21 +++++---- .../operate/web/facade/MatDeliverFacade.java | 6 +-- .../operate/web/facade/PostReviewFacade.java | 51 +++++++++++++++++++--- 3 files changed, 61 insertions(+), 17 deletions(-) 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 92da762..496ae0d 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 @@ -507,11 +507,12 @@ public class AntenatalExaminationFacade { /** * 根据身份证号或者就诊卡号查询产妇 * - * @param cardNo - * @param vcCardNo - * @return + * @param cardNo 身份证号 + * @param vcCardNo 就诊卡号 + * @param type 类型 1 孕妇 3 产妇 -1 不区分 + * @param outHospital 是否需要查外院 */ - public Patients findOnePatient(String cardNo, String vcCardNo, String id, String hospitalId, Integer type) { + public Patients findOnePatient(String cardNo, String vcCardNo, String id, String hospitalId, Integer type, boolean outHospital) { PatientsQuery patientsQuery = new PatientsQuery(); if (StringUtils.isNotEmpty(cardNo)) { patientsQuery.setCardNo(cardNo); @@ -528,10 +529,12 @@ public class AntenatalExaminationFacade { if (CollectionUtils.isNotEmpty(list)) { return list.get(0); } - patientsQuery.setHospitalId(null); - list = patientsService.queryPatient(patientsQuery); - if (CollectionUtils.isNotEmpty(list)) { - return list.get(0); + if (outHospital) { + patientsQuery.setHospitalId(null); + list = patientsService.queryPatient(patientsQuery); + if (CollectionUtils.isNotEmpty(list)) { + return list.get(0); + } } return patients; } @@ -589,7 +592,7 @@ public class AntenatalExaminationFacade { hospital = list1.get(0) + ""; } //查询产妇数据 - patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospital, 1); + patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospital, 1, false); } if (null == patients) { diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java index 8dc74f0..fde9fab 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java @@ -282,15 +282,15 @@ public class MatDeliverFacade { return new BaseResponse().setErrormsg("没有相关的产妇记录").setErrorcode(ErrorCodeConstants.BUSINESS_ERROR); }*/ //外院的孕妇 - Patients patients1 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, null, 1); + Patients patients1 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, null, 1,false); //外院的产妇 // Patients patients2 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, null, 3); //http://jira.healthbaby.com.cn/browse/WEB-204 修改bug //本院的孕妇 - Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, hospital, 1); + Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, hospital, 1,false); //本院产妇 - Patients patients3 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, hospital, 3); + Patients patients3 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, hospital, 3,false); //本院产妇,并且本院没建档需要提醒补录记录 if(null!=patients3 && null==patients){ patients=patients3; diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java index c81e8fa..7a38188 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java @@ -53,17 +53,37 @@ public class PostReviewFacade { @Autowired private OrganizationService organizationService; + /** + * + * 增加产后复查记录 + * + * 3、当前孕妇在系统中的本次妊娠期处于已分娩(孕周大于41+6孕周自动分娩、做了分娩记录、儿童建档对应的孕妇分娩),但该孕妇在本院未建档,点击查询进入新增复查界面;在保存产后复查时要自动给该产妇建档(建档的基本信息为该产妇在系统中最新的建档信息) + + 4、当通过产后复查给产妇建档时,如果查询到该产妇在本院有patient数据并且该patient的buildType=1,则要把该patient的buildType更新为0(防止儿童建档时产生了产妇建档数据,在添加产后复查时重复给该产妇建档) + + * @param postReviewRequest + * @param userId + * @return + */ public BaseResponse addPostReview(PostReviewRequest postReviewRequest,Integer userId) { + //获取数据 + Patients patients1 = patientsService.findOnePatientById(postReviewRequest.getParentId()); + String hospital= autoMatchFacade.getHospitalId(userId); + //判断是否是同一个医院 + if(!patients1.getHospitalId().equals(hospital)){ + patients1.setId(null); + patients1.setHospitalId(hospital); + patients1.setBuildType(0); + patientsService.addPatient(patients1); + } if (StringUtils.isEmpty(postReviewRequest.getId())) { PostReviewModel postReviewModel = postReviewRequest.convertToDataModel(); postReviewModel.setYn(YnEnums.YES.getId()); - List list1 = autoMatchFacade.matchOrgId(userId); - if(CollectionUtils.isNotEmpty(list1)){ - postReviewModel.setHospitalId(list1.get(0)+""); - } + postReviewModel.setHospitalId(hospital); Patients patients = patientsService.findOnePatientById(postReviewRequest.getParentId()); if(StringUtils.isNotEmpty(postReviewRequest.getDueDate())){ patients.setFmDate(DateUtil.parseYMD(postReviewRequest.getDueDate())); + patients.setBuildType(0); patientsService.updatePatient(patients); } postReviewModel.setPid(patients.getPid()); @@ -79,11 +99,32 @@ public class PostReviewFacade { return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); } + /** + * + * 1、当前孕妇在系统中的本次妊娠期处于未分娩/已终止妊娠或在结束上次妊娠期后再次新增了建档,不管该孕妇在本院是否建档,点击查询时提示当前用户未分娩,不能进行复查 + + 2、当前孕妇在系统中的本次妊娠期处于已分娩(孕周大于41+6孕周自动分娩、做了分娩记录、儿童建档对应的孕妇分娩),并且该孕妇在本院已建档,点击查询进入新增复查界面 + + 3、当前孕妇在系统中的本次妊娠期处于已分娩(孕周大于41+6孕周自动分娩、做了分娩记录、儿童建档对应的孕妇分娩),但该孕妇在本院未建档,点击查询进入新增复查界面;在保存产后复查时要自动给该产妇建档(建档的基本信息为该产妇在系统中最新的建档信息) + + 4、当通过产后复查给产妇建档时,如果查询到该产妇在本院有patient数据并且该patient的buildType=1,则要把该patient的buildType更新为0(防止儿童建档时产生了产妇建档数据,在添加产后复查时重复给该产妇建档) + * + * @param postReviewQueryRequest + * @param userId + * @return + */ public BaseResponse queryPostList(PostReviewQueryRequest postReviewQueryRequest,Integer userId) { + //未分娩建档 + Patients patients = examinationFacade.findOnePatient(postReviewQueryRequest.getCardNo(), postReviewQueryRequest.getVcCardNo(), null, null, 1,false); + if(null!=patients){ + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("当前用户未分娩,不能进行复查"); + } + + String hospitalId = autoMatchFacade.getHospitalId(userId); //取所有医院的建档数据 优先取本院 ,然后取外院 - Patients patientsList = examinationFacade.findOnePatient(postReviewQueryRequest.getCardNo(), postReviewQueryRequest.getVcCardNo(), null, hospitalId, 3); + Patients patientsList = examinationFacade.findOnePatient(postReviewQueryRequest.getCardNo(), postReviewQueryRequest.getVcCardNo(), null, hospitalId, 3,true); PostReviewListResult postReviewListResult = new PostReviewListResult(); if (null != patientsList) { -- 1.8.3.1