Commit 84ccd86ce028f3f75d103fd348674f16539ee5de

Authored by shiyang
1 parent f634234fda

民生工程数据接口-新生儿信息(从)C401

Showing 1 changed file with 213 additions and 121 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LivelihoodProjectsFacade.java View file @ 84ccd86
... ... @@ -17,6 +17,7 @@
17 17 import com.lyms.platform.operate.web.utils.CollectionUtils;
18 18 import com.lyms.platform.operate.web.utils.CommonsHelper;
19 19 import com.lyms.platform.permission.dao.master.CouponMapper;
  20 +import com.lyms.platform.permission.model.Organization;
20 21 import com.lyms.platform.permission.model.Users;
21 22 import com.lyms.platform.permission.service.OrganizationService;
22 23 import com.lyms.platform.permission.service.UsersService;
23 24  
24 25  
... ... @@ -84,11 +85,11 @@
84 85 try {
85 86 Map<String, Object> map = new HashMap<>();
86 87 //id
87   - map.put("id",model.getId());
  88 + map.put("id",StringUtils.isNotEmpty(model.getId())?model.getId():"/");
88 89 //档案编号
89   - map.put("file_number","/");
  90 + map.put("file_number",null);
90 91 //纸质档案编号
91   - map.put("file_number_paper","/");
  92 + map.put("file_number_paper",null);
92 93 //证件类型(lyms_basicconfig表中查"parentId": "c914bb2e-1825-4036-8a41-fe617c90d405")
93 94 String credentials_type_code="99";
94 95 if(StringUtils.isNotEmpty(model.getCertificateTypeId())){
... ... @@ -109,7 +110,7 @@
109 110 }
110 111 map.put("credentials_type_code",credentials_type_code);
111 112 //其他身份证件名称
112   - map.put("other_credentials_type","/");
  113 + map.put("other_credentials_type",null);
113 114 //证件号码
114 115 map.put("credentials_number",StringUtils.isNotEmpty(model.getCertificateNum())?model.getCertificateNum():"/");
115 116 //出生日期
116 117  
117 118  
118 119  
119 120  
120 121  
121 122  
... ... @@ -129,26 +130,26 @@
129 130 //姓名
130 131 map.put("name",StringUtils.isNotEmpty(model.getUsername())?model.getUsername():"/");
131 132 //姓名简拼
132   - map.put("en_name","/");
  133 + map.put("en_name",null);
133 134 //所属民族
134 135 String nation_code= CdGwNationEnums.getId(getBasicConfig(model.getNationId()));
135 136 map.put("nation_code",StringUtils.isNotEmpty(nation_code)?nation_code:"99");
136 137 //性别
137 138 map.put("gender_code","2");
138 139 //工作单位
139   - map.put("work_unit",StringUtils.isNotEmpty(model.getWorkUnit())?model.getWorkUnit():"/");
  140 + map.put("work_unit",StringUtils.isNotEmpty(model.getWorkUnit())?model.getWorkUnit():null);
140 141 //固定电话
141   - map.put("tel","/");
  142 + map.put("tel",null);
142 143 //手机号
143 144 map.put("phone",StringUtils.isNotEmpty(model.getPhone())?model.getPhone():"/");
144 145 //联系人姓名
145   - map.put("contact_name","/");
  146 + map.put("contact_name",null);
146 147 //联系人电话
147   - map.put("contact_phone","/");
  148 + map.put("contact_phone",null);
148 149 //是否常驻
149   - map.put("is_permanent_code","/");
  150 + map.put("is_permanent_code",null);
150 151 //流动情况
151   - map.put("permanent_type_code","/");
  152 + map.put("permanent_type_code",null);
152 153  
153 154 //户籍类型(lyms_basicconfig表中查"parentId": "57624ba30cf23d4631523e9d")
154 155 String address_type_code="2";
155 156  
156 157  
157 158  
158 159  
... ... @@ -166,15 +167,15 @@
166 167 }
167 168 map.put("census_register_type_code",address_type_code);
168 169 //居住类型
169   - map.put("address_type_code","/");
  170 + map.put("address_type_code",null);
170 171 //户籍区划编码
171   - map.put("residence_district_id","/");
  172 + map.put("residence_district_id",null);
172 173 //户籍地址区划详情
173   - map.put("residence_district_detail","/");
  174 + map.put("residence_district_detail",null);
174 175 //户籍地址
175   - map.put("residence_address","/");
  176 + map.put("residence_address",null);
176 177 //身份证住址
177   - map.put("id_card_address","/");
  178 + map.put("id_card_address",null);
178 179 //年龄
179 180 Integer age=model.getAge();
180 181 if(null==model.getAge()){
181 182  
... ... @@ -187,9 +188,9 @@
187 188 //身高(cm)系统中不能获取 没有就传最小取值
188 189 map.put("height",20);
189 190 //血型
190   - map.put("blood_type_code","/");
  191 + map.put("blood_type_code",null);
191 192 //RH阴性
192   - map.put("blood_type_rh_code","/");
  193 + map.put("blood_type_rh_code",null);
193 194 //文化程度(lyms_basicconfig表中查"parentId": "8046934b-ebe8-4037-98b6-a9ec47996700")
194 195 String edu_attainment_code="10";
195 196 if(StringUtils.isNotEmpty(model.getLevelTypeId())){
... ... @@ -242,7 +243,7 @@
242 243 }
243 244 map.put("edu_attainment_code",edu_attainment_code);
244 245 //职业
245   - map.put("profession_code","/");
  246 + map.put("profession_code",null);
246 247 //婚姻状况(lyms_basicconfig表中查"parentId": "0ab3e86b-dfdb-47eb-a58b-a2f2d978b69f")
247 248 String marital_status_code="5";
248 249 if(StringUtils.isNotEmpty(model.getMarriageId())){
... ... @@ -259,7 +260,7 @@
259 260 }
260 261 map.put("marital_status_code",marital_status_code);
261 262 //责任医生
262   - map.put("doctor_name","/");
  263 + map.put("doctor_name",null);
263 264 //建档人
264 265 String create_doctor="/";
265 266 if(StringUtils.isNotEmpty(model.getBuildDoctor())) {
266 267  
267 268  
... ... @@ -272,11 +273,11 @@
272 273 //建档日期
273 274 map.put("this_date",null!=model.getBuildDay()?DateUtil.getyyyy_MM_dd_hms(model.getBuildDay()):DateUtil.getyyyy_MM_dd_hms(new Date()));
274 275 //出生人口编码
275   - map.put("childbirth_code","/");
  276 + map.put("childbirth_code",null);
276 277 //是否孕妇
277   - map.put("is_gravida","/");
  278 + map.put("is_gravida",null);
278 279 //是否产妇
279   - map.put("is_puerpera","/");
  280 + map.put("is_puerpera",null);
280 281 //系统录入时间
281 282 map.put("entering_time",null!=model.getCreated()?DateUtil.getyyyy_MM_dd_hms(model.getCreated()):DateUtil.getyyyy_MM_dd_hms(new Date()));
282 283 //所属机构编码
... ... @@ -293,7 +294,7 @@
293 294 }
294 295 map.put("district_nation_code", organizationService.getAreaCode(areaName));
295 296 //母亲姓名简拼
296   - map.put("mother_en_name","/");
  297 + map.put("mother_en_name",null);
297 298 //数据上传时间
298 299 // map.put("import_time",null);
299 300 //修改时间
300 301  
301 302  
302 303  
303 304  
... ... @@ -342,15 +343,15 @@
342 343 try {
343 344 Map<String,Object> map=new HashMap<>();
344 345 //id
345   - map.put("id",model.getId());
  346 + map.put("id",StringUtils.isNotEmpty(model.getId())?model.getId():"/");
346 347 //档案编号
347   - map.put("babyModels", "/");
  348 + map.put("babyModels", null);
348 349 //纸质档案编号
349   - map.put("file_number_paper", "/");
  350 + map.put("file_number_paper", null);
350 351 //证件类型
351   - map.put("credentials_type_code", "/");
  352 + map.put("credentials_type_code", null);
352 353 //其他证件名称
353   - map.put("other_credentials_type", "/");
  354 + map.put("other_credentials_type", null);
354 355 //证件号码
355 356 map.put("credentials_number", StringUtils.isNotEmpty(model.getCardNo())?model.getCardNo():"/");
356 357 //出生日期
... ... @@ -370,7 +371,7 @@
370 371 //姓名
371 372 map.put("name", StringUtils.isNotEmpty(model.getName())?model.getName():"/");
372 373 //姓名简拼
373   - map.put("en_name", "/");
  374 + map.put("en_name", null);
374 375 //所属民族
375 376 String nation_code= CdGwNationEnums.getId(getBasicConfig(model.getBnationId()));
376 377 map.put("nation_code",StringUtils.isNotEmpty(nation_code)?nation_code:"99");
377 378  
... ... @@ -386,9 +387,9 @@
386 387 }
387 388 map.put("gender_code", gender_code);
388 389 //接种条码
389   - map.put("vaccination_code", "/");
  390 + map.put("vaccination_code", null);
390 391 //固话
391   - map.put("tel", "/");
  392 + map.put("tel", null);
392 393 //手机号
393 394 String phone="/";
394 395 if(StringUtils.isNotEmpty(model.getMphone())){
395 396  
396 397  
397 398  
398 399  
399 400  
400 401  
... ... @@ -399,21 +400,21 @@
399 400 }
400 401 map.put("phone", phone);
401 402 //是否常住
402   - map.put("is_permanent_code", "/");
  403 + map.put("is_permanent_code", null);
403 404 //流动情况
404   - map.put("permanent_type_code", "/");
  405 + map.put("permanent_type_code", null);
405 406 //户籍类型 系统中不能获取,默认2
406 407 map.put("census_register_type_code", "2");
407 408 //居住类型
408   - map.put("address_type_code", "/");
  409 + map.put("address_type_code", null);
409 410 //户籍地址区划Id
410   - map.put("residence_district_id", "/");
  411 + map.put("residence_district_id", null);
411 412 //户籍地址区划详情
412   - map.put("residence_district_detail", "/");
  413 + map.put("residence_district_detail", null);
413 414 //户籍地址
414   - map.put("residence_address", "/");
  415 + map.put("residence_address", null);
415 416 //身份证住址
416   - map.put("id_card_address", "/");
  417 + map.put("id_card_address", null);
417 418 //年龄
418 419 Integer age=0;
419 420 if(null!=model.getBirth()){
420 421  
... ... @@ -438,9 +439,9 @@
438 439 }
439 440 map.put("weight", babyWeight);
440 441 //血型
441   - map.put("blood_type_code", "/");
  442 + map.put("blood_type_code", null);
442 443 //RH阴性
443   - map.put("blood_type_rh_code", "/");
  444 + map.put("blood_type_rh_code", null);
444 445 //责任医生
445 446 String create_doctor="/";
446 447 if(StringUtils.isNotEmpty(model.getBuildDoctor())) {
447 448  
... ... @@ -480,11 +481,11 @@
480 481 }
481 482 map.put("mother_credentials_type_code", mother_credentials_type_code);
482 483 //母亲其他证件名称
483   - map.put("mother_other_credentials_type", "/");
  484 + map.put("mother_other_credentials_type", null);
484 485 //母亲证件号码
485 486 map.put("mother_credentials_number", StringUtils.isNotEmpty(model.getMcertNo())?model.getMcertNo():"/");
486 487 //出生人口编码
487   - map.put("childbirth_code", "/");
  488 + map.put("childbirth_code", null);
488 489 //录入系统时间
489 490 map.put("entering_time", null!=model.getCreated()?DateUtil.getyyyy_MM_dd_hms(model.getCreated()):DateUtil.getyyyy_MM_dd_hms(new Date()));
490 491 //所属机构编码
... ... @@ -501,7 +502,7 @@
501 502 }
502 503 map.put("district_nation_code", organizationService.getAreaCode(areaName));
503 504 //母亲姓名简拼
504   - map.put("mother_en_name", "/");
  505 + map.put("mother_en_name", null);
505 506 //导入时间(存入数据)
506 507 // map.put("import_time", null);
507 508 //修改时间
... ... @@ -540,7 +541,7 @@
540 541 try {
541 542 Map<String, Object> map = new HashMap<>();
542 543 //id
543   - map.put("id",patients.getId());
  544 + map.put("id",StringUtils.isNotEmpty(patients.getId())?patients.getId():"/");
544 545 //档案状态
545 546 map.put("file_status_code", null!=patients.getType()?(patients.getType()==1?"1":"2"):"/");
546 547 //末次月经
547 548  
548 549  
... ... @@ -565,11 +566,11 @@
565 566 //结案时间
566 567 map.put("close_date", null);
567 568 //结案原因
568   - map.put("close_reason_code", "/");
  569 + map.put("close_reason_code", null);
569 570 //结案原因-其它
570   - map.put("close_reason_detailed", "/");
  571 + map.put("close_reason_detailed", null);
571 572 //母子保健卡号
572   - map.put("health_card_number", "/");
  573 + map.put("health_card_number", null);
573 574 //姓名
574 575 map.put("mother_name", StringUtils.isNotEmpty(patients.getUsername())?patients.getUsername():"/");
575 576 //年龄
... ... @@ -595,8 +596,14 @@
595 596 areaRegisterName=CommonsHelper.getName1(patients.getAreaRegisterId(), basicConfigService);
596 597 }
597 598 map.put("mother_now_address_id", organizationService.getAreaCode(areaRegisterName));
598   - //母亲现住址详情
599   - map.put("mother_now_address", CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getVillageRegister()+patients.getAddressRegister(), basicConfigService));
  599 + //母亲现住址详情(非必填)
  600 + String mother_now_address=null;
  601 + if(StringUtils.isNotEmpty(patients.getProvinceRegisterId()) && StringUtils.isNotEmpty(patients.getCityRegisterId()) &&
  602 + StringUtils.isNotEmpty(patients.getAreaRegisterId()) && StringUtils.isNotEmpty(patients.getStreetRegisterId()) &&
  603 + StringUtils.isNotEmpty(patients.getVillageRegister()) && StringUtils.isNotEmpty(patients.getAddressRegister())){
  604 + mother_now_address= CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getVillageRegister()+patients.getAddressRegister(), basicConfigService);
  605 + }
  606 + map.put("mother_now_address", mother_now_address);
600 607 //母亲户籍地址标识,母亲户籍地址区划编码(居委会/村)取 县/区 级的编码
601 608 String areaName="";
602 609 if(StringUtils.isNotEmpty(patients.getAreaId())){
... ... @@ -604,7 +611,7 @@
604 611 }
605 612 map.put("mother_address_id", organizationService.getAreaCode(areaName));
606 613 //母亲户籍地址--详情部分
607   - map.put("mother_address_detail", patients.getAddress());
  614 + map.put("mother_address_detail", StringUtils.isNotEmpty(patients.getAddress())?patients.getAddress():"/");
608 615 //母亲地址(出生证明母亲地址) 获取母亲 户籍地址,没有 就/
609 616 String mother_address="/";
610 617 if(StringUtils.isNotEmpty(patients.getProvinceId()) && StringUtils.isNotEmpty(patients.getCityId()) &&
... ... @@ -633,7 +640,7 @@
633 640 }
634 641 map.put("mother_credentials_type_code", mother_credentials_type_code);
635 642 //其他证件名称
636   - map.put("mother_other_credentials_type", "/");
  643 + map.put("mother_other_credentials_type", null);
637 644 //有效身份证件号码
638 645 map.put("mother_credentials_number", StringUtils.isNotEmpty(patients.getCardNo())?patients.getCardNo():"/");
639 646 //丈夫姓名
... ... @@ -662,7 +669,13 @@
662 669 }
663 670 map.put("father_now_address_id", organizationService.getAreaCode(hareaName));
664 671 //丈夫现住址详情
665   - map.put("father_now_address", CommonsHelper.getResidence(patients.getHprovinceId(), patients.getHcityId(), patients.getHareaId(), patients.getHstreetId(), patients.getHvillage()+patients.getHaddress(), basicConfigService));
  672 + String father_now_address=null;
  673 + if(StringUtils.isNotEmpty(patients.getHprovinceId()) && StringUtils.isNotEmpty(patients.getHcityId()) &&
  674 + StringUtils.isNotEmpty(patients.getHareaId()) && StringUtils.isNotEmpty(patients.getHstreetId()) &&
  675 + StringUtils.isNotEmpty(patients.getHvillage()) && StringUtils.isNotEmpty(patients.getHaddress())){
  676 + father_now_address= CommonsHelper.getResidence(patients.getHprovinceId(), patients.getHcityId(), patients.getHareaId(), patients.getHstreetId(), patients.getHvillage()+patients.getHaddress(), basicConfigService);
  677 + }
  678 + map.put("father_now_address", father_now_address);
666 679 //丈夫户籍地址标识,丈夫户籍地址区划编码(区县)取 县/区 级的编码
667 680 String hareaRegisterName="";
668 681 if(StringUtils.isNotEmpty(patients.getHareaRegisterId())){
669 682  
670 683  
671 684  
672 685  
... ... @@ -699,23 +712,23 @@
699 712 }
700 713 map.put("father_credentials_type_code", father_credentials_type_code);
701 714 //丈夫其他证件名称
702   - map.put("father_other_credentials_type", "/");
  715 + map.put("father_other_credentials_type", null);
703 716 //丈夫有效身份证件号码
704 717 map.put("father_credentials_number", StringUtils.isNotEmpty(patients.getHcertificateNum())?patients.getHcertificateNum():"/");
705 718 //手机号码
706 719 map.put("phone", StringUtils.isNotEmpty(patients.getHusbandPhone())?patients.getHusbandPhone():"/");
707 720 //是否高危
708   - map.put("is_high_risk", "/");
  721 + map.put("is_high_risk", null);
709 722 //是否早孕建档
710   - map.put("is_early_pregnancy", "/");
  723 + map.put("is_early_pregnancy", null);
711 724 //是否已打印出生证明
712   - map.put("is_birth_certificate", "/");
  725 + map.put("is_birth_certificate", null);
713 726 //录入系统时间
714 727 map.put("entering_time", null!=patients.getCreated()?DateUtil.getyyyy_MM_dd_hms(patients.getCreated()):DateUtil.getyyyy_MM_dd_hms(new Date()));
715 728 //是否未提供男方信息(建档时是否未提供男方信息)
716 729 map.put("not_provided_father_info", null!=patients.getReqHusband()?(patients.getReqHusband()?false:true):false);
717 730 //丈夫电话
718   - map.put("father_phone", "/");
  731 + map.put("father_phone", null);
719 732 //建档日期
720 733 map.put("this_date",null!=patients.getBookbuildingDate()?DateUtil.getyyyy_MM_dd_hms(patients.getBookbuildingDate()):DateUtil.getyyyy_MM_dd_hms(new Date()));
721 734 //所属机构编码
722 735  
723 736  
724 737  
725 738  
... ... @@ -851,15 +864,15 @@
851 864 //总出血量
852 865 map.put("bleeding_amount_total", null);
853 866 //会阴情况
854   - map.put("perineal_condition_code", "/");
  867 + map.put("perineal_condition_code",null);
855 868 //撕裂Ⅰ°
856   - map.put("perineal_tearing_one", "/");
  869 + map.put("perineal_tearing_one",null);
857 870 //撕裂Ⅱ°
858   - map.put("perineal_tearing_two", "/");
  871 + map.put("perineal_tearing_two", null);
859 872 //撕裂Ⅲ°
860   - map.put("perineal_tearing_three", "/");
  873 + map.put("perineal_tearing_three", null);
861 874 //撕裂缝线
862   - map.put("perineal_tearing_suture", "/");
  875 + map.put("perineal_tearing_suture", null);
863 876 //新生儿情况
864 877 String neonatal_condition_code="/";
865 878 if (null!=model.getTireNumber()) {
866 879  
... ... @@ -876,9 +889,9 @@
876 889 }
877 890 map.put("neonatal_condition_code", neonatal_condition_code);
878 891 //畸形详细
879   - map.put("malformation_detailed", "/");
  892 + map.put("malformation_detailed", null);
880 893 //新生儿情况其它
881   - map.put("neonatal_condition_other", "/");
  894 + map.put("neonatal_condition_other", null);
882 895 //出院时间
883 896 map.put("out_time", null);
884 897 //分娩医院名称
885 898  
... ... @@ -897,9 +910,9 @@
897 910 String maternal_state_code=model.getMaternalInfo();
898 911 map.put("maternal_state_code", StringUtils.isNotEmpty(maternal_state_code)?maternal_state_code:"/");
899 912 //产时并发症
900   - map.put("obstetric_morbidity_code", "/");
  913 + map.put("obstetric_morbidity_code", null);
901 914 //产时并发症--详述
902   - map.put("obstetric_morbidity_contents", "/");
  915 + map.put("obstetric_morbidity_contents", null);
903 916 //开奶时间
904 917 map.put("milk_open_time", null);
905 918 //分娩机构(分娩医疗机构统一社会信用代码)
... ... @@ -970,6 +983,12 @@
970 983 Map map=new HashMap();
971 984 //id
972 985 map.put("id", StringUtils.isNotEmpty(baby.getId())?baby.getId():"/");
  986 + //出生时间
  987 + String birth_date=baby.getDueTime();
  988 + if(StringUtils.isEmpty(birth_date)){
  989 +
  990 + }
  991 + map.put("birth_date", birth_date);
973 992 //性别
974 993 String gender_code="0";
975 994 if(StringUtils.isNotEmpty(baby.getBabyGender())){
... ... @@ -1022,60 +1041,133 @@
1022 1041 }
1023 1042 }
1024 1043 map.put("mid_wife", mid_wife);
1025   - //出生地点分类
1026   - map.put("birth_place_code", "/");
1027   - //
1028   - map.put("", "/");
1029   - //
1030   - map.put("", "/");
1031   - //
1032   - map.put("", "/");
1033   - //
1034   - map.put("", "/");
1035   - //
1036   - map.put("", "/");
1037   - //
1038   - map.put("", "/");
1039   - //
1040   - map.put("", "/");
1041   - //
1042   - map.put("", "/");
1043   - //
1044   - map.put("", "/");
1045   - //
1046   - map.put("", "/");
1047   - //
1048   - map.put("", "/");
1049   - //
1050   - map.put("", "/");
1051   - //
1052   - map.put("", "/");
1053   - //
1054   - map.put("", "/");
1055   - //
1056   - map.put("", "/");
1057   - //
1058   - map.put("", "/");
1059   - //
1060   - map.put("", "/");
1061   - //
1062   - map.put("", "/");
1063   - //
1064   - map.put("", "/");
1065   - //
1066   - map.put("", "/");
1067   - //
1068   - map.put("", "/");
1069   - //
1070   - map.put("", "/");
1071   - //
1072   - map.put("", "/");
1073   - //
1074   - map.put("", "/");
1075   - //
1076   - map.put("", "/");
1077   - //
1078   - map.put("", "/");
  1044 + //出生地点分类(参考前端分娩页面 分娩地点类型字段)
  1045 + String birth_place_code="99";
  1046 + if(StringUtils.isNotEmpty(model.getFmddlx())){
  1047 + switch (model.getFmddlx()){
  1048 + case "1":
  1049 + birth_place_code="2";
  1050 + break;
  1051 + case "2":
  1052 + birth_place_code="2";
  1053 + break;
  1054 + case "3":
  1055 + birth_place_code="1";
  1056 + break;
  1057 + case "4":
  1058 + birth_place_code="2";
  1059 + break;
  1060 + case "5":
  1061 + birth_place_code="2";
  1062 + break;
  1063 + case "6":
  1064 + birth_place_code="1";
  1065 + break;
  1066 + case "7":
  1067 + birth_place_code="99";
  1068 + break;
  1069 + case "8":
  1070 + birth_place_code="3";
  1071 + break;
  1072 + case "9":
  1073 + birth_place_code="4";
  1074 + break;
  1075 + case "10":
  1076 + birth_place_code="99";
  1077 + break;
  1078 + }
  1079 + }
  1080 + map.put("birth_place_code", birth_place_code);
  1081 + //出生地点区划Id(出生地点区划Id(区县))
  1082 + String birth_district_id="/";
  1083 + if (StringUtils.isNotEmpty(model.getFmHospital())) {
  1084 + Organization organization = organizationService.getOrganization(Integer.parseInt(model.getFmHospital()));
  1085 + if (organization != null && organization.getYn() == YnEnums.YES.getId()) {
  1086 + String hospitalArea=CommonsHelper.getName1(organization.getAreaId(), basicConfigService);
  1087 + birth_district_id=organizationService.getAreaCode(hospitalArea);
  1088 + }
  1089 + }
  1090 + map.put("birth_district_id", birth_district_id);
  1091 + //分娩结局
  1092 + String birth_condition_code="/";
  1093 + if(StringUtils.isNotEmpty(baby.getPregnancyOut())) {
  1094 + switch (baby.getPregnancyOut()) {
  1095 + case "0":
  1096 + birth_condition_code="1";
  1097 + break;
  1098 + case "1":
  1099 + birth_condition_code="2";
  1100 + break;
  1101 + case "2":
  1102 + birth_condition_code="2";
  1103 + break;
  1104 + case "3":
  1105 + birth_condition_code="3";
  1106 + break;
  1107 + case "4":
  1108 + birth_condition_code="4";
  1109 + break;
  1110 + }
  1111 + }
  1112 + map.put("birth_condition_code", birth_condition_code);
  1113 + //Apgar1分钟(必填)
  1114 + Integer apgar1=0;
  1115 + if (StringUtils.isNotEmpty(baby.getApgarScore())) {
  1116 + Map m = JsonUtil.str2Obj(baby.getApgarScore(), Map.class);
  1117 + if (null!=m) {
  1118 + Object b = m.get("pf1");
  1119 + if (null!=b && StringUtils.isNotEmpty(b.toString())) {
  1120 + apgar1 = Integer.parseInt(b.toString());
  1121 + }
  1122 + }
  1123 + }
  1124 + map.put("apgar1", apgar1);
  1125 + //Apgar3分钟
  1126 + map.put("apgar3", null);
  1127 + //Apgar5分钟
  1128 + map.put("apgar5", null);
  1129 + //Apgar10分钟
  1130 + map.put("apgar10", null);
  1131 + //出生次序
  1132 + map.put("birth_order", StringUtils.isNotEmpty(baby.getCftc())?baby.getCftc():"/");
  1133 + //健康状态(系统没有字段 默认1良好)
  1134 + map.put("health_state_code", "1");
  1135 + //出生缺陷
  1136 + map.put("birth_defect_code", null);
  1137 + //出生缺陷详述
  1138 + map.put("birth_defect_contents", null);
  1139 + //出生头围(cm)
  1140 + map.put("head_circumference", null);
  1141 + //出生胸围(cm)
  1142 + map.put("bust", null);
  1143 + //抢救
  1144 + map.put("rescue", null);
  1145 + //新生儿并发症
  1146 + map.put("baby_complication", null);
  1147 + //新生儿并发症描述
  1148 + map.put("baby_complication_contents", null);
  1149 + //死亡原因
  1150 + map.put("death_cause", null);
  1151 + //死亡时间
  1152 + map.put("death_time", null);
  1153 + //新生儿指导记录
  1154 + map.put("guidance_record", null);
  1155 + //关联分娩记录Id
  1156 + map.put("master_id", StringUtils.isNotEmpty(model.getId())?model.getId():"/");
  1157 + //录入系统时间
  1158 + map.put("entering_time", null!=model.getCreated()?DateUtil.getyyyy_MM_dd_hms(model.getCreated()):DateUtil.getyyyy_MM_dd_hms(new Date()));
  1159 + //所属机构编码(所属医疗机构统一社会信用代码)
  1160 + String hospital_name = couponMapper.findHospitalNameById(model.getHospitalId());
  1161 + String organ_id=organizationService.getPlatHosNewCode(hospital_name);
  1162 + map.put("organ_id", StringUtils.isNotEmpty(organ_id)?organ_id:"/");
  1163 + //导入时间
  1164 +// map.put("import_time", null);
  1165 + //修改时间
  1166 + map.put("last_modified_time", null);
  1167 + //删除状态
  1168 + map.put("is_deleted", 0);
  1169 + //删除时间
  1170 + map.put("deleted_time", null);
1079 1171  
1080 1172 data.add(map);
1081 1173 } catch (Exception e) {