Commit 05e6cac1ab8b1ff76f8966cb788b7fa43bd120d9
1 parent
6b0a6737f7
Exists in
master
and in
6 other branches
南和分娩
Showing 2 changed files with 534 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/nanhe/NhfyFmService.java
View file @
05e6cac
1 | +package com.lyms.hospitalapi.nanhe; | |
2 | + | |
3 | +import com.lyms.hospitalapi.dzfy.Fm; | |
4 | +import com.lyms.hospitalapi.qhdfy.FmItem; | |
5 | +import com.lyms.platform.biz.service.PatientsService; | |
6 | +import com.lyms.platform.common.enums.FmTypeEnums; | |
7 | +import com.lyms.platform.common.enums.RenShenJieJuEnums; | |
8 | +import com.lyms.platform.common.enums.TpmcTypeEnums; | |
9 | +import com.lyms.platform.common.enums.YnEnums; | |
10 | +import com.lyms.platform.common.utils.DateUtil; | |
11 | +import com.lyms.platform.common.utils.ExceptionUtils; | |
12 | +import com.lyms.platform.common.utils.StringUtils; | |
13 | +import com.lyms.platform.operate.web.facade.BabyBookbuildingFacade; | |
14 | +import com.lyms.platform.operate.web.facade.MatDeliverFacade; | |
15 | +import com.lyms.platform.operate.web.facade.PatientServiceFacade; | |
16 | +import com.lyms.platform.operate.web.request.BabyBookbuildingAddRequest; | |
17 | +import com.lyms.platform.operate.web.request.MatDeliverAddRequest; | |
18 | +import com.lyms.platform.permission.model.Users; | |
19 | +import com.lyms.platform.permission.model.UsersQuery; | |
20 | +import com.lyms.platform.permission.service.UsersService; | |
21 | +import com.lyms.platform.pojo.MaternalDeliverModel; | |
22 | +import com.lyms.platform.pojo.Patients; | |
23 | +import com.lyms.platform.query.PatientsQuery; | |
24 | +import org.apache.commons.collections.CollectionUtils; | |
25 | +import org.springframework.beans.factory.annotation.Autowired; | |
26 | +import org.springframework.stereotype.Service; | |
27 | + | |
28 | +import java.text.DecimalFormat; | |
29 | +import java.text.ParseException; | |
30 | +import java.text.SimpleDateFormat; | |
31 | +import java.util.*; | |
32 | + | |
33 | +/** | |
34 | + * Created by Administrator on 2018/1/4. | |
35 | + */ | |
36 | +@Service("lnhFyFmService") | |
37 | +public class NhfyFmService implements InhFyFmService { | |
38 | + | |
39 | + @Autowired | |
40 | + private PatientsService patientsService; | |
41 | + | |
42 | + @Autowired | |
43 | + private MatDeliverFacade matDeliverFacade; | |
44 | + | |
45 | + @Autowired | |
46 | + private UsersService usersService; | |
47 | + | |
48 | + @Autowired | |
49 | + private BabyBookbuildingFacade babyBookbuildingFacade; | |
50 | + | |
51 | + @Autowired | |
52 | + private PatientServiceFacade patientServiceFacade; | |
53 | + | |
54 | + private static Map<Integer, String> ONE_ENUMS = new HashMap<>(); | |
55 | + | |
56 | + private static Map<String, List> babyMap = new HashMap<>(); | |
57 | + | |
58 | + private static final String HOSPITALID = "1000000115"; | |
59 | + static { | |
60 | + ONE_ENUMS.put(0, "长"); | |
61 | + ONE_ENUMS.put(1, "次"); | |
62 | + ONE_ENUMS.put(2, "三"); | |
63 | + ONE_ENUMS.put(3, "四"); | |
64 | + ONE_ENUMS.put(4, "五"); | |
65 | + ONE_ENUMS.put(5, "六"); | |
66 | + ONE_ENUMS.put(6, "七"); | |
67 | + | |
68 | + | |
69 | + List<String> b1 = new ArrayList<>(); | |
70 | + b1.add("长女"); | |
71 | + b1.add("次女"); | |
72 | + babyMap.put("00", b1); | |
73 | + | |
74 | + List<String> b2 = new ArrayList<>(); | |
75 | + b2.add("长子"); | |
76 | + b2.add("次子"); | |
77 | + babyMap.put("11", b2); | |
78 | + | |
79 | + List<String> b3 = new ArrayList<>(); | |
80 | + b3.add("之子"); | |
81 | + b3.add("之女"); | |
82 | + | |
83 | + List<String> b4 = new ArrayList<>(); | |
84 | + b4.add("之女"); | |
85 | + b4.add("之子"); | |
86 | + babyMap.put("01", b4); | |
87 | + babyMap.put("10", b3); | |
88 | + List<String> b5 = new ArrayList<>(); | |
89 | + b5.add("之子"); | |
90 | + List<String> b6 = new ArrayList<>(); | |
91 | + b6.add("之女"); | |
92 | + | |
93 | + babyMap.put("1", b5); | |
94 | + babyMap.put("0", b6); | |
95 | + } | |
96 | + | |
97 | + public void fmTimerWork() { | |
98 | + SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
99 | + Date end = new Date(new Date().getTime()-1000*60*60); | |
100 | + Date start = new Date(end.getTime()-1000*60*60*2); | |
101 | + String startStr = fmt.format(start); | |
102 | + String endStr = fmt.format(end); | |
103 | + System.out.println("start=" + startStr + "end=" + endStr); | |
104 | +// queryFmPatient(startStr, endStr, null); | |
105 | + } | |
106 | + | |
107 | + public void syncByPhone(List<Fm> list) { | |
108 | + queryFmPatient(list); | |
109 | + } | |
110 | + | |
111 | + | |
112 | + | |
113 | + public void queryFmPatient(List<Fm> allList) { | |
114 | + | |
115 | + saveFm sfm = new saveFm(allList); | |
116 | + Thread t = new Thread(sfm); | |
117 | + t.start(); | |
118 | + | |
119 | + } | |
120 | + | |
121 | + private List buildBabyName(List<Fm> items) { | |
122 | + String id = ""; | |
123 | + if (items.size() > 2) { | |
124 | + int boyCount = 0; | |
125 | + int girlCount = 0; | |
126 | + List<String> l = new ArrayList<>(); | |
127 | + for (int i = 0; i < items.size(); i++) { | |
128 | + Fm item = items.get(i); | |
129 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(item.getBABY_SEX())) { | |
130 | + if ("男".equals(item.getBABY_SEX())) { | |
131 | + l.add(ONE_ENUMS.get(boyCount) + "子"); | |
132 | + boyCount++; | |
133 | + } else if ("女".equals(item.getBABY_SEX())) { | |
134 | + l.add(ONE_ENUMS.get(girlCount) + "女"); | |
135 | + girlCount++; | |
136 | + } | |
137 | + } | |
138 | + } | |
139 | + return l; | |
140 | + } else { | |
141 | + for (int i = 0; i < items.size(); i++) { | |
142 | + Fm item = items.get(i); | |
143 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(item.getBABY_SEX())) { | |
144 | + if ("男".equals(item.getBABY_SEX())) | |
145 | + { | |
146 | + id += "1"; | |
147 | + } | |
148 | + else if ("女".equals(item.getBABY_SEX())) | |
149 | + { | |
150 | + id += "0"; | |
151 | + } | |
152 | + | |
153 | + } | |
154 | + } | |
155 | + return babyMap.get(id); | |
156 | + } | |
157 | + } | |
158 | + | |
159 | + public void buildBaby(FmItem item,Patients patInfo,Fm fm, Date dueDate, String babyName) | |
160 | + { | |
161 | + try{ | |
162 | + | |
163 | + ExceptionUtils.catchException("buildBaby===="); | |
164 | + | |
165 | + if ("死产".equals(fm.getBABY_PREGNANCY_OUT())) | |
166 | + { | |
167 | + return; | |
168 | + } | |
169 | + | |
170 | + UsersQuery usersQuery = new UsersQuery(); | |
171 | + usersQuery.setYn(YnEnums.YES.getId()); | |
172 | + usersQuery.setName("产科"); | |
173 | + usersQuery.setOrgId(new Integer(Integer.parseInt(HOSPITALID))); | |
174 | + List<Users> users = usersService.queryUsers(usersQuery); | |
175 | + | |
176 | + BabyBookbuildingAddRequest request = new BabyBookbuildingAddRequest(); | |
177 | + request.setHospitalId(HOSPITALID); | |
178 | + | |
179 | + request.setMommyName(fm.getNAME()); //母亲姓名 | |
180 | + Date bir = patInfo.getBirth(); | |
181 | + if(bir!=null){ | |
182 | + try { | |
183 | + SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); | |
184 | + Date birth = format.parse(bir.toString()); | |
185 | + format = new SimpleDateFormat("yyyy-MM-dd"); | |
186 | + request.setMommyBirthday(format.format(birth)); | |
187 | + }catch (ParseException e) | |
188 | + { | |
189 | + ExceptionUtils.catchException(e,"孕妇生日解析异常"); | |
190 | + } | |
191 | + } | |
192 | + | |
193 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(fm.getIDCARD())) | |
194 | + { | |
195 | + request.setMommyCertificateTypeId("70ae1d93-2964-46bc-83fa-bec9ff605b1c"); //证件类型 (身份证号码) | |
196 | + request.setMommyCertificateNum(fm.getIDCARD()); //证件号 | |
197 | + } | |
198 | + else if (StringUtils.isNotEmpty(fm.getPHONE())) | |
199 | + { | |
200 | + request.setMommyCertificateTypeId("57e1dcd3f0f02e7ca519d6c6"); //证件类型 (手机号码) | |
201 | + request.setMommyCertificateNum(fm.getPHONE()); //证件号 | |
202 | + } | |
203 | + | |
204 | + request.setMommyPhone(fm.getPHONE()); | |
205 | + | |
206 | + request.setBabyName(babyName); | |
207 | + request.setSex("男".equals(item.getYexb()) ? 1 : 0); | |
208 | + | |
209 | + request.setBabyBirthday(DateUtil.getyyyy_MM_dd(dueDate)); //生日 | |
210 | + | |
211 | + if (StringUtils.isNotEmpty(fm.getDUE_WEEK())) { | |
212 | + String week = fm.getDUE_WEEK(); | |
213 | + | |
214 | + try { | |
215 | + request.setDueWeek(Integer.parseInt(week)); //分娩孕周 | |
216 | + }catch (Exception e) | |
217 | + { | |
218 | + | |
219 | + } | |
220 | + } | |
221 | + | |
222 | + String fmfs = ""; | |
223 | + if (fm.getDELIVERY_MODE() != null && "剖宫产".equals(fm.getDELIVERY_MODE())) | |
224 | + { | |
225 | + fmfs = FmTypeEnums.O1.getId(); | |
226 | + } | |
227 | + else | |
228 | + { | |
229 | + fmfs = FmTypeEnums.O.getId(); | |
230 | + } | |
231 | + | |
232 | + request.setDueType(fmfs);//分娩方式 | |
233 | + //request.setFetusCount(item.getDjt()); //第几胎 | |
234 | + //request.setDueCount(item.getCjc());//第几产 | |
235 | + String weight = fm.getSBABY_WEIGHT(); | |
236 | + String height = fm.getSBABY_HEIGHT(); | |
237 | + if(weight!=null){ | |
238 | + DecimalFormat df = new DecimalFormat("#.00"); | |
239 | + double w = Double.parseDouble(weight); | |
240 | + request.setBabyWeight(df.format(w/1000)); //体重 | |
241 | + } | |
242 | + if(height!=null){ | |
243 | + request.setBabyHeight(height); //身长 | |
244 | + } | |
245 | + | |
246 | + Map<String,String> map = new HashMap<>(); | |
247 | + String pf1 = fm.getSBABY_APGAR_SCORE_ONE(); | |
248 | + String pf5 = fm.getSBABY_APGAR_SCORE_FIVE(); | |
249 | + String pf10 = fm.getSBABY_APGAR_SCORE_TEN(); | |
250 | + if(pf1!=null){ | |
251 | + map.put("pf1", pf1); | |
252 | + } | |
253 | + if(pf5!=null){ | |
254 | + map.put("pf5", pf5); | |
255 | + } | |
256 | + if(pf10!=null){ | |
257 | + map.put("pf10", pf10); | |
258 | + } | |
259 | + | |
260 | + request.setApgarScore(map); | |
261 | + request.setDeliverOrg(HOSPITALID); | |
262 | + | |
263 | + request.setBuildDoctor(users.get(0).getId() + ""); | |
264 | + request.setBuildDate(DateUtil.getyyyy_MM_dd(dueDate)); | |
265 | + //request.setHighRisk("是".equals(item.getSfgw()) ? 1 : 0); ////是否高危 0 非高危 1高危 | |
266 | + request.setMalformation((fm.getBABY_DEFORMITY() == null ? 0 : 1)); //畸形 0非畸形 1畸形 | |
267 | + //request.setMalformation("无".equals(item.getJx()) ? 0 : 1); //畸形 0非畸形 1畸形 | |
268 | + | |
269 | +// request.setServiceType(ServiceTypeEnums.STANDARD_SERVICE.getId()); //标准服务 | |
270 | +// request.setServiceStatus(ServiceStatusEnums.STANDARD_OPEN.getId()); //开通 | |
271 | + | |
272 | + /*if (patInfo != null && StringUtils.isNotEmpty(fm.getBHNUM())) | |
273 | + { | |
274 | + Map<String,Object> diags = dzfyHisService.queryHisBabyDiagnosis(fm.getBHNUM()); | |
275 | + if (diags != null && diags.size() > 0) | |
276 | + { | |
277 | + request.setBlNo(fm.getBHNUM()); | |
278 | + request.setBabyDiagnosis(diags.get("diagnosisItem") == null ? "" : diags.get("diagnosisItem").toString()); | |
279 | + } | |
280 | + }*/ | |
281 | + | |
282 | + //标准服务开通 | |
283 | + request.setSerInfos(patientServiceFacade.defaultServiceOpen()); | |
284 | + | |
285 | + babyBookbuildingFacade.addBabyBookbuilding(request, users.get(0).getId()); | |
286 | + | |
287 | + }catch (Exception e) | |
288 | + { | |
289 | + ExceptionUtils.catchException(e, "buildBaby exception"); | |
290 | + e.printStackTrace(); | |
291 | + } | |
292 | + } | |
293 | + | |
294 | + public class saveFm implements Runnable{ | |
295 | + | |
296 | + private List<Fm> allList; | |
297 | + | |
298 | + public saveFm(List<Fm> list){ | |
299 | + this.allList=list; | |
300 | + } | |
301 | + | |
302 | + public void run(){ | |
303 | + | |
304 | + SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
305 | + try { | |
306 | + | |
307 | + System.out.println("fm=" + allList.toString()); | |
308 | + int a =0;//用来判断是否建了儿童档案,如果建了儿童档案就不保存分娩记录 | |
309 | + int count = 0; | |
310 | + List<Users> users = new ArrayList<Users>(); | |
311 | + | |
312 | + Date dueDate = null; | |
313 | + List<MatDeliverAddRequest.Baby> babies = new ArrayList<>(); | |
314 | + MatDeliverAddRequest deliverAddRequest = new MatDeliverAddRequest(); | |
315 | + for(Fm allFm:allList){ | |
316 | + System.out.println(allFm.toString()); | |
317 | + a=0; | |
318 | + count=0; | |
319 | + if (!"活产".equals(allFm.getBABY_PREGNANCY_OUT())) | |
320 | + { | |
321 | + continue; | |
322 | + } | |
323 | + if (StringUtils.isEmpty(allFm.getPHONE()) && StringUtils.isEmpty(allFm.getIDCARD())) | |
324 | + { | |
325 | + continue; | |
326 | + } | |
327 | + | |
328 | + PatientsQuery query = new PatientsQuery(); | |
329 | + query.setYn(YnEnums.YES.getId()); | |
330 | + query.setType(1); //孕妇 | |
331 | + query.setDueStatus(0); //未终止妊娠 | |
332 | + String[] strs = new String[]{allFm.getPHONE(),allFm.getIDCARD()}; | |
333 | + query.setPc(strs); | |
334 | + | |
335 | + //查询该孕妇是否在孕产婴系统中建档 | |
336 | + List<Patients> patientses = patientsService.queryPatient(query); | |
337 | + Patients patient = new Patients(); | |
338 | + if(CollectionUtils.isNotEmpty(patientses)){ | |
339 | + ExceptionUtils.catchException("patientses"+patientses); | |
340 | + patient = patientses.get(0); | |
341 | + UsersQuery usersQuery = new UsersQuery(); | |
342 | + usersQuery.setYn(YnEnums.YES.getId()); | |
343 | + usersQuery.setOrgId(new Integer(Integer.parseInt(HOSPITALID))); | |
344 | + usersQuery.setName("产房"); | |
345 | + users = usersService.queryUsers(usersQuery); | |
346 | + | |
347 | + if (CollectionUtils.isNotEmpty(users) && users.get(0).getId() != null) { | |
348 | + | |
349 | + Date dateTime = fmt.parse(allFm.getBABY_DELIVERY_TIME()); | |
350 | + if(dateTime!=null){ | |
351 | + if (!StringUtils.isNotEmpty(allFm.getBABY_DELIVERY_TIME().toString())) { | |
352 | + continue; | |
353 | + }else{ | |
354 | + dueDate = dateTime; | |
355 | + } | |
356 | + }else{ | |
357 | + continue; | |
358 | + } | |
359 | + | |
360 | + Map<String, Map<String,String>> map = new HashMap<>(); | |
361 | + Map<String, String> map1 = new HashMap<>(); | |
362 | + Map<String, String> map2 = new HashMap<>(); | |
363 | + Map<String, String> map3 = new HashMap<>(); | |
364 | + Map<String, String> totalMap = new HashMap<>(); | |
365 | + | |
366 | + Integer prod_Process_One = allFm.getPROD_PROCESS_ONE(); | |
367 | + Integer prod_Process_Two = allFm.getPROD_PROCESS_TWO(); | |
368 | + Integer prod_Process_Three = allFm.getPROD_PROCESS_THREE(); | |
369 | + if(prod_Process_One!=null){ | |
370 | + map1.put("h",String.valueOf(prod_Process_One.intValue()/60)); | |
371 | + map1.put("m",String.valueOf(prod_Process_One.intValue()%60)); | |
372 | + map.put("one", map1); | |
373 | + } | |
374 | + if(prod_Process_Two!=null){ | |
375 | + map2.put("h",String.valueOf(prod_Process_Two.intValue()/60)); | |
376 | + map2.put("m",String.valueOf(prod_Process_Two.intValue()%60)); | |
377 | + map.put("two",map2); | |
378 | + } | |
379 | + if(prod_Process_Three!=null){ | |
380 | + map3.put("h",String.valueOf(prod_Process_Three.intValue()/60)); | |
381 | + map3.put("m",String.valueOf(prod_Process_Three.intValue()%60)); | |
382 | + map.put("three",map3); | |
383 | + } | |
384 | + | |
385 | + /* int hProcess = Integer.parseInt(allFm.getTOTAL_PROCESS())/60;//总产程小时数 | |
386 | + int mProcess = Integer.parseInt(allFm.getTOTAL_PROCESS())%60;//总产程分钟数 | |
387 | + totalMap.put("h",String.valueOf(hProcess)); | |
388 | + totalMap.put("m",String.valueOf(mProcess));*/ | |
389 | + | |
390 | + deliverAddRequest.setProdprocess(map); | |
391 | + deliverAddRequest.setTotalprocess(totalMap); | |
392 | + deliverAddRequest.setDeliverDoctor(allFm.getDELIVER_DOCTOR()); | |
393 | + deliverAddRequest.setDueDate(DateUtil.getyyyy_MM_dd(dueDate)); | |
394 | + deliverAddRequest.setParentId(patient.getId()); | |
395 | + deliverAddRequest.setPid(patient.getPid()); | |
396 | + deliverAddRequest.setOperationCause("-"); | |
397 | + String week = ""; | |
398 | + if (StringUtils.isNotEmpty(allFm.getDUE_WEEK())) { | |
399 | + | |
400 | + week = allFm.getDUE_WEEK() + "周"; | |
401 | + if (StringUtils.isNotEmpty(allFm.getDUE_WEEK()) && StringUtils.isNotEmpty(allFm.getDUE_DAY())) | |
402 | + { | |
403 | + week += allFm.getDUE_DAY() + "天"; | |
404 | + } | |
405 | + | |
406 | + deliverAddRequest.setDueWeek(week); | |
407 | + } | |
408 | + | |
409 | + deliverAddRequest.setTireNumber(allFm.getFETUS_NUM());// 胎数(之前赋值为死值1) | |
410 | + Integer placenta_Num = allFm.getPLACENTA_NUM(); | |
411 | + if(placenta_Num!=null){ | |
412 | + deliverAddRequest.setPlacenta(allFm.getPLACENTA_NUM().toString());// 胎盘(之前赋值为死值1) | |
413 | + } | |
414 | + if ("完好".equals(allFm.getPERINEAL_CONDITION()) || "".equals(allFm.getPERINEAL_CONDITION())) { | |
415 | + deliverAddRequest.setPerinealCondition("full"); | |
416 | + } else if ("会阴切开".equals(allFm.getPERINEAL_CONDITION()) || "侧切".equals(allFm.getPERINEAL_CONDITION())) { | |
417 | + deliverAddRequest.setPerinealCondition("split"); | |
418 | + } | |
419 | + | |
420 | + if ("一度裂伤".equals(allFm.getPERINEAL_CONDITION())) { | |
421 | + deliverAddRequest.setSiLielevel(1); | |
422 | + } else if ("二度裂伤".equals(allFm.getPERINEAL_CONDITION())) { | |
423 | + deliverAddRequest.setSiLielevel(2); | |
424 | + } else if ("三度裂伤".equals(allFm.getPERINEAL_CONDITION())) { | |
425 | + deliverAddRequest.setSiLielevel(3); | |
426 | + } | |
427 | + | |
428 | + Integer th_Lose = allFm.getTH_LOSE_BLOOD(); | |
429 | + if(th_Lose!=null){ | |
430 | + if (StringUtils.isNotEmpty(allFm.getTH_LOSE_BLOOD().toString())) { | |
431 | + deliverAddRequest.settHloseBloodL(Double.parseDouble(allFm.getTH_LOSE_BLOOD().toString())); | |
432 | + } | |
433 | + } | |
434 | + | |
435 | + Map deliveryMode = new HashMap(); //分娩方式 | |
436 | + | |
437 | + String fmfs = ""; | |
438 | + if (allFm.getDELIVERY_MODE() != null && "手术产".equals(allFm.getDELIVERY_MODE())) | |
439 | + { | |
440 | + fmfs = FmTypeEnums.O1.getId(); | |
441 | + } | |
442 | + else | |
443 | + { | |
444 | + fmfs = FmTypeEnums.O.getId(); | |
445 | + } | |
446 | + deliveryMode.put("fmfs",fmfs); | |
447 | + deliverAddRequest.setDeliveryMode(deliveryMode); | |
448 | + //胎盘信息 | |
449 | + List<MaternalDeliverModel.ExtPlacenta> extPlacentas = new ArrayList<>(); | |
450 | + MaternalDeliverModel.ExtPlacenta extPlacenta = new MaternalDeliverModel.ExtPlacenta(); | |
451 | + String tpmcType = ""; //胎盘娩出方式 | |
452 | + if ("手术产".equals(allFm.getTMCTYPE()) || "手取胎盘".equals(allFm.getTMCTYPE())) { | |
453 | + tpmcType = TpmcTypeEnums.O2.getId(); | |
454 | + } else if ("自然产出".equals(allFm.getTMCTYPE()) || "自然娩出".equals(allFm.getTMCTYPE())) { | |
455 | + tpmcType = TpmcTypeEnums.O.getId(); | |
456 | + } | |
457 | + extPlacenta.setTpmcType(tpmcType); | |
458 | + extPlacentas.add(extPlacenta); | |
459 | + deliverAddRequest.setExtPlacentas(extPlacentas); | |
460 | + | |
461 | + | |
462 | + //儿童 | |
463 | + MatDeliverAddRequest.Baby baby = new MatDeliverAddRequest.Baby(); | |
464 | + Map<String, String> as = new HashMap<>(); | |
465 | + String pf1 = allFm.getSBABY_APGAR_SCORE_ONE(); | |
466 | + String pf5 = allFm.getSBABY_APGAR_SCORE_FIVE(); | |
467 | + String pf10 = allFm.getSBABY_APGAR_SCORE_TEN(); | |
468 | + if(pf1!=null){ | |
469 | + as.put("pf1", allFm.getSBABY_APGAR_SCORE_ONE()); | |
470 | + } | |
471 | + if(pf5!=null){ | |
472 | + as.put("pf5", allFm.getSBABY_APGAR_SCORE_FIVE()); | |
473 | + } | |
474 | + if(pf10!=null){ | |
475 | + as.put("pf10", allFm.getSBABY_APGAR_SCORE_TEN()); | |
476 | + } | |
477 | + | |
478 | + | |
479 | + baby.setApgarScore(as); | |
480 | + baby.setBabyGender("男".equals(allFm.getBABY_SEX()) ? "1" : "0"); | |
481 | + String babyHeight = allFm.getSBABY_HEIGHT(); | |
482 | + String babyWeight = allFm.getSBABY_WEIGHT(); | |
483 | + Integer baby_Asphyxiam = allFm.getBABY_ASPHYXIAM(); | |
484 | + if(babyHeight!=null){ | |
485 | + baby.setBabyHeight(allFm.getSBABY_HEIGHT());//新生儿生长 | |
486 | + } | |
487 | + if(babyWeight!=null){ | |
488 | + baby.setBabyWeight(allFm.getSBABY_WEIGHT());//新生儿重量 | |
489 | + } | |
490 | + if(baby_Asphyxiam!=null){ | |
491 | + baby.setAsphyxiaM(allFm.getBABY_ASPHYXIAM().toString()); //窒息分钟 | |
492 | + } | |
493 | + | |
494 | + baby.setDeformity((allFm.getBABY_DEFORMITY()==null?0:1)); //畸形 0非畸形 1畸形 | |
495 | + | |
496 | + String baby_Pregnancy_Out = allFm.getBABY_PREGNANCY_OUT(); | |
497 | + if(baby_Pregnancy_Out!=null && StringUtils.isNotEmpty(baby_Pregnancy_Out)){ | |
498 | + baby.setPregnancyOut(RenShenJieJuEnums.getIdByName(allFm.getBABY_PREGNANCY_OUT())); // 妊娠结局 | |
499 | + } | |
500 | + | |
501 | + baby.setDueTime(fmt.format(dueDate));//分娩时间 | |
502 | + babies.add(baby); | |
503 | + | |
504 | + } | |
505 | + } | |
506 | + } | |
507 | + | |
508 | + if(a==0){ | |
509 | + deliverAddRequest.setBabies(babies); | |
510 | + deliverAddRequest.setFmHospital(HOSPITALID); //设置为南和 | |
511 | + ExceptionUtils.catchException("deliverAddRequest===" + deliverAddRequest); | |
512 | + if(users!=null && users.size()>0){ | |
513 | + matDeliverFacade.addOrUpdateMatDeliver(deliverAddRequest, users.get(0).getId()); | |
514 | + } | |
515 | + } | |
516 | + | |
517 | + } catch (Exception e) { | |
518 | + ExceptionUtils.catchException(e, "sql执行异常"); | |
519 | + e.printStackTrace(); | |
520 | + } | |
521 | + | |
522 | + } | |
523 | + } | |
524 | + | |
525 | + | |
526 | + | |
527 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FmController.java
View file @
05e6cac
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | import com.lyms.hospitalapi.dzfy.Fm; |
4 | 4 | import com.lyms.hospitalapi.lpfy.IlpFyFmService; |
5 | +import com.lyms.hospitalapi.nanhe.InhFyFmService; | |
5 | 6 | import com.lyms.platform.common.result.BaseResponse; |
6 | 7 | import org.springframework.beans.factory.annotation.Autowired; |
7 | 8 | import org.springframework.stereotype.Controller; |
... | ... | @@ -22,6 +23,9 @@ |
22 | 23 | @Autowired |
23 | 24 | private IlpFyFmService lpfyFmService; |
24 | 25 | |
26 | + @Autowired | |
27 | + private InhFyFmService lnhFyFmService; | |
28 | + | |
25 | 29 | @RequestMapping(method = RequestMethod.POST, value = "/saveFmData") |
26 | 30 | @ResponseBody |
27 | 31 | public String saveFmData(@RequestBody List<Fm> models, |
28 | 32 | |
... | ... | @@ -29,7 +33,10 @@ |
29 | 33 | |
30 | 34 | if("17".equals(models.get(0).getVision())){ |
31 | 35 | lpfyFmService.queryFmPatient(models); |
36 | + }if("41".equals(models.get(0).getVision())){ | |
37 | + lnhFyFmService.queryFmPatient(models); | |
32 | 38 | } |
39 | + | |
33 | 40 | |
34 | 41 | |
35 | 42 | return null; |