Commit 07d531ace27168dc8261395d08d3f56a08267d1f
1 parent
6186b85242
Exists in
master
and in
1 other branch
修改产检删除
Showing 16 changed files with 232 additions and 106 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/Organization.java
- platform-common/src/main/java/com/lyms/platform/common/constants/ErrorCodeConstants.java
- platform-dal/src/main/java/com/lyms/platform/pojo/Patients.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/AutoMatchFacade.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/MatDeliverFacade.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/facade/PostReviewFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/AntExAddRequest.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/MatDeliverAddRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/PostReviewRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntData.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntexListResult.java
- platform-operate-api/src/main/resources/database.properties
platform-biz-service/src/main/java/com/lyms/platform/permission/model/Organization.java
View file @
07d531a
| ... | ... | @@ -26,7 +26,8 @@ |
| 26 | 26 | private Date modified; |
| 27 | 27 | private Date created; |
| 28 | 28 | private String shortCode; |
| 29 | - | |
| 29 | + //是否是建档医院 1 建档医院 数据库默认建档医院 2 非建档医院 | |
| 30 | + private Integer bStatus; | |
| 30 | 31 | private IdTextModel levelObj; |
| 31 | 32 | private IdTextModel typeObj; |
| 32 | 33 | private Object province; |
| ... | ... | @@ -36,6 +37,14 @@ |
| 36 | 37 | private String foreignId; |
| 37 | 38 | private Integer orgType; //-1 未设置 0 公司 1 医院 |
| 38 | 39 | private Integer status; |
| 40 | + | |
| 41 | + public Integer getbStatus() { | |
| 42 | + return bStatus; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public void setbStatus(Integer bStatus) { | |
| 46 | + this.bStatus = bStatus; | |
| 47 | + } | |
| 39 | 48 | |
| 40 | 49 | public Integer getStatus() { |
| 41 | 50 | return status; |
platform-common/src/main/java/com/lyms/platform/common/constants/ErrorCodeConstants.java
View file @
07d531a
platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
View file @
07d531a
| ... | ... | @@ -170,6 +170,8 @@ |
| 170 | 170 | private String publishId; |
| 171 | 171 | |
| 172 | 172 | private String publishName; |
| 173 | + //数据来源id,用于区域隐藏建档 | |
| 174 | + private String source; | |
| 173 | 175 | |
| 174 | 176 | private Integer yn; |
| 175 | 177 | |
| ... | ... | @@ -233,6 +235,14 @@ |
| 233 | 235 | private Integer postViewTimes; |
| 234 | 236 | //操作人 |
| 235 | 237 | private Integer operator; |
| 238 | + | |
| 239 | + public String getSource() { | |
| 240 | + return source; | |
| 241 | + } | |
| 242 | + | |
| 243 | + public void setSource(String source) { | |
| 244 | + this.source = source; | |
| 245 | + } | |
| 236 | 246 | |
| 237 | 247 | public String getoRiskFactor() { |
| 238 | 248 | return oRiskFactor; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
07d531a
| ... | ... | @@ -57,46 +57,58 @@ |
| 57 | 57 | private UsersService usersService; |
| 58 | 58 | @Autowired |
| 59 | 59 | private DeleteProcessHandler deleteProcessHandler; |
| 60 | -@Autowired | |
| 60 | + @Autowired | |
| 61 | 61 | private AntExRecordService recordService; |
| 62 | - private BaseResponse riskEnums; | |
| 63 | 62 | |
| 63 | + private String runType; | |
| 64 | 64 | /** |
| 65 | + * 处理区域隐藏建档 | |
| 66 | + * | |
| 67 | + * @param pid 系统中 | |
| 68 | + * @param parentId | |
| 69 | + * @param userId | |
| 70 | + * @return | |
| 71 | + */ | |
| 72 | + public String handHideBuild(String pid, String parentId, Integer userId) { | |
| 73 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
| 74 | + //修改时不为空 | |
| 75 | + if (StringUtils.isNotEmpty(parentId)) { | |
| 76 | + return parentId; | |
| 77 | + } | |
| 78 | + | |
| 79 | + Patients patients = findOnePatient(null, null, null, hospitalId, 1, false, pid, true); | |
| 80 | + //表示本院已经有隐藏建档 | |
| 81 | + if (null != patients) { | |
| 82 | + return patients.getId(); | |
| 83 | + } | |
| 84 | + | |
| 85 | + //表示区域的 | |
| 86 | + if (ErrorCodeConstants.RUN_MODE.equals(runType) && StringUtils.isEmpty(parentId) && StringUtils.isNotEmpty(pid)) { | |
| 87 | + patients = findOnePatient(null, null, null, null, 1, false, pid, false); | |
| 88 | + patients.setSource(patients.getId()); | |
| 89 | + patients.setId(null); | |
| 90 | + patients.setHospitalId(hospitalId); | |
| 91 | + patients.setType(1); | |
| 92 | + patients.setCreated(new Date()); | |
| 93 | + patients.setBookbuildingDoctor(userId + ""); | |
| 94 | + patients.setEnable("0"); | |
| 95 | + patients.setBookbuildingDate(new Date()); | |
| 96 | + patientsService.addPatient(patients); | |
| 97 | + return patients.getId(); | |
| 98 | + } | |
| 99 | + return null; | |
| 100 | + } | |
| 101 | + /** | |
| 65 | 102 | * 修改最后一次产检时间 |
| 66 | 103 | * |
| 67 | 104 | * @param hospitalId |
| 68 | 105 | * @param id |
| 69 | 106 | * @param type 1 初诊 2 复诊 |
| 70 | 107 | */ |
| 71 | - private void setLashCTimes(String hospitalId, String id, int type) { | |
| 108 | + private void setLashCTimes(String id) { | |
| 72 | 109 | |
| 73 | - /* Patients patients = patientsService.findOnePatientById(id); | |
| 74 | - List<Date> list = new ArrayList<>(); | |
| 75 | - if (type == 2) { | |
| 76 | 110 | AntExQuery antExQuery = new AntExQuery(); |
| 77 | - antExQuery.setYn(YnEnums.YES.getId()); | |
| 78 | - antExQuery.setHospitalId(hospitalId); | |
| 79 | 111 | antExQuery.setParentId(id); |
| 80 | - List<AntenatalExaminationModel> antExList = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
| 81 | - if (CollectionUtils.isNotEmpty(antExList)) { | |
| 82 | - for (AntenatalExaminationModel antEx : antExList) { | |
| 83 | - list.add(antEx.getCheckDate()); | |
| 84 | - } | |
| 85 | - } | |
| 86 | - } else if (type == 1) { | |
| 87 | - AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
| 88 | - antExChuQuery.setYn(YnEnums.YES.getId()); | |
| 89 | - antExChuQuery.setHospitalId(hospitalId); | |
| 90 | - antExChuQuery.setParentId(id); | |
| 91 | - List<AntExChuModel> antExChu = antenatalExaminationService.queryAntExChu(antExChuQuery.convertToQuery()); | |
| 92 | - if (CollectionUtils.isNotEmpty(antExChu)) { | |
| 93 | - for (AntExChuModel antEx : antExChu) { | |
| 94 | - list.add(antEx.getCheckTime()); | |
| 95 | - } | |
| 96 | - } | |
| 97 | - }*/ | |
| 98 | - AntExQuery antExQuery = new AntExQuery(); | |
| 99 | - antExQuery.setParentId(id); | |
| 100 | 112 | antExQuery.setYn(YnEnums.YES.getId()); |
| 101 | 113 | Date date=null; |
| 102 | 114 | List<AntenatalExaminationModel> antEx = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "checkDate")); |
| ... | ... | @@ -147,7 +159,7 @@ |
| 147 | 159 | //修改本院最后一次定义高危 |
| 148 | 160 | updateLastRhTime(patients.getId(), hospitalId); |
| 149 | 161 | //修改最后一次检查时间 |
| 150 | - setLashCTimes(hospitalId, antExAddRequest.getParentId(), 2); | |
| 162 | + setLashCTimes(antExAddRequest.getParentId()); | |
| 151 | 163 | |
| 152 | 164 | //复诊,修改产检管理 |
| 153 | 165 | antenatalExaminationService.updateAntExRecord(antExAddRequest.getId(), 2); |
| ... | ... | @@ -176,7 +188,7 @@ |
| 176 | 188 | antenatalExaminationService.addOneBabyAnt(model); |
| 177 | 189 | |
| 178 | 190 | //修改最后一次检查时间 |
| 179 | - setLashCTimes(hospitalId, antExAddRequest.getParentId(), 2); | |
| 191 | + setLashCTimes(antExAddRequest.getParentId()); | |
| 180 | 192 | //修改申请单状态 |
| 181 | 193 | updateApplyOrder(model, antExAddRequest.getParentId()); |
| 182 | 194 | //修改孕妇高危等级 |
| ... | ... | @@ -250,6 +262,15 @@ |
| 250 | 262 | public BaseResponse addOneAnetExChu(AntExcAddRequest excAddRequest, Integer userId) { |
| 251 | 263 | AntExChuModel antExChuModel = excAddRequest.convertToDataModel(); |
| 252 | 264 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 265 | + | |
| 266 | + //表示区域的 | |
| 267 | + if (ErrorCodeConstants.RUN_MODE.equals(runType)) { | |
| 268 | + String parentId = handHideBuild(excAddRequest.getPid(), excAddRequest.getParentId(), userId); | |
| 269 | + if (StringUtils.isEmpty(parentId)) { | |
| 270 | + //打印日志 | |
| 271 | + } | |
| 272 | + antExChuModel.setParentId(parentId); | |
| 273 | + } | |
| 253 | 274 | antExChuModel.setOperator(userId); |
| 254 | 275 | if (StringUtils.isNotEmpty(antExChuModel.getId()) && StringUtils.isNotEmpty(antExChuModel.getParentId())) { |
| 255 | 276 | antExChuModel.setHospitalId(hospitalId); |
| ... | ... | @@ -273,7 +294,7 @@ |
| 273 | 294 | //修改本院最后一次定义高危 |
| 274 | 295 | updateLastRhTime(patients.getId(), hospitalId); |
| 275 | 296 | |
| 276 | - setLashCTimes(hospitalId, antExChuModel.getParentId(), 1); | |
| 297 | + setLashCTimes(antExChuModel.getParentId()); | |
| 277 | 298 | |
| 278 | 299 | //初诊,修改产检管理 |
| 279 | 300 | // antenatalExaminationService.updateAntExRecord(antExChuModel.getId(), 1); |
| ... | ... | @@ -319,7 +340,7 @@ |
| 319 | 340 | |
| 320 | 341 | //修改本院最后一次定义高危 |
| 321 | 342 | updateLastRhTime(patients.getId(), hospitalId); |
| 322 | - setLashCTimes(hospitalId, antExChuModel.getParentId(), 1); | |
| 343 | + setLashCTimes(antExChuModel.getParentId()); | |
| 323 | 344 | if(StringUtils.isNotEmpty(antExChuModel.getPid())){ |
| 324 | 345 | recordService.handExRecord(antExChuModel.getPid()); |
| 325 | 346 | } |
| ... | ... | @@ -788,7 +809,7 @@ |
| 788 | 809 | List<SortIn> listDate = new ArrayList(); |
| 789 | 810 | |
| 790 | 811 | if (CollectionUtils.isNotEmpty(list)) { |
| 791 | - Patients patients2 = findOnePatient(null, null, null, hospital, -1, true, exListQueryRequest.getPid()); | |
| 812 | + Patients patients2 = findOnePatient(null, null, null, hospital, -1, true, exListQueryRequest.getPid(),false); | |
| 792 | 813 | antexListResult.convertToResult(null, patients2, null); |
| 793 | 814 | |
| 794 | 815 | HighScoreResult highScoreResult = findLastRisk(list.get(0).getPid(), false); |
| ... | ... | @@ -1447,7 +1468,7 @@ |
| 1447 | 1468 | //修改最后一次检查时间 |
| 1448 | 1469 | AntenatalExaminationModel antenatalExaminationModel = antenatalExaminationService.findOneById(antExQueryRequest.getId()); |
| 1449 | 1470 | |
| 1450 | - setLashCTimes(hospital, antenatalExaminationModel.getParentId(), 2); | |
| 1471 | + setLashCTimes( antenatalExaminationModel.getParentId()); | |
| 1451 | 1472 | |
| 1452 | 1473 | updateLastRisk(antenatalExaminationModel.getParentId()); |
| 1453 | 1474 | recordService.handExRecord(antenatalExaminationModel.getParentId()); |
| ... | ... | @@ -1496,7 +1517,7 @@ |
| 1496 | 1517 | antenatalExaminationService.updateAntExChu(antExChuModel, antExQueryRequest.getId()); |
| 1497 | 1518 | |
| 1498 | 1519 | AntExChuModel antExChuModel1 = antenatalExaminationService.findOne(antExQueryRequest.getId()); |
| 1499 | - setLashCTimes(hospital, antExChuModel1.getParentId(), 1); | |
| 1520 | + setLashCTimes(antExChuModel1.getParentId()); | |
| 1500 | 1521 | updateLastRisk(antExChuModel1.getParentId()); |
| 1501 | 1522 | recordService.handExRecord(antExChuModel1.getParentId()); |
| 1502 | 1523 | } else { |
| ... | ... | @@ -1583,7 +1604,7 @@ |
| 1583 | 1604 | * @param type 类型 1 孕妇 3 产妇 -1 不区分 |
| 1584 | 1605 | * @param outHospital 是否需要查外院 |
| 1585 | 1606 | */ |
| 1586 | - public Patients findOnePatient(String cardNo, String vcCardNo, String id, String hospitalId, Integer type, boolean outHospital, String pid) { | |
| 1607 | + public Patients findOnePatient(String cardNo, String vcCardNo, String id, String hospitalId, Integer type, boolean outHospital, String pid, boolean isEnable) { | |
| 1587 | 1608 | PatientsQuery patientsQuery = new PatientsQuery(); |
| 1588 | 1609 | if (StringUtils.isNotEmpty(cardNo)) { |
| 1589 | 1610 | patientsQuery.setCardNo(cardNo); |
| ... | ... | @@ -1598,6 +1619,9 @@ |
| 1598 | 1619 | patientsQuery.setHospitalId(hospitalId); |
| 1599 | 1620 | patientsQuery.setYn(YnEnums.YES.getId()); |
| 1600 | 1621 | patientsQuery.setBuildType(1); |
| 1622 | + if (isEnable) { | |
| 1623 | + patientsQuery.setEnable("0"); | |
| 1624 | + } | |
| 1601 | 1625 | Patients patients = null; |
| 1602 | 1626 | List<Patients> list = patientsService.queryPatient1(patientsQuery, "modified"); |
| 1603 | 1627 | if (CollectionUtils.isNotEmpty(list)) { |
| 1604 | 1628 | |
| 1605 | 1629 | |
| ... | ... | @@ -1661,19 +1685,33 @@ |
| 1661 | 1685 | } |
| 1662 | 1686 | } else { |
| 1663 | 1687 | |
| 1664 | - //查询产妇数据 | |
| 1665 | - patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospitalId, 1, false, null); | |
| 1688 | + //区域模式 | |
| 1689 | + if (ErrorCodeConstants.RUN_MODE.equals(runType)) { | |
| 1690 | + patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospitalId, 1, false, null, true); | |
| 1691 | + } else { | |
| 1692 | + //查询产妇数据 | |
| 1693 | + patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospitalId, 1, false, null, false); | |
| 1694 | + } | |
| 1666 | 1695 | } |
| 1667 | 1696 | |
| 1668 | 1697 | if (null == patients) { |
| 1669 | - //查询是否还有其他记录 | |
| 1670 | - patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospitalId, 3, false, null); | |
| 1671 | - | |
| 1672 | - if (null != patients) { | |
| 1673 | - return new BaseResponse().setErrorcode(ErrorCodeConstants.BUSINESS_ERROR).setErrormsg("该孕妇在系统中已分娩/已终止妊娠不能再进行产检,请重新建档"); | |
| 1698 | + if (ErrorCodeConstants.RUN_MODE.equals(runType)) { | |
| 1699 | + //查询是否还有其他记录 | |
| 1700 | + patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospitalId, 3, false, null, true); | |
| 1701 | + } else { | |
| 1702 | + //查询是否还有其他记录 | |
| 1703 | + patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospitalId, 3, false, null, false); | |
| 1674 | 1704 | } |
| 1675 | 1705 | |
| 1676 | - return new BaseResponse().setErrorcode(ErrorCodeConstants.BUSINESS_ERROR).setErrormsg("该孕妇还未在本院建档不能进行产检"); | |
| 1706 | + | |
| 1707 | + //区域模式 | |
| 1708 | + if (ErrorCodeConstants.RUN_MODE.equals(runType)) { | |
| 1709 | + //原来单机 | |
| 1710 | + if (null != patients) { | |
| 1711 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.BUSINESS_ERROR).setErrormsg("该孕妇在系统中已分娩/已终止妊娠不能再进行产检,请重新建档"); | |
| 1712 | + } | |
| 1713 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.BUSINESS_ERROR).setErrormsg("该孕妇还未在本院建档不能进行产检"); | |
| 1714 | + } | |
| 1677 | 1715 | } |
| 1678 | 1716 | |
| 1679 | 1717 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AutoMatchFacade.java
View file @
07d531a
| ... | ... | @@ -13,6 +13,7 @@ |
| 13 | 13 | import com.lyms.platform.pojo.Patients; |
| 14 | 14 | import com.lyms.platform.query.PatientsQuery; |
| 15 | 15 | import org.apache.commons.collections.CollectionUtils; |
| 16 | +import org.apache.commons.lang.StringUtils; | |
| 16 | 17 | import org.springframework.beans.factory.annotation.Autowired; |
| 17 | 18 | import org.springframework.stereotype.Component; |
| 18 | 19 | |
| ... | ... | @@ -111,6 +112,17 @@ |
| 111 | 112 | return null; |
| 112 | 113 | } |
| 113 | 114 | return list.get(0)+""; |
| 115 | + } | |
| 116 | + public boolean checkBStatus(Integer userId){ | |
| 117 | + String hospital=getHospitalId(userId); | |
| 118 | + if(StringUtils.isEmpty(hospital)){ | |
| 119 | + return true; | |
| 120 | + } | |
| 121 | + Organization org= organizationService.getOrganization(Integer.valueOf(hospital)); | |
| 122 | + if(null!=org){ | |
| 123 | + return org.getbStatus()==1; | |
| 124 | + } | |
| 125 | + return false; | |
| 114 | 126 | } |
| 115 | 127 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
07d531a
| ... | ... | @@ -11,6 +11,7 @@ |
| 11 | 11 | import com.lyms.platform.common.result.BaseListResponse; |
| 12 | 12 | import com.lyms.platform.common.result.BaseResponse; |
| 13 | 13 | import com.lyms.platform.common.utils.*; |
| 14 | +import com.lyms.platform.common.utils.StringUtils; | |
| 14 | 15 | import com.lyms.platform.operate.web.request.*; |
| 15 | 16 | import com.lyms.platform.operate.web.result.*; |
| 16 | 17 | import com.lyms.platform.operate.web.utils.JdbcUtil; |
| ... | ... | @@ -23,6 +24,7 @@ |
| 23 | 24 | import com.lyms.platform.pojo.*; |
| 24 | 25 | import com.lyms.platform.query.*; |
| 25 | 26 | import org.apache.commons.collections.CollectionUtils; |
| 27 | +import org.apache.commons.lang.*; | |
| 26 | 28 | import org.slf4j.Logger; |
| 27 | 29 | import org.slf4j.LoggerFactory; |
| 28 | 30 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -103,6 +105,8 @@ |
| 103 | 105 | @Autowired |
| 104 | 106 | private SieveService sieveService; |
| 105 | 107 | |
| 108 | + private String runType; | |
| 109 | + | |
| 106 | 110 | /** |
| 107 | 111 | * 添加孕妇建档 |
| 108 | 112 | * @param yunRequest |
| ... | ... | @@ -543,7 +547,11 @@ |
| 543 | 547 | { |
| 544 | 548 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 545 | 549 | patientsQuery.setVcCardNo(bookbuildingQueryRequest.getVcCardNo()); |
| 546 | - patientsQuery.setHospitalId(hospitalId); | |
| 550 | + //区域模式 | |
| 551 | + if (!ErrorCodeConstants.RUN_MODE.equals(runType)) { | |
| 552 | + patientsQuery.setHospitalId(hospitalId); | |
| 553 | + } | |
| 554 | + | |
| 547 | 555 | List<Patients> patientsVc = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); |
| 548 | 556 | if (CollectionUtils.isNotEmpty(patientsVc)) |
| 549 | 557 | { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
07d531a
| ... | ... | @@ -69,6 +69,9 @@ |
| 69 | 69 | private BabyBookbuildingFacade babyBookbuildingFacade; |
| 70 | 70 | @Autowired |
| 71 | 71 | private DeleteProcessHandler deleteProcessHandler; |
| 72 | + | |
| 73 | + private String runType; | |
| 74 | + | |
| 72 | 75 | private static Map<Integer, String> ONE_ENUMS = new HashMap<>(); |
| 73 | 76 | |
| 74 | 77 | private static Map<String, List> babyMap = new HashMap<>(); |
| ... | ... | @@ -120,6 +123,15 @@ |
| 120 | 123 | public BaseResponse addOrUpdateMatDeliver(MatDeliverAddRequest deliverAddRequest, Integer userId) { |
| 121 | 124 | List<MaternalDeliverModel.Baby> babyList = new ArrayList<>(); |
| 122 | 125 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 126 | + MaternalDeliverModel maternalDeliverModel = deliverAddRequest.convertToDataModel(); | |
| 127 | + //区域模式 | |
| 128 | + if (ErrorCodeConstants.RUN_MODE.equals(runType)) { | |
| 129 | + String parentId =antenatalExaminationFacade.handHideBuild(deliverAddRequest.getPid(), deliverAddRequest.getParentId(), userId); | |
| 130 | + if (StringUtils.isEmpty(parentId)) { | |
| 131 | + } | |
| 132 | + maternalDeliverModel.setParentId(parentId); | |
| 133 | + } | |
| 134 | + | |
| 123 | 135 | //增加 |
| 124 | 136 | if (StringUtils.isEmpty(deliverAddRequest.getId()) && StringUtils.isNotEmpty(deliverAddRequest.getParentId())) { |
| 125 | 137 | MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); |
| ... | ... | @@ -144,7 +156,7 @@ |
| 144 | 156 | if (CollectionUtils.isNotEmpty(list2) || CollectionUtils.isNotEmpty(models)) { |
| 145 | 157 | return new BaseResponse().setErrorcode(ErrorCodeConstants.DATA_EXIST).setErrormsg("同一天只能建一次分娩/终止妊娠"); |
| 146 | 158 | } |
| 147 | - MaternalDeliverModel maternalDeliverModel = deliverAddRequest.convertToDataModel(); | |
| 159 | + | |
| 148 | 160 | //获取到小孩信息 |
| 149 | 161 | maternalDeliverModel.setOperator(userId); |
| 150 | 162 | List<MatDeliverAddRequest.Baby> list = deliverAddRequest.getBabies(); |
| ... | ... | @@ -214,7 +226,7 @@ |
| 214 | 226 | matDeliverService.addMatDeliver(maternalDeliverModel); |
| 215 | 227 | //修改 |
| 216 | 228 | } else if (StringUtils.isNotEmpty(deliverAddRequest.getId()) && StringUtils.isNotEmpty(deliverAddRequest.getParentId())) { |
| 217 | - MaternalDeliverModel maternalDeliverModel = deliverAddRequest.convertToDataModel(); | |
| 229 | + | |
| 218 | 230 | MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); |
| 219 | 231 | maternalDeliverModel.setOperator(userId); |
| 220 | 232 | Patients patients2 = patientsService.findOnePatientById(deliverAddRequest.getParentId()); |
| ... | ... | @@ -266,18 +278,6 @@ |
| 266 | 278 | |
| 267 | 279 | //修改分娩日期 |
| 268 | 280 | updatePatientFmDate(patients.getPid(), fmDate, 3); |
| 269 | - /* if (CollectionUtils.isNotEmpty(patients)) { | |
| 270 | - if(fmDate.after(DateUtil.addDay(patients.get(0).getLastMenses(),168))){ | |
| 271 | - Patients patients2=new Patients(); | |
| 272 | - patients2.setFmDate(fmDate); | |
| 273 | - patients2.setType(3); | |
| 274 | - PatientsQuery patientsQuery1=new PatientsQuery(); | |
| 275 | - patientsQuery1.setPid(patients.get(0).getPid()); | |
| 276 | - patientsQuery1.setYn(YnEnums.YES.getId()); | |
| 277 | - patientsQuery1.setLastMensesStart(); | |
| 278 | - patientsService.findAndModify(patientsQuery1, patients2); | |
| 279 | - } | |
| 280 | - }*/ | |
| 281 | 281 | } |
| 282 | 282 | } else { |
| 283 | 283 | return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("parentId 为空,找不到产妇"); |
| 284 | 284 | |
| ... | ... | @@ -385,37 +385,7 @@ |
| 385 | 385 | } |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | - public static void main(String[] args) { | |
| 389 | - MatDeliverAddRequest.Baby baby = new MatDeliverAddRequest.Baby(); | |
| 390 | - baby.setBabyGender("1"); | |
| 391 | 388 | |
| 392 | - MatDeliverAddRequest.Baby baby1 = new MatDeliverAddRequest.Baby(); | |
| 393 | - baby1.setBabyGender("1"); | |
| 394 | - MatDeliverAddRequest.Baby baby2 = new MatDeliverAddRequest.Baby(); | |
| 395 | - baby2.setBabyGender("0"); | |
| 396 | - MatDeliverAddRequest.Baby baby3 = new MatDeliverAddRequest.Baby(); | |
| 397 | - baby3.setBabyGender("1"); | |
| 398 | - MatDeliverAddRequest.Baby baby4 = new MatDeliverAddRequest.Baby(); | |
| 399 | - baby4.setBabyGender("0"); | |
| 400 | - List list = new ArrayList(); | |
| 401 | - list.add(baby); | |
| 402 | - list.add(baby1); | |
| 403 | - /*list.add(baby2); | |
| 404 | - list.add(baby3); | |
| 405 | - list.add(baby4); */ | |
| 406 | - System.out.print(buildBabyName(list)); | |
| 407 | - ; | |
| 408 | - | |
| 409 | - | |
| 410 | - Date fmDate = DateUtil.parseYMD("2016-8-18"); | |
| 411 | - | |
| 412 | - | |
| 413 | - Date date = DateUtil.addDay(DateUtil.parseYMD("2015-8-11"), 168); | |
| 414 | - System.out.print(DateUtil.getyyyy_MM_dd(date)); | |
| 415 | - System.out.print(fmDate.after(date)); | |
| 416 | - | |
| 417 | - } | |
| 418 | - | |
| 419 | 389 | /** |
| 420 | 390 | * 处理儿童 |
| 421 | 391 | * |
| 422 | 392 | |
| 423 | 393 | |
| 424 | 394 | |
| ... | ... | @@ -530,16 +500,22 @@ |
| 530 | 500 | if (null == patients) { |
| 531 | 501 | return new BaseResponse().setErrormsg("没有相关的产妇记录").setErrorcode(ErrorCodeConstants.BUSINESS_ERROR); |
| 532 | 502 | }*/ |
| 503 | + //区域模式 | |
| 504 | + boolean isEnable=false; | |
| 505 | + if (ErrorCodeConstants.RUN_MODE.equals(runType)) { | |
| 506 | + isEnable=true; | |
| 507 | + } | |
| 508 | + | |
| 533 | 509 | //外院的孕妇 |
| 534 | - Patients patients1 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, null, 1, false, null); | |
| 510 | + Patients patients1 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, null, 1, false, null,true); | |
| 535 | 511 | //外院的产妇 |
| 536 | 512 | // Patients patients2 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, null, 3); |
| 537 | 513 | |
| 538 | 514 | //http://jira.healthbaby.com.cn/browse/WEB-204 修改bug |
| 539 | 515 | //本院的孕妇 |
| 540 | - Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, hospital, 1, false, null); | |
| 516 | + Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, hospital, 1, false, null,isEnable); | |
| 541 | 517 | //本院产妇 |
| 542 | - Patients patients3 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, hospital, 3, false, null); | |
| 518 | + Patients patients3 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, hospital, 3, false, null,isEnable); | |
| 543 | 519 | PersonModelQuery personModelQuery = new PersonModelQuery(); |
| 544 | 520 | String pid = ""; |
| 545 | 521 | if (null != patients1) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
07d531a
| ... | ... | @@ -380,6 +380,11 @@ |
| 380 | 380 | } else { |
| 381 | 381 | String hospital = autoMatchFacade.getHospitalId(userId); |
| 382 | 382 | patientsQuery.setHospitalId(hospital); |
| 383 | + | |
| 384 | + boolean result = autoMatchFacade.checkBStatus(userId); | |
| 385 | + if(!result){ | |
| 386 | + patientsQuery.setEnable("0"); | |
| 387 | + } | |
| 383 | 388 | } |
| 384 | 389 | patientsQuery.setNeed(needPage); |
| 385 | 390 | |
| ... | ... | @@ -453,7 +458,7 @@ |
| 453 | 458 | patientsQuery.setPhone(patientQueryRequest.getPhone()); |
| 454 | 459 | patientsQuery.setCardNo(patientQueryRequest.getCardNo()); |
| 455 | 460 | String hospital = autoMatchFacade.getHospitalId(userId); |
| 456 | - Patients patients = antenatalExaminationFacade.findOnePatient(patientQueryRequest.getCardNo(), null, patientQueryRequest.getId(), hospital, -1, false, patientQueryRequest.getPid()); | |
| 461 | + Patients patients = antenatalExaminationFacade.findOnePatient(patientQueryRequest.getCardNo(), null, patientQueryRequest.getId(), hospital, -1, false, patientQueryRequest.getPid(),false); | |
| 457 | 462 | PatientBaseResult patientBaseResult = new PatientBaseResult(); |
| 458 | 463 | if (null != patients) { |
| 459 | 464 | patientBaseResult.convert(patients); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java
View file @
07d531a
| ... | ... | @@ -62,6 +62,8 @@ |
| 62 | 62 | @Autowired |
| 63 | 63 | private ApplyOrderService applyOrderService; |
| 64 | 64 | |
| 65 | + private String runType; | |
| 66 | + | |
| 65 | 67 | /** |
| 66 | 68 | * |
| 67 | 69 | * 增加产后复查记录 |
| 68 | 70 | |
| ... | ... | @@ -75,10 +77,21 @@ |
| 75 | 77 | * @return |
| 76 | 78 | */ |
| 77 | 79 | public BaseResponse addPostReview(PostReviewRequest postReviewRequest,Integer userId) { |
| 80 | + PostReviewModel postReviewModel = postReviewRequest.convertToDataModel(); | |
| 81 | + | |
| 82 | + //表示区域的 | |
| 83 | + if (ErrorCodeConstants.RUN_MODE.equals(runType)) { | |
| 84 | + String parentId = examinationFacade.handHideBuild(postReviewRequest.getPid(), postReviewRequest.getParentId(), userId); | |
| 85 | + if (StringUtils.isEmpty(parentId)) { | |
| 86 | + //打印日志 | |
| 87 | + } | |
| 88 | + postReviewModel.setParentId(parentId); | |
| 89 | + } | |
| 90 | + | |
| 78 | 91 | //获取数据 |
| 79 | 92 | Patients patients1 = patientsService.findOnePatientById(postReviewRequest.getParentId()); |
| 80 | 93 | String hospital= autoMatchFacade.getHospitalId(userId); |
| 81 | - PostReviewModel postReviewModel = postReviewRequest.convertToDataModel(); | |
| 94 | + | |
| 82 | 95 | postReviewModel.setOperator(userId); |
| 83 | 96 | //判断是否是同一个医院 |
| 84 | 97 | if(!patients1.getHospitalId().equals(hospital)){ |
| 85 | 98 | |
| ... | ... | @@ -180,9 +193,15 @@ |
| 180 | 193 | * @return |
| 181 | 194 | */ |
| 182 | 195 | public BaseResponse queryPostList(PostReviewQueryRequest postReviewQueryRequest,Integer userId) { |
| 196 | + Patients patients=null; | |
| 197 | + if(ErrorCodeConstants.RUN_MODE.equals(runType)){ | |
| 198 | + patients = examinationFacade.findOnePatient(postReviewQueryRequest.getCardNo(), postReviewQueryRequest.getVcCardNo(), null, null, 1,false,null,true); | |
| 199 | + }else { | |
| 200 | + patients = examinationFacade.findOnePatient(postReviewQueryRequest.getCardNo(), postReviewQueryRequest.getVcCardNo(), null, null, 1,false,null,false); | |
| 201 | + } | |
| 183 | 202 | |
| 184 | 203 | //未分娩建档 |
| 185 | - Patients patients = examinationFacade.findOnePatient(postReviewQueryRequest.getCardNo(), postReviewQueryRequest.getVcCardNo(), null, null, 1,false,null); | |
| 204 | + | |
| 186 | 205 | if(null!=patients){ |
| 187 | 206 | return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("该孕妇还未分娩,不能进行复查"); |
| 188 | 207 | } |
| ... | ... | @@ -191,7 +210,7 @@ |
| 191 | 210 | |
| 192 | 211 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 193 | 212 | //取所有医院的建档数据 优先取本院 ,然后取外院 |
| 194 | - Patients patientsList = examinationFacade.findOnePatient(postReviewQueryRequest.getCardNo(), postReviewQueryRequest.getVcCardNo(), null, hospitalId, 3,true,null); | |
| 213 | + Patients patientsList = examinationFacade.findOnePatient(postReviewQueryRequest.getCardNo(), postReviewQueryRequest.getVcCardNo(), null, hospitalId, 3,true,null,true); | |
| 195 | 214 | PostReviewListResult postReviewListResult = new PostReviewListResult(); |
| 196 | 215 | if (null != patientsList) { |
| 197 | 216 | if(null!=patientsList.getDueStatus() && 1 == patientsList.getDueStatus()){ |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/AntExAddRequest.java
View file @
07d531a
| ... | ... | @@ -18,6 +18,8 @@ |
| 18 | 18 | public class AntExAddRequest implements IBasicRequestConvert<AntenatalExaminationModel> { |
| 19 | 19 | // 访视记录id |
| 20 | 20 | private String id; |
| 21 | + | |
| 22 | + private String pid; | |
| 21 | 23 | //产妇id |
| 22 | 24 | private String parentId; |
| 23 | 25 | //当前孕周 |
| ... | ... | @@ -75,6 +77,13 @@ |
| 75 | 77 | private String nextCheckTime; |
| 76 | 78 | private String cDueWeek; |
| 77 | 79 | |
| 80 | + public String getPid() { | |
| 81 | + return pid; | |
| 82 | + } | |
| 83 | + | |
| 84 | + public void setPid(String pid) { | |
| 85 | + this.pid = pid; | |
| 86 | + } | |
| 78 | 87 | |
| 79 | 88 | public String getcDueWeek() { |
| 80 | 89 | return cDueWeek; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/AntExcAddRequest.java
View file @
07d531a
| ... | ... | @@ -25,6 +25,8 @@ |
| 25 | 25 | @NotEmpty(message = "孕妇id不能为空") |
| 26 | 26 | private String parentId; |
| 27 | 27 | private String id; |
| 28 | + | |
| 29 | + private String pid; | |
| 28 | 30 | //预产期 |
| 29 | 31 | private String dueDate; |
| 30 | 32 | //末次月经 |
| ... | ... | @@ -858,6 +860,14 @@ |
| 858 | 860 | |
| 859 | 861 | public void setYwgmHistory(Map ywgmHistory) { |
| 860 | 862 | this.ywgmHistory = ywgmHistory; |
| 863 | + } | |
| 864 | + | |
| 865 | + public String getPid() { | |
| 866 | + return pid; | |
| 867 | + } | |
| 868 | + | |
| 869 | + public void setPid(String pid) { | |
| 870 | + this.pid = pid; | |
| 861 | 871 | } |
| 862 | 872 | |
| 863 | 873 | @Override |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatDeliverAddRequest.java
View file @
07d531a
| ... | ... | @@ -21,6 +21,8 @@ |
| 21 | 21 | @Form |
| 22 | 22 | public class MatDeliverAddRequest implements IBasicRequestConvert<MaternalDeliverModel>{ |
| 23 | 23 | private String id; |
| 24 | + // | |
| 25 | + private String pid; | |
| 24 | 26 | //产妇id |
| 25 | 27 | private String parentId; |
| 26 | 28 | //分娩时间 |
| ... | ... | @@ -82,6 +84,14 @@ |
| 82 | 84 | private String fmHospital; |
| 83 | 85 | //接生医生 |
| 84 | 86 | private String deliverDoctor; |
| 87 | + | |
| 88 | + public String getPid() { | |
| 89 | + return pid; | |
| 90 | + } | |
| 91 | + | |
| 92 | + public void setPid(String pid) { | |
| 93 | + this.pid = pid; | |
| 94 | + } | |
| 85 | 95 | |
| 86 | 96 | public String getDeathCauseText() { |
| 87 | 97 | return deathCauseText; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/PostReviewRequest.java
View file @
07d531a
| ... | ... | @@ -21,6 +21,7 @@ |
| 21 | 21 | @Form |
| 22 | 22 | public class PostReviewRequest implements IBasicRequestConvert<PostReviewModel> { |
| 23 | 23 | private String id; |
| 24 | + private String pid; | |
| 24 | 25 | //产妇id |
| 25 | 26 | @FormParam |
| 26 | 27 | @NotEmpty(message = "产妇id不能为空") |
| ... | ... | @@ -95,6 +96,14 @@ |
| 95 | 96 | //下次产检时间 |
| 96 | 97 | private String nextCheckTime; |
| 97 | 98 | private String yl; |
| 99 | + | |
| 100 | + public String getPid() { | |
| 101 | + return pid; | |
| 102 | + } | |
| 103 | + | |
| 104 | + public void setPid(String pid) { | |
| 105 | + this.pid = pid; | |
| 106 | + } | |
| 98 | 107 | |
| 99 | 108 | public String getYl() { |
| 100 | 109 | return yl; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntData.java
View file @
07d531a
| 1 | 1 | package com.lyms.platform.operate.web.result; |
| 2 | 2 | |
| 3 | +import com.lyms.platform.common.result.BaseModel; | |
| 3 | 4 | import com.lyms.platform.common.utils.DateUtil; |
| 4 | 5 | import com.lyms.platform.common.utils.StringUtils; |
| 5 | 6 | import com.lyms.platform.pojo.*; |
| ... | ... | @@ -7,7 +8,7 @@ |
| 7 | 8 | |
| 8 | 9 | import java.util.Date; |
| 9 | 10 | |
| 10 | -public class AntData { | |
| 11 | +public class AntData extends BaseModel{ | |
| 11 | 12 | private String dueWeek; |
| 12 | 13 | //分娩时间 |
| 13 | 14 | private String dueDate; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntexListResult.java
View file @
07d531a
| ... | ... | @@ -12,12 +12,14 @@ |
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | 14 | * 产前筛查列表返回对象 |
| 15 | - * <p> | |
| 15 | + * <p/> | |
| 16 | 16 | * Created by Administrator on 2016/6/16 0016. |
| 17 | 17 | */ |
| 18 | 18 | public class AntexListResult { |
| 19 | 19 | |
| 20 | 20 | private String id; |
| 21 | + | |
| 22 | + private String pid; | |
| 21 | 23 | //名字 |
| 22 | 24 | private String name; |
| 23 | 25 | //年龄 |
| ... | ... | @@ -51,6 +53,14 @@ |
| 51 | 53 | //<!---------基本信息-----------> |
| 52 | 54 | |
| 53 | 55 | |
| 56 | + public String getPid() { | |
| 57 | + return pid; | |
| 58 | + } | |
| 59 | + | |
| 60 | + public void setPid(String pid) { | |
| 61 | + this.pid = pid; | |
| 62 | + } | |
| 63 | + | |
| 54 | 64 | public String getTireNumber1() { |
| 55 | 65 | return tireNumber1; |
| 56 | 66 | } |
| 57 | 67 | |
| 58 | 68 | |
| ... | ... | @@ -191,16 +201,16 @@ |
| 191 | 201 | } |
| 192 | 202 | |
| 193 | 203 | public AntexListResult convertToResult(List<AntenatalExaminationModel> destModel, Patients patients, List<AntExChuModel> antExChuModel) { |
| 194 | - if(null!=patients){ | |
| 204 | + if (null != patients) { | |
| 195 | 205 | setId(patients.getId()); |
| 196 | 206 | try { |
| 197 | 207 | if (null != patients.getBirth()) { |
| 198 | 208 | setAge(DateUtil.getAge(patients.getBirth())); |
| 199 | 209 | setBirth(DateUtil.getyyyy_MM_dd(patients.getBirth())); |
| 200 | 210 | } |
| 201 | - | |
| 202 | 211 | } catch (Exception e) { |
| 203 | 212 | } |
| 213 | + setPid(patients.getPid()); | |
| 204 | 214 | if (null != patients.getDueDate()) { |
| 205 | 215 | setyChanQi(DateUtil.getyyyy_MM_dd(patients.getDueDate())); |
| 206 | 216 | } |
| 207 | 217 | |
| ... | ... | @@ -209,9 +219,8 @@ |
| 209 | 219 | setPhone(patients.getPhone()); |
| 210 | 220 | setRemarks(patients.getMremark()); |
| 211 | 221 | setCardNo(patients.getCardNo()); |
| 212 | - | |
| 213 | 222 | setVcCardNo(patients.getVcCardNo()); |
| 214 | - if (null!=patients.getDueStatus() && 1 == patients.getDueStatus()) { | |
| 223 | + if (null != patients.getDueStatus() && 1 == patients.getDueStatus()) { | |
| 215 | 224 | this.dueWeek = "终止妊娠"; |
| 216 | 225 | } else if (3 == patients.getType()) { |
| 217 | 226 | this.dueWeek = "已分娩"; |
| 218 | 227 | |
| ... | ... | @@ -221,13 +230,10 @@ |
| 221 | 230 | this.dueWeek = StringUtils.dueWeek(days); |
| 222 | 231 | } |
| 223 | 232 | } |
| 224 | - | |
| 225 | 233 | if (null != patients.getLastMenses()) { |
| 226 | 234 | setLastMenses(DateUtil.getyyyy_MM_dd(patients.getLastMenses())); |
| 227 | 235 | } |
| 228 | 236 | } |
| 229 | - | |
| 230 | - | |
| 231 | 237 | return this; |
| 232 | 238 | } |
| 233 | 239 |
platform-operate-api/src/main/resources/database.properties
View file @
07d531a