Commit 845beaa5b2ef858fc845519f4c4fbafe1fbe5c2f
1 parent
74b6163190
Exists in
master
and in
8 other branches
产检增加pid
Showing 5 changed files with 73 additions and 23 deletions
- platform-dal/src/main/java/com/lyms/platform/pojo/AntExChuModel.java
- platform-dal/src/main/java/com/lyms/platform/pojo/AntenatalExaminationModel.java
- platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/AntExQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
platform-dal/src/main/java/com/lyms/platform/pojo/AntExChuModel.java
View file @
845beaa
... | ... | @@ -16,6 +16,7 @@ |
16 | 16 | |
17 | 17 | private String id; |
18 | 18 | private String parentId; |
19 | + private String pid; | |
19 | 20 | //预产期 |
20 | 21 | private Date dueDate; |
21 | 22 | //末次月经 |
... | ... | @@ -88,6 +89,14 @@ |
88 | 89 | private Date created; |
89 | 90 | private String hospitalId; |
90 | 91 | private String bp; |
92 | + | |
93 | + public String getPid() { | |
94 | + return pid; | |
95 | + } | |
96 | + | |
97 | + public void setPid(String pid) { | |
98 | + this.pid = pid; | |
99 | + } | |
91 | 100 | |
92 | 101 | public String getBp() { |
93 | 102 | return bp; |
platform-dal/src/main/java/com/lyms/platform/pojo/AntenatalExaminationModel.java
View file @
845beaa
... | ... | @@ -15,6 +15,7 @@ |
15 | 15 | public class AntenatalExaminationModel { |
16 | 16 | |
17 | 17 | private String id; |
18 | + private String pid; | |
18 | 19 | private String parentId; |
19 | 20 | /* //名字 |
20 | 21 | private String name; |
... | ... | @@ -91,6 +92,14 @@ |
91 | 92 | private Date modified; |
92 | 93 | private String hospitalId; |
93 | 94 | private String cDueWeek; |
95 | + | |
96 | + public String getPid() { | |
97 | + return pid; | |
98 | + } | |
99 | + | |
100 | + public void setPid(String pid) { | |
101 | + this.pid = pid; | |
102 | + } | |
94 | 103 | |
95 | 104 | public String getcDueWeek() { |
96 | 105 | return cDueWeek; |
platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java
View file @
845beaa
... | ... | @@ -25,6 +25,16 @@ |
25 | 25 | private Date nextCheckTimeStart; |
26 | 26 | private Date nextCheckTimeEnd; |
27 | 27 | |
28 | + private String pid; | |
29 | + | |
30 | + public String getPid() { | |
31 | + return pid; | |
32 | + } | |
33 | + | |
34 | + public void setPid(String pid) { | |
35 | + this.pid = pid; | |
36 | + } | |
37 | + | |
28 | 38 | public String getHospitalId() { |
29 | 39 | return hospitalId; |
30 | 40 | } |
... | ... | @@ -99,6 +109,9 @@ |
99 | 109 | |
100 | 110 | if(null!=hospitalId){ |
101 | 111 | condition=condition.and("hospitalId",hospitalId,MongoOper.IS); |
112 | + } | |
113 | + if(null!=pid){ | |
114 | + condition=condition.and("pid",pid,MongoOper.IS); | |
102 | 115 | } |
103 | 116 | |
104 | 117 | boolean isAddStart = Boolean.FALSE; |
platform-dal/src/main/java/com/lyms/platform/query/AntExQuery.java
View file @
845beaa
... | ... | @@ -18,6 +18,7 @@ |
18 | 18 | private String parentId; |
19 | 19 | private Integer yn; |
20 | 20 | private String id; |
21 | + private String pid; | |
21 | 22 | //创建时间 |
22 | 23 | private Date start; |
23 | 24 | |
24 | 25 | |
... | ... | @@ -39,11 +40,22 @@ |
39 | 40 | this.start = start; |
40 | 41 | } |
41 | 42 | |
43 | + public String getPid() { | |
44 | + return pid; | |
45 | + } | |
46 | + | |
47 | + public void setPid(String pid) { | |
48 | + this.pid = pid; | |
49 | + } | |
50 | + | |
42 | 51 | @Override |
43 | 52 | public MongoQuery convertToQuery() { |
44 | 53 | MongoCondition condition=MongoCondition.newInstance(); |
45 | 54 | if(null!=parentId){ |
46 | 55 | condition= condition.and("parentId",parentId, MongoOper.IS); |
56 | + } | |
57 | + if(null!=pid){ | |
58 | + condition= condition.and("pid",pid, MongoOper.IS); | |
47 | 59 | } |
48 | 60 | if(null!=yn){ |
49 | 61 | condition= condition.and("yn",yn, MongoOper.IS); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
845beaa
... | ... | @@ -79,6 +79,7 @@ |
79 | 79 | if (CollectionUtils.isNotEmpty(list)) { |
80 | 80 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("同一天只能建一次复诊"); |
81 | 81 | } |
82 | + model.setPid( patientsService.findOnePatientById(antExAddRequest.getParentId()).getPid()); | |
82 | 83 | antenatalExaminationService.addOneBabyAnt(model); |
83 | 84 | updateApplyOrder(model, antExAddRequest.getParentId()); |
84 | 85 | } |
85 | 86 | |
... | ... | @@ -114,17 +115,16 @@ |
114 | 115 | antenatalExaminationService.updateAntExChu(antExChuModel, antExChuModel.getId()); |
115 | 116 | } else { |
116 | 117 | List list1 = autoMatchFacade.matchOrgId(userId); |
118 | + Patients patients = patientsService.findOnePatientById(excAddRequest.getParentId()); | |
119 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
120 | + patientsQuery.setPid(patients.getPid()); | |
121 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
117 | 122 | if (CollectionUtils.isNotEmpty(list1)) { |
118 | 123 | antExChuModel.setHospitalId(list1.get(0) + ""); |
119 | 124 | AntExChuQuery antExChuQuery = new AntExChuQuery(); |
120 | 125 | antExChuQuery.setYn(YnEnums.YES.getId()); |
121 | 126 | antExChuQuery.setHospitalId(list1.get(0) + ""); |
122 | 127 | |
123 | - Patients patients = patientsService.findOnePatientById(excAddRequest.getParentId()); | |
124 | - PatientsQuery patientsQuery = new PatientsQuery(); | |
125 | - patientsQuery.setPid(patients.getPid()); | |
126 | - patientsQuery.setYn(YnEnums.YES.getId()); | |
127 | - | |
128 | 128 | List<Patients> list = patientsService.queryPatient(patientsQuery); |
129 | 129 | antExChuQuery.setStart(list.get(0).getCreated()); |
130 | 130 | antExChuQuery.setParentId(excAddRequest.getParentId()); |
... | ... | @@ -133,6 +133,7 @@ |
133 | 133 | return new BaseResponse().setErrorcode(ErrorCodeConstants.DATA_EXIST).setErrormsg("您本次妊娠中已在本医院建档"); |
134 | 134 | } |
135 | 135 | } |
136 | + antExChuModel.setPid(patients.getPid()); | |
136 | 137 | antExChuModel.setYn(YnEnums.YES.getId()); |
137 | 138 | antenatalExaminationService.addOneAntEx(antExChuModel); |
138 | 139 | } |
... | ... | @@ -159,7 +160,7 @@ |
159 | 160 | List list1 = JsonUtil.toList(model.getRiskFactor(), List.class); |
160 | 161 | highScoreResult = queryRisk(list1); |
161 | 162 | } |
162 | - if (null != model &&!"{}".equals(model.getOtherRisk())) { | |
163 | + if (null != model && !"{}".equals(model.getOtherRisk())) { | |
163 | 164 | Map map = JsonUtil.str2Obj(model.getOtherRisk(), Map.class); |
164 | 165 | |
165 | 166 | //风险因素 |
... | ... | @@ -227,7 +228,7 @@ |
227 | 228 | for (Patients patients : list) { |
228 | 229 | HighScoreResult highScoreResult = findLastRisk(patients.getId()); |
229 | 230 | antexListResult.setRiskFactor(highScoreResult.getHighRisk()); |
230 | - antexListResult.setRiskScore(highScoreResult.getScore()+""); | |
231 | + antexListResult.setRiskScore(highScoreResult.getScore() + ""); | |
231 | 232 | List<StopPregModel> stopPregs = null; |
232 | 233 | List<AntData> data = new ArrayList<>(); |
233 | 234 | MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); |
... | ... | @@ -256,7 +257,8 @@ |
256 | 257 | } |
257 | 258 | } |
258 | 259 | PostReviewQuery postReviewQuery = new PostReviewQuery(); |
259 | - ;postReviewQuery.setYn(YnEnums.YES.getId()); | |
260 | + ; | |
261 | + postReviewQuery.setYn(YnEnums.YES.getId()); | |
260 | 262 | if (StringUtils.isNotEmpty(dueDate)) { |
261 | 263 | Date date = DateUtil.parseYMD(dueDate); |
262 | 264 | //初诊记录 |
... | ... | @@ -358,7 +360,7 @@ |
358 | 360 | * @param vcCardNo |
359 | 361 | * @return |
360 | 362 | */ |
361 | - public Patients findOnePatient(String cardNo, String vcCardNo, String id, String hospitalId,Integer type) { | |
363 | + public Patients findOnePatient(String cardNo, String vcCardNo, String id, String hospitalId, Integer type) { | |
362 | 364 | PatientsQuery patientsQuery = new PatientsQuery(); |
363 | 365 | if (StringUtils.isNotEmpty(cardNo)) { |
364 | 366 | patientsQuery.setCardNo(cardNo); |
... | ... | @@ -397,7 +399,7 @@ |
397 | 399 | return "0"; |
398 | 400 | } |
399 | 401 | int day = DateUtil.getDays(date, new Date()); |
400 | - int start = 15 * 7+3; | |
402 | + int start = 15 * 7 + 3; | |
401 | 403 | int end = 20 * 7 + 6; |
402 | 404 | if (day >= start && day <= end) { |
403 | 405 | SieveApplyOrderQuery sieveApplyOrderQuery = new SieveApplyOrderQuery(); |
... | ... | @@ -438,8 +440,10 @@ |
438 | 440 | hospital = list1.get(0) + ""; |
439 | 441 | } |
440 | 442 | //查询产妇数据 |
441 | - patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospital,1); | |
442 | - patients1 = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, null,1); | |
443 | + patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospital, 1); | |
444 | + if (null == patients) { | |
445 | + patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, null, 1); | |
446 | + } | |
443 | 447 | } |
444 | 448 | |
445 | 449 | if (null == patients) { |
... | ... | @@ -448,7 +452,7 @@ |
448 | 452 | |
449 | 453 | AntexListResult antexListResult = new AntexListResult(); |
450 | 454 | AntExChuQuery antExChuQuery = new AntExChuQuery(); |
451 | - antExChuQuery.setParentId(patients1.getId()); | |
455 | + antExChuQuery.setPid(patients.getPid()); | |
452 | 456 | antExChuQuery.setYn(YnEnums.YES.getId()); |
453 | 457 | //获取初诊记录 |
454 | 458 | List<AntExChuModel> antExChulist = antenatalExaminationService.queryAntExChu(antExChuQuery); |
455 | 459 | |
... | ... | @@ -457,8 +461,11 @@ |
457 | 461 | antExChuModel = antExChulist.get(0); |
458 | 462 | }*/ |
459 | 463 | HighScoreResult highScoreResult = findLastRisk(patients.getId()); |
464 | + AntExQuery antExQuery=new AntExQuery(); | |
465 | + antExQuery.setYn(YnEnums.YES.getId()); | |
466 | + antExQuery.setPid(patients.getPid()); | |
460 | 467 | //查询产前检查记录 |
461 | - List<AntenatalExaminationModel> list = antenatalExaminationService.findAllByParentId(patients.getId()); | |
468 | + List<AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
462 | 469 | /* List data = new ArrayList(); |
463 | 470 | if (null != antExChuModel && StringUtils.isNotEmpty(antExChuModel.getHighrisk())) { |
464 | 471 | List l = JsonUtil.toList(antExChuModel.getHighrisk(), List.class); |
465 | 472 | |
466 | 473 | |
467 | 474 | |
468 | 475 | |
469 | 476 | |
... | ... | @@ -475,26 +482,26 @@ |
475 | 482 | data.add(); |
476 | 483 | }*/ |
477 | 484 | antexListResult.convertToResult(list, patients, antExChulist); |
478 | - antexListResult.setData(handlAntData(antExChulist,list)); | |
485 | + antexListResult.setData(handlAntData(antExChulist, list)); | |
479 | 486 | antexListResult.setIsSieve(cap(patients.getLastMenses(), patients.getId())); |
480 | 487 | antexListResult.setRiskFactor(highScoreResult.getHighRisk()); |
481 | - antexListResult.setRiskScore(highScoreResult.getScore()+""); | |
488 | + antexListResult.setRiskScore(highScoreResult.getScore() + ""); | |
482 | 489 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(antexListResult); |
483 | 490 | } |
484 | 491 | |
485 | - public List handlAntData(List<AntExChuModel> antExChulist,List<AntenatalExaminationModel> list){ | |
492 | + public List handlAntData(List<AntExChuModel> antExChulist, List<AntenatalExaminationModel> list) { | |
486 | 493 | List<AntData> dataList = new ArrayList<>(); |
487 | - Organization organization=null; | |
488 | - if(CollectionUtils.isNotEmpty(antExChulist)){ | |
489 | - for(AntExChuModel antExChuModel1:antExChulist){ | |
494 | + Organization organization = null; | |
495 | + if (CollectionUtils.isNotEmpty(antExChulist)) { | |
496 | + for (AntExChuModel antExChuModel1 : antExChulist) { | |
490 | 497 | if (null != antExChuModel1.getHospitalId()) { |
491 | 498 | organization = organizationService.getOrganization(Integer.valueOf(antExChuModel1.getHospitalId())); |
492 | 499 | } |
493 | - dataList.add(new AntData(antExChuModel1,null != organization ? organization.getName() : "")); | |
500 | + dataList.add(new AntData(antExChuModel1, null != organization ? organization.getName() : "")); | |
494 | 501 | } |
495 | 502 | } |
496 | - if(CollectionUtils.isNotEmpty(list)){ | |
497 | - for(AntenatalExaminationModel model:list){ | |
503 | + if (CollectionUtils.isNotEmpty(list)) { | |
504 | + for (AntenatalExaminationModel model : list) { | |
498 | 505 | if (null != model.getHospitalId()) { |
499 | 506 | organization = organizationService.getOrganization(Integer.valueOf(model.getHospitalId())); |
500 | 507 | } |