Commit df4f2cb2dd225f27e802c9a6c899c04cc6b69a30

Authored by wtt
1 parent b0decc20bc

承德分娩导出

Showing 5 changed files with 178 additions and 9 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java View file @ df4f2cb
... ... @@ -271,7 +271,14 @@
271 271 childbirthManagerRequest.setInitQuery(hsColum);
272 272 childbirthManagerRequest.setInitQueryMap(childbirthManagerRequest.getInitQueryMapHs());
273 273 }
274   -
  274 + if (o != null && "9".equals(o.getCityId()))
  275 + {
  276 + String cdColum = "dueDate,fmHospital,name,age,cardNo,buildWeek,czWeek,hivkt," +
  277 + "syjg,ygbmky,dueWeek,deliveryMode,maternalInfo,tireNumber,livingNumber," +
  278 + "deliverDoctor,phone,rhloseBloodL,gcStatus,recordsNum";
  279 + childbirthManagerRequest.setInitQuery(cdColum);
  280 + childbirthManagerRequest.setInitQueryMap(childbirthManagerRequest.getInitQueryMapCd());
  281 + }
275 282 Map<String, String> query;
276 283 if (StringUtils.isNotEmpty(childbirthManagerRequest.getInitQuery())) {
277 284 // 自定义查询
278 285  
279 286  
... ... @@ -303,14 +310,51 @@
303 310 @SuppressWarnings("unchecked")
304 311 List<ChildbirthManagerQueryModel> childbirthManagerQueryModelList = matDeliverFacade.childbirthManager(childbirthManagerRequest).getData();
305 312 List<Map<String, Object>> list = new ArrayList<>();
306   - for (ChildbirthManagerQueryModel childbirthManagerQueryModel : childbirthManagerQueryModelList) {
307   - Map<String, Object> map = BeanUtils.objectToObjectMap(childbirthManagerQueryModel);
308   - for (String key : map.keySet()) {
309   - if (StringUtils.isEmpty(String.valueOf(map.get(key)))) {
310   - map.put(key, "-");
  313 +
  314 + if (o != null && "9".equals(o.getCityId()))
  315 + {
  316 + for (ChildbirthManagerQueryModel childbirthManagerQueryModel : childbirthManagerQueryModelList) {
  317 +
  318 + if(StringUtils.isNotEmpty(childbirthManagerQueryModel.getHivkt())){
  319 + if("yin".equals(childbirthManagerQueryModel.getHivkt())){
  320 + childbirthManagerQueryModel.setHivkt("-");
  321 + }else if("yang".equals(childbirthManagerQueryModel.getHivkt())){
  322 + childbirthManagerQueryModel.setHivkt("+");
  323 + }
311 324 }
  325 + if(StringUtils.isNotEmpty(childbirthManagerQueryModel.getSyjg())){
  326 + if("yin".equals(childbirthManagerQueryModel.getSyjg())){
  327 + childbirthManagerQueryModel.setSyjg("-");
  328 + }else if("yang".equals(childbirthManagerQueryModel.getSyjg())){
  329 + childbirthManagerQueryModel.setSyjg("+");
  330 + }
  331 + }
  332 + if(StringUtils.isNotEmpty(childbirthManagerQueryModel.getYgbmky())){
  333 + if("yin".equals(childbirthManagerQueryModel.getYgbmky())){
  334 + childbirthManagerQueryModel.setYgbmky("-");
  335 + }else if("yang".equals(childbirthManagerQueryModel.getYgbmky())){
  336 + childbirthManagerQueryModel.setYgbmky("+");
  337 + }
  338 + }
  339 + Map<String, Object> map = BeanUtils.objectToObjectMap(childbirthManagerQueryModel);
  340 + for (String key : map.keySet()) {
  341 + if (StringUtils.isEmpty(String.valueOf(map.get(key)))) {
  342 + map.put(key, "");
  343 + continue;
  344 + }
  345 + }
  346 + list.add(map);
312 347 }
313   - list.add(map);
  348 + }else {
  349 + for (ChildbirthManagerQueryModel childbirthManagerQueryModel : childbirthManagerQueryModelList) {
  350 + Map<String, Object> map = BeanUtils.objectToObjectMap(childbirthManagerQueryModel);
  351 + for (String key : map.keySet()) {
  352 + if (StringUtils.isEmpty(String.valueOf(map.get(key)))) {
  353 + map.put(key, "-");
  354 + }
  355 + }
  356 + list.add(map);
  357 + }
314 358 }
315 359 Map<String, String> header = new LinkedHashMap<>();
316 360 Map<String, String> temp = childbirthManagerRequest.getInitQueryMap();
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java View file @ df4f2cb
... ... @@ -109,6 +109,9 @@
109 109 @Autowired
110 110 private UsersService usersService;
111 111 @Autowired
  112 + private AntenatalExaminationService antExService;
  113 +
  114 + @Autowired
112 115 private StopPregnancyService stopPregnancyService;
113 116  
114 117 @Autowired
... ... @@ -2657,7 +2660,7 @@
2657 2660 }
2658 2661 List <MaternalDeliverModel> mlist = maternalDeliverModelList.subList(i, end);
2659 2662 Callable c = new MaterDeliverWorker(organizationService, usersService,
2660   - babyService, basicConfigService, childbirthManagerRequest.getInitQuery(),
  2663 + babyService,antExService, basicConfigService, childbirthManagerRequest.getInitQuery(),
2661 2664 mlist, patientsMap, postpartumRecordsService, recordsService, childbirthManagerRequest.getShowDetail());
2662 2665 Future f = commonThreadPool.submit(c);
2663 2666 if (f != null) {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ChildbirthManagerRequest.java View file @ df4f2cb
... ... @@ -220,6 +220,7 @@
220 220  
221 221 private Map<String, String> initQueryMap;
222 222 private Map<String, String> initQueryMapHs;
  223 + private Map<String, String> initQueryMapCd;
223 224  
224 225 private Map<String, String> normalQueryMap;
225 226  
... ... @@ -433,6 +434,14 @@
433 434 return areaQueryMap;
434 435 }
435 436  
  437 + public Map <String, String> getInitQueryMapCd() {
  438 + return initQueryMapCd;
  439 + }
  440 +
  441 + public void setInitQueryMapCd(Map <String, String> initQueryMapCd) {
  442 + this.initQueryMapCd = initQueryMapCd;
  443 + }
  444 +
436 445 public void setAreaQueryMap(Map<String, String> areaQueryMap) {
437 446 this.areaQueryMap = areaQueryMap;
438 447 }
439 448  
... ... @@ -499,8 +508,34 @@
499 508 initQueryMap.put("maternalDeliverId", "");
500 509 initQueryMap.put("patientId", "");
501 510 initQueryMap.put("pid", "");
  511 + //承德导出
  512 + Map<String, String> initQueryMapCd = new LinkedHashMap<>();
  513 + initQueryMapCd.put("dueDate", "分娩日期");
  514 + initQueryMapCd.put("fmHospital", "分娩单位");
  515 + initQueryMapCd.put("name", "姓名");
  516 + initQueryMapCd.put("age", "年龄");
  517 + initQueryMapCd.put("cardNo", "证件号");
  518 + initQueryMapCd.put("buildWeek", "建档孕周");
  519 + initQueryMapCd.put("czWeek", "初诊孕周");
  520 + initQueryMapCd.put("hivkt", "艾滋病检测结果");
  521 + initQueryMapCd.put("syjg", "梅毒检测结果");
  522 + initQueryMapCd.put("ygbmky", "乙肝检测结果");
  523 + initQueryMapCd.put("dueWeek", "分娩孕周");
  524 + initQueryMapCd.put("deliveryMode", "分娩方式");
  525 + initQueryMapCd.put("maternalInfo", "产妇情况");
  526 + initQueryMapCd.put("tireNumber", "胎数");
  527 + initQueryMapCd.put("livingNumber", "活产数");
  528 + initQueryMapCd.put("deliverDoctor", "接生医生");
  529 + initQueryMapCd.put("phone", "联系方式");
  530 + initQueryMapCd.put("rhloseBloodL", "产后24小时内失血量");
  531 +// initQueryMapCd.put("apgarScorePf1", "Apgar1分钟");
  532 +// initQueryMapCd.put("apgarScorePf5", "Apgar5分钟");
  533 +// initQueryMapCd.put("apgarScorePf10", "Apgar10分钟");
  534 + initQueryMapCd.put("gcStatus", "产后观察");
  535 + initQueryMapCd.put("recordsNum", "记录条数");
502 536  
503 537  
  538 +
504 539 //衡水导出
505 540 Map<String, String> initQueryMapHs = new LinkedHashMap<>();
506 541 initQueryMapHs.put("vcCardNo", "卡号");
507 542  
... ... @@ -605,9 +640,12 @@
605 640 areaQueryMap.put("maternalDeliverId", "");
606 641 areaQueryMap.put("patientId", "");
607 642 areaQueryMap.put("pid", "");
  643 +
  644 +
608 645 this.initQueryMap = initQueryMap;
609 646 this.initQueryMapHs = initQueryMapHs;
610 647 this.normalQueryMap = normalQueryMap;
  648 + this.initQueryMapCd = initQueryMapCd;
611 649 this.areaQueryMap = areaQueryMap;
612 650 }
613 651 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/ChildbirthManagerQueryModel.java View file @ df4f2cb
... ... @@ -11,6 +11,18 @@
11 11 */
12 12 public class ChildbirthManagerQueryModel {
13 13  
  14 + /*承德定制*/
  15 + //初诊孕周
  16 + private String czWeek;
  17 + // 艾滋病检测结果
  18 + private String hivkt;
  19 + // 梅毒检测结果
  20 + private String syjg;
  21 + // 乙肝检测结果
  22 + private String ygbmky;
  23 +
  24 +
  25 +
14 26 private String maternalDeliverId;
15 27  
16 28 private String patientId;
... ... @@ -1094,6 +1106,38 @@
1094 1106  
1095 1107 public void setBuildWeek(String buildWeek) {
1096 1108 this.buildWeek = buildWeek;
  1109 + }
  1110 +
  1111 + public String getCzWeek() {
  1112 + return czWeek;
  1113 + }
  1114 +
  1115 + public void setCzWeek(String czWeek) {
  1116 + this.czWeek = czWeek;
  1117 + }
  1118 +
  1119 + public String getHivkt() {
  1120 + return hivkt;
  1121 + }
  1122 +
  1123 + public void setHivkt(String hivkt) {
  1124 + this.hivkt = hivkt;
  1125 + }
  1126 +
  1127 + public String getSyjg() {
  1128 + return syjg;
  1129 + }
  1130 +
  1131 + public void setSyjg(String syjg) {
  1132 + this.syjg = syjg;
  1133 + }
  1134 +
  1135 + public String getYgbmky() {
  1136 + return ygbmky;
  1137 + }
  1138 +
  1139 + public void setYgbmky(String ygbmky) {
  1140 + this.ygbmky = ygbmky;
1097 1141 }
1098 1142 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/MaterDeliverWorker.java View file @ df4f2cb
... ... @@ -9,6 +9,7 @@
9 9 import com.lyms.platform.permission.service.OrganizationService;
10 10 import com.lyms.platform.permission.service.UsersService;
11 11 import com.lyms.platform.pojo.*;
  12 +import com.lyms.platform.query.AntExChuQuery;
12 13 import com.lyms.platform.query.BabyModelQuery;
13 14 import com.lyms.platform.query.PostpartumRecordsQuery;
14 15 import com.lyms.platform.query.RecordsQuery;
... ... @@ -34,6 +35,7 @@
34 35 private OrganizationService organizationService;
35 36 private UsersService usersService;
36 37 private BabyService babyService;
  38 + private AntenatalExaminationService antExService;
37 39 private BasicConfigService basicConfigService;
38 40 private String initQuery;
39 41 private List<MaternalDeliverModel> maternalDeliverModelList;
... ... @@ -43,7 +45,7 @@
43 45 private int showDetail;
44 46  
45 47 public MaterDeliverWorker(OrganizationService organizationService,UsersService usersService,
46   - BabyService babyService,BasicConfigService basicConfigService,String initQuery,
  48 + BabyService babyService,AntenatalExaminationService antExService,BasicConfigService basicConfigService,String initQuery,
47 49 List<MaternalDeliverModel> maternalDeliverModelList,Map<String, Patients> patientsMap,
48 50 PostpartumRecordsService postpartumRecordsService,RecordsService recordsService,int showDetail) {
49 51 this.maternalDeliverModelList = maternalDeliverModelList;
... ... @@ -51,6 +53,7 @@
51 53 this.organizationService = organizationService;
52 54 this.usersService = usersService;
53 55 this.babyService = babyService;
  56 + this.antExService = antExService;
54 57 this.initQuery = initQuery;
55 58 this.basicConfigService = basicConfigService;
56 59 this.postpartumRecordsService = postpartumRecordsService;
... ... @@ -74,6 +77,43 @@
74 77 BeanUtils.copy(maternalDeliverModel, childbirthManagerQueryModel);
75 78 }
76 79 BeanUtils.copy(patients, childbirthManagerQueryModel);
  80 + // 承德定制使用
  81 + if(antExService != null && initQuery.contains("fmHospital") && initQuery.contains("buildWeek")
  82 + && initQuery.contains("czWeek") && initQuery.contains("hivkt")
  83 + && initQuery.contains("syjg") && initQuery.contains("ygbmky")){
  84 + AntExChuQuery antExChuQuery = new AntExChuQuery();
  85 + antExChuQuery.setYn(YnEnums.YES.getId());
  86 + antExChuQuery.setParentId(patients.getId());
  87 + List<AntExChuModel> antExChuModels = antExService.queryAntExChu(antExChuQuery);//初诊记录
  88 + if(CollectionUtils.isNotEmpty(antExChuModels)){
  89 + AntExChuModel antExChuModel = antExChuModels.get(0);
  90 + if (antExChuModel !=null) {
  91 + String czWeek = "";
  92 + try {
  93 + if (antExChuModel.getCreated().getTime() - patients.getDueDate().getTime() > 0 && patients.getBuildType() == 2) {
  94 + czWeek = "已分娩";
  95 + } else {
  96 + int days = DateUtil.daysBetween(patients.getLastMenses(), antExChuModel.getCreated());
  97 + if (days > 7 * 42 - 1) {
  98 + czWeek = "已分娩";
  99 + } else {
  100 + String week = (days / 7) + "";
  101 + int day = (days % 7);
  102 + czWeek = "孕" + week + "周" + (day > 0 ? "+" + day + "天" : "");
  103 + }
  104 + }
  105 + } catch (Exception e) {
  106 + // 什么都不干
  107 + }
  108 + childbirthManagerQueryModel.setCzWeek(czWeek);//初诊孕周
  109 + childbirthManagerQueryModel.setHivkt(antExChuModel.getHivkt()); // 艾滋病检测结果
  110 + childbirthManagerQueryModel.setSyjg(antExChuModel.getSyjg()); // 梅毒检测结果
  111 + childbirthManagerQueryModel.setYgbmky(antExChuModel.getYgbmky()); // 乙肝检测结果 (乙肝表面抗原)
  112 + }
  113 +
  114 + }
  115 +
  116 + }
77 117  
78 118 if ("2100001635".equals(patients.getHospitalId()))
79 119 {