Commit ed74d4a19c6fbfdf481f9c4f6f188ab936e5840a

Authored by jiangjiazhi
1 parent 5984e41c89

分娩作废产检劵

Showing 1 changed file with 168 additions and 149 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java View file @ ed74d4a
... ... @@ -35,7 +35,7 @@
35 35  
36 36 /**
37 37 * 分娩记录信息
38   - * <p>
  38 + * <p/>
39 39 * Created by Administrator on 2016/6/17 0017.
40 40 */
41 41 @Component
42 42  
43 43  
... ... @@ -138,14 +138,31 @@
138 138  
139 139 //表示区域的
140 140 if (StringUtils.isNotEmpty(organizationGroupsFacade.findByCurrentUserId(hospitalId))) {
141   - String parentId =antenatalExaminationFacade.handHideBuild(deliverAddRequest.getPid(), deliverAddRequest.getParentId(), userId,-1);
  141 + String parentId = antenatalExaminationFacade.handHideBuild(deliverAddRequest.getPid(), deliverAddRequest.getParentId(), userId, -1);
142 142 if (StringUtils.isEmpty(parentId)) {
143 143 logger.warn("get handHideBuild parentId is null.");
144 144 }
145 145 maternalDeliverModel.setParentId(parentId);
146 146 deliverAddRequest.setParentId(parentId);
147 147 }
  148 + List<String> babyIds = new ArrayList<>();
  149 + String parentId = maternalDeliverModel.getParentId();
  150 + String userName = "";
  151 + PatientsQuery patientsQuery = new PatientsQuery();
  152 + patientsQuery.setId(parentId);
  153 + List<Patients> patients = patientsService.queryPatient(patientsQuery);
148 154  
  155 +
  156 + Patients patients1 = null;
  157 + if (CollectionUtils.isNotEmpty(patients)) {
  158 + maternalDeliverModel.setPid(patients.get(0).getPid());
  159 + }
  160 +
  161 + if (CollectionUtils.isNotEmpty(patients)) {
  162 + patients1 = patients.get(0);
  163 + userName = patients1.getUsername();
  164 + }
  165 +
149 166 //增加
150 167 if (StringUtils.isEmpty(deliverAddRequest.getId()) && StringUtils.isNotEmpty(deliverAddRequest.getParentId())) {
151 168 MatDeliverQuery matDeliverQuery = new MatDeliverQuery();
152 169  
... ... @@ -174,17 +191,13 @@
174 191 //获取到小孩信息
175 192 maternalDeliverModel.setOperator(userId);
176 193 List<MatDeliverAddRequest.Baby> list = deliverAddRequest.getBabies();
177   - List<String> babyIds = new ArrayList<>();
178   - String parentId = maternalDeliverModel.getParentId();
179   - PatientsQuery patientsQuery = new PatientsQuery();
180   - patientsQuery.setId(parentId);
181   - List<Patients> patients = patientsService.queryPatient(patientsQuery);
182   - Patients patients1 = null;
  194 +
  195 +
183 196 if (CollectionUtils.isNotEmpty(patients)) {
184 197 maternalDeliverModel.setPid(patients.get(0).getPid());
185 198 }
186 199 if (CollectionUtils.isNotEmpty(list)) {
187   - String userName = "";
  200 +
188 201 if (CollectionUtils.isNotEmpty(patients)) {
189 202 patients1 = patients.get(0);
190 203 userName = patients1.getUsername();
... ... @@ -198,7 +211,7 @@
198 211 patientsLocal.setIsAutoFm(YnEnums.NO.getId());
199 212 patientsLocal.setType(3);
200 213 patientsLocal.setFmHospital(hospitalId);
201   - patientsLocal.setFmType(MapUtils.isNotEmpty(deliverAddRequest.getDeliveryMode())?null:deliverAddRequest.getDeliveryMode().toString());
  214 + patientsLocal.setFmType(MapUtils.isNotEmpty(deliverAddRequest.getDeliveryMode()) ? null : deliverAddRequest.getDeliveryMode().toString());
202 215 try {
203 216 patientsLocal.setFmAge(DateUtil.getAge(patients1.getBirth(), fmDate));
204 217 } catch (Exception e) {
... ... @@ -237,7 +250,8 @@
237 250 if (CollectionUtils.isEmpty(babyModels)) {
238 251 handBaby(deliverAddRequest, babyList, maternalDeliverModel, list, babyIds, parentId, userName, patients1, hospitalId);
239 252 } else {
240   - maternalDeliverModel.setBaby(updateBaby(deliverAddRequest,list,patients1.getLastMenses()));
  253 +// maternalDeliverModel.setBaby(updateBaby(deliverAddRequest,list,patients1.getLastMenses()));
  254 + handBaby(deliverAddRequest, babyList, maternalDeliverModel, list, babyIds, parentId, userName, patients1, hospitalId);
241 255 }
242 256 }
243 257  
... ... @@ -249,7 +263,7 @@
249 263 maternalDeliverModel.setYn(YnEnums.YES.getId());
250 264 matDeliverService.addMatDeliver(maternalDeliverModel);
251 265 //作废产检劵
252   - patientCheckTicketService.cancelCheckTicket(hospitalId,deliverAddRequest.getParentId());
  266 + patientCheckTicketService.cancelCheckTicket(hospitalId, deliverAddRequest.getParentId());
253 267 //修改
254 268 } else if (StringUtils.isNotEmpty(deliverAddRequest.getId()) && StringUtils.isNotEmpty(deliverAddRequest.getParentId())) {
255 269  
256 270  
257 271  
258 272  
259 273  
260 274  
261 275  
262 276  
263 277  
... ... @@ -283,43 +297,42 @@
283 297 List<MatDeliverAddRequest.Baby> list = deliverAddRequest.getBabies();
284 298 //修改小孩信息
285 299 if (CollectionUtils.isNotEmpty(list)) {
286   - maternalDeliverModel.setBaby(updateBaby(deliverAddRequest,list,patients2.getLastMenses()
287   - ));
  300 +// maternalDeliverModel.setBaby(updateBaby(deliverAddRequest,list,patients2.getLastMenses()));
  301 + handBaby(deliverAddRequest, babyList, maternalDeliverModel, list, babyIds, parentId, userName, patients1, hospitalId);
288 302 }
289 303  
290 304 matDeliverService.updateOne(maternalDeliverModel, maternalDeliverModel.getId());
291 305  
292 306 if (null != deliverAddRequest.getDueDate()) {
293 307 Date fmDate = DateUtil.parseYMD(deliverAddRequest.getDueDate());
294   - PatientsQuery patientsQuery = new PatientsQuery();
295   - patientsQuery.setId(deliverAddRequest.getParentId());
296   - Patients patients = patientsService.findOnePatientById(deliverAddRequest.getParentId());
297 308  
298   - Patients patients1 = new Patients();
299   - patients1.setId(deliverAddRequest.getParentId());
300   - patients1.setFmDate(fmDate);
  309 + Patients patientss = patientsService.findOnePatientById(deliverAddRequest.getParentId());
  310 +
  311 + Patients patients12 = new Patients();
  312 + patients12.setId(deliverAddRequest.getParentId());
  313 + patients12.setFmDate(fmDate);
301 314 // HuJiaqi添加开始,这里冗余了分娩分娩医院,分娩年龄,分娩孕周,分娩方式,并将状态更改为产妇
302   - patients1.setType(3);
303   - patients1.setIsAutoFm(YnEnums.NO.getId());
304   - patients1.setFmHospital(hospitalId);
305   - patients1.setFmType(MapUtils.isNotEmpty(deliverAddRequest.getDeliveryMode())?null:deliverAddRequest.getDeliveryMode().toString());
  315 + patients12.setType(3);
  316 + patients12.setIsAutoFm(YnEnums.NO.getId());
  317 + patients12.setFmHospital(hospitalId);
  318 + patients12.setFmType(MapUtils.isNotEmpty(deliverAddRequest.getDeliveryMode()) ? null : deliverAddRequest.getDeliveryMode().toString());
306 319 try {
307   - patients1.setFmAge(DateUtil.getAge(patients.getBirth(), fmDate));
  320 + patients12.setFmAge(DateUtil.getAge(patientss.getBirth(), fmDate));
308 321 } catch (Exception e) {
309 322 System.out.println(patients1.getId() + ":这条数据的生日和分娩时间异常");
310 323 // 跳过
311 324 }
312 325 try {
313   - patients1.setFmWeek(DateUtil.getDays(patients.getLastMenses(), fmDate));
  326 + patients12.setFmWeek(DateUtil.getDays(patientss.getLastMenses(), fmDate));
314 327 } catch (Exception e) {
315   - System.out.println(patients1.getId() + ":这条数据的末日月经和分娩时间异常");
  328 + System.out.println(patients12.getId() + ":这条数据的末日月经和分娩时间异常");
316 329 // 跳过
317 330 }
318 331 // HuJiaqi添加结束
319   - patientsService.updatePatient(patients1);
  332 + patientsService.updatePatient(patients12);
320 333  
321 334 //修改分娩日期
322   - updatePatientFmDate(patients.getPid(), fmDate, 3);
  335 + updatePatientFmDate(patientss.getPid(), fmDate, 3);
323 336 }
324 337 } else {
325 338 return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("parentId 为空,找不到产妇");
326 339  
327 340  
328 341  
329 342  
330 343  
331 344  
332 345  
... ... @@ -434,36 +447,36 @@
434 447 * @param list
435 448 * @return
436 449 */
437   - private List updateBaby(MatDeliverAddRequest deliverAddRequest,List<MatDeliverAddRequest.Baby> list ,Date lastMenses){
  450 + private List updateBaby(MatDeliverAddRequest deliverAddRequest, List<MatDeliverAddRequest.Baby> list, Date lastMenses) {
438 451 List<MaternalDeliverModel.Baby> babyList = new ArrayList<>();
439 452 for (MatDeliverAddRequest.Baby baby : list) {
440 453 MaternalDeliverModel.Baby babyModel = baby.convertToDataModel();
441   - if(com.lyms.platform.common.utils.StringUtils.isNotEmpty(babyModel.getId())){
  454 + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(babyModel.getId())) {
442 455 //判断妊娠结局是活产才添加数据
443   - BabyModel babyModel1=new BabyModel();
444   - BabyModelQuery query=new BabyModelQuery();
  456 + BabyModel babyModel1 = new BabyModel();
  457 + BabyModelQuery query = new BabyModelQuery();
445 458 query.setId(babyModel.getId());
446 459 babyModel1.setParentId(deliverAddRequest.getParentId());
447 460 if ((RenShenJieJuEnums.O.getId() + "").equals(baby.getPregnancyOut())) {
448 461 babyModel1.setYn(YnEnums.YES.getId());
449   - }else{
  462 + } else {
450 463 babyModel1.setYn(YnEnums.NO.getId());
451 464  
452 465 //修改满足条件的person数据
453   - List<BabyModel> updateBaby=babyService.queryBabyWithQuery(query);
  466 + List<BabyModel> updateBaby = babyService.queryBabyWithQuery(query);
454 467  
455   - if(CollectionUtils.isNotEmpty(updateBaby)){
456   - for(BabyModel babydel:updateBaby){
457   - if(com.lyms.platform.common.utils.StringUtils.isNotEmpty(babydel.getPid())){
458   - PersonModel p=new PersonModel();
  468 + if (CollectionUtils.isNotEmpty(updateBaby)) {
  469 + for (BabyModel babydel : updateBaby) {
  470 + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(babydel.getPid())) {
  471 + PersonModel p = new PersonModel();
459 472 p.setYn(YnEnums.NO.getId());
460 473 p.setId(babydel.getPid());
461   - personService.updatePerson(p,babydel.getPid());
  474 + personService.updatePerson(p, babydel.getPid());
462 475 }
463 476 }
464 477 }
465 478 }
466   - babyModel1.setBirth(DateUtil.parseYMD(baby.getDueTime()));
  479 + babyModel1.setBirth(DateUtil.parseYMDHMS(baby.getDueTime()));
467 480 babyModel1.setSex(Integer.valueOf(baby.getBabyGender()));
468 481 Map map = deliverAddRequest.getDeliveryMode();
469 482 String fmfs = null;
470 483  
... ... @@ -476,8 +489,14 @@
476 489 int day = DateUtil.getDays(lastMenses, DateUtil.parseYMD(deliverAddRequest.getDueDate()));
477 490 babyModel1.setDueWeek(day / 7);
478 491 }
  492 + //身长
479 493 babyModel1.setBabyHeight(baby.getBabyHeight());
480   - babyModel1.setBabyWeight(baby.getBabyWeight());
  494 + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(baby.getBabyWeight())) {
  495 + babyModel1.setBabyWeight(com.lyms.platform.common.utils.StringUtils.cutBabyWeight(baby.getBabyWeight()));
  496 + }
  497 + babyModel1.setApgarScore(babyModel.getApgarScore());
  498 + babyModel1.setMalformation(babyModel.getDeformity());
  499 +
481 500 babyService.findAndModify(query.convertToQuery(), babyModel1);
482 501 }
483 502 babyList.add(babyModel);
... ... @@ -588,7 +607,7 @@
588 607 */
589 608 public BaseResponse queryMatDeliver(MatDeliverQueryRequest deliverQueryRequest, Integer userId) {
590 609  
591   - String hospital=autoMatchFacade.getHospitalId(userId);
  610 + String hospital = autoMatchFacade.getHospitalId(userId);
592 611 //获取
593 612 /* Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, hospital, -1);
594 613 if (null == patients) {
595 614  
596 615  
597 616  
... ... @@ -597,18 +616,18 @@
597 616  
598 617 Organization og = organizationService.getOrganization(Integer.valueOf(hospital));
599 618 //区域模式
600   - boolean isEnable=og.getbStatus()==1;
  619 + boolean isEnable = og.getbStatus() == 1;
601 620  
602 621 //外院的孕妇
603   - Patients patients1 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, null, 1, false, null,true);
  622 + Patients patients1 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, null, 1, false, null, true);
604 623 //外院的产妇
605 624 // Patients patients2 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, null, 3);
606 625  
607 626 //http://jira.healthbaby.com.cn/browse/WEB-204 修改bug
608 627 //本院的孕妇
609   - Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, organizationGroupsFacade.findGroupHospital(userId,false), 1, false, null,isEnable);
  628 + Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, organizationGroupsFacade.findGroupHospital(userId, false), 1, false, null, isEnable);
610 629 //本院产妇
611   - Patients patients3 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, organizationGroupsFacade.findGroupHospital(userId,false), 3, false, null,isEnable);
  630 + Patients patients3 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, organizationGroupsFacade.findGroupHospital(userId, false), 3, false, null, isEnable);
612 631 PersonModelQuery personModelQuery = new PersonModelQuery();
613 632 String pid = "";
614 633 if (null != patients1) {
615 634  
616 635  
617 636  
... ... @@ -752,20 +771,20 @@
752 771 patientsService.updatePatient(patients);
753 772  
754 773 //删除分娩记录的时候删除分娩的小孩信息
755   - BabyModelQuery babyModelQuery=new BabyModelQuery();
  774 + BabyModelQuery babyModelQuery = new BabyModelQuery();
756 775 babyModelQuery.setParentId(matModel.getParentId());
757 776 babyModelQuery.setYn(YnEnums.YES.getId());
758 777  
759 778 //修改满足条件的person数据
760   - List<BabyModel> updateBaby=babyService.queryBabyWithQuery(babyModelQuery);
  779 + List<BabyModel> updateBaby = babyService.queryBabyWithQuery(babyModelQuery);
761 780  
762   - if(CollectionUtils.isNotEmpty(updateBaby)){
763   - for(BabyModel babyModel:updateBaby){
764   - if(com.lyms.platform.common.utils.StringUtils.isNotEmpty(babyModel.getPid())){
765   - PersonModel p=new PersonModel();
  781 + if (CollectionUtils.isNotEmpty(updateBaby)) {
  782 + for (BabyModel babyModel : updateBaby) {
  783 + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(babyModel.getPid())) {
  784 + PersonModel p = new PersonModel();
766 785 p.setYn(YnEnums.NO.getId());
767 786 p.setId(babyModel.getPid());
768   - personService.updatePerson(p,babyModel.getPid());
  787 + personService.updatePerson(p, babyModel.getPid());
769 788 }
770 789 }
771 790 }
... ... @@ -1165,7 +1184,7 @@
1165 1184 // 居住类型
1166 1185 if (childbirthManagerRequest.getInitQuery().contains("pliveTypeId")) {
1167 1186 try {
1168   - if(StringUtils.isNotEmpty(patients.getPliveTypeId())) {
  1187 + if (StringUtils.isNotEmpty(patients.getPliveTypeId())) {
1169 1188 childbirthManagerQueryModel.setPliveTypeId(basicConfigService.getOneBasicConfigById(patients.getPliveTypeId()).getName());
1170 1189 }
1171 1190 } catch (Exception e) {
... ... @@ -1176,7 +1195,7 @@
1176 1195 // 户口类型
1177 1196 if (childbirthManagerRequest.getInitQuery().contains("pcensusTypeId")) {
1178 1197 try {
1179   - if(StringUtils.isNotEmpty(patients.getPcensusTypeId())) {
  1198 + if (StringUtils.isNotEmpty(patients.getPcensusTypeId())) {
1180 1199 childbirthManagerQueryModel.setPcensusTypeId(basicConfigService.getOneBasicConfigById(patients.getPcensusTypeId()).getName());
1181 1200 }
1182 1201 } catch (Exception e) {
... ... @@ -1221,8 +1240,8 @@
1221 1240 pregnancyOut += renShenJieJuEnums.getName() + ",";
1222 1241 break;
1223 1242 }
1224   - if(StringUtils.isEmpty(pregnancyOut)){
1225   - pregnancyOut+="-,";
  1243 + if (StringUtils.isEmpty(pregnancyOut)) {
  1244 + pregnancyOut += "-,";
1226 1245 }
1227 1246 }
1228 1247 }
... ... @@ -1232,8 +1251,8 @@
1232 1251 sex += sexEnum.getText() + ",";
1233 1252 break;
1234 1253 }
1235   - if(StringUtils.isEmpty(sex)){
1236   - sex+="-,";
  1254 + if (StringUtils.isEmpty(sex)) {
  1255 + sex += "-,";
1237 1256 }
1238 1257 }
1239 1258 }
... ... @@ -1241,12 +1260,12 @@
1241 1260 babyHeight += babyModel.getBabyHeight() == null ? "-," : babyModel.getBabyHeight() + ",";
1242 1261 asphyxiaM += babyModel.getAsphyxiaM() == null ? "-," : babyModel.getAsphyxiaM() + ",";
1243 1262 babyHealthy += babyModel.getBabyHealthy() == null ? "-," : babyModel.getBabyHealthy() + ",";
1244   - if(Integer.valueOf(0).equals(babyModel.getMalformation())){
1245   - malformation+="非畸形"+",";
1246   - }else if(Integer.valueOf(1).equals(babyModel.getMalformation())){
1247   - malformation+="畸形"+",";
1248   - }else{
1249   - malformation+="-,";
  1263 + if (Integer.valueOf(0).equals(babyModel.getMalformation())) {
  1264 + malformation += "非畸形" + ",";
  1265 + } else if (Integer.valueOf(1).equals(babyModel.getMalformation())) {
  1266 + malformation += "畸形" + ",";
  1267 + } else {
  1268 + malformation += "-,";
1250 1269 }
1251 1270 Map<String, String> map = JsonUtil.getMap(babyModel.getApgarScore());
1252 1271 if (MapUtils.isNotEmpty(map)) {
... ... @@ -1385,7 +1404,7 @@
1385 1404 }
1386 1405 }
1387 1406 heartRate += placenta.get("heartRate") == null ? "" : placenta.get("heartRate") + ",";
1388   - for (FetalEnums fetalEnums : FetalEnums.values()) {
  1407 + for (FetalEnums fetalEnums : FetalEnums.values()) {
1389 1408 if (fetalEnums.getId().equals(placenta.get("fetalPresentation"))) {
1390 1409 fetalPresentation += fetalEnums.getName() + ",";
1391 1410 break;
1392 1411  
1393 1412  
... ... @@ -1407,19 +1426,19 @@
1407 1426 Map<String, String> prodprocessOne = prodprocessMap.get("one");
1408 1427 if (MapUtils.isNotEmpty(prodprocessOne)) {
1409 1428 childbirthManagerQueryModel.setProdprocessOne(prodprocessOne.get("h") + "时," + prodprocessOne.get("m") + "分");
1410   - }else{
  1429 + } else {
1411 1430 childbirthManagerQueryModel.setProdprocessOne("");
1412 1431 }
1413 1432 Map<String, String> prodprocessTwo = prodprocessMap.get("two");
1414 1433 if (MapUtils.isNotEmpty(prodprocessTwo)) {
1415 1434 childbirthManagerQueryModel.setProdprocessTwo(prodprocessTwo.get("h") + "时," + prodprocessTwo.get("m") + "分");
1416   - }else{
  1435 + } else {
1417 1436 childbirthManagerQueryModel.setProdprocessTwo("");
1418 1437 }
1419 1438 Map<String, String> prodprocessThree = prodprocessMap.get("three");
1420 1439 if (MapUtils.isNotEmpty(prodprocessThree)) {
1421 1440 childbirthManagerQueryModel.setProdprocessThree(prodprocessThree.get("h") + "时," + prodprocessThree.get("m") + "分");
1422   - }else{
  1441 + } else {
1423 1442 childbirthManagerQueryModel.setProdprocessThree("");
1424 1443 }
1425 1444 }
1426 1445  
1427 1446  
1428 1447  
... ... @@ -1621,25 +1640,25 @@
1621 1640 @Autowired
1622 1641 private CommonService commonService;
1623 1642  
1624   - public BaseObjectResponse findMatDeliverData(String id){
  1643 + public BaseObjectResponse findMatDeliverData(String id) {
1625 1644  
1626 1645 BaseObjectResponse br = new BaseObjectResponse();
1627 1646  
1628   - if (org.apache.commons.lang.StringUtils.isEmpty(id)){
  1647 + if (org.apache.commons.lang.StringUtils.isEmpty(id)) {
1629 1648 br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR);
1630 1649 br.setErrormsg("id为空");
1631 1650 return br;
1632 1651 }
1633 1652  
1634 1653 MaternalDeliverModel data = matDeliverService.getOneMatDeliver(id);
1635   - if (data==null || data.getYn()==YnEnums.NO.getId()){
  1654 + if (data == null || data.getYn() == YnEnums.NO.getId()) {
1636 1655 br.setErrorcode(ErrorCodeConstants.NO_DATA);
1637 1656 br.setErrormsg("没有查询到数据");
1638 1657 return br;
1639 1658 }
1640 1659  
1641 1660 /* 基本信息 */
1642   - if (StringUtils.isEmpty(data.getParentId())){
  1661 + if (StringUtils.isEmpty(data.getParentId())) {
1643 1662 br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR);
1644 1663 br.setErrormsg("数据异常");
1645 1664 return br;
1646 1665  
1647 1666  
1648 1667  
1649 1668  
1650 1669  
1651 1670  
1652 1671  
1653 1672  
... ... @@ -1647,46 +1666,46 @@
1647 1666  
1648 1667 Patients patients = patientsService.findOnePatientById(data.getParentId());
1649 1668  
1650   - if (patients==null){
  1669 + if (patients == null) {
1651 1670 br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR);
1652 1671 br.setErrormsg("数据异常");
1653 1672 return br;
1654 1673 }
1655 1674  
1656   - Map<String,Object> map= new HashMap<>();
1657   - map.put("id",data.getId());
1658   - map.put("username",patients.getUsername());
1659   - map.put("birth",DateUtil.getyyyy_MM_dd(patients.getBirth()));
1660   - map.put("age",DateUtil.getAge(patients.getBirth()));
1661   - map.put("phone",patients.getPhone());
1662   - map.put("fmWeek",patients.getFmWeek());
1663   - map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate()));
1664   - map.put("mremark",patients.getMremark());
  1675 + Map<String, Object> map = new HashMap<>();
  1676 + map.put("id", data.getId());
  1677 + map.put("username", patients.getUsername());
  1678 + map.put("birth", DateUtil.getyyyy_MM_dd(patients.getBirth()));
  1679 + map.put("age", DateUtil.getAge(patients.getBirth()));
  1680 + map.put("phone", patients.getPhone());
  1681 + map.put("fmWeek", patients.getFmWeek());
  1682 + map.put("dueDate", DateUtil.getyyyy_MM_dd(patients.getDueDate()));
  1683 + map.put("mremark", patients.getMremark());
1665 1684  
1666 1685 String riskFactor = "";
1667   - if (StringUtils.isNotEmpty(patients.getoRiskFactor())){
  1686 + if (StringUtils.isNotEmpty(patients.getoRiskFactor())) {
1668 1687 riskFactor = patients.getoRiskFactor();
1669 1688 }
1670 1689  
1671   - if (CollectionUtils.isNotEmpty(patients.getRiskFactorId())){
1672   - if (StringUtils.isEmpty(riskFactor)){
  1690 + if (CollectionUtils.isNotEmpty(patients.getRiskFactorId())) {
  1691 + if (StringUtils.isEmpty(riskFactor)) {
1673 1692 riskFactor = commonService.resloveFactor(patients.getRiskFactorId());
1674   - }else {
  1693 + } else {
1675 1694 riskFactor = riskFactor + "," + commonService.resloveFactor(patients.getRiskFactorId());
1676 1695 }
1677 1696 }
1678   - map.put("oRiskFactor",riskFactor);
  1697 + map.put("oRiskFactor", riskFactor);
1679 1698 map.put("riskLevel", FunvCommonUtil.getBaseicConfigByid(patients.getRiskLevelId(), basicConfigService));
1680   - map.put("riskScore",patients.getRiskScore());
  1699 + map.put("riskScore", patients.getRiskScore());
1681 1700  
1682 1701 map.put("deliveryDate", data.getDueDate());
1683 1702 map.put("dueWeek", data.getDueWeek());
1684 1703  
1685 1704 String fmHospital = "";
1686 1705  
1687   - if (StringUtils.isNotEmpty(data.getFmHospital())){
  1706 + if (StringUtils.isNotEmpty(data.getFmHospital())) {
1688 1707 Organization organization = organizationService.getOrganization(Integer.parseInt(data.getFmHospital()));
1689   - if (organization!=null && organization.getYn()==YnEnums.YES.getId()){
  1708 + if (organization != null && organization.getYn() == YnEnums.YES.getId()) {
1690 1709 fmHospital = organization.getName();
1691 1710 }
1692 1711 }
1693 1712  
... ... @@ -1695,9 +1714,9 @@
1695 1714  
1696 1715 String deliverDoctor = "";
1697 1716  
1698   - if (StringUtils.isNotEmpty(data.getDeliverDoctor())){
  1717 + if (StringUtils.isNotEmpty(data.getDeliverDoctor())) {
1699 1718 Users users = usersService.getUsers(Integer.parseInt(data.getDeliverDoctor()));
1700   - if (users!=null && users.getYn()==YnEnums.YES.getId()){
  1719 + if (users != null && users.getYn() == YnEnums.YES.getId()) {
1701 1720 deliverDoctor = users.getName();
1702 1721 }
1703 1722 }
1704 1723  
1705 1724  
... ... @@ -1708,12 +1727,12 @@
1708 1727 map.put("tireNumber", TaiShuEnums.getTitle(data.getTireNumber() + ""));//胎数
1709 1728 map.put("placenta", data.getPlacenta());//胎盘
1710 1729  
1711   - List<Map<String,Object>> placetaList = new ArrayList<>();
  1730 + List<Map<String, Object>> placetaList = new ArrayList<>();
1712 1731  
1713   - if (CollectionUtils.isNotEmpty(data.getPlacentas())){
  1732 + if (CollectionUtils.isNotEmpty(data.getPlacentas())) {
1714 1733 @SuppressWarnings("unchecked")
1715 1734 List<MatDeliverAddRequest.Placenta> placentas = data.getPlacentas();
1716   - if (CollectionUtils.isNotEmpty(placentas)){
  1735 + if (CollectionUtils.isNotEmpty(placentas)) {
1717 1736 for (Object obj : placentas) {
1718 1737  
1719 1738 String fetalPosition = "";
... ... @@ -1754,10 +1773,10 @@
1754 1773 fetalPresentation += placenta.get("fetalPresentation") == null ? "" : placenta.get("fetalPresentation");
1755 1774 }
1756 1775 }
1757   - Map<String,Object> placetaMap = new HashMap<>();
1758   - placetaMap.put("fetalPosition",fetalPosition);
1759   - placetaMap.put("fetalPresentation",fetalPresentation);
1760   - placetaMap.put("heartRate",heartRate);
  1776 + Map<String, Object> placetaMap = new HashMap<>();
  1777 + placetaMap.put("fetalPosition", fetalPosition);
  1778 + placetaMap.put("fetalPresentation", fetalPresentation);
  1779 + placetaMap.put("heartRate", heartRate);
1761 1780 placetaList.add(placetaMap);
1762 1781 }
1763 1782 }
1764 1783  
1765 1784  
1766 1785  
1767 1786  
1768 1787  
... ... @@ -1766,24 +1785,24 @@
1766 1785 map.put("placentaData", placetaList);//胎盘信息
1767 1786  
1768 1787 String deliveryMode = "";
1769   - if (StringUtils.isNotEmpty(data.getDeliveryMode())){
  1788 + if (StringUtils.isNotEmpty(data.getDeliveryMode())) {
1770 1789  
1771 1790 StringBuilder sb = new StringBuilder();
1772 1791  
1773   - Map m = JsonUtil.str2Obj(data.getDeliveryMode(),Map.class);
  1792 + Map m = JsonUtil.str2Obj(data.getDeliveryMode(), Map.class);
1774 1793 String fmfs = null;
1775   - if (m!=null){
  1794 + if (m != null) {
1776 1795 Object b = m.get("fmfs");
1777   - if (b!=null){
  1796 + if (b != null) {
1778 1797 fmfs = b.toString();
1779   - if (fmfs!=null){
1780   - if (fmfs.equals("1")){
  1798 + if (fmfs != null) {
  1799 + if (fmfs.equals("1")) {
1781 1800 String fmName = FmTypeEnums.getFmNameById(fmfs);
1782 1801 sb.append(fmName).append(",");
1783 1802 String scfs = m.get("scfs").toString();
1784 1803 sb.append(FmTypeEnums.getFmScNameById(scfs));
1785 1804 deliveryMode = sb.toString();
1786   - }else if (fmfs.equals("2")){
  1805 + } else if (fmfs.equals("2")) {
1787 1806 String fmName = FmTypeEnums.getFmNameById(fmfs);
1788 1807 deliveryMode = fmName;
1789 1808 }
1790 1809  
... ... @@ -1792,10 +1811,10 @@
1792 1811 }
1793 1812 }
1794 1813 map.put("deliveryMode", deliveryMode);//分娩方式
1795   - map.put("operationCause", data.getOperationCause()==null ? "--":data.getOperationCause());
  1814 + map.put("operationCause", data.getOperationCause() == null ? "--" : data.getOperationCause());
1796 1815  
1797 1816 findProcess(data.getProdprocess(), map);//1,2,3产程
1798   - findTotalProcess(data.getTotalprocess(),map);//总产程
  1817 + findTotalProcess(data.getTotalprocess(), map);//总产程
1799 1818  
1800 1819 map.put("perinealCondition", data.getPerinealCondition());
1801 1820  
... ... @@ -1805,7 +1824,7 @@
1805 1824  
1806 1825 /* 产后生理 */
1807 1826 map.put("maternalInfo", data.getMaternalInfo());
1808   - map.put("deathCause", data.getDeathCause()==null ? "--" : data.getDeathCause());
  1827 + map.put("deathCause", data.getDeathCause() == null ? "--" : data.getDeathCause());
1809 1828 // 产后血压 收缩压,舒张压
1810 1829 String ssy = "";
1811 1830 String szy = "";
1812 1831  
1813 1832  
1814 1833  
1815 1834  
1816 1835  
1817 1836  
1818 1837  
... ... @@ -1836,43 +1855,43 @@
1836 1855 map.put("sHloseBloodL", data.getsHloseBloodL());
1837 1856 map.put("loseBloodCause", data.getLoseBloodCause());
1838 1857 //产科并发症(需要解析)
1839   - map.put("ocs", ResolveUtils.replace(JsonUtil.str2Obj(data.getOcs(),Map.class)));
  1858 + map.put("ocs", ResolveUtils.replace(JsonUtil.str2Obj(data.getOcs(), Map.class)));
1840 1859  
1841 1860 /* 胎盘及新生儿信息 */
1842 1861  
1843 1862 //胎盘信息
1844   - List<Map<String,Object>> ExtPlacentaList = new ArrayList<>();
  1863 + List<Map<String, Object>> ExtPlacentaList = new ArrayList<>();
1845 1864  
1846   - if (CollectionUtils.isNotEmpty(data.getExtPlacentas())){
1847   - for (MaternalDeliverModel.ExtPlacenta temp : data.getExtPlacentas()){
1848   - Map<String,Object> extMap = new HashMap<>();
  1865 + if (CollectionUtils.isNotEmpty(data.getExtPlacentas())) {
  1866 + for (MaternalDeliverModel.ExtPlacenta temp : data.getExtPlacentas()) {
  1867 + Map<String, Object> extMap = new HashMap<>();
1849 1868 extMap.put("tpmcType", TaiShuEnums.getTpNameById(temp.getTpmcType()));
1850 1869 //TODO 娩出方式???
1851 1870 String tpSize = "";
1852 1871 tpSize += temp.getTpSize().get("c") + "*" + temp.getTpSize().get("k") + "*" + temp.getTpSize().get("g") + "cm";
1853   - extMap.put("tpSize",tpSize);
1854   - extMap.put("tpWeight",temp.getTpWeight());
1855   - extMap.put("umbilicalCordLength",temp.getUmbilicalCordLength());
  1872 + extMap.put("tpSize", tpSize);
  1873 + extMap.put("tpWeight", temp.getTpWeight());
  1874 + extMap.put("umbilicalCordLength", temp.getUmbilicalCordLength());
1856 1875  
1857 1876 String umbilicalCordEx = "";
1858 1877 String umbilicalCordExType = "";
1859 1878  
1860   - if (StringUtils.isNotEmpty(temp.getUmbilicalCordEx())){
1861   - if (temp.getUmbilicalCordEx().equals("no")){
  1879 + if (StringUtils.isNotEmpty(temp.getUmbilicalCordEx())) {
  1880 + if (temp.getUmbilicalCordEx().equals("no")) {
1862 1881 umbilicalCordEx = "无";
1863   - }else if (temp.getUmbilicalCordEx().equals("yes")){
  1882 + } else if (temp.getUmbilicalCordEx().equals("yes")) {
1864 1883 umbilicalCordEx = "有";
1865   - if (StringUtils.isNotEmpty(temp.getUmbilicalCordExType())){
1866   - for (QiDaiEnums qiDaiEnums : QiDaiEnums.values()){
1867   - if (qiDaiEnums.getId().equals(temp.getUmbilicalCordExType())){
  1884 + if (StringUtils.isNotEmpty(temp.getUmbilicalCordExType())) {
  1885 + for (QiDaiEnums qiDaiEnums : QiDaiEnums.values()) {
  1886 + if (qiDaiEnums.getId().equals(temp.getUmbilicalCordExType())) {
1868 1887 umbilicalCordExType = qiDaiEnums.getName();
1869 1888 }
1870 1889 }
1871 1890 }
1872 1891 }
1873 1892 }
1874   - extMap.put("umbilicalCordEx",umbilicalCordEx);
1875   - extMap.put("umbilicalCordExType",umbilicalCordExType);
  1893 + extMap.put("umbilicalCordEx", umbilicalCordEx);
  1894 + extMap.put("umbilicalCordExType", umbilicalCordExType);
1876 1895  
1877 1896 ExtPlacentaList.add(extMap);
1878 1897 }
1879 1898  
1880 1899  
... ... @@ -1881,19 +1900,19 @@
1881 1900  
1882 1901 //新生儿信息
1883 1902  
1884   - List<Map<String,Object>> babyList = new ArrayList<>();
  1903 + List<Map<String, Object>> babyList = new ArrayList<>();
1885 1904  
1886   - if (CollectionUtils.isNotEmpty(data.getBaby())){
1887   - for (MaternalDeliverModel.Baby temp : data.getBaby()){
1888   - Map<String,Object> babyMap = new HashMap<>();
1889   - babyMap.put("dueTime",temp.getDueTime());
1890   - babyMap.put("pregnancyOut",temp.getPregnancyOut());
1891   - babyMap.put("deformity",temp.getDeformity()==null ? "" : temp.getDeformity() == 1 ? "是" : "否");
1892   - babyMap.put("babyGender",temp.getBabyGender() == null ? "" : SexEnum.getTextById(
  1905 + if (CollectionUtils.isNotEmpty(data.getBaby())) {
  1906 + for (MaternalDeliverModel.Baby temp : data.getBaby()) {
  1907 + Map<String, Object> babyMap = new HashMap<>();
  1908 + babyMap.put("dueTime", temp.getDueTime());
  1909 + babyMap.put("pregnancyOut", temp.getPregnancyOut());
  1910 + babyMap.put("deformity", temp.getDeformity() == null ? "" : temp.getDeformity() == 1 ? "是" : "否");
  1911 + babyMap.put("babyGender", temp.getBabyGender() == null ? "" : SexEnum.getTextById(
1893 1912 Integer.parseInt(temp.getBabyGender())));
1894   - babyMap.put("babyWeight",temp.getBabyWeight());
1895   - babyMap.put("babyHeight",temp.getBabyHeight());
1896   - babyMap.put("babyHealthy",temp.getBabyHealthy());
  1913 + babyMap.put("babyWeight", temp.getBabyWeight());
  1914 + babyMap.put("babyHeight", temp.getBabyHeight());
  1915 + babyMap.put("babyHealthy", temp.getBabyHealthy());
1897 1916 String apgarScorePf1 = "";
1898 1917 String apgarScorePf5 = "";
1899 1918 String apgarScorePf10 = "";
... ... @@ -1903,11 +1922,11 @@
1903 1922 apgarScorePf5 += map.get("pf5") == null ? "" : map.get("pf5") + "*";
1904 1923 apgarScorePf10 += map.get("pf10") == null ? "" : map.get("pf10");
1905 1924 }
1906   - babyMap.put("apgarScore",apgarScorePf1 + apgarScorePf5 + apgarScorePf10);
1907   - babyMap.put("asphyxiaM",temp.getAsphyxiaM());
1908   - babyMap.put("contactStartM",temp.getContactStartM());
1909   - babyMap.put("contactM",temp.getContactM());
1910   - babyMap.put("earlySuck",temp.getEarlySuck() == null ? "" : "yes".equals(temp.getEarlySuck()) ? "是" : "否");
  1925 + babyMap.put("apgarScore", apgarScorePf1 + apgarScorePf5 + apgarScorePf10);
  1926 + babyMap.put("asphyxiaM", temp.getAsphyxiaM());
  1927 + babyMap.put("contactStartM", temp.getContactStartM());
  1928 + babyMap.put("contactM", temp.getContactM());
  1929 + babyMap.put("earlySuck", temp.getEarlySuck() == null ? "" : "yes".equals(temp.getEarlySuck()) ? "是" : "否");
1911 1930  
1912 1931 babyList.add(babyMap);
1913 1932 }
... ... @@ -1922,7 +1941,7 @@
1922 1941 }
1923 1942  
1924 1943 //总产程
1925   - public static Map<String,Object> findTotalProcess(String totalProcess,Map<String,Object> map){
  1944 + public static Map<String, Object> findTotalProcess(String totalProcess, Map<String, Object> map) {
1926 1945  
1927 1946 String p = "";
1928 1947  
1929 1948  
... ... @@ -1930,13 +1949,13 @@
1930 1949 if (MapUtils.isNotEmpty(totalprocessMap)) {
1931 1950 p = totalprocessMap.get("h") + "时," + totalprocessMap.get("m") + "分";
1932 1951 }
1933   - map.put("totalProcess",p);
  1952 + map.put("totalProcess", p);
1934 1953 return map;
1935 1954  
1936 1955 }
1937 1956  
1938 1957 //解析1,2,3产程
1939   - public static Map<String,Object> findProcess(String process,Map<String,Object> map){
  1958 + public static Map<String, Object> findProcess(String process, Map<String, Object> map) {
1940 1959 // process = "{\"one\":{\"h\":4,\"m\":20},\"two\":{\"m\":53},\"three\":{\"m\":7}}";
1941 1960 String one = "";
1942 1961 String two = "";
... ... @@ -1956,9 +1975,9 @@
1956 1975 three = prodprocessOne.get("h") + "时" + prodprocessThree.get("m") + "分";
1957 1976 }
1958 1977 }
1959   - map.put("one",one);
1960   - map.put("two",two);
1961   - map.put("three",three);
  1978 + map.put("one", one);
  1979 + map.put("two", two);
  1980 + map.put("three", three);
1962 1981 return map;
1963 1982 }
1964 1983