Commit f89c2ad36f6c0533593edfb65f2b78a2ab5d6fb7
1 parent
c2e0d5b94a
Exists in
dev
#fix:优化医信照护his数据同步,根据产妇、孕妇类型自动开通对应服务逻辑
Showing 1 changed file with 67 additions and 44 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientServiceController.java
View file @
f89c2ad
... | ... | @@ -164,62 +164,85 @@ |
164 | 164 | String bookbuildingDoctor = patients.getBookbuildingDoctor(); |
165 | 165 | //续期,增加 |
166 | 166 | if(yxzhVO.getRenew() == 1){ |
167 | + //1孕妇 2儿童 3 产妇 | |
167 | 168 | PatientServiceQuery patientServiceQuery = new PatientServiceQuery(); |
168 | - patientServiceQuery.setParentid(patients.getId()); | |
169 | - patientServiceQuery.setPerType(1); | |
170 | - patientServiceQuery.setSerType(1); | |
171 | - List<PatientService> patientServices = patientServiceService.queryPatientService(patientServiceQuery); | |
172 | - if(CollectionUtils.isNotEmpty(patientServices)){ | |
173 | - PatientService patientService = patientServices.get(0); | |
174 | - PatientService ps = new PatientService(); | |
169 | + List<PatientService> patientServices=new ArrayList<>(); | |
170 | + if (patients.getType()==1){ | |
171 | + patientServiceQuery.setParentid(patients.getId()); | |
172 | + patientServiceQuery.setPerType(1); | |
173 | + patientServiceQuery.setSerType(1); | |
174 | + patientServices = patientServiceService.queryPatientService(patientServiceQuery); | |
175 | + if(CollectionUtils.isNotEmpty(patientServices)){ | |
176 | + PatientService patientService = patientServices.get(0); | |
177 | + PatientService ps = new PatientService(); | |
178 | + ps.setId(patientService.getId()); | |
179 | + ps.setParentid(patientService.getParentid()); | |
180 | + ps.setSerStatus(1); | |
181 | + ps.setServiceWeek(yxzhVO.getWeeks()); | |
182 | + ps.setSerType(1); | |
183 | + patientServiceFacade.updatePatientService(ps,Integer.valueOf(bookbuildingDoctor)); | |
175 | 184 | |
176 | - ps.setId(patientService.getId()); | |
177 | - ps.setParentid(patientService.getParentid()); | |
178 | - ps.setSerStatus(1); | |
179 | - ps.setServiceWeek(yxzhVO.getWeeks()); | |
180 | - ps.setSerType(1); | |
181 | - patientServiceFacade.updatePatientService(ps,Integer.valueOf(bookbuildingDoctor)); | |
185 | + } | |
186 | + patientServiceQuery.setSerType(6); | |
187 | + patientServices = patientServiceService.queryPatientService(patientServiceQuery); | |
188 | + if(CollectionUtils.isNotEmpty(patientServices)){ | |
189 | + PatientService patientService = patientServices.get(0); | |
190 | + PatientService ps = new PatientService(); | |
191 | + ps.setId(patientService.getId()); | |
192 | + ps.setParentid(patientService.getParentid()); | |
193 | + ps.setSerStatus(1); | |
194 | + ps.setServiceWeek(yxzhVO.getWeeks()); | |
195 | + ps.setSerType(6); | |
196 | + baseResponse = patientServiceFacade.updatePatientService(ps,Integer.valueOf(bookbuildingDoctor)); | |
182 | 197 | |
183 | - } | |
184 | - patientServiceQuery.setSerType(6); | |
185 | - patientServices = patientServiceService.queryPatientService(patientServiceQuery); | |
186 | - if(CollectionUtils.isNotEmpty(patientServices)){ | |
187 | - PatientService patientService = patientServices.get(0); | |
188 | - PatientService ps = new PatientService(); | |
198 | + } | |
199 | + }else if (patients.getType()==3){ | |
200 | + patientServiceQuery.setPerType(3); | |
201 | + patientServiceQuery.setSerType(20); | |
202 | + patientServices = patientServiceService.queryPatientService(patientServiceQuery); | |
203 | + if(CollectionUtils.isNotEmpty(patientServices)){ | |
204 | + PatientService patientService = patientServices.get(0); | |
205 | + PatientService ps = new PatientService(); | |
206 | + ps.setId(patientService.getId()); | |
207 | + ps.setParentid(patientService.getParentid()); | |
208 | + ps.setSerStatus(1); | |
209 | + ps.setServiceWeek(yxzhVO.getWeeks()); | |
210 | + ps.setSerType(20); | |
211 | + baseResponse = patientServiceFacade.updatePatientService(ps,Integer.valueOf(bookbuildingDoctor)); | |
189 | 212 | |
190 | - ps.setId(patientService.getId()); | |
191 | - ps.setParentid(patientService.getParentid()); | |
192 | - ps.setSerStatus(1); | |
193 | - ps.setServiceWeek(yxzhVO.getWeeks()); | |
194 | - ps.setSerType(6); | |
195 | - baseResponse = patientServiceFacade.updatePatientService(ps,Integer.valueOf(bookbuildingDoctor)); | |
196 | - | |
213 | + } | |
197 | 214 | } |
198 | - | |
199 | 215 | return baseResponse; |
200 | 216 | }else{ |
201 | - | |
217 | + List<Map<String,String>> list = new ArrayList<>(); | |
202 | 218 | PatientService ps = new PatientService(); |
203 | 219 | ps.setSerStatus(1); |
204 | - ps.setPerType(1); | |
205 | 220 | ps.setParentid(patients.getId()); |
206 | 221 | ps.setCreateUser(bookbuildingDoctor); |
207 | 222 | ps.setCreateDate(new Date()); |
208 | - | |
209 | - List<Map<String,String>> list = new ArrayList<>(); | |
210 | - Map<String,String> m1 = new HashMap<>(); | |
211 | - m1.put("serType","1"); | |
212 | - m1.put("serviceWeek",yxzhVO.getWeeks()+""); | |
213 | - Map<String,String> m2 = new HashMap<>(); | |
214 | - m2.put("serType","6"); | |
215 | - m2.put("serviceWeek",yxzhVO.getWeeks()+""); | |
216 | - list.add(m1); | |
217 | - list.add(m2); | |
223 | + //1孕妇 2儿童 3 产妇 | |
224 | + if (patients.getType()==1){ | |
225 | + //开通围产、精准服务 | |
226 | + ps.setPerType(1); | |
227 | + Map<String,String> m1 = new HashMap<>(); | |
228 | + m1.put("serType","1"); | |
229 | + m1.put("serviceWeek",yxzhVO.getWeeks()+""); | |
230 | + Map<String,String> m2 = new HashMap<>(); | |
231 | + m2.put("serType","6"); | |
232 | + m2.put("serviceWeek",yxzhVO.getWeeks()+""); | |
233 | + list.add(m1); | |
234 | + list.add(m2); | |
235 | + }else if (patients.getType()==3){ | |
236 | + //开通产后康复服务 | |
237 | + ps.setPerType(3); | |
238 | + Map<String,String> m3 = new HashMap<>(); | |
239 | + m3.put("serType","20"); | |
240 | + m3.put("serviceWeek",yxzhVO.getWeeks()+""); | |
241 | + list.add(m3); | |
242 | + } | |
218 | 243 | ps.setSerInfos(list); |
219 | 244 | return patientServiceFacade.addPatientService(ps, Integer.valueOf(bookbuildingDoctor),hospitalId); |
220 | 245 | } |
221 | - | |
222 | - | |
223 | 246 | }catch (Exception e){ |
224 | 247 | e.printStackTrace(); |
225 | 248 | baseResponse.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); |