Commit 3e2b9f1de8cc2fb0554e84ed71106894085de9dd
Exists in
master
and in
7 other branches
Merge remote-tracking branch 'origin/master'
Showing 8 changed files
- platform-common/src/main/java/com/lyms/platform/common/enums/FmTypeEnums.java
- platform-common/src/main/java/com/lyms/platform/common/enums/TaiShuEnums.java
- platform-dal/src/main/java/com/lyms/platform/query/ResidentsArchiveQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnantBuildController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/ResolveUtils.java
platform-common/src/main/java/com/lyms/platform/common/enums/FmTypeEnums.java
View file @
3e2b9f1
| ... | ... | @@ -30,6 +30,29 @@ |
| 30 | 30 | return null; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | + public static String getFmNameById(String id) | |
| 34 | + { | |
| 35 | + for (FmTypeEnums e : FmTypeEnums.values()) { | |
| 36 | + if (e.getId().equals(id)) | |
| 37 | + { | |
| 38 | + return e.getName(); | |
| 39 | + } | |
| 40 | + } | |
| 41 | + return null; | |
| 42 | + } | |
| 43 | + | |
| 44 | + | |
| 45 | + public static String getFmScNameById(String id) | |
| 46 | + { | |
| 47 | + for (FmScEnums e : FmScEnums.values()) { | |
| 48 | + if (e.getId().equals(id)) | |
| 49 | + { | |
| 50 | + return e.getName(); | |
| 51 | + } | |
| 52 | + } | |
| 53 | + return null; | |
| 54 | + } | |
| 55 | + | |
| 33 | 56 | public static List<Map> getFmTypeEnums() { |
| 34 | 57 | List<Map> list = new ArrayList<>(); |
| 35 | 58 | for (FmTypeEnums e : FmTypeEnums.values()) { |
platform-common/src/main/java/com/lyms/platform/common/enums/TaiShuEnums.java
View file @
3e2b9f1
| 1 | 1 | package com.lyms.platform.common.enums; |
| 2 | 2 | |
| 3 | +import org.apache.commons.lang.StringUtils; | |
| 4 | + | |
| 3 | 5 | /** |
| 4 | 6 | * 胎盘 |
| 5 | 7 | * Created by Administrator on 2016/6/21 0021. |
| ... | ... | @@ -54,6 +56,23 @@ |
| 54 | 56 | this.name = name; |
| 55 | 57 | } |
| 56 | 58 | } |
| 59 | + | |
| 60 | + public static String getTpNameById(String id) { | |
| 61 | + | |
| 62 | + if (StringUtils.isEmpty(id)){ | |
| 63 | + return null; | |
| 64 | + } | |
| 65 | + | |
| 66 | + for (TpEnums e : TpEnums.values()) { | |
| 67 | + if (e.getId().equals(id)) | |
| 68 | + { | |
| 69 | + return e.getName(); | |
| 70 | + } | |
| 71 | + } | |
| 72 | + return null; | |
| 73 | + } | |
| 74 | + | |
| 75 | + | |
| 57 | 76 | public enum TpEnums { |
| 58 | 77 | O("完整","1"),O1("不完整","2"); |
| 59 | 78 | private TpEnums(String name,String id){ |
platform-dal/src/main/java/com/lyms/platform/query/ResidentsArchiveQuery.java
View file @
3e2b9f1
| ... | ... | @@ -137,6 +137,9 @@ |
| 137 | 137 | if (StringUtils.isNotBlank(cityId)) { |
| 138 | 138 | condition = condition.and("cityId", cityId, MongoOper.IS); |
| 139 | 139 | } |
| 140 | + if (StringUtils.isNotBlank(sex)) { | |
| 141 | + condition = condition.and("sex", sex, MongoOper.IS); | |
| 142 | + } | |
| 140 | 143 | if (StringUtils.isNotBlank(areaId)) { |
| 141 | 144 | condition = condition.and("areaId", areaId, MongoOper.IS); |
| 142 | 145 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java
View file @
3e2b9f1
| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | import com.lyms.platform.common.base.LoginContext; |
| 6 | 6 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 7 | 7 | import com.lyms.platform.common.result.BaseListResponse; |
| 8 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
| 8 | 9 | import com.lyms.platform.common.result.BaseResponse; |
| 9 | 10 | import com.lyms.platform.common.utils.BeanUtils; |
| 10 | 11 | import com.lyms.platform.common.utils.ExcelUtil; |
| ... | ... | @@ -325,6 +326,13 @@ |
| 325 | 326 | } catch (Exception e) { |
| 326 | 327 | ExceptionUtils.catchException(e, "childbirthManagerExcel异常"); |
| 327 | 328 | } |
| 329 | + } | |
| 330 | + | |
| 331 | + @RequestMapping(value = "/findMatDeliverData", method = RequestMethod.GET) | |
| 332 | + @ResponseBody | |
| 333 | +// @TokenRequired | |
| 334 | + public BaseObjectResponse findMatDeliverData(@RequestParam("id")String id){ | |
| 335 | + return matDeliverFacade.findMatDeliverData(id); | |
| 328 | 336 | } |
| 329 | 337 | |
| 330 | 338 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnantBuildController.java
View file @
3e2b9f1
| ... | ... | @@ -487,5 +487,19 @@ |
| 487 | 487 | doctorNo); |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | + /** | |
| 491 | + * 查看孕妇建档信息 | |
| 492 | + * @param id 孕妇ID | |
| 493 | + * @return | |
| 494 | + */ | |
| 495 | + @RequestMapping(value = "/findPatientData", method = RequestMethod.GET) | |
| 496 | + @ResponseBody | |
| 497 | + @TokenRequired | |
| 498 | + public BaseObjectResponse findPatientData(@RequestParam("id")String id){ | |
| 499 | + return bookbuildingFacade.findPatientData(id); | |
| 500 | + } | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 490 | 504 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
3e2b9f1
| ... | ... | @@ -12,8 +12,10 @@ |
| 12 | 12 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 13 | 13 | import com.lyms.platform.common.result.BaseResponse; |
| 14 | 14 | import com.lyms.platform.common.utils.*; |
| 15 | +import com.lyms.platform.common.utils.StringUtils; | |
| 15 | 16 | import com.lyms.platform.operate.web.request.*; |
| 16 | 17 | import com.lyms.platform.operate.web.result.*; |
| 18 | +import com.lyms.platform.operate.web.utils.CommonsHelper; | |
| 17 | 19 | import com.lyms.platform.operate.web.utils.JdbcUtil; |
| 18 | 20 | import com.lyms.platform.operate.web.utils.MessageCenterService; |
| 19 | 21 | import com.lyms.platform.permission.model.Organization; |
| ... | ... | @@ -24,6 +26,7 @@ |
| 24 | 26 | import com.lyms.platform.pojo.*; |
| 25 | 27 | import com.lyms.platform.query.*; |
| 26 | 28 | import org.apache.commons.collections.CollectionUtils; |
| 29 | +import org.apache.commons.lang.*; | |
| 27 | 30 | import org.slf4j.Logger; |
| 28 | 31 | import org.slf4j.LoggerFactory; |
| 29 | 32 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -1459,5 +1462,78 @@ |
| 1459 | 1462 | } |
| 1460 | 1463 | return ""; |
| 1461 | 1464 | } |
| 1465 | + | |
| 1466 | + public BaseObjectResponse findPatientData(String id){ | |
| 1467 | + | |
| 1468 | + BaseObjectResponse br = new BaseObjectResponse(); | |
| 1469 | + if (org.apache.commons.lang.StringUtils.isEmpty(id)){ | |
| 1470 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 1471 | + br.setErrormsg("id为空"); | |
| 1472 | + return br; | |
| 1473 | + } | |
| 1474 | + | |
| 1475 | + Patients data = patientsService.findOnePatientById(id); | |
| 1476 | + if (data==null || data.getYn()==YnEnums.NO.getId()){ | |
| 1477 | + br.setErrorcode(ErrorCodeConstants.NO_DATA); | |
| 1478 | + br.setErrormsg("没有查询到数据"); | |
| 1479 | + return br; | |
| 1480 | + } | |
| 1481 | + | |
| 1482 | + Map<String,Object> map = new HashMap<>(); | |
| 1483 | + map.put("id",data.getId()); | |
| 1484 | + /* 孕妇基础数据 */ | |
| 1485 | + map.put("username",data.getUsername()); | |
| 1486 | + map.put("pcerteType",getBasicConfig(data.getPcerteTypeId())); | |
| 1487 | + map.put("cardNo",data.getCardNo()); | |
| 1488 | + map.put("pcountry",getBasicConfig(data.getPcountryId())); | |
| 1489 | + map.put("pnation",getBasicConfig(data.getPnationId())); | |
| 1490 | + map.put("birth",DateUtil.getyyyy_MM_dd(data.getBirth())); | |
| 1491 | + map.put("age",DateUtil.getAge(data.getBirth())); | |
| 1492 | + map.put("pcensusType",getBasicConfig(data.getPcensusTypeId())); | |
| 1493 | + map.put("pliveType",getBasicConfig(data.getPliveTypeId())); | |
| 1494 | + map.put("pprofessionType",getBasicConfig(data.getPprofessionTypeId())); | |
| 1495 | + map.put("plevelType",getBasicConfig(data.getPlevelTypeId())); | |
| 1496 | + //TODO 家庭人均收入 | |
| 1497 | + | |
| 1498 | + /* 孕妇联系方式 */ | |
| 1499 | + map.put("residence", CommonsHelper.getResidence(data.getProvinceId(),data.getCityId(), | |
| 1500 | + data.getAreaId(),data.getStreetId(),data.getAddress(),basicConfigService)); | |
| 1501 | + map.put("register",CommonsHelper.getResidence(data.getProvinceRegisterId(), data.getCityRegisterId(), | |
| 1502 | + data.getAreaRegisterId(), data.getStreetRegisterId(), data.getAddressRegister(), basicConfigService)); | |
| 1503 | + map.put("postRest",CommonsHelper.getResidence(data.getProvinceId(), data.getCityId(), | |
| 1504 | + data.getAreaId(), data.getStreetId(), data.getAddress(), basicConfigService)); | |
| 1505 | + | |
| 1506 | + /* 丈夫信息 */ | |
| 1507 | + map.put("husbandName",data.getHusbandName()); | |
| 1508 | + map.put("hcertificateType",getBasicConfig(data.getHcertificateTypeId())); | |
| 1509 | + map.put("hcertificateNum",data.getHcertificateNum()); | |
| 1510 | + map.put("hcountry",getBasicConfig(data.getHcountryId())); | |
| 1511 | + map.put("hnation",getBasicConfig(data.getHnationId())); | |
| 1512 | + map.put("husbandPhone",data.getHusbandPhone()); | |
| 1513 | + map.put("hprofessionType",getBasicConfig(data.getHprofessionTypeId())); | |
| 1514 | + map.put("hworkUnit",data.getHworkUnit()); | |
| 1515 | + map.put("hregister",CommonsHelper.getResidence(data.getHprovinceRegisterId(), data.getHcityRegisterId(), | |
| 1516 | + data.getHareaRegisterId(), data.getHstreetRegisterId(), data.getHaddressRegister(), | |
| 1517 | + basicConfigService)); | |
| 1518 | + | |
| 1519 | + /* 院内信息 */ | |
| 1520 | + map.put("lastMenses",DateUtil.getyyyy_MM_dd(data.getLastMenses())); | |
| 1521 | + //TODO 纠正末次月经 | |
| 1522 | + map.put("dueDate",DateUtil.getyyyy_MM_dd(data.getDueDate())); | |
| 1523 | + map.put("vcCardNo",data.getVcCardNo()); | |
| 1524 | + //TODO 条码 | |
| 1525 | + //TODO 档案编号 | |
| 1526 | + map.put("mremark",data.getMremark()); | |
| 1527 | + //TODO 服务类型 | |
| 1528 | + map.put("serviceStatus",ServiceStatusEnums.getNameById(data.getServiceStatus())); | |
| 1529 | + | |
| 1530 | + br.setData(map); | |
| 1531 | + br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 1532 | + br.setErrormsg("成功"); | |
| 1533 | + return br; | |
| 1534 | + } | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1462 | 1538 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
3e2b9f1
| ... | ... | @@ -12,6 +12,8 @@ |
| 12 | 12 | import com.lyms.platform.operate.web.request.NewBabyManagerRequest; |
| 13 | 13 | import com.lyms.platform.operate.web.result.*; |
| 14 | 14 | import com.lyms.platform.operate.web.utils.CommonsHelper; |
| 15 | +import com.lyms.platform.operate.web.utils.FunvCommonUtil; | |
| 16 | +import com.lyms.platform.operate.web.utils.ResolveUtils; | |
| 15 | 17 | import com.lyms.platform.permission.model.Organization; |
| 16 | 18 | import com.lyms.platform.permission.model.OrganizationQuery; |
| 17 | 19 | import com.lyms.platform.permission.model.Users; |
| 18 | 20 | |
| ... | ... | @@ -33,15 +35,13 @@ |
| 33 | 35 | |
| 34 | 36 | /** |
| 35 | 37 | * 分娩记录信息 |
| 36 | - * <p/> | |
| 38 | + * <p> | |
| 37 | 39 | * Created by Administrator on 2016/6/17 0017. |
| 38 | 40 | */ |
| 39 | 41 | @Component |
| 40 | 42 | public class MatDeliverFacade { |
| 41 | 43 | |
| 42 | 44 | private Logger logger = LoggerFactory.getLogger(MatDeliverFacade.class); |
| 43 | - @Autowired | |
| 44 | - private PatientCheckTicketService patientCheckTicketService; | |
| 45 | 45 | |
| 46 | 46 | @Autowired |
| 47 | 47 | private MatDeliverService matDeliverService; |
| ... | ... | @@ -136,7 +136,7 @@ |
| 136 | 136 | |
| 137 | 137 | //表示区域的 |
| 138 | 138 | if (StringUtils.isNotEmpty(organizationGroupsFacade.findByCurrentUserId(hospitalId))) { |
| 139 | - String parentId = antenatalExaminationFacade.handHideBuild(deliverAddRequest.getPid(), deliverAddRequest.getParentId(), userId, -1); | |
| 139 | + String parentId =antenatalExaminationFacade.handHideBuild(deliverAddRequest.getPid(), deliverAddRequest.getParentId(), userId,-1); | |
| 140 | 140 | if (StringUtils.isEmpty(parentId)) { |
| 141 | 141 | logger.warn("get handHideBuild parentId is null."); |
| 142 | 142 | } |
| ... | ... | @@ -196,11 +196,7 @@ |
| 196 | 196 | patientsLocal.setIsAutoFm(YnEnums.NO.getId()); |
| 197 | 197 | patientsLocal.setType(3); |
| 198 | 198 | patientsLocal.setFmHospital(deliverAddRequest.getFmHospital()); |
| 199 | - //自动分娩的时候修改buildtype为0 http://jira.healthbaby.com.cn/browse/WEB-808 | |
| 200 | - if (null != patients1.getBuildType() && patients1.getBuildType() == 2) { | |
| 201 | - patientsLocal.setBuildType(0); | |
| 202 | - } | |
| 203 | - patientsLocal.setFmType(MapUtils.isNotEmpty(deliverAddRequest.getDeliveryMode()) ? null : deliverAddRequest.getDeliveryMode().toString()); | |
| 199 | + patientsLocal.setFmType(MapUtils.isNotEmpty(deliverAddRequest.getDeliveryMode())?null:deliverAddRequest.getDeliveryMode().toString()); | |
| 204 | 200 | try { |
| 205 | 201 | patientsLocal.setFmAge(DateUtil.getAge(patients1.getBirth(), fmDate)); |
| 206 | 202 | } catch (Exception e) { |
| ... | ... | @@ -258,10 +254,6 @@ |
| 258 | 254 | |
| 259 | 255 | maternalDeliverModel.setYn(YnEnums.YES.getId()); |
| 260 | 256 | matDeliverService.addMatDeliver(maternalDeliverModel); |
| 261 | - | |
| 262 | - | |
| 263 | - //作废产检劵 | |
| 264 | - patientCheckTicketService.cancelCheckTicket(hospitalId, deliverAddRequest.getParentId()); | |
| 265 | 257 | //修改 |
| 266 | 258 | } else if (StringUtils.isNotEmpty(deliverAddRequest.getId()) && StringUtils.isNotEmpty(deliverAddRequest.getParentId())) { |
| 267 | 259 | |
| 268 | 260 | |
| ... | ... | @@ -315,33 +307,28 @@ |
| 315 | 307 | if (CollectionUtils.isNotEmpty(list)) { |
| 316 | 308 | for (MatDeliverAddRequest.Baby baby : list) { |
| 317 | 309 | MaternalDeliverModel.Baby babyModel = baby.convertToDataModel(); |
| 318 | - | |
| 319 | - //表示修改了新生儿 | |
| 320 | - if(com.lyms.platform.common.utils.StringUtils.isNotEmpty(babyModel.getId())){ | |
| 321 | - //判断妊娠结局是活产才添加数据 | |
| 322 | - BabyModel babyModel1 = new BabyModel(); | |
| 323 | - BabyModelQuery query = new BabyModelQuery(); | |
| 324 | - query.setParentId(deliverAddRequest.getParentId()); | |
| 325 | - query.setId(babyModel.getId()); | |
| 326 | - | |
| 327 | - if ((RenShenJieJuEnums.O.getId() + "").equals(baby.getPregnancyOut())) { | |
| 328 | - babyModel1.setYn(YnEnums.YES.getId()); | |
| 329 | - } else { | |
| 330 | - babyModel1.setYn(YnEnums.NO.getId()); | |
| 331 | - } | |
| 332 | - babyModel1.setBirth(DateUtil.parseYMD(baby.getDueTime())); | |
| 333 | - babyModel1.setSex(Integer.valueOf(baby.getBabyGender())); | |
| 334 | - Map map = deliverAddRequest.getDeliveryMode(); | |
| 335 | - String fmfs = null; | |
| 336 | - if (!map.isEmpty()) { | |
| 337 | - fmfs = map.get("fmfs").toString(); | |
| 338 | - } | |
| 339 | - babyModel1.setDueType(fmfs); | |
| 340 | - babyModel1.setBabyHeight(baby.getBabyHeight()); | |
| 341 | - babyModel1.setBabyWeight(baby.getBabyWeight()); | |
| 342 | - babyService.findAndModify(query.convertToQuery(), babyModel1); | |
| 343 | - babyList.add(babyModel); | |
| 310 | + //判断妊娠结局是活产才添加数据 | |
| 311 | + BabyModel babyModel1=new BabyModel(); | |
| 312 | + MatDeliverQuery query=new MatDeliverQuery(); | |
| 313 | + query.setId(deliverAddRequest.getId()); | |
| 314 | + babyModel1.setParentId(deliverAddRequest.getParentId()); | |
| 315 | + if ((RenShenJieJuEnums.O.getId() + "").equals(baby.getPregnancyOut())) { | |
| 316 | + babyModel1.setYn(YnEnums.YES.getId()); | |
| 317 | + }else{ | |
| 318 | + babyModel1.setYn(YnEnums.NO.getId()); | |
| 344 | 319 | } |
| 320 | + babyModel1.setBirth(DateUtil.parseYMD(baby.getDueTime())); | |
| 321 | + babyModel1.setSex(Integer.valueOf(baby.getBabyGender())); | |
| 322 | + Map map = deliverAddRequest.getDeliveryMode(); | |
| 323 | + String fmfs = null; | |
| 324 | + if (!map.isEmpty()) { | |
| 325 | + fmfs = map.get("fmfs").toString(); | |
| 326 | + } | |
| 327 | + babyModel1.setDueType(fmfs); | |
| 328 | + babyModel1.setBabyHeight(baby.getBabyHeight()); | |
| 329 | + babyModel1.setBabyWeight(baby.getBabyWeight()); | |
| 330 | + babyService.findAndModify(query.convertToQuery(), babyModel1); | |
| 331 | + babyList.add(babyModel); | |
| 345 | 332 | } |
| 346 | 333 | maternalDeliverModel.setBaby(babyList); |
| 347 | 334 | } |
| 348 | 335 | |
| ... | ... | @@ -359,13 +346,9 @@ |
| 359 | 346 | patients1.setFmDate(fmDate); |
| 360 | 347 | // HuJiaqi添加开始,这里冗余了分娩分娩医院,分娩年龄,分娩孕周,分娩方式,并将状态更改为产妇 |
| 361 | 348 | patients1.setType(3); |
| 362 | - //自动分娩的时候修改buildtype为0 http://jira.healthbaby.com.cn/browse/WEB-808 | |
| 363 | - if (null != patients.getBuildType() && patients.getBuildType() == 2) { | |
| 364 | - patients1.setBuildType(0); | |
| 365 | - } | |
| 366 | 349 | patients1.setIsAutoFm(YnEnums.NO.getId()); |
| 367 | 350 | patients1.setFmHospital(deliverAddRequest.getFmHospital()); |
| 368 | - patients1.setFmType(MapUtils.isNotEmpty(deliverAddRequest.getDeliveryMode()) ? null : deliverAddRequest.getDeliveryMode().toString()); | |
| 351 | + patients1.setFmType(MapUtils.isNotEmpty(deliverAddRequest.getDeliveryMode())?null:deliverAddRequest.getDeliveryMode().toString()); | |
| 369 | 352 | try { |
| 370 | 353 | patients1.setFmAge(DateUtil.getAge(patients1.getBirth(), fmDate)); |
| 371 | 354 | } catch (Exception e) { |
| ... | ... | @@ -410,10 +393,6 @@ |
| 410 | 393 | if (fmDate.getTime() >= DateUtil.addDay(patients.getLastMenses(), 168).getTime()) { |
| 411 | 394 | patients.setFmDate(fmDate); |
| 412 | 395 | patients.setType(3); |
| 413 | - //自动分娩的时候修改buildtype为0 http://jira.healthbaby.com.cn/browse/WEB-808 | |
| 414 | - if (null != patients.getBuildType() && patients.getBuildType() == 2) { | |
| 415 | - patients.setBuildType(0); | |
| 416 | - } | |
| 417 | 396 | patientsService.updatePatient(patients); |
| 418 | 397 | } |
| 419 | 398 | } |
| ... | ... | @@ -597,7 +576,7 @@ |
| 597 | 576 | */ |
| 598 | 577 | public BaseResponse queryMatDeliver(MatDeliverQueryRequest deliverQueryRequest, Integer userId) { |
| 599 | 578 | |
| 600 | - String hospital = autoMatchFacade.getHospitalId(userId); | |
| 579 | + String hospital=autoMatchFacade.getHospitalId(userId); | |
| 601 | 580 | //获取 |
| 602 | 581 | /* Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, hospital, -1); |
| 603 | 582 | if (null == patients) { |
| 604 | 583 | |
| 605 | 584 | |
| 606 | 585 | |
| 607 | 586 | |
| 608 | 587 | |
| 609 | 588 | |
| 610 | 589 | |
| 611 | 590 | |
| ... | ... | @@ -606,34 +585,28 @@ |
| 606 | 585 | |
| 607 | 586 | Organization og = organizationService.getOrganization(Integer.valueOf(hospital)); |
| 608 | 587 | //区域模式 |
| 609 | - boolean isEnable = og.getbStatus() == 1; | |
| 588 | + boolean isEnable=og.getbStatus()==1; | |
| 610 | 589 | |
| 611 | 590 | //外院的孕妇 |
| 612 | - Patients patients1 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, null, 1, false, null, true); | |
| 591 | + Patients patients1 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, null, 1, false, null,true); | |
| 613 | 592 | //外院的产妇 |
| 614 | 593 | // Patients patients2 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, null, 3); |
| 615 | 594 | |
| 616 | 595 | //http://jira.healthbaby.com.cn/browse/WEB-204 修改bug |
| 617 | 596 | //本院的孕妇 |
| 618 | - Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, organizationGroupsFacade.findGroupHospital(userId, false), 1, false, null, isEnable); | |
| 597 | + Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, organizationGroupsFacade.findGroupHospital(userId,false), 1, false, null,isEnable); | |
| 619 | 598 | //本院产妇 |
| 620 | - Patients patients3 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, organizationGroupsFacade.findGroupHospital(userId, false), 3, false, null, isEnable); | |
| 599 | + Patients patients3 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, organizationGroupsFacade.findGroupHospital(userId,false), 3, false, null,isEnable); | |
| 621 | 600 | PersonModelQuery personModelQuery = new PersonModelQuery(); |
| 622 | 601 | String pid = ""; |
| 623 | - Integer buildType = null; | |
| 624 | 602 | if (null != patients1) { |
| 625 | 603 | pid = patients1.getPid(); |
| 626 | - buildType = patients1.getBuildType(); | |
| 627 | 604 | } else if (null != patients) { |
| 628 | 605 | pid = patients.getPid(); |
| 629 | - buildType = patients.getBuildType(); | |
| 630 | 606 | } else if (null != patients3) { |
| 631 | 607 | pid = patients3.getPid(); |
| 632 | - buildType = patients3.getBuildType(); | |
| 633 | 608 | } |
| 634 | - //http://jira.healthbaby.com.cn/browse/WEB-795 | |
| 635 | - if (StringUtils.isNotEmpty(pid) && null != buildType && | |
| 636 | - buildType != 2) { | |
| 609 | + if (StringUtils.isNotEmpty(pid)) { | |
| 637 | 610 | personModelQuery.setId(pid); |
| 638 | 611 | List<PersonModel> personModels = personService.queryPersons(personModelQuery); |
| 639 | 612 | if (CollectionUtils.isNotEmpty(personModels)) { |
| ... | ... | @@ -1148,7 +1121,7 @@ |
| 1148 | 1121 | // 居住类型 |
| 1149 | 1122 | if (childbirthManagerRequest.getInitQuery().contains("pliveTypeId")) { |
| 1150 | 1123 | try { |
| 1151 | - if (StringUtils.isNotEmpty(patients.getPliveTypeId())) { | |
| 1124 | + if(StringUtils.isNotEmpty(patients.getPliveTypeId())) { | |
| 1152 | 1125 | childbirthManagerQueryModel.setPliveTypeId(basicConfigService.getOneBasicConfigById(patients.getPliveTypeId()).getName()); |
| 1153 | 1126 | } |
| 1154 | 1127 | } catch (Exception e) { |
| ... | ... | @@ -1159,7 +1132,7 @@ |
| 1159 | 1132 | // 户口类型 |
| 1160 | 1133 | if (childbirthManagerRequest.getInitQuery().contains("pcensusTypeId")) { |
| 1161 | 1134 | try { |
| 1162 | - if (StringUtils.isNotEmpty(patients.getPcensusTypeId())) { | |
| 1135 | + if(StringUtils.isNotEmpty(patients.getPcensusTypeId())) { | |
| 1163 | 1136 | childbirthManagerQueryModel.setPcensusTypeId(basicConfigService.getOneBasicConfigById(patients.getPcensusTypeId()).getName()); |
| 1164 | 1137 | } |
| 1165 | 1138 | } catch (Exception e) { |
| 1166 | 1139 | |
| ... | ... | @@ -1173,15 +1146,10 @@ |
| 1173 | 1146 | BabyModelQuery babyModelQuery = new BabyModelQuery(); |
| 1174 | 1147 | babyModelQuery.setYn(YnEnums.YES.getId()); |
| 1175 | 1148 | babyModelQuery.setParentId(patients.getId()); |
| 1149 | + babyModelQuery.setPregnancyOut(RenShenJieJuEnums.O.getId()); | |
| 1176 | 1150 | List<BabyModel> babyModelList = babyService.queryBabyWithQuery(babyModelQuery); |
| 1177 | 1151 | if (CollectionUtils.isNotEmpty(babyModelList)) { |
| 1178 | - int i = 0; | |
| 1179 | - for (BabyModel babyModel : babyModelList) { | |
| 1180 | - if (RenShenJieJuEnums.O.getId().equals(babyModel.getPregnancyOut())) { | |
| 1181 | - i++; | |
| 1182 | - } | |
| 1183 | - } | |
| 1184 | - childbirthManagerQueryModel.setLivingNumber(i); | |
| 1152 | + childbirthManagerQueryModel.setLivingNumber(babyModelList.size()); | |
| 1185 | 1153 | } else { |
| 1186 | 1154 | if (childbirthManagerQueryModel.getTireNumber() == null) { |
| 1187 | 1155 | childbirthManagerQueryModel.setLivingNumber(null); |
| ... | ... | @@ -1279,10 +1247,6 @@ |
| 1279 | 1247 | childbirthManagerQueryModel.setLoseBloodCause(""); |
| 1280 | 1248 | } |
| 1281 | 1249 | } |
| 1282 | - // 1/2/24小时失血量 | |
| 1283 | - childbirthManagerQueryModel.setOhloseBloodL(maternalDeliverModel.getsHloseBloodL()); | |
| 1284 | - childbirthManagerQueryModel.setThloseBloodL(maternalDeliverModel.gettHloseBloodL()); | |
| 1285 | - childbirthManagerQueryModel.setRhloseBloodL(maternalDeliverModel.getrHloseBloodL()); | |
| 1286 | 1250 | |
| 1287 | 1251 | // 查询分娩方式 |
| 1288 | 1252 | childbirthManagerQueryModel.setMaternalDeliverId(maternalDeliverModel.getId()); |
| 1289 | 1253 | |
| 1290 | 1254 | |
| ... | ... | @@ -1382,19 +1346,19 @@ |
| 1382 | 1346 | Map<String, String> prodprocessOne = prodprocessMap.get("one"); |
| 1383 | 1347 | if (MapUtils.isNotEmpty(prodprocessOne)) { |
| 1384 | 1348 | childbirthManagerQueryModel.setProdprocessOne(prodprocessOne.get("h") + "时," + prodprocessOne.get("m") + "分"); |
| 1385 | - } else { | |
| 1349 | + }else{ | |
| 1386 | 1350 | childbirthManagerQueryModel.setProdprocessOne(""); |
| 1387 | 1351 | } |
| 1388 | 1352 | Map<String, String> prodprocessTwo = prodprocessMap.get("two"); |
| 1389 | 1353 | if (MapUtils.isNotEmpty(prodprocessTwo)) { |
| 1390 | 1354 | childbirthManagerQueryModel.setProdprocessTwo(prodprocessTwo.get("h") + "时," + prodprocessTwo.get("m") + "分"); |
| 1391 | - } else { | |
| 1355 | + }else{ | |
| 1392 | 1356 | childbirthManagerQueryModel.setProdprocessTwo(""); |
| 1393 | 1357 | } |
| 1394 | 1358 | Map<String, String> prodprocessThree = prodprocessMap.get("three"); |
| 1395 | 1359 | if (MapUtils.isNotEmpty(prodprocessThree)) { |
| 1396 | 1360 | childbirthManagerQueryModel.setProdprocessThree(prodprocessThree.get("h") + "时," + prodprocessThree.get("m") + "分"); |
| 1397 | - } else { | |
| 1361 | + }else{ | |
| 1398 | 1362 | childbirthManagerQueryModel.setProdprocessThree(""); |
| 1399 | 1363 | } |
| 1400 | 1364 | } |
| ... | ... | @@ -1402,8 +1366,8 @@ |
| 1402 | 1366 | // 总产程 |
| 1403 | 1367 | Map<String, String> totalprocessMap = JsonUtil.getMap(maternalDeliverModel.getTotalprocess()); |
| 1404 | 1368 | if (MapUtils.isNotEmpty(totalprocessMap)) { |
| 1405 | - childbirthManagerQueryModel.setTotalprocess(totalprocessMap.get("h") + "时," + totalprocessMap.get("m") + "分"); | |
| 1406 | - } else { | |
| 1369 | + childbirthManagerQueryModel.setTotalprocess(totalprocessMap.get("h") + "时" + totalprocessMap.get("m") + "分"); | |
| 1370 | + }else{ | |
| 1407 | 1371 | childbirthManagerQueryModel.setTotalprocess(""); |
| 1408 | 1372 | } |
| 1409 | 1373 | |
| ... | ... | @@ -1511,7 +1475,6 @@ |
| 1511 | 1475 | } |
| 1512 | 1476 | babyModelQuery.setHospitalId(autoMatchFacade.getHospitalId(newBabyManagerRequest.getOperatorId())); |
| 1513 | 1477 | babyModelQuery.setBuildType(2); |
| 1514 | - babyModelQuery.setOrder("birth"); | |
| 1515 | 1478 | List<BabyModel> babyModelList = babyService.queryBabyWithQuery(babyModelQuery); |
| 1516 | 1479 | if (CollectionUtils.isEmpty(babyModelList)) { |
| 1517 | 1480 | newBabyManagerResult.setPageInfo(babyModelQuery.getPageInfo()); |
| ... | ... | @@ -1528,8 +1491,8 @@ |
| 1528 | 1491 | matDeliverQuery.setParentIdList(parentIdList); |
| 1529 | 1492 | List<MaternalDeliverModel> maternalDeliverModelList = matDeliverService.query(matDeliverQuery); |
| 1530 | 1493 | List<NewBabyManagerQueryModel> newBabyManagerQueryModelList = new ArrayList<>(); |
| 1531 | - for (BabyModel babyModel : babyModelList) { | |
| 1532 | - for (MaternalDeliverModel maternalDeliverModel : maternalDeliverModelList) { | |
| 1494 | + for (MaternalDeliverModel maternalDeliverModel : maternalDeliverModelList) { | |
| 1495 | + for (BabyModel babyModel : babyModelList) { | |
| 1533 | 1496 | if (maternalDeliverModel.getParentId().equals(babyModel.getParentId())) { |
| 1534 | 1497 | NewBabyManagerQueryModel newBabyManagerQueryModel = new NewBabyManagerQueryModel(); |
| 1535 | 1498 | BeanUtils.copy(babyModel, newBabyManagerQueryModel); |
| ... | ... | @@ -1577,5 +1540,340 @@ |
| 1577 | 1540 | newBabyManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); |
| 1578 | 1541 | return newBabyManagerResult; |
| 1579 | 1542 | } |
| 1543 | + | |
| 1544 | + public BaseObjectResponse findMatDeliverData(String id){ | |
| 1545 | + | |
| 1546 | + BaseObjectResponse br = new BaseObjectResponse(); | |
| 1547 | + | |
| 1548 | + if (org.apache.commons.lang.StringUtils.isEmpty(id)){ | |
| 1549 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 1550 | + br.setErrormsg("id为空"); | |
| 1551 | + return br; | |
| 1552 | + } | |
| 1553 | + | |
| 1554 | + MaternalDeliverModel data = matDeliverService.getOneMatDeliver(id); | |
| 1555 | + if (data==null || data.getYn()==YnEnums.NO.getId()){ | |
| 1556 | + br.setErrorcode(ErrorCodeConstants.NO_DATA); | |
| 1557 | + br.setErrormsg("没有查询到数据"); | |
| 1558 | + return br; | |
| 1559 | + } | |
| 1560 | + | |
| 1561 | + /* 基本信息 */ | |
| 1562 | + if (StringUtils.isEmpty(data.getParentId())){ | |
| 1563 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 1564 | + br.setErrormsg("数据异常"); | |
| 1565 | + return br; | |
| 1566 | + } | |
| 1567 | + | |
| 1568 | + Patients patients = patientsService.findOnePatientById(data.getParentId()); | |
| 1569 | + | |
| 1570 | + if (patients==null){ | |
| 1571 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 1572 | + br.setErrormsg("数据异常"); | |
| 1573 | + return br; | |
| 1574 | + } | |
| 1575 | + | |
| 1576 | + Map<String,Object> map= new HashMap<>(); | |
| 1577 | + map.put("id",data.getId()); | |
| 1578 | + map.put("username",patients.getUsername()); | |
| 1579 | + map.put("birth",DateUtil.getyyyy_MM_dd(patients.getBirth())); | |
| 1580 | + map.put("age",DateUtil.getAge(patients.getBirth())); | |
| 1581 | + map.put("phone",patients.getPhone()); | |
| 1582 | + map.put("fmWeek",patients.getFmWeek()); | |
| 1583 | + map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); | |
| 1584 | + map.put("mremark",patients.getMremark()); | |
| 1585 | + map.put("oRiskFactor",patients.getoRiskFactor()); | |
| 1586 | + map.put("riskLevel", FunvCommonUtil.getBaseicConfigByid(patients.getRiskLevelId(),basicConfigService)); | |
| 1587 | + map.put("riskScore",patients.getRiskScore()); | |
| 1588 | + | |
| 1589 | + map.put("deliveryDate", data.getDueDate()); | |
| 1590 | + map.put("dueWeek", data.getDueWeek()); | |
| 1591 | + | |
| 1592 | + String fmHospital = ""; | |
| 1593 | + | |
| 1594 | + if (StringUtils.isNotEmpty(data.getFmHospital())){ | |
| 1595 | + Organization organization = organizationService.getOrganization(Integer.parseInt(data.getFmHospital())); | |
| 1596 | + if (organization!=null && organization.getYn()==YnEnums.YES.getId()){ | |
| 1597 | + fmHospital = organization.getName(); | |
| 1598 | + } | |
| 1599 | + } | |
| 1600 | + | |
| 1601 | + map.put("fmHospital", fmHospital); | |
| 1602 | + | |
| 1603 | + String deliverDoctor = ""; | |
| 1604 | + | |
| 1605 | + if (StringUtils.isNotEmpty(data.getDeliverDoctor())){ | |
| 1606 | + Users users = usersService.getUsers(Integer.parseInt(data.getDeliverDoctor())); | |
| 1607 | + if (users!=null && users.getYn()==YnEnums.YES.getId()){ | |
| 1608 | + deliverDoctor = users.getName(); | |
| 1609 | + } | |
| 1610 | + } | |
| 1611 | + | |
| 1612 | + map.put("deliverDoctor", deliverDoctor); | |
| 1613 | + | |
| 1614 | + /* 分娩信息 */ | |
| 1615 | + String tireNumber = ""; | |
| 1616 | + if (data.getTireNumber()!=null){ | |
| 1617 | + | |
| 1618 | + } | |
| 1619 | + map.put("tireNumber", tireNumber);//胎数 | |
| 1620 | + map.put("placenta", data.getPlacenta());//胎盘 | |
| 1621 | + | |
| 1622 | + List<Map<String,Object>> placetaList = new ArrayList<>(); | |
| 1623 | + | |
| 1624 | + if (CollectionUtils.isNotEmpty(data.getPlacentas())){ | |
| 1625 | + @SuppressWarnings("unchecked") | |
| 1626 | + List<MatDeliverAddRequest.Placenta> placentas = data.getPlacentas(); | |
| 1627 | + if (CollectionUtils.isNotEmpty(placentas)){ | |
| 1628 | + for (Object obj : placentas) { | |
| 1629 | + | |
| 1630 | + String fetalPosition = ""; | |
| 1631 | + String fetalPresentation = ""; | |
| 1632 | + String heartRate = ""; | |
| 1633 | + | |
| 1634 | + if ("com.lyms.platform.operate.web.request.MatDeliverAddRequest$Placenta".equals(obj.getClass().getName())) { | |
| 1635 | + //转换类型 | |
| 1636 | + MatDeliverAddRequest.Placenta placenta = (MatDeliverAddRequest.Placenta) obj; | |
| 1637 | + if (placenta!=null){ | |
| 1638 | + //胎方位 | |
| 1639 | + if (StringUtils.isNotEmpty(placenta.getFetalPosition())){ | |
| 1640 | + for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) { | |
| 1641 | + if (fetalPositionEnums.getId().equals(placenta.getFetalPosition())) { | |
| 1642 | + fetalPosition += fetalPositionEnums.getName(); | |
| 1643 | + break; | |
| 1644 | + } | |
| 1645 | + } | |
| 1646 | + } | |
| 1647 | + //胎先露 | |
| 1648 | + fetalPresentation += placenta.getFetalPresentation() == null ? "" : placenta.getFetalPresentation(); | |
| 1649 | + //胎心率 | |
| 1650 | + heartRate += placenta.getHeartRate() == null ? "" : placenta.getHeartRate().toString(); | |
| 1651 | + } | |
| 1652 | + } | |
| 1653 | + | |
| 1654 | + if ("java.util.LinkedHashMap".equals(obj.getClass().getName())) { | |
| 1655 | + Map<String, String> placenta = JsonUtil.getMap(obj.toString()); | |
| 1656 | + if (MapUtils.isNotEmpty(placenta)) { | |
| 1657 | + if (placenta.get("fetalPosition")!=null){ | |
| 1658 | + for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) { | |
| 1659 | + if (fetalPositionEnums.getId().equals(placenta.get("fetalPosition"))) { | |
| 1660 | + fetalPosition += fetalPositionEnums.getName(); | |
| 1661 | + break; | |
| 1662 | + } | |
| 1663 | + } | |
| 1664 | + } | |
| 1665 | + heartRate += placenta.get("heartRate") == null ? "" : placenta.get("heartRate"); | |
| 1666 | + fetalPresentation += placenta.get("fetalPresentation") == null ? "" : placenta.get("fetalPresentation"); | |
| 1667 | + } | |
| 1668 | + } | |
| 1669 | + Map<String,Object> placetaMap = new HashMap<>(); | |
| 1670 | + placetaMap.put("fetalPosition",fetalPosition); | |
| 1671 | + placetaMap.put("fetalPresentation",fetalPresentation); | |
| 1672 | + placetaMap.put("heartRate",heartRate); | |
| 1673 | + placetaList.add(placetaMap); | |
| 1674 | + } | |
| 1675 | + } | |
| 1676 | + } | |
| 1677 | + | |
| 1678 | + map.put("placentaData", placetaList);//胎盘信息 | |
| 1679 | + | |
| 1680 | + String deliveryMode = ""; | |
| 1681 | + if (StringUtils.isNotEmpty(data.getDeliveryMode())){ | |
| 1682 | + | |
| 1683 | + StringBuilder sb = new StringBuilder(); | |
| 1684 | + | |
| 1685 | + Map m = JsonUtil.str2Obj(data.getDeliveryMode(),Map.class); | |
| 1686 | + String fmfs = null; | |
| 1687 | + if (m!=null){ | |
| 1688 | + Object b = m.get("fmfs"); | |
| 1689 | + if (b!=null){ | |
| 1690 | + fmfs = b.toString(); | |
| 1691 | + if (fmfs!=null){ | |
| 1692 | + if (fmfs.equals("1")){ | |
| 1693 | + String fmName = FmTypeEnums.getFmNameById(fmfs); | |
| 1694 | + sb.append(fmName).append(","); | |
| 1695 | + String scfs = m.get("scfs").toString(); | |
| 1696 | + sb.append(FmTypeEnums.getFmScNameById(scfs)); | |
| 1697 | + deliveryMode = sb.toString(); | |
| 1698 | + }else if (fmfs.equals("2")){ | |
| 1699 | + String fmName = FmTypeEnums.getFmNameById(fmfs); | |
| 1700 | + deliveryMode = fmName; | |
| 1701 | + } | |
| 1702 | + } | |
| 1703 | + } | |
| 1704 | + } | |
| 1705 | + } | |
| 1706 | + map.put("deliveryMode", deliveryMode);//分娩方式 | |
| 1707 | + map.put("operationCause", data.getOperationCause()==null ? "--":data.getOperationCause()); | |
| 1708 | + | |
| 1709 | + findProcess(data.getProdprocess(), map);//1,2,3产程 | |
| 1710 | + findTotalProcess(data.getTotalprocess(),map);//总产程 | |
| 1711 | + | |
| 1712 | + map.put("perinealCondition", data.getPerinealCondition()); | |
| 1713 | + | |
| 1714 | + //TODO 撕裂等级 | |
| 1715 | + | |
| 1716 | + map.put("needleNum", data.getNeedleNum()); | |
| 1717 | + | |
| 1718 | + /* 产后生理 */ | |
| 1719 | + map.put("maternalInfo", data.getMaternalInfo()); | |
| 1720 | + map.put("deathCause", data.getDeathCause()==null ? "--" : data.getDeathCause()); | |
| 1721 | + // 产后血压 收缩压,舒张压 | |
| 1722 | + String ssy = ""; | |
| 1723 | + String szy = ""; | |
| 1724 | + Map<String, String> chBpMap = JsonUtil.getMap(data.getChBp()); | |
| 1725 | + if (MapUtils.isNotEmpty(chBpMap)) { | |
| 1726 | + ssy = chBpMap.get("ssy"); | |
| 1727 | + szy = chBpMap.get("szy"); | |
| 1728 | + } | |
| 1729 | + map.put("ssy", ssy); | |
| 1730 | + map.put("szy", szy); | |
| 1731 | + // 产后2小时血压 收缩压,舒张压 | |
| 1732 | + String ssy2h = ""; | |
| 1733 | + String szy2h = ""; | |
| 1734 | + Map<String, String> ch2BpMap = JsonUtil.getMap(data.getCh2Bp()); | |
| 1735 | + if (MapUtils.isNotEmpty(ch2BpMap)) { | |
| 1736 | + ssy2h = ch2BpMap.get("ssy"); | |
| 1737 | + szy2h = ch2BpMap.get("szy"); | |
| 1738 | + } | |
| 1739 | + map.put("ssy2h", ssy2h); | |
| 1740 | + map.put("szy2h", szy2h); | |
| 1741 | + | |
| 1742 | + map.put("breath", data.getBreath()); | |
| 1743 | + map.put("pulse", data.getPulse()); | |
| 1744 | + | |
| 1745 | + map.put("oHloseBloodL", data.getoHloseBloodL()); | |
| 1746 | + map.put("tHloseBloodL", data.gettHloseBloodL()); | |
| 1747 | + map.put("rHloseBloodL", data.getrHloseBloodL()); | |
| 1748 | + map.put("sHloseBloodL", data.getsHloseBloodL()); | |
| 1749 | + map.put("loseBloodCause", data.getLoseBloodCause()); | |
| 1750 | + //产科并发症(需要解析) | |
| 1751 | + map.put("ocs", ResolveUtils.replace(JsonUtil.str2Obj(data.getOcs(),Map.class))); | |
| 1752 | + | |
| 1753 | + /* 胎盘及新生儿信息 */ | |
| 1754 | + | |
| 1755 | + //胎盘信息 | |
| 1756 | + List<Map<String,Object>> ExtPlacentaList = new ArrayList<>(); | |
| 1757 | + | |
| 1758 | + if (CollectionUtils.isNotEmpty(data.getExtPlacentas())){ | |
| 1759 | + for (MaternalDeliverModel.ExtPlacenta temp : data.getExtPlacentas()){ | |
| 1760 | + Map<String,Object> extMap = new HashMap<>(); | |
| 1761 | + extMap.put("tpmcType", TaiShuEnums.getTpNameById(temp.getTpmcType())); | |
| 1762 | + //TODO 娩出方式??? | |
| 1763 | + String tpSize = ""; | |
| 1764 | + tpSize += temp.getTpSize().get("c") + "*" + temp.getTpSize().get("k") + "*" + temp.getTpSize().get("g") + "cm"; | |
| 1765 | + extMap.put("tpSize",tpSize); | |
| 1766 | + extMap.put("tpWeight",temp.getTpWeight()); | |
| 1767 | + extMap.put("umbilicalCordLength",temp.getUmbilicalCordLength()); | |
| 1768 | + | |
| 1769 | + String umbilicalCordEx = ""; | |
| 1770 | + String umbilicalCordExType = ""; | |
| 1771 | + | |
| 1772 | + if (StringUtils.isNotEmpty(temp.getUmbilicalCordEx())){ | |
| 1773 | + if (temp.getUmbilicalCordEx().equals("no")){ | |
| 1774 | + umbilicalCordEx = "无"; | |
| 1775 | + }else if (temp.getUmbilicalCordEx().equals("yes")){ | |
| 1776 | + umbilicalCordEx = "有"; | |
| 1777 | + if (StringUtils.isNotEmpty(temp.getUmbilicalCordExType())){ | |
| 1778 | + for (QiDaiEnums qiDaiEnums : QiDaiEnums.values()){ | |
| 1779 | + if (qiDaiEnums.getId().equals(temp.getUmbilicalCordExType())){ | |
| 1780 | + umbilicalCordExType = qiDaiEnums.getName(); | |
| 1781 | + } | |
| 1782 | + } | |
| 1783 | + } | |
| 1784 | + } | |
| 1785 | + } | |
| 1786 | + extMap.put("umbilicalCordEx",umbilicalCordEx); | |
| 1787 | + extMap.put("umbilicalCordExType",umbilicalCordExType); | |
| 1788 | + | |
| 1789 | + ExtPlacentaList.add(extMap); | |
| 1790 | + } | |
| 1791 | + } | |
| 1792 | + map.put("ExtPlacentaList", ExtPlacentaList); | |
| 1793 | + | |
| 1794 | + //新生儿信息 | |
| 1795 | + | |
| 1796 | + List<Map<String,Object>> babyList = new ArrayList<>(); | |
| 1797 | + | |
| 1798 | + if (CollectionUtils.isNotEmpty(data.getBaby())){ | |
| 1799 | + for (MaternalDeliverModel.Baby temp : data.getBaby()){ | |
| 1800 | + Map<String,Object> babyMap = new HashMap<>(); | |
| 1801 | + babyMap.put("dueTime",temp.getDueTime()); | |
| 1802 | + babyMap.put("pregnancyOut",temp.getPregnancyOut()); | |
| 1803 | + babyMap.put("deformity",temp.getDeformity()==null ? "" : temp.getDeformity() == 1 ? "是" : "否"); | |
| 1804 | + babyMap.put("babyGender",temp.getBabyGender() == null ? "" : SexEnum.getTextById( | |
| 1805 | + Integer.parseInt(temp.getBabyGender()))); | |
| 1806 | + babyMap.put("babyWeight",temp.getBabyWeight()); | |
| 1807 | + babyMap.put("babyHeight",temp.getBabyHeight()); | |
| 1808 | + babyMap.put("babyHealthy",temp.getBabyHealthy()); | |
| 1809 | + String apgarScorePf1 = ""; | |
| 1810 | + String apgarScorePf5 = ""; | |
| 1811 | + String apgarScorePf10 = ""; | |
| 1812 | + Map<String, String> m = JsonUtil.getMap(temp.getApgarScore()); | |
| 1813 | + if (MapUtils.isNotEmpty(map)) { | |
| 1814 | + apgarScorePf1 += map.get("pf1") == null ? "" : map.get("pf1") + "*"; | |
| 1815 | + apgarScorePf5 += map.get("pf5") == null ? "" : map.get("pf5") + "*"; | |
| 1816 | + apgarScorePf10 += map.get("pf10") == null ? "" : map.get("pf10"); | |
| 1817 | + } | |
| 1818 | + babyMap.put("apgarScore",apgarScorePf1 + apgarScorePf5 + apgarScorePf10); | |
| 1819 | + babyMap.put("asphyxiaM",temp.getAsphyxiaM()); | |
| 1820 | + babyMap.put("contactStartM",temp.getContactStartM()); | |
| 1821 | + babyMap.put("contactM",temp.getContactM()); | |
| 1822 | + babyMap.put("earlySuck",temp.getEarlySuck() == null ? "" : "yes".equals(temp.getEarlySuck()) ? "是" : "否"); | |
| 1823 | + | |
| 1824 | + babyList.add(babyMap); | |
| 1825 | + } | |
| 1826 | + } | |
| 1827 | + | |
| 1828 | + map.put("babyList", babyList); | |
| 1829 | + | |
| 1830 | + br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 1831 | + br.setErrormsg("成功"); | |
| 1832 | + br.setData(map); | |
| 1833 | + return br; | |
| 1834 | + } | |
| 1835 | + | |
| 1836 | + //总产程 | |
| 1837 | + public static Map<String,Object> findTotalProcess(String totalProcess,Map<String,Object> map){ | |
| 1838 | + | |
| 1839 | + String p = ""; | |
| 1840 | + | |
| 1841 | + Map<String, String> totalprocessMap = JsonUtil.getMap(totalProcess); | |
| 1842 | + if (MapUtils.isNotEmpty(totalprocessMap)) { | |
| 1843 | + p = totalprocessMap.get("h") + "时," + totalprocessMap.get("m") + "分"; | |
| 1844 | + } | |
| 1845 | + map.put("totalProcess",p); | |
| 1846 | + return map; | |
| 1847 | + | |
| 1848 | + } | |
| 1849 | + | |
| 1850 | + //解析1,2,3产程 | |
| 1851 | + public static Map<String,Object> findProcess(String process,Map<String,Object> map){ | |
| 1852 | +// process = "{\"one\":{\"h\":4,\"m\":20},\"two\":{\"m\":53},\"three\":{\"m\":7}}"; | |
| 1853 | + String one = ""; | |
| 1854 | + String two = ""; | |
| 1855 | + String three = ""; | |
| 1856 | + Map<String, Map<String, String>> prodprocessMap = JsonUtil.getDoubleMap(process); | |
| 1857 | + if (MapUtils.isNotEmpty(prodprocessMap)) { | |
| 1858 | + Map<String, String> prodprocessOne = prodprocessMap.get("one"); | |
| 1859 | + if (MapUtils.isNotEmpty(prodprocessOne)) { | |
| 1860 | + one = prodprocessOne.get("h") + "时" + prodprocessOne.get("m") + "分"; | |
| 1861 | + } | |
| 1862 | + Map<String, String> prodprocessTwo = prodprocessMap.get("two"); | |
| 1863 | + if (MapUtils.isNotEmpty(prodprocessTwo)) { | |
| 1864 | + two = prodprocessOne.get("h") + "时" + prodprocessTwo.get("m") + "分"; | |
| 1865 | + } | |
| 1866 | + Map<String, String> prodprocessThree = prodprocessMap.get("three"); | |
| 1867 | + if (MapUtils.isNotEmpty(prodprocessThree)) { | |
| 1868 | + three = prodprocessOne.get("h") + "时" + prodprocessThree.get("m") + "分"; | |
| 1869 | + } | |
| 1870 | + } | |
| 1871 | + map.put("one",one); | |
| 1872 | + map.put("two",two); | |
| 1873 | + map.put("three",three); | |
| 1874 | + return map; | |
| 1875 | + } | |
| 1876 | + | |
| 1877 | + | |
| 1580 | 1878 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/ResolveUtils.java
View file @
3e2b9f1
| 1 | +package com.lyms.platform.operate.web.utils; | |
| 2 | + | |
| 3 | +import com.lyms.platform.biz.service.BasicConfigService; | |
| 4 | +import com.lyms.platform.common.utils.JsonUtil; | |
| 5 | + | |
| 6 | +import java.util.HashMap; | |
| 7 | +import java.util.Iterator; | |
| 8 | +import java.util.Map; | |
| 9 | +import java.util.Set; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * Created by Administrator on 2017/1/9 0009. | |
| 13 | + */ | |
| 14 | +public class ResolveUtils { | |
| 15 | + | |
| 16 | + private static final Map<String, String> content = new HashMap<>(); | |
| 17 | + | |
| 18 | + private static final String YES_OR_NO = "yesOrNo"; | |
| 19 | + | |
| 20 | + static { | |
| 21 | + content.put("qztp", "前置胎盘"); | |
| 22 | + content.put("tpzb", "胎盘早剥"); | |
| 23 | + content.put("tpzl", "胎盘滞留"); | |
| 24 | + content.put("tmzp", "胎膜早破"); | |
| 25 | + content.put("chcx", "产后出血"); | |
| 26 | + content.put("rsqgxy", "妊娠期高血压"); | |
| 27 | + content.put("zxqqq", "子痫前期(轻)"); | |
| 28 | + content.put("zxqqz", "子痫前期(重)"); | |
| 29 | + content.put("zxmxgxybfzxqq", "子痫慢性高血压并发子痫前期"); | |
| 30 | + content.put("rshbmxgxy", "妊娠合并慢性高血压"); | |
| 31 | + content.put("qt", "其他"); | |
| 32 | + } | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * 解析产科并发症 | |
| 36 | + * @param map | |
| 37 | + * @return | |
| 38 | + */ | |
| 39 | + public static String replace(Map map) { | |
| 40 | + if (null == map) { | |
| 41 | + return ""; | |
| 42 | + } | |
| 43 | + StringBuilder sb = new StringBuilder(); | |
| 44 | + try { | |
| 45 | + if ("yes".equals(map.get(YES_OR_NO))) { | |
| 46 | + Set<Map.Entry<String, Object>> m = map.entrySet(); | |
| 47 | + Iterator<Map.Entry<String, Object>> it = m.iterator(); | |
| 48 | + while (it.hasNext()) { | |
| 49 | + Map.Entry<String, Object> ma = it.next(); | |
| 50 | + if (ma.getKey().equals(YES_OR_NO)) { | |
| 51 | + continue; | |
| 52 | + } | |
| 53 | + | |
| 54 | + if ("true".equals(ma.getValue() + "")) { | |
| 55 | + | |
| 56 | + if (content.containsKey(ma.getKey())) { | |
| 57 | + sb.append(content.get(ma.getKey())).append(','); | |
| 58 | + } | |
| 59 | + } | |
| 60 | + } | |
| 61 | + | |
| 62 | + String bigSB = sb.toString(); | |
| 63 | + | |
| 64 | + if (bigSB.contains("其他,")){ | |
| 65 | + if (map.containsKey("qtText")){ | |
| 66 | + bigSB = bigSB.replace("其他,","其他:" + map.get("qtText")); | |
| 67 | + } | |
| 68 | + } | |
| 69 | + | |
| 70 | + if (bigSB.endsWith(",")) { | |
| 71 | + bigSB = bigSB.substring(0, bigSB.length() - 1); | |
| 72 | + } | |
| 73 | + return bigSB; | |
| 74 | + | |
| 75 | + }else if ("no".equals(map.get(YES_OR_NO))){ | |
| 76 | + return "无"; | |
| 77 | + } | |
| 78 | + | |
| 79 | + }catch (Exception e){ | |
| 80 | + e.printStackTrace(); | |
| 81 | + } | |
| 82 | + return ""; | |
| 83 | + } | |
| 84 | + | |
| 85 | + public static void main(String[] str) { | |
| 86 | + String ssss = "{\"qztp\":true,\"yesOrNo\":\"no\",\"tpzb\":true,\"zxqqz\":true,\"zxqqq\":true,\"tpzl\":true," + | |
| 87 | + "\"zxmxgxybfzxqq\":true,\"chcx\":true,\"rshbmxgxy\":true,\"tmzp\":true,\"rsqgxy\":true,\"qt\":false,\"qtText\":\"11\"}"; | |
| 88 | + | |
| 89 | + Map m = JsonUtil.str2Obj(ssss,Map.class); | |
| 90 | + | |
| 91 | + String a = replace(m); | |
| 92 | + System.out.print("哈哈.................... " + a); | |
| 93 | + } | |
| 94 | + | |
| 95 | +} |