Commit 830e86ece7d9e1bc435e4d06d1e831f889401158
1 parent
3eaad65267
Exists in
master
and in
8 other branches
修改新电子病历
Showing 2 changed files with 38 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
830e86e
... | ... | @@ -1175,6 +1175,12 @@ |
1175 | 1175 | |
1176 | 1176 | if (CollectionUtils.isEmpty(list)) { |
1177 | 1177 | antenatalExaminationService.updateOneAnt(antEx, antExQueryRequest.getId()); |
1178 | + | |
1179 | + | |
1180 | + AntenatalExaminationModel antenatalExaminationModel= antenatalExaminationService.findOneById(antExQueryRequest.getId()); | |
1181 | + | |
1182 | + updateLastRisk(antenatalExaminationModel.getParentId()); | |
1183 | + | |
1178 | 1184 | } else { |
1179 | 1185 | return new BaseResponse().setErrorcode(ErrorCodeConstants.BUSINESS_ERROR).setErrormsg("当前产检记录不是本院最新的产检记录,不能删除"); |
1180 | 1186 | } |
... | ... | @@ -1212,6 +1218,11 @@ |
1212 | 1218 | |
1213 | 1219 | if (CollectionUtils.isEmpty(list)) { |
1214 | 1220 | antenatalExaminationService.updateAntExChu(antExChuModel, antExQueryRequest.getId()); |
1221 | + | |
1222 | + AntExChuModel antExChuModel1= antenatalExaminationService.findOne(antExQueryRequest.getId()); | |
1223 | + | |
1224 | + updateLastRisk(antExChuModel1.getParentId()); | |
1225 | + | |
1215 | 1226 | }else{ |
1216 | 1227 | return new BaseResponse().setErrorcode(ErrorCodeConstants.BUSINESS_ERROR).setErrormsg("当前产检记录不是本院最新的产检记录,不能删除"); |
1217 | 1228 | } |
... | ... | @@ -1220,6 +1231,26 @@ |
1220 | 1231 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
1221 | 1232 | } |
1222 | 1233 | |
1234 | + /** | |
1235 | + * 删除的时候设置最新的高危 | |
1236 | + * @param parentId | |
1237 | + */ | |
1238 | + private void updateLastRisk(String parentId){ | |
1239 | + Patients patients= patientsService.findOnePatientById(parentId); | |
1240 | + | |
1241 | + PatientsQuery patientsQuery1=new PatientsQuery(); | |
1242 | + patientsQuery1.setPid(patients.getPid()); | |
1243 | + patientsQuery1.setYn(YnEnums.YES.getId()); | |
1244 | + Patients patients1=new Patients(); | |
1245 | + patients1.setModified(new Date()); | |
1246 | + | |
1247 | + HighScoreResult highScoreResult= findLastRisk(patients.getPid(),true); | |
1248 | + patients1.setRiskScore(highScoreResult.getScore()); | |
1249 | + patients1.setRiskFactorId(highScoreResult.getHighId()); | |
1250 | + patients1.setRiskLevelId(JsonUtil.array2JsonString(highScoreResult.getLevelId())); | |
1251 | + | |
1252 | + patientsService.findAndModify(patientsQuery1,patients1); | |
1253 | + } | |
1223 | 1254 | /** |
1224 | 1255 | * 根据身份证号或者就诊卡号查询产妇 |
1225 | 1256 | * |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
830e86e
... | ... | @@ -13,6 +13,7 @@ |
13 | 13 | import com.lyms.platform.operate.web.request.MessageRequest; |
14 | 14 | import com.lyms.platform.operate.web.result.BasicConfigResult; |
15 | 15 | import com.lyms.platform.operate.web.result.BookbuildingRecordResult; |
16 | +import com.lyms.platform.operate.web.result.HighScoreResult; | |
16 | 17 | import com.lyms.platform.operate.web.result.PregnantInfoResult; |
17 | 18 | import com.lyms.platform.operate.web.utils.MessageCenterService; |
18 | 19 | import com.lyms.platform.permission.model.Organization; |
... | ... | @@ -74,6 +75,8 @@ |
74 | 75 | |
75 | 76 | @Autowired |
76 | 77 | private BabyBookbuildingFacade babyBookbuildingFacade; |
78 | + @Autowired | |
79 | + private AntenatalExaminationFacade antenatalExaminationFacade; | |
77 | 80 | |
78 | 81 | /** |
79 | 82 | * 添加孕妇建档 |
... | ... | @@ -200,6 +203,10 @@ |
200 | 203 | if (resperson != null) |
201 | 204 | { |
202 | 205 | patient.setPid(resperson.getId()); |
206 | + HighScoreResult highScoreResult= antenatalExaminationFacade.findLastRisk(resperson.getId(), true); | |
207 | + patient.setRiskFactorId(highScoreResult.getHighId()); | |
208 | + patient.setRiskScore(highScoreResult.getScore()); | |
209 | + patient.setRiskLevelId(JsonUtil.array2JsonString(highScoreResult.getLevelId())); | |
203 | 210 | } |
204 | 211 | |
205 | 212 | patient.setCreated(new Date()); |