Commit 78118207485298eedf712c7f42450242c85a67ed
1 parent
7efe38fa7d
Exists in
master
and in
2 other branches
修改妊娠终止或自动分娩时,同时修改体重记录为type=3状态,解决体重录入的bug
Showing 4 changed files with 46 additions and 17 deletions
- 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/MatDeliverFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/StopPregnancyFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
7811820
... | ... | @@ -3566,15 +3566,17 @@ |
3566 | 3566 | type, boolean outHospital, String pid, boolean isEnable) { |
3567 | 3567 | //queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, currentGroupHospital, 3, false, null, og.getbStatus() == 1 |
3568 | 3568 | PatientsQuery patientsQuery = new PatientsQuery(); |
3569 | - if (StringUtils.isNotEmpty(cardNo)) { | |
3570 | - patientsQuery.setCardNo(cardNo); | |
3571 | - } else if (StringUtils.isNotEmpty(id)) { | |
3569 | + //如果参数传patient id ,肯定应该以id为查询条件 cfl 20230927 | |
3570 | + if (StringUtils.isNotEmpty(id)) { | |
3572 | 3571 | patientsQuery.setId(id); |
3572 | + }else if (StringUtils.isNotEmpty(cardNo)) { | |
3573 | + patientsQuery.setCardNo(cardNo); | |
3573 | 3574 | } else if (StringUtils.isNotEmpty(pid)) { |
3574 | 3575 | patientsQuery.setPid(pid); |
3575 | 3576 | } |
3576 | 3577 | |
3577 | - if (StringUtils.isEmpty(cardNo)) { | |
3578 | + //id 和卡号都为空,才有可能使用就诊卡号查询 cfl 20230927 | |
3579 | + if (StringUtils.isNotEmpty(id) && StringUtils.isEmpty(cardNo)) { | |
3578 | 3580 | if (StringUtils.isNotEmpty(vcCardNo)) { |
3579 | 3581 | //德州市妇幼保健院医院通过(就诊卡号、银行卡号,社保卡号) 查询出对应的用过的卡号 add lqy |
3580 | 3582 | if (CollectionUtils.isNotEmpty(hospitalId) && hospitalId.contains("1000000114")) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
7811820
... | ... | @@ -426,6 +426,14 @@ |
426 | 426 | personModel.setModified(new Date()); |
427 | 427 | personService.updatePerson(personModel, patients1.getPid()); |
428 | 428 | } |
429 | + //更新档案关联体重为终止妊娠状态 cfl 20230927 | |
430 | + PatientWeight pw = mongoTemplate.findOne(Query.query(Criteria.where("type").is(1) | |
431 | + .and("patientId").is(patientsLocal.getId()).and("yn").is("1")), PatientWeight.class); | |
432 | + if(pw != null){ | |
433 | + pw.setType(3); | |
434 | + pw.setModified(new Date()); | |
435 | + patientWeightService2.update(Query.query(Criteria.where("id").is(pw.getId())), pw); | |
436 | + } | |
429 | 437 | } |
430 | 438 | } |
431 | 439 | //先查询这个产妇分娩的小孩是否已建档 |
... | ... | @@ -1370,9 +1378,9 @@ |
1370 | 1378 | // } |
1371 | 1379 | // else |
1372 | 1380 | // { |
1373 | - //改成这种是因为需求要求 分娩自动流转儿童信息,建档时间为空,医生确认建档 | |
1374 | - babyModel.setYn(YnEnums.NO.getId()); | |
1375 | - babyModel.setDataStatus(1); | |
1381 | + //改成这种是因为需求要求 分娩自动流转儿童信息,建档时间为空,医生确认建档 | |
1382 | + babyModel.setYn(YnEnums.NO.getId()); | |
1383 | + babyModel.setDataStatus(1); | |
1376 | 1384 | // } |
1377 | 1385 | |
1378 | 1386 | // PersonModel personModel = new PersonModel(); |
... | ... | @@ -2697,7 +2705,7 @@ |
2697 | 2705 | |
2698 | 2706 | patientsQuery.setYyzyfmHospitalId(childbirthManagerRequest.getYyzyfmHospitalId()); |
2699 | 2707 | patientsQuery.setHospitalId(childbirthManagerRequest.getFirstHospitalId()); |
2700 | - | |
2708 | + | |
2701 | 2709 | System.out.println("fm patient query = "+ patientsQuery.convertToQuery().convertToMongoQuery()); |
2702 | 2710 | List <Patients> patientsList = patientsService.queryPatient(patientsQuery); |
2703 | 2711 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/StopPregnancyFacade.java
View file @
7811820
... | ... | @@ -13,7 +13,6 @@ |
13 | 13 | import com.lyms.platform.operate.web.result.AntexListResult; |
14 | 14 | import com.lyms.platform.operate.web.result.StopPregResult; |
15 | 15 | import com.lyms.platform.operate.web.service.ITrackDownService; |
16 | -import com.lyms.platform.permission.model.Organization; | |
17 | 16 | import com.lyms.platform.permission.model.Users; |
18 | 17 | import com.lyms.platform.permission.model.UsersQuery; |
19 | 18 | import com.lyms.platform.permission.service.CouponService; |
... | ... | @@ -28,7 +27,6 @@ |
28 | 27 | import org.springframework.data.mongodb.core.query.Query; |
29 | 28 | import org.springframework.stereotype.Component; |
30 | 29 | |
31 | -import javax.rmi.CORBA.Util; | |
32 | 30 | import java.util.*; |
33 | 31 | |
34 | 32 | /** |
... | ... | @@ -86,6 +84,9 @@ |
86 | 84 | @Autowired |
87 | 85 | private OrganizationService organizationService; |
88 | 86 | |
87 | + @Autowired | |
88 | + private PatientWeightService2 patientWeightService2; | |
89 | + | |
89 | 90 | /** |
90 | 91 | * 更新终止妊娠 |
91 | 92 | * |
... | ... | @@ -280,6 +281,14 @@ |
280 | 281 | yunBookbuildingService.updatePregnant(patient, patient.getId()); |
281 | 282 | //终止妊娠生成追访信息 |
282 | 283 | addTrackDownInfo(userId, patient); |
284 | + //更新档案关联体重为终止妊娠状态 cfl 20230927 | |
285 | + PatientWeight pw = mongoTemplate.findOne(Query.query(Criteria.where("type").is(1) | |
286 | + .and("patientId").is(patient.getId()).and("yn").is("1")), PatientWeight.class); | |
287 | + if(pw != null){ | |
288 | + pw.setType(3); | |
289 | + pw.setModified(new Date()); | |
290 | + patientWeightService2.update(Query.query(Criteria.where("id").is(pw.getId())), pw); | |
291 | + } | |
283 | 292 | } |
284 | 293 | } |
285 | 294 | |
... | ... | @@ -388,6 +397,14 @@ |
388 | 397 | yunBookbuildingService.updatePregnant(patient, patient.getId()); |
389 | 398 | //终止妊娠生成追访信息 |
390 | 399 | addTrackDownInfo(userId, patient); |
400 | + //更新档案关联体重为终止妊娠状态 cfl 20230927 | |
401 | + PatientWeight pw = mongoTemplate.findOne(Query.query(Criteria.where("type").is(1) | |
402 | + .and("patientId").is(patient.getId()).and("yn").is("1")), PatientWeight.class); | |
403 | + if(pw != null){ | |
404 | + pw.setType(3); | |
405 | + pw.setModified(new Date()); | |
406 | + patientWeightService2.update(Query.query(Criteria.where("id").is(pw.getId())), pw); | |
407 | + } | |
391 | 408 | } |
392 | 409 | } |
393 | 410 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
7811820
... | ... | @@ -223,6 +223,7 @@ |
223 | 223 | if (StringUtils.isEmpty(patientWeight.getId()) && patients != null) { |
224 | 224 | dayWeights.put(DateUtil.getyyyy_MM_dd(new Date()), nowWeight); |
225 | 225 | patientWeight.setPid(patients.getPid()); |
226 | + patientWeight.setPatientId(patients.getId()); | |
226 | 227 | patientWeight.setDayWeights(dayWeights); |
227 | 228 | patientWeight.setHospitalId(hospitalId); |
228 | 229 | patientWeight.setOperaterId(userId.toString()); |
... | ... | @@ -268,7 +269,8 @@ |
268 | 269 | |
269 | 270 | Map<String, Object> series = new LinkedHashMap<>(); |
270 | 271 | String isNormal = "true"; |
271 | - if (pw != null) | |
272 | + String isUp = "1"; | |
273 | + if (pw != null && StringUtils.isNotEmpty(pw.getBmi())) | |
272 | 274 | { |
273 | 275 | |
274 | 276 | double bmiD = Double.parseDouble(pw.getBmi()); |
... | ... | @@ -302,7 +304,7 @@ |
302 | 304 | } |
303 | 305 | } |
304 | 306 | |
305 | - String isUp = "1"; | |
307 | + | |
306 | 308 | Map<String,String> dayweights = pw.getDayWeights(); |
307 | 309 | if (dayweights != null && dayweights.size() > 1 && sp > 0) |
308 | 310 | { |
... | ... | @@ -326,7 +328,7 @@ |
326 | 328 | int endWeek = DateUtil.getWeek(patients.getLastMenses(),DateUtil.parseYMD(lastKey)); |
327 | 329 | isUp = (Double.parseDouble(dayweights.get(lastKey)) - Double.parseDouble(dayweights.get(lastSecKey))) /(endWeek - startWeek) > sp ? "2" : isUp; |
328 | 330 | } |
329 | - result.put("isUp",isUp); | |
331 | + | |
330 | 332 | getSeries(series, bmiStr, pw.getBregmatic()); |
331 | 333 | if (series.get("highDataMap") != null) |
332 | 334 | { |
... | ... | @@ -339,7 +341,7 @@ |
339 | 341 | } |
340 | 342 | } |
341 | 343 | } |
342 | - | |
344 | + result.put("isUp",isUp); | |
343 | 345 | result.put("isNormal",isNormal); |
344 | 346 | return result; |
345 | 347 | } |
... | ... | @@ -1641,7 +1643,7 @@ |
1641 | 1643 | } |
1642 | 1644 | else |
1643 | 1645 | { |
1644 | - kcal = Math.round(Double.parseDouble(kmap.get("kulStart"))) + "-" + Math.round(Double.parseDouble(kmap.get("kulEnd"))); | |
1646 | + kcal = Math.round(Double.parseDouble(kmap.get("kulStart"))) + "-" + Math.round(Double.parseDouble(kmap.get("kulEnd"))); | |
1645 | 1647 | } |
1646 | 1648 | |
1647 | 1649 | |
... | ... | @@ -3127,7 +3129,7 @@ |
3127 | 3129 | || risks.contains("de7468e6-1bb5-4fab-ae84-78857868409a"))) |
3128 | 3130 | { |
3129 | 3131 | String k = (kcal < 1500 ? 1500 : (kcal > 2300 ? 2300 : kcal))+"kcal"; |
3130 | - weightReport = mongoTemplate.find(Query.query(Criteria.where("kcal").is(k).and("type").is(1)), HightWeightWeekModel.class); | |
3132 | + weightReport = mongoTemplate.find(Query.query(Criteria.where("kcal").is(k).and("type").is(1)), HightWeightWeekModel.class); | |
3131 | 3133 | } |
3132 | 3134 | |
3133 | 3135 | map.put("weekInfo", CollectionUtils.isNotEmpty(weightReport) ? weightReport : null); |