Commit a284d6d6be689e4933576b87542d19c7c7a1d568
1 parent
fd75eae806
Exists in
master
and in
1 other branch
孕妇分娩后 变成产妇
Showing 2 changed files with 92 additions and 5 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
a284d6d
... | ... | @@ -63,7 +63,10 @@ |
63 | 63 | AntenatalExaminationModel antenatalExamination = antExAddRequest.convertToDataModel(); |
64 | 64 | antenatalExamination.setHospitalId(autoMatchFacade.matchOrgId(userId).get(0) + ""); |
65 | 65 | antenatalExaminationService.updateOneAnt(antenatalExamination, antExAddRequest.getId()); |
66 | + //修改申请单状态 | |
66 | 67 | updateApplyOrder(antenatalExamination, antExAddRequest.getParentId()); |
68 | + //修改孕妇高危等级 | |
69 | + updatePatientRiskLevel(antenatalExamination,patientsService.findOnePatientById(antExAddRequest.getParentId())); | |
67 | 70 | } else { |
68 | 71 | AntenatalExaminationModel model = antExAddRequest.convertToDataModel(); |
69 | 72 | model.setYn(YnEnums.YES.getId()); |
70 | 73 | |
71 | 74 | |
... | ... | @@ -79,9 +82,13 @@ |
79 | 82 | if (CollectionUtils.isNotEmpty(list)) { |
80 | 83 | return new BaseResponse().setErrorcode(ErrorCodeConstants.DATA_EXIST).setErrormsg("同一天只能建一次复诊"); |
81 | 84 | } |
82 | - model.setPid( patientsService.findOnePatientById(antExAddRequest.getParentId()).getPid()); | |
85 | + Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId()); | |
86 | + model.setPid(patients.getPid()); | |
83 | 87 | antenatalExaminationService.addOneBabyAnt(model); |
88 | + //修改申请单状态 | |
84 | 89 | updateApplyOrder(model, antExAddRequest.getParentId()); |
90 | + //修改孕妇高危等级 | |
91 | + updatePatientRiskLevel(model, patients); | |
85 | 92 | } |
86 | 93 | |
87 | 94 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
... | ... | @@ -113,6 +120,10 @@ |
113 | 120 | AntExChuModel antExChuModel = excAddRequest.convertToDataModel(); |
114 | 121 | if (StringUtils.isNotEmpty(antExChuModel.getId()) && StringUtils.isNotEmpty(antExChuModel.getParentId())) { |
115 | 122 | antenatalExaminationService.updateAntExChu(antExChuModel, antExChuModel.getId()); |
123 | + | |
124 | + Patients patients = patientsService.findOnePatientById(excAddRequest.getParentId()); | |
125 | + //修改患者风险等级 | |
126 | + updatePatientRiskLevel(antExChuModel, patients); | |
116 | 127 | } else { |
117 | 128 | List list1 = autoMatchFacade.matchOrgId(userId); |
118 | 129 | Patients patients = patientsService.findOnePatientById(excAddRequest.getParentId()); |
119 | 130 | |
... | ... | @@ -136,10 +147,73 @@ |
136 | 147 | antExChuModel.setPid(patients.getPid()); |
137 | 148 | antExChuModel.setYn(YnEnums.YES.getId()); |
138 | 149 | antenatalExaminationService.addOneAntEx(antExChuModel); |
150 | + //修改患者风险等级 | |
151 | + updatePatientRiskLevel(antExChuModel, patients); | |
139 | 152 | } |
140 | 153 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
141 | 154 | } |
142 | - | |
155 | + //修改患者风险等级 | |
156 | + private void updatePatientRiskLevel(AntExChuModel antExChuModel, Patients patients) { | |
157 | + List<String> list = new ArrayList<>(); | |
158 | + try { | |
159 | + if (StringUtils.isNotEmpty(antExChuModel.getHighrisk()) && !"[]".equals(antExChuModel.getHighrisk())) { | |
160 | + List l = JsonUtil.toList(antExChuModel.getHighrisk(), List.class); | |
161 | + for(int i=0;i< l.size();i++){ | |
162 | + BasicConfig basicConfig= basicConfigService.getOneBasicConfigById(l.get(i).toString()); | |
163 | + basicConfig= basicConfigService.getOneBasicConfigById(basicConfig.getParentId()); | |
164 | + if(null!=basicConfig&&!list.contains(basicConfig.getId())){ | |
165 | + list.add(basicConfig.getId()); | |
166 | + } | |
167 | + } | |
168 | + } | |
169 | + } catch (Exception e) { | |
170 | + } | |
171 | + try { | |
172 | + if (StringUtils.isNotEmpty(antExChuModel.getOtherHighRisk()) && !"{}".equals(antExChuModel.getOtherHighRisk())) { | |
173 | + Map map = JsonUtil.str2Obj(antExChuModel.getOtherHighRisk(), Map.class); | |
174 | + String m = (String) map.get("fyyse"); | |
175 | + if(!list.contains(m)){ | |
176 | + list.add(m); | |
177 | + } | |
178 | + } | |
179 | + } catch (Exception e) { | |
180 | + } | |
181 | + if (!list.isEmpty()) { | |
182 | + patients.setRiskLevelId(JsonUtil.array2JsonString(list)); | |
183 | + patientsService.updatePatient(patients); | |
184 | + } | |
185 | + } | |
186 | + //修改患者风险等级 | |
187 | + private void updatePatientRiskLevel(AntenatalExaminationModel antExChuModel, Patients patients) { | |
188 | + List<String> list = new ArrayList<>(); | |
189 | + try { | |
190 | + if (StringUtils.isNotEmpty(antExChuModel.getRiskFactor()) && !"[]".equals(antExChuModel.getRiskFactor())) { | |
191 | + List l = JsonUtil.toList(antExChuModel.getRiskFactor(), List.class); | |
192 | + for(int i=0;i< l.size();i++){ | |
193 | + BasicConfig basicConfig= basicConfigService.getOneBasicConfigById(l.get(i).toString()); | |
194 | + basicConfig= basicConfigService.getOneBasicConfigById(basicConfig.getParentId()); | |
195 | + if(null!=basicConfig&&!list.contains(basicConfig.getId())){ | |
196 | + list.add(basicConfig.getId()); | |
197 | + } | |
198 | + } | |
199 | + } | |
200 | + } catch (Exception e) { | |
201 | + } | |
202 | + try { | |
203 | + if (StringUtils.isNotEmpty(antExChuModel.getOtherRisk()) && !"{}".equals(antExChuModel.getOtherRisk())) { | |
204 | + Map map = JsonUtil.str2Obj(antExChuModel.getOtherRisk(), Map.class); | |
205 | + String m = (String) map.get("fyyse"); | |
206 | + if(!list.contains(m)){ | |
207 | + list.add(m); | |
208 | + } | |
209 | + } | |
210 | + } catch (Exception e) { | |
211 | + } | |
212 | + if (!list.isEmpty()) { | |
213 | + patients.setRiskLevelId(JsonUtil.array2JsonString(list)); | |
214 | + patientsService.updatePatient(patients); | |
215 | + } | |
216 | + } | |
143 | 217 | /** |
144 | 218 | * 获取最后一次高危产检的高危信息 |
145 | 219 | * <p> |
... | ... | @@ -462,7 +536,7 @@ |
462 | 536 | antExChuModel = antExChulist.get(0); |
463 | 537 | }*/ |
464 | 538 | HighScoreResult highScoreResult = findLastRisk(patients.getId()); |
465 | - AntExQuery antExQuery=new AntExQuery(); | |
539 | + AntExQuery antExQuery = new AntExQuery(); | |
466 | 540 | antExQuery.setYn(YnEnums.YES.getId()); |
467 | 541 | antExQuery.setPid(patients.getPid()); |
468 | 542 | //查询产前检查记录 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/MatDeliverListResult.java
View file @
a284d6d
... | ... | @@ -79,7 +79,7 @@ |
79 | 79 | if (CollectionUtils.isNotEmpty(destList)) { |
80 | 80 | List<MatDeliverExt> list = new ArrayList<>(); |
81 | 81 | for (MaternalDeliverModel model : destList) { |
82 | - list.add(new MatDeliverExt(model,patients.getCreated(),patients.getBuildType())); | |
82 | + list.add(new MatDeliverExt(model,patients.getCreated(),patients.getBuildType(),patients.getFmDate())); | |
83 | 83 | } |
84 | 84 | setData(list); |
85 | 85 | } |
... | ... | @@ -179,7 +179,9 @@ |
179 | 179 | private String enableEdit = "0"; |
180 | 180 | //建档类型 0 未分娩建档 1儿童建档时建档 |
181 | 181 | private String dueType; |
182 | - public MatDeliverExt(MaternalDeliverModel deliverModel, Date lastCreatedTime,Integer buildType) { | |
182 | + //分娩时间,补录时使用 | |
183 | + private String dueDate; | |
184 | + public MatDeliverExt(MaternalDeliverModel deliverModel, Date lastCreatedTime,Integer buildType,Date dueDate) { | |
183 | 185 | setCheckTime(deliverModel.getDueDate()); |
184 | 186 | setId(deliverModel.getId()); |
185 | 187 | setHospitalId(deliverModel.getHospitalId()); |
... | ... | @@ -191,6 +193,17 @@ |
191 | 193 | if(null!=buildType){ |
192 | 194 | dueType=buildType+""; |
193 | 195 | } |
196 | + if(null!=dueDate){ | |
197 | + this.dueDate=DateUtil.getyyyy_MM_dd(dueDate); | |
198 | + } | |
199 | + } | |
200 | + | |
201 | + public String getDueDate() { | |
202 | + return dueDate; | |
203 | + } | |
204 | + | |
205 | + public void setDueDate(String dueDate) { | |
206 | + this.dueDate = dueDate; | |
194 | 207 | } |
195 | 208 | |
196 | 209 | public String getDueType() { |