Commit 163a86edd883ea531dd1b3baee18747938f1240a

Authored by jiangjiazhi
1 parent e20d7c640f

增加soureceid

Showing 2 changed files with 340 additions and 99 deletions

platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/ConvertHelper.java View file @ 163a86e
1 1 package com.lyms.platform.job.index.restore.data;
2 2  
3 3 import java.lang.reflect.Field;
4   -import java.util.ArrayList;
5   -import java.util.Date;
6   -import java.util.HashMap;
7   -import java.util.Iterator;
8   -import java.util.List;
9   -import java.util.Map;
10   -import java.util.Properties;
11   -import java.util.Set;
  4 +import java.util.*;
12 5  
  6 +import com.lyms.platform.common.enums.FetalEnums;
  7 +import com.lyms.platform.common.enums.FetalPositionEnums;
  8 +import com.lyms.platform.common.enums.JoinEnums;
  9 +import com.lyms.platform.job.index.model.Placenta;
13 10 import org.apache.commons.collections.CollectionUtils;
14 11 import org.springframework.core.io.ClassPathResource;
15 12 import org.springframework.core.io.support.EncodedResource;
16 13  
17 14  
18 15  
19 16  
... ... @@ -32,17 +29,19 @@
32 29 /**
33 30 * Created by Administrator on 2016/9/29 0029.
34 31 */
35   -public class ConvertHelper {
  32 +public class ConvertHelper
  33 +{
36 34  
37   - private static String AUTO_WORKER = "system-worker";
  35 + private static String AUTO_WORKER = "system-worker";
38 36  
39   - private static final String YES_OR_NO = "yesOrNo";
  37 + private static final String YES_OR_NO = "yesOrNo";
40 38  
41 39 private static java.util.Map<Class, List<String>> cachedField = new HashMap<>();
42 40  
43   - private static final Map<String, String> content = new HashMap<>();
  41 + private static final Map<String, String> content = new HashMap<>();
44 42  
45   - static {
  43 + static
  44 + {
46 45 content.put("ycxjbs", "遗传性疾病史");
47 46 content.put("jsjbs", "精神疾病史");
48 47 content.put("xtjx", "先天畸形");
49 48  
50 49  
51 50  
... ... @@ -93,18 +92,22 @@
93 92  
94 93 }
95 94  
96   - private static Properties properties = new Properties();
  95 + private static Properties properties = new Properties();
97 96  
98   - static {
99   - try {
  97 + static
  98 + {
  99 + try
  100 + {
100 101 properties = PropertiesLoaderUtils.loadProperties(new EncodedResource(new ClassPathResource(
101   - "lable.properties"), "utf8"));
102   - } catch (Exception e) {
  102 + "lable.properties"), "utf8"));
  103 + } catch (Exception e)
  104 + {
103 105 e.printStackTrace();
104 106 }
105 107 }
106 108  
107   - public static com.lymsh.mommybaby.maindata.model.Patients convertToMamiBaby(BabyModel babyModel) {
  109 + public static com.lymsh.mommybaby.maindata.model.Patients convertToMamiBaby(BabyModel babyModel)
  110 + {
108 111 com.lymsh.mommybaby.maindata.model.Patients patients = new com.lymsh.mommybaby.maindata.model.Patients();
109 112 //新生儿类型为2
110 113 patients.setType(2);
... ... @@ -123,7 +126,8 @@
123 126 return patients;
124 127 }
125 128  
126   - public static Reports convertToBabyCheck(BabyCheckModel babyCheckModel, BabyModel babyModel) {
  129 + public static Reports convertToBabyCheck(BabyCheckModel babyCheckModel, BabyModel babyModel)
  130 + {
127 131 Reports reports = new Reports();
128 132 reports.setYn(babyCheckModel.getYn());
129 133 reports.setType(2);
... ... @@ -137,7 +141,8 @@
137 141 * @param patients
138 142 * @return
139 143 */
140   - public static com.lymsh.mommybaby.maindata.model.Patients convertPatient(Patients patients) {
  144 + public static com.lymsh.mommybaby.maindata.model.Patients convertPatient(Patients patients)
  145 + {
141 146 com.lymsh.mommybaby.maindata.model.Patients localPatient = new com.lymsh.mommybaby.maindata.model.Patients();
142 147 localPatient.setDueDate(patients.getDueDate());
143 148 localPatient.setCreated(patients.getCreated());
... ... @@ -165,7 +170,8 @@
165 170 * @param users
166 171 * @return
167 172 */
168   - public static DoctorUsers convertUsers(com.lyms.platform.permission.model.Users users) {
  173 + public static DoctorUsers convertUsers(com.lyms.platform.permission.model.Users users)
  174 + {
169 175 DoctorUsers users1 = new DoctorUsers();
170 176 users1.setCreated(users.getCreated());
171 177 users1.setModified(users.getModified());
... ... @@ -188,7 +194,8 @@
188 194 * @param organization
189 195 * @return
190 196 */
191   - public static Hospitals convertHospital(Organization organization) {
  197 + public static Hospitals convertHospital(Organization organization)
  198 + {
192 199 Hospitals hospitals = new Hospitals();
193 200 hospitals.setCreated(organization.getCreated());
194 201 hospitals.setModified(organization.getModified());
... ... @@ -204,7 +211,8 @@
204 211 hospitals.setPublishName(AUTO_WORKER);
205 212 hospitals.setOnline(0);
206 213 //院内系统设置医院为试运行 正式运行的时候需要设置医院online
207   - if (null != organization.getStatus() && (0 == organization.getStatus() || 1 == organization.getStatus())) {
  214 + if (null != organization.getStatus() && (0 == organization.getStatus() || 1 == organization.getStatus()))
  215 + {
208 216 hospitals.setOnline(1);
209 217 }
210 218 return hospitals;
... ... @@ -216,7 +224,8 @@
216 224 * @param antExChuModel
217 225 * @return
218 226 */
219   - public static Reports convertAntExChu(AntExChuModel antExChuModel, Date lastMenses, Map map, String doctorUserName) {
  227 + public static Reports convertAntExChu(AntExChuModel antExChuModel, Date lastMenses, Map map, String doctorUserName)
  228 + {
220 229 Reports reports = new Reports();
221 230 //孕期类型
222 231 reports.setType(1);
... ... @@ -244,7 +253,8 @@
244 253 * @return
245 254 */
246 255 public static Reports convertAntExChu(AntenatalExaminationModel antExChuModel, Date lastMenses,
247   - Map<String, String> rhMap, String doctorUserName) {
  256 + Map<String, String> rhMap, String doctorUserName)
  257 + {
248 258 Reports reports = new Reports();
249 259 //孕期类型
250 260 reports.setType(1);
251 261  
252 262  
253 263  
254 264  
255 265  
256 266  
257 267  
... ... @@ -272,37 +282,46 @@
272 282 * @return
273 283 */
274 284 private static String convertAntExChuResult(AntExChuModel antExChuModel, Map<String, String> bgMap,
275   - String doctorUserName) {
  285 + String doctorUserName)
  286 + {
276 287 List list = new ArrayList();
277 288  
278 289 List<String> list2 = getField(antExChuModel);
279   - for (int i = 0; i < list2.size(); i++) {
  290 + for (int i = 0; i < list2.size(); i++)
  291 + {
280 292 Object obj = ReflectionUtils.getFieldValue(antExChuModel, list2.get(i));
281 293 String key = properties.getProperty(list2.get(i));
282 294 java.util.Map<String, Object> dataMap = new HashMap<>();
283   - if (null != key) {
284   - if ("血压".equals(key)) {
  295 + if (null != key)
  296 + {
  297 + if ("血压".equals(key))
  298 + {
285 299 Map map = JsonUtil.str2Obj(antExChuModel.getBp(), Map.class);
286   - if (null != map) {
  300 + if (null != map)
  301 + {
287 302 String ssy = null;
288 303 String szy = null;
289 304 Object obj1 = map.get("ssy");
290   - if (null != obj1) {
  305 + if (null != obj1)
  306 + {
291 307 //低压
292 308 ssy = map.get("ssy").toString();
293 309 }
294 310 obj1 = map.get("szy");
295   - if (null != obj1) {
  311 + if (null != obj1)
  312 + {
296 313 szy = map.get("szy").toString();
297 314 }
298 315 //高压
299   - if (StringUtils.isNotEmpty(szy)) {
  316 + if (StringUtils.isNotEmpty(szy))
  317 + {
300 318 java.util.Map<String, Object> dataMap1 = new HashMap<>();
301 319 dataMap1.put("k", "血压低压");
302 320 dataMap1.put("v", szy + "mmHg");
303 321 list.add(dataMap1);
304 322 }
305   - if (StringUtils.isNotEmpty(ssy)) {
  323 + if (StringUtils.isNotEmpty(ssy))
  324 + {
306 325 dataMap.put("k", "血压(高)");
307 326 dataMap.put("v", ssy + "mmHg");
308 327 list.add(dataMap);
309 328  
310 329  
311 330  
312 331  
313 332  
... ... @@ -311,22 +330,29 @@
311 330 continue;
312 331 }
313 332 //高危
314   - if ("高危因素".equals(key)) {
  333 + if ("高危因素".equals(key))
  334 + {
315 335 List map = JsonUtil.toList(antExChuModel.getHighrisk(), List.class);
316   - if (CollectionUtils.isNotEmpty(map)) {
  336 + if (CollectionUtils.isNotEmpty(map))
  337 + {
317 338 StringBuilder sb = new StringBuilder();
318   - for (Object str : map) {
319   - if (null != str && org.apache.commons.lang.StringUtils.isNotEmpty(str.toString())) {
  339 + for (Object str : map)
  340 + {
  341 + if (null != str && org.apache.commons.lang.StringUtils.isNotEmpty(str.toString()))
  342 + {
320 343 String val = bgMap.get(str.toString());
321   - if (org.apache.commons.lang.StringUtils.isNotEmpty(val)) {
  344 + if (org.apache.commons.lang.StringUtils.isNotEmpty(val))
  345 + {
322 346 sb.append(val).append("、");
323 347 }
324 348 }
325 349 }
326   - if (null != antExChuModel.getOtherHighRisk() && !"{}".equals(antExChuModel.getOtherHighRisk())) {
  350 + if (null != antExChuModel.getOtherHighRisk() && !"{}".equals(antExChuModel.getOtherHighRisk()))
  351 + {
327 352 Map map1 = JsonUtil.str2Obj(antExChuModel.getOtherHighRisk(), Map.class);
328 353 Object rh = map1.get("fxysu");
329   - if (null != rh && StringUtils.isNotEmpty(rh.toString())) {
  354 + if (null != rh && StringUtils.isNotEmpty(rh.toString()))
  355 + {
330 356 sb.append(rh);
331 357 }
332 358 }
333 359  
334 360  
335 361  
336 362  
337 363  
338 364  
... ... @@ -337,25 +363,103 @@
337 363 list.add(dataMap1);
338 364 }
339 365 continue;
  366 + } else if ("胎盘".equals(key))
  367 + {
  368 + if (CollectionUtils.isNotEmpty(antExChuModel.getPlacentas()))
  369 + {
  370 + String heartRateVal="",fetalPositionVal="",fetalPresentationVal="",joinVal="";
  371 + for (int j =0; j < antExChuModel.getPlacentas().size(); j++)
  372 + {
  373 + LinkedHashMap map = (LinkedHashMap) antExChuModel.getPlacentas().get(j);
  374 + //胎先露、胎方位、胎心率和衔接
  375 + String heartRate = String.valueOf(map.get("heartRate"));
  376 + String fetalPosition = String.valueOf(map.get("fetalPosition"));
  377 + String fetalPresentation =String.valueOf(map.get("fetalPresentation"));
  378 + String join = String.valueOf(map.get("join"));
  379 + if(StringUtils.isNotEmpty(heartRate)){
  380 + heartRateVal+=heartRate+"次/分"+",";
  381 + }
  382 + if(StringUtils.isNotEmpty(fetalPosition)){
  383 + fetalPositionVal+= FetalPositionEnums.getTitle(fetalPosition)+",";
  384 + }
  385 + if(StringUtils.isNotEmpty(fetalPresentation)){
  386 + fetalPresentationVal+= FetalEnums.getTitle(fetalPresentation)+",";
  387 + }
  388 + if(StringUtils.isNotEmpty(join)){
  389 + joinVal+=JoinEnums.getTitle(join)+",";
  390 + }
  391 + }
  392 + if(heartRateVal.endsWith(",")){
  393 + heartRateVal=heartRateVal.substring(0,heartRateVal.length()-1);
  394 + }
  395 + if(fetalPositionVal.endsWith(",")){
  396 + fetalPositionVal=fetalPositionVal.substring(0,fetalPositionVal.length()-1);
  397 + }
  398 + if(fetalPresentationVal.endsWith(",")){
  399 + fetalPresentationVal=fetalPresentationVal.substring(0,fetalPresentationVal.length()-1);
  400 + }
  401 + if(joinVal.endsWith(",")){
  402 + joinVal=joinVal.substring(0,joinVal.length()-1);
  403 + }
  404 +
  405 + //胎心率
  406 + if(StringUtils.isNotEmpty(heartRateVal)){
  407 + java.util.Map<String, Object> dataMap1 = new HashMap<>();
  408 + dataMap1.put("k", "胎心率");
  409 + dataMap1.put("v", heartRateVal);
  410 + list.add(dataMap1);
  411 + }
  412 + //胎心率
  413 + if(StringUtils.isNotEmpty(fetalPositionVal))
  414 + {
  415 + java.util.Map<String, Object> dataMap2 = new HashMap<>();
  416 + dataMap2.put("k", "胎方位");
  417 + dataMap2.put("v", fetalPositionVal);
  418 + list.add(dataMap2);
  419 + }
  420 +
  421 + //胎先露
  422 + if(StringUtils.isNotEmpty(fetalPresentationVal))
  423 + {
  424 + java.util.Map<String, Object> dataMap3 = new HashMap<>();
  425 + dataMap3.put("k", "胎先露");
  426 + dataMap3.put("v", fetalPresentationVal);
  427 + list.add(dataMap3);
  428 + }
  429 + if(StringUtils.isNotEmpty(joinVal))
  430 + {
  431 + java.util.Map<String, Object> dataMap4 = new HashMap<>();
  432 + dataMap4.put("k", "衔接");
  433 + dataMap4.put("v", joinVal);
  434 + list.add(dataMap4);
  435 + }
  436 + }
  437 + continue;
340 438 }
341 439 dataMap.put("k", key);
342   - if ("产检医生".equals(key)) {
  440 + if ("产检医生".equals(key))
  441 + {
343 442 obj = doctorUserName;
344 443 dataMap.put("v", obj);
345 444 list.add(dataMap);
346 445 continue;
347 446 }
348   - if (obj instanceof Date) {
  447 + if (obj instanceof Date)
  448 + {
349 449 dataMap.put("v", DateUtil.getyyyy_MM_dd((Date) obj));
350   - } else {
  450 + } else
  451 + {
351 452 String str = getAntExChuValue(key, antExChuModel);
352   - if (null != str) {
  453 + if (null != str)
  454 + {
353 455 dataMap.put("v", str);
354   - } else {
  456 + } else
  457 + {
355 458 dataMap.put("v", obj);
356 459 }
357 460 }
358   - if (null != obj) {
  461 + if (null != obj)
  462 + {
359 463 list.add(dataMap);
360 464 }
361 465 }
362 466  
363 467  
364 468  
365 469  
366 470  
367 471  
368 472  
... ... @@ -364,37 +468,46 @@
364 468 }
365 469  
366 470 private static String convertAntExResult(AntenatalExaminationModel antExChuModel, Map<String, String> hrMap,
367   - String doctorUserName) {
  471 + String doctorUserName)
  472 + {
368 473 List list = new ArrayList();
369 474  
370 475 List<String> list2 = getField(antExChuModel);
371   - for (int i = 0; i < list2.size(); i++) {
  476 + for (int i = 0; i < list2.size(); i++)
  477 + {
372 478 Object obj = ReflectionUtils.getFieldValue(antExChuModel, list2.get(i));
373 479 String key = properties.getProperty(list2.get(i));
374 480 java.util.Map<String, Object> dataMap = new HashMap<>();
375   - if (null != key) {
376   - if ("血压".equals(key)) {
  481 + if (null != key)
  482 + {
  483 + if ("血压".equals(key))
  484 + {
377 485 Map map = JsonUtil.str2Obj(antExChuModel.getBp(), Map.class);
378   - if (null != map) {
  486 + if (null != map)
  487 + {
379 488  
380 489 String ssy = null;
381 490 String szy = null;
382 491 Object obj1 = map.get("ssy");
383   - if (null != obj1) {
  492 + if (null != obj1)
  493 + {
384 494 //低压
385 495 ssy = map.get("ssy").toString();
386 496 }
387 497 obj1 = map.get("szy");
388   - if (null != obj1) {
  498 + if (null != obj1)
  499 + {
389 500 szy = map.get("szy").toString();
390 501 }
391   - if (StringUtils.isNotEmpty(szy)) {
  502 + if (StringUtils.isNotEmpty(szy))
  503 + {
392 504 java.util.Map<String, Object> dataMap1 = new HashMap<>();
393 505 dataMap1.put("k", "血压(低压)");
394 506 dataMap1.put("v", szy + "mmHg");
395 507 list.add(dataMap1);
396 508 }
397   - if (StringUtils.isNotEmpty(ssy)) {
  509 + if (StringUtils.isNotEmpty(ssy))
  510 + {
398 511 dataMap.put("k", "高压");
399 512 dataMap.put("v", ssy + "mmHg");
400 513 list.add(dataMap);
401 514  
402 515  
403 516  
404 517  
405 518  
... ... @@ -403,22 +516,29 @@
403 516 continue;
404 517 }
405 518 //高危
406   - else if ("高危因素".equals(key)) {
  519 + else if ("高危因素".equals(key))
  520 + {
407 521 List map = JsonUtil.toList(antExChuModel.getRiskFactor(), List.class);
408   - if (CollectionUtils.isNotEmpty(map)) {
  522 + if (CollectionUtils.isNotEmpty(map))
  523 + {
409 524 StringBuilder sb = new StringBuilder();
410   - for (Object str : map) {
411   - if (org.apache.commons.lang.StringUtils.isNotEmpty(str.toString())) {
  525 + for (Object str : map)
  526 + {
  527 + if (null!=str&&org.apache.commons.lang.StringUtils.isNotEmpty(str.toString()))
  528 + {
412 529 String val = hrMap.get(str.toString());
413   - if (org.apache.commons.lang.StringUtils.isNotEmpty(val)) {
  530 + if (org.apache.commons.lang.StringUtils.isNotEmpty(val))
  531 + {
414 532 sb.append(val).append("、");
415 533 }
416 534 }
417 535 }
418   - if (null != antExChuModel.getOtherRisk() && !"{}".equals(antExChuModel.getOtherRisk())) {
  536 + if (null != antExChuModel.getOtherRisk() && !"{}".equals(antExChuModel.getOtherRisk()))
  537 + {
419 538 Map map1 = JsonUtil.str2Obj(antExChuModel.getOtherRisk(), Map.class);
420 539 Object rh = map1.get("fxysu");
421   - if (null != rh && StringUtils.isNotEmpty(rh.toString())) {
  540 + if (null != rh && StringUtils.isNotEmpty(rh.toString()))
  541 + {
422 542 sb.append(rh);
423 543 }
424 544 }
425 545  
426 546  
427 547  
428 548  
... ... @@ -429,17 +549,94 @@
429 549 list.add(dataMap1);
430 550 }
431 551 continue;
432   - } else if ("产检医生".equals(key)) {
  552 + } else if ("产检医生".equals(key))
  553 + {
433 554 obj = doctorUserName;
  555 + } else if ("胎盘".equals(key))
  556 + {
  557 + if (CollectionUtils.isNotEmpty(antExChuModel.getTireData()))
  558 + {
  559 + String heartRateVal="",fetalPositionVal="",fetalPresentationVal="",joinVal="";
  560 + for (int j =0; j < antExChuModel.getTireData().size(); j++)
  561 + {
  562 + LinkedHashMap map = (LinkedHashMap) antExChuModel.getTireData().get(j);
  563 + //胎先露、胎方位、胎心率和衔接
  564 + String heartRate = String.valueOf(map.get("heartRate"));
  565 + String fetalPosition = String.valueOf(map.get("fetalPosition"));
  566 + String fetalPresentation =String.valueOf(map.get("fetalPresentation"));
  567 + String join = String.valueOf(map.get("join"));
  568 + if(!"null".equals(heartRate) &&StringUtils.isNotEmpty(heartRate)){
  569 + heartRateVal+=heartRate+"次/分"+",";
  570 + }
  571 + if(!"null".equals(fetalPosition) &&StringUtils.isNotEmpty(fetalPosition)){
  572 + fetalPositionVal+= FetalPositionEnums.getTitle(fetalPosition)+",";
  573 + }
  574 + if(!"null".equals(fetalPresentation) &&StringUtils.isNotEmpty(fetalPresentation)){
  575 + fetalPresentationVal+= FetalEnums.getTitle(fetalPresentation)+",";
  576 + }
  577 + if(!"null".equals(join) &&StringUtils.isNotEmpty(join)){
  578 + joinVal+=JoinEnums.getTitle(join)+",";
  579 + }
  580 + }
  581 + if(heartRateVal.endsWith(",")){
  582 + heartRateVal=heartRateVal.substring(0,heartRateVal.length()-1);
  583 + }
  584 + if(fetalPositionVal.endsWith(",")){
  585 + fetalPositionVal=fetalPositionVal.substring(0,fetalPositionVal.length()-1);
  586 + }
  587 + if(fetalPresentationVal.endsWith(",")){
  588 + fetalPresentationVal=fetalPresentationVal.substring(0,fetalPresentationVal.length()-1);
  589 + }
  590 + if(joinVal.endsWith(",")){
  591 + joinVal=joinVal.substring(0,joinVal.length()-1);
  592 + }
  593 +
  594 +
  595 + //胎心率
  596 + if(StringUtils.isNotEmpty(heartRateVal)){
  597 + java.util.Map<String, Object> dataMap1 = new HashMap<>();
  598 + dataMap1.put("k", "胎心率");
  599 + dataMap1.put("v", heartRateVal);
  600 + list.add(dataMap1);
  601 + }
  602 + //胎心率
  603 + if(StringUtils.isNotEmpty(fetalPositionVal))
  604 + {
  605 + java.util.Map<String, Object> dataMap2 = new HashMap<>();
  606 + dataMap2.put("k", "胎方位");
  607 + dataMap2.put("v", fetalPositionVal);
  608 + list.add(dataMap2);
  609 + }
  610 +
  611 + //胎先露
  612 + if(StringUtils.isNotEmpty(fetalPresentationVal))
  613 + {
  614 + java.util.Map<String, Object> dataMap3 = new HashMap<>();
  615 + dataMap3.put("k", "胎先露");
  616 + dataMap3.put("v", fetalPresentationVal);
  617 + list.add(dataMap3);
  618 + }
  619 + if(StringUtils.isNotEmpty(joinVal))
  620 + {
  621 + java.util.Map<String, Object> dataMap4 = new HashMap<>();
  622 + dataMap4.put("k", "衔接");
  623 + dataMap4.put("v", joinVal);
  624 + list.add(dataMap4);
  625 + }
  626 + }
  627 + continue;
434 628 }
435 629  
436 630 dataMap.put("k", key);
437   - if (obj instanceof Date) {
  631 + if (obj instanceof Date)
  632 + {
438 633 dataMap.put("v", DateUtil.getyyyy_MM_dd((Date) obj));
439   - } else {
  634 + } else
  635 + {
440 636 dataMap.put("v", obj);
441 637 }
442   - if (null != obj) {
  638 + if (null != obj)
  639 + {
443 640 list.add(dataMap);
444 641 }
445 642 }
446 643  
447 644  
448 645  
449 646  
450 647  
451 648  
452 649  
453 650  
454 651  
... ... @@ -447,30 +644,40 @@
447 644 return JsonUtil.array2JsonString(list);
448 645 }
449 646  
450   - private static String getAntExChuValue(String key, AntExChuModel antExChuModel) {
  647 + private static String getAntExChuValue(String key, AntExChuModel antExChuModel)
  648 + {
451 649 StringBuilder sb = new StringBuilder();
452 650 Map<String, Object> map = null;
453   - if ("既往史".equals(key)) {
  651 + if ("既往史".equals(key))
  652 + {
454 653 map = JsonUtil.str2Obj(antExChuModel.getPastHistory(), Map.class);
455   - } else if ("家族史".equals(key)) {
  654 + } else if ("家族史".equals(key))
  655 + {
456 656 map = JsonUtil.str2Obj(antExChuModel.getFamilyHistory(), Map.class);
457   - } else if ("个人史".equals(key)) {
  657 + } else if ("个人史".equals(key))
  658 + {
458 659 map = JsonUtil.str2Obj(antExChuModel.getPersonalHistory(), Map.class);
459   - } else if ("疫苗接种史".equals(key)) {
  660 + } else if ("疫苗接种史".equals(key))
  661 + {
460 662 map = JsonUtil.str2Obj(antExChuModel.getYmjzHistory(), Map.class);
461   - } else if ("药物过敏史".equals(key)) {
  663 + } else if ("药物过敏史".equals(key))
  664 + {
462 665 map = JsonUtil.str2Obj(antExChuModel.getYwgmHistory(), Map.class);
463   - } else if ("妇科手术史".equals(key)) {
  666 + } else if ("妇科手术史".equals(key))
  667 + {
464 668 map = JsonUtil.str2Obj(antExChuModel.getFksxHistory(), Map.class);
465   - } else if ("叶酸服用".equals(key)) {
  669 + } else if ("叶酸服用".equals(key))
  670 + {
466 671 map = JsonUtil.str2Obj(antExChuModel.getYsfyHistory(), Map.class);
467   - } else if ("本次妊娠情况".equals(key)) {
  672 + } else if ("本次妊娠情况".equals(key))
  673 + {
468 674 map = JsonUtil.str2Obj(antExChuModel.getCestationInfo(), Map.class);
469 675 }
470 676 return replace(map, sb);
471 677 }
472 678  
473   - public static void main(String[] args) {
  679 + public static void main(String[] args)
  680 + {
474 681 AntExChuModel antExChuModel = new AntExChuModel();
475 682 antExChuModel.setFamilyHistory("{\"npx\":true,\"sm\":true,\"yesOrNo\":\"yes\"}");
476 683 antExChuModel.setPregnancyTimes(3);
477 684  
478 685  
479 686  
480 687  
481 688  
482 689  
483 690  
484 691  
485 692  
486 693  
487 694  
488 695  
... ... @@ -478,60 +685,90 @@
478 685 antExChuModel.setYsfyHistory("{\"yesOrNo\":\"yes\",\"yzq3\":true}");
479 686 antExChuModel.setBp("{\"ssy\":70,\"szy\":120}");
480 687 antExChuModel.setFuwei("11");
481   - System.out.print(convertAntExChu(antExChuModel, null, null, "").getResult());
  688 + System.out.println(convertAntExChu(antExChuModel, null, null, "").getResult());
  689 +
  690 +
  691 +
  692 + AntenatalExaminationModel antenatalExaminationModel = new AntenatalExaminationModel();
  693 + List<Placenta> list = new ArrayList<>();
  694 + Placenta placenta = new Placenta();
  695 + placenta.setFetalPosition(FetalPositionEnums.ONE1.getId());
  696 + placenta.setJoin(JoinEnums.O.getId());
  697 + placenta.setFetalPresentation(FetalEnums.A.getId());
  698 + placenta.setHeartRate(111.00);
  699 + list.add(placenta);
  700 + antenatalExaminationModel.setTireData(list);
  701 +
  702 + System.out.print(convertAntExChu(antenatalExaminationModel, null, null, "").getResult());
482 703 }
483 704  
484   - private static String replace(Map map, StringBuilder sb) {
485   - if (null == map) {
  705 + private static String replace(Map map, StringBuilder sb)
  706 + {
  707 + if (null == map)
  708 + {
486 709 return null;
487 710 }
488   - if ("yes".equals(map.get(YES_OR_NO))) {
  711 + if ("yes".equals(map.get(YES_OR_NO)))
  712 + {
489 713 Set<Map.Entry<String, Object>> m = map.entrySet();
490 714 Iterator<Map.Entry<String, Object>> it = m.iterator();
491   - while (it.hasNext()) {
  715 + while (it.hasNext())
  716 + {
492 717 Map.Entry<String, Object> ma = it.next();
493   - if (ma.getKey().equals(YES_OR_NO)) {
  718 + if (ma.getKey().equals(YES_OR_NO))
  719 + {
494 720 continue;
495 721 }
496   - if ("true".equals(ma.getValue() + "")) {
497   - if (content.containsKey(ma.getKey())) {
  722 + if ("true".equals(ma.getValue() + ""))
  723 + {
  724 + if (content.containsKey(ma.getKey()))
  725 + {
498 726 sb.append(content.get(ma.getKey())).append(',');
499 727 }
500 728 }
501 729 }
502 730  
503   - if (map.containsKey("qtText")) {
  731 + if (map.containsKey("qtText"))
  732 + {
504 733 sb.append(map.get("qtText"));
505 734 }
506   - if (sb.toString().endsWith(",")) {
  735 + if (sb.toString().endsWith(","))
  736 + {
507 737 return sb.substring(0, sb.length() - 1);
508 738 }
509   - } else if ("no".equals(map.get(YES_OR_NO))) {
  739 + } else if ("no".equals(map.get(YES_OR_NO)))
  740 + {
510 741 sb.append("无");
511 742 }
512 743 return sb.toString();
513 744 }
514 745  
515   - private static List<String> getField(AntExChuModel antExChuModel) {
516   - if (cachedField.containsKey(antExChuModel.getClass())) {
  746 + private static List<String> getField(AntExChuModel antExChuModel)
  747 + {
  748 + if (cachedField.containsKey(antExChuModel.getClass()))
  749 + {
517 750 return cachedField.get(antExChuModel.getClass());
518 751 }
519 752 Field[] field = AntExChuModel.class.getDeclaredFields();
520 753 List<String> fieldName = new ArrayList<>();
521   - for (Field f : field) {
  754 + for (Field f : field)
  755 + {
522 756 fieldName.add(f.getName());
523 757 }
524 758 cachedField.put(antExChuModel.getClass(), fieldName);
525 759 return fieldName;
526 760 }
527 761  
528   - private static List<String> getField(AntenatalExaminationModel antExChuModel) {
529   - if (cachedField.containsKey(antExChuModel.getClass())) {
  762 + private static List<String> getField(AntenatalExaminationModel antExChuModel)
  763 + {
  764 + if (cachedField.containsKey(antExChuModel.getClass()))
  765 + {
530 766 return cachedField.get(antExChuModel.getClass());
531 767 }
532 768 Field[] field = AntenatalExaminationModel.class.getDeclaredFields();
533 769 List<String> fieldName = new ArrayList<>();
534   - for (Field f : field) {
  770 + for (Field f : field)
  771 + {
535 772 fieldName.add(f.getName());
536 773 }
537 774 cachedField.put(antExChuModel.getClass(), fieldName);
platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/SyncDataWork.java View file @ 163a86e
... ... @@ -531,9 +531,10 @@
531 531 }
532 532 String doctorUserName = null;
533 533 List<AntExChuModel> antExChuModel = antenatalExaminationService.queryAntExChu(antExChuQuery);
534   -
  534 + logger.info("query antexc" + patients.getId() + ". list size:"+antExChuModel.size());
535 535 if (CollectionUtils.isNotEmpty(antExChuModel))
536 536 {
  537 + logger.info("query antexc" + patients.getId() + ". list size:"+antExChuModel);
537 538 handLastRisk(patients, mamiPatient.getId());
538 539  
539 540 doctorUserName = null;
540 541  
... ... @@ -554,8 +555,9 @@
554 555  
555 556 Reports reports = ConvertHelper.convertAntExChu(antExChuModel1, patients.getLastMenses(),
556 557 bgHighRisk, doctorUserName);
557   -
  558 + logger.info("query handleDoctorMemeber" + patients.getId() + ". antex chu:"+antExChuModel1.getId());
558 559 handleDoctorMemeber(reports, antExChuModel1.getProdDoctor(), mamiPatient, patients, stopWatch3);
  560 + logger.info("query handleDoctorMemeber" + patients.getId() + ". antex chu:" + antExChuModel1.getId());
559 561 }
560 562 }
561 563 }
... ... @@ -650,7 +652,7 @@
650 652 List<AntenatalExaminationModel> antList = antenatalExaminationService
651 653 .queryAntenatalExamination(antExQuery.convertToQuery());
652 654 String doctorUserName = null;
653   - logger.info("query antex" + patients.getId() + ".");
  655 + logger.info("query antex" + patients.getId() + ". list size:"+antList.size());
654 656 if (CollectionUtils.isNotEmpty(antList))
655 657 {
656 658 for (AntenatalExaminationModel ant : antList)
... ... @@ -953,6 +955,7 @@
953 955  
954 956 private void handLastRisk(com.lyms.platform.pojo.Patients patients, Integer patientId)
955 957 {
  958 + logger.info("start handLastRisk " + patients.getId() + ".");
956 959  
957 960 StringBuilder sb = new StringBuilder();
958 961 List<RiskColorEnum> data = new ArrayList<>();
... ... @@ -1019,6 +1022,7 @@
1019 1022 risks.setCrisis(crisis);
1020 1023 risks.setPublishId(0);
1021 1024 risks.setPublishName("system-worker");
  1025 + logger.info("addRisks " + patients.getId() + ".");
1022 1026 risksService.addRisks(risks);
1023 1027  
1024 1028 if (null != patientId)
... ... @@ -1030,7 +1034,7 @@
1030 1034 {
1031 1035 ERROR_LOGGER.error("convert high risk error.", e);
1032 1036 }
1033   -
  1037 + logger.info("end handLastRisk " + patients.getId() + ".");
1034 1038 }
1035 1039  
1036 1040 public static void main(String[] args)