diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java index 7dc0e6d..1da676e 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java @@ -35,7 +35,7 @@ import java.util.*; /** * 分娩记录信息 - *

+ *

* Created by Administrator on 2016/6/17 0017. */ @Component @@ -138,13 +138,30 @@ public class MatDeliverFacade { //表示区域的 if (StringUtils.isNotEmpty(organizationGroupsFacade.findByCurrentUserId(hospitalId))) { - String parentId =antenatalExaminationFacade.handHideBuild(deliverAddRequest.getPid(), deliverAddRequest.getParentId(), userId,-1); + String parentId = antenatalExaminationFacade.handHideBuild(deliverAddRequest.getPid(), deliverAddRequest.getParentId(), userId, -1); if (StringUtils.isEmpty(parentId)) { logger.warn("get handHideBuild parentId is null."); } maternalDeliverModel.setParentId(parentId); deliverAddRequest.setParentId(parentId); } + List babyIds = new ArrayList<>(); + String parentId = maternalDeliverModel.getParentId(); + String userName = ""; + PatientsQuery patientsQuery = new PatientsQuery(); + patientsQuery.setId(parentId); + List patients = patientsService.queryPatient(patientsQuery); + + + Patients patients1 = null; + if (CollectionUtils.isNotEmpty(patients)) { + maternalDeliverModel.setPid(patients.get(0).getPid()); + } + + if (CollectionUtils.isNotEmpty(patients)) { + patients1 = patients.get(0); + userName = patients1.getUsername(); + } //增加 if (StringUtils.isEmpty(deliverAddRequest.getId()) && StringUtils.isNotEmpty(deliverAddRequest.getParentId())) { @@ -174,17 +191,13 @@ public class MatDeliverFacade { //获取到小孩信息 maternalDeliverModel.setOperator(userId); List list = deliverAddRequest.getBabies(); - List babyIds = new ArrayList<>(); - String parentId = maternalDeliverModel.getParentId(); - PatientsQuery patientsQuery = new PatientsQuery(); - patientsQuery.setId(parentId); - List patients = patientsService.queryPatient(patientsQuery); - Patients patients1 = null; + + if (CollectionUtils.isNotEmpty(patients)) { maternalDeliverModel.setPid(patients.get(0).getPid()); } if (CollectionUtils.isNotEmpty(list)) { - String userName = ""; + if (CollectionUtils.isNotEmpty(patients)) { patients1 = patients.get(0); userName = patients1.getUsername(); @@ -198,7 +211,7 @@ public class MatDeliverFacade { patientsLocal.setIsAutoFm(YnEnums.NO.getId()); patientsLocal.setType(3); patientsLocal.setFmHospital(hospitalId); - patientsLocal.setFmType(MapUtils.isNotEmpty(deliverAddRequest.getDeliveryMode())?null:deliverAddRequest.getDeliveryMode().toString()); + patientsLocal.setFmType(MapUtils.isNotEmpty(deliverAddRequest.getDeliveryMode()) ? null : deliverAddRequest.getDeliveryMode().toString()); try { patientsLocal.setFmAge(DateUtil.getAge(patients1.getBirth(), fmDate)); } catch (Exception e) { @@ -237,7 +250,8 @@ public class MatDeliverFacade { if (CollectionUtils.isEmpty(babyModels)) { handBaby(deliverAddRequest, babyList, maternalDeliverModel, list, babyIds, parentId, userName, patients1, hospitalId); } else { - maternalDeliverModel.setBaby(updateBaby(deliverAddRequest,list,patients1.getLastMenses())); +// maternalDeliverModel.setBaby(updateBaby(deliverAddRequest,list,patients1.getLastMenses())); + handBaby(deliverAddRequest, babyList, maternalDeliverModel, list, babyIds, parentId, userName, patients1, hospitalId); } } @@ -249,7 +263,7 @@ public class MatDeliverFacade { maternalDeliverModel.setYn(YnEnums.YES.getId()); matDeliverService.addMatDeliver(maternalDeliverModel); //作废产检劵 - patientCheckTicketService.cancelCheckTicket(hospitalId,deliverAddRequest.getParentId()); + patientCheckTicketService.cancelCheckTicket(hospitalId, deliverAddRequest.getParentId()); //修改 } else if (StringUtils.isNotEmpty(deliverAddRequest.getId()) && StringUtils.isNotEmpty(deliverAddRequest.getParentId())) { @@ -283,43 +297,42 @@ public class MatDeliverFacade { List list = deliverAddRequest.getBabies(); //修改小孩信息 if (CollectionUtils.isNotEmpty(list)) { - maternalDeliverModel.setBaby(updateBaby(deliverAddRequest,list,patients2.getLastMenses() - )); +// maternalDeliverModel.setBaby(updateBaby(deliverAddRequest,list,patients2.getLastMenses())); + handBaby(deliverAddRequest, babyList, maternalDeliverModel, list, babyIds, parentId, userName, patients1, hospitalId); } matDeliverService.updateOne(maternalDeliverModel, maternalDeliverModel.getId()); if (null != deliverAddRequest.getDueDate()) { Date fmDate = DateUtil.parseYMD(deliverAddRequest.getDueDate()); - PatientsQuery patientsQuery = new PatientsQuery(); - patientsQuery.setId(deliverAddRequest.getParentId()); - Patients patients = patientsService.findOnePatientById(deliverAddRequest.getParentId()); - Patients patients1 = new Patients(); - patients1.setId(deliverAddRequest.getParentId()); - patients1.setFmDate(fmDate); + Patients patientss = patientsService.findOnePatientById(deliverAddRequest.getParentId()); + + Patients patients12 = new Patients(); + patients12.setId(deliverAddRequest.getParentId()); + patients12.setFmDate(fmDate); // HuJiaqi添加开始,这里冗余了分娩分娩医院,分娩年龄,分娩孕周,分娩方式,并将状态更改为产妇 - patients1.setType(3); - patients1.setIsAutoFm(YnEnums.NO.getId()); - patients1.setFmHospital(hospitalId); - patients1.setFmType(MapUtils.isNotEmpty(deliverAddRequest.getDeliveryMode())?null:deliverAddRequest.getDeliveryMode().toString()); + patients12.setType(3); + patients12.setIsAutoFm(YnEnums.NO.getId()); + patients12.setFmHospital(hospitalId); + patients12.setFmType(MapUtils.isNotEmpty(deliverAddRequest.getDeliveryMode()) ? null : deliverAddRequest.getDeliveryMode().toString()); try { - patients1.setFmAge(DateUtil.getAge(patients.getBirth(), fmDate)); + patients12.setFmAge(DateUtil.getAge(patientss.getBirth(), fmDate)); } catch (Exception e) { System.out.println(patients1.getId() + ":这条数据的生日和分娩时间异常"); // 跳过 } try { - patients1.setFmWeek(DateUtil.getDays(patients.getLastMenses(), fmDate)); + patients12.setFmWeek(DateUtil.getDays(patientss.getLastMenses(), fmDate)); } catch (Exception e) { - System.out.println(patients1.getId() + ":这条数据的末日月经和分娩时间异常"); + System.out.println(patients12.getId() + ":这条数据的末日月经和分娩时间异常"); // 跳过 } // HuJiaqi添加结束 - patientsService.updatePatient(patients1); + patientsService.updatePatient(patients12); //修改分娩日期 - updatePatientFmDate(patients.getPid(), fmDate, 3); + updatePatientFmDate(patientss.getPid(), fmDate, 3); } } else { return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("parentId 为空,找不到产妇"); @@ -434,36 +447,36 @@ public class MatDeliverFacade { * @param list * @return */ - private List updateBaby(MatDeliverAddRequest deliverAddRequest,List list ,Date lastMenses){ + private List updateBaby(MatDeliverAddRequest deliverAddRequest, List list, Date lastMenses) { List babyList = new ArrayList<>(); for (MatDeliverAddRequest.Baby baby : list) { MaternalDeliverModel.Baby babyModel = baby.convertToDataModel(); - if(com.lyms.platform.common.utils.StringUtils.isNotEmpty(babyModel.getId())){ + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(babyModel.getId())) { //判断妊娠结局是活产才添加数据 - BabyModel babyModel1=new BabyModel(); - BabyModelQuery query=new BabyModelQuery(); + BabyModel babyModel1 = new BabyModel(); + BabyModelQuery query = new BabyModelQuery(); query.setId(babyModel.getId()); babyModel1.setParentId(deliverAddRequest.getParentId()); if ((RenShenJieJuEnums.O.getId() + "").equals(baby.getPregnancyOut())) { babyModel1.setYn(YnEnums.YES.getId()); - }else{ + } else { babyModel1.setYn(YnEnums.NO.getId()); //修改满足条件的person数据 - List updateBaby=babyService.queryBabyWithQuery(query); + List updateBaby = babyService.queryBabyWithQuery(query); - if(CollectionUtils.isNotEmpty(updateBaby)){ - for(BabyModel babydel:updateBaby){ - if(com.lyms.platform.common.utils.StringUtils.isNotEmpty(babydel.getPid())){ - PersonModel p=new PersonModel(); + if (CollectionUtils.isNotEmpty(updateBaby)) { + for (BabyModel babydel : updateBaby) { + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(babydel.getPid())) { + PersonModel p = new PersonModel(); p.setYn(YnEnums.NO.getId()); p.setId(babydel.getPid()); - personService.updatePerson(p,babydel.getPid()); + personService.updatePerson(p, babydel.getPid()); } } } } - babyModel1.setBirth(DateUtil.parseYMD(baby.getDueTime())); + babyModel1.setBirth(DateUtil.parseYMDHMS(baby.getDueTime())); babyModel1.setSex(Integer.valueOf(baby.getBabyGender())); Map map = deliverAddRequest.getDeliveryMode(); String fmfs = null; @@ -476,8 +489,14 @@ public class MatDeliverFacade { int day = DateUtil.getDays(lastMenses, DateUtil.parseYMD(deliverAddRequest.getDueDate())); babyModel1.setDueWeek(day / 7); } + //身长 babyModel1.setBabyHeight(baby.getBabyHeight()); - babyModel1.setBabyWeight(baby.getBabyWeight()); + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(baby.getBabyWeight())) { + babyModel1.setBabyWeight(com.lyms.platform.common.utils.StringUtils.cutBabyWeight(baby.getBabyWeight())); + } + babyModel1.setApgarScore(babyModel.getApgarScore()); + babyModel1.setMalformation(babyModel.getDeformity()); + babyService.findAndModify(query.convertToQuery(), babyModel1); } babyList.add(babyModel); @@ -588,7 +607,7 @@ public class MatDeliverFacade { */ public BaseResponse queryMatDeliver(MatDeliverQueryRequest deliverQueryRequest, Integer userId) { - String hospital=autoMatchFacade.getHospitalId(userId); + String hospital = autoMatchFacade.getHospitalId(userId); //获取 /* Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, hospital, -1); if (null == patients) { @@ -597,18 +616,18 @@ public class MatDeliverFacade { Organization og = organizationService.getOrganization(Integer.valueOf(hospital)); //区域模式 - boolean isEnable=og.getbStatus()==1; + boolean isEnable = og.getbStatus() == 1; //外院的孕妇 - Patients patients1 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, null, 1, false, null,true); + Patients patients1 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, null, 1, false, null, true); //外院的产妇 // Patients patients2 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, null, 3); //http://jira.healthbaby.com.cn/browse/WEB-204 修改bug //本院的孕妇 - Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, organizationGroupsFacade.findGroupHospital(userId,false), 1, false, null,isEnable); + Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, organizationGroupsFacade.findGroupHospital(userId, false), 1, false, null, isEnable); //本院产妇 - Patients patients3 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, organizationGroupsFacade.findGroupHospital(userId,false), 3, false, null,isEnable); + Patients patients3 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, organizationGroupsFacade.findGroupHospital(userId, false), 3, false, null, isEnable); PersonModelQuery personModelQuery = new PersonModelQuery(); String pid = ""; if (null != patients1) { @@ -752,20 +771,20 @@ public class MatDeliverFacade { patientsService.updatePatient(patients); //删除分娩记录的时候删除分娩的小孩信息 - BabyModelQuery babyModelQuery=new BabyModelQuery(); + BabyModelQuery babyModelQuery = new BabyModelQuery(); babyModelQuery.setParentId(matModel.getParentId()); babyModelQuery.setYn(YnEnums.YES.getId()); //修改满足条件的person数据 - List updateBaby=babyService.queryBabyWithQuery(babyModelQuery); + List updateBaby = babyService.queryBabyWithQuery(babyModelQuery); - if(CollectionUtils.isNotEmpty(updateBaby)){ - for(BabyModel babyModel:updateBaby){ - if(com.lyms.platform.common.utils.StringUtils.isNotEmpty(babyModel.getPid())){ - PersonModel p=new PersonModel(); + if (CollectionUtils.isNotEmpty(updateBaby)) { + for (BabyModel babyModel : updateBaby) { + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(babyModel.getPid())) { + PersonModel p = new PersonModel(); p.setYn(YnEnums.NO.getId()); p.setId(babyModel.getPid()); - personService.updatePerson(p,babyModel.getPid()); + personService.updatePerson(p, babyModel.getPid()); } } } @@ -1165,7 +1184,7 @@ public class MatDeliverFacade { // 居住类型 if (childbirthManagerRequest.getInitQuery().contains("pliveTypeId")) { try { - if(StringUtils.isNotEmpty(patients.getPliveTypeId())) { + if (StringUtils.isNotEmpty(patients.getPliveTypeId())) { childbirthManagerQueryModel.setPliveTypeId(basicConfigService.getOneBasicConfigById(patients.getPliveTypeId()).getName()); } } catch (Exception e) { @@ -1176,7 +1195,7 @@ public class MatDeliverFacade { // 户口类型 if (childbirthManagerRequest.getInitQuery().contains("pcensusTypeId")) { try { - if(StringUtils.isNotEmpty(patients.getPcensusTypeId())) { + if (StringUtils.isNotEmpty(patients.getPcensusTypeId())) { childbirthManagerQueryModel.setPcensusTypeId(basicConfigService.getOneBasicConfigById(patients.getPcensusTypeId()).getName()); } } catch (Exception e) { @@ -1221,8 +1240,8 @@ public class MatDeliverFacade { pregnancyOut += renShenJieJuEnums.getName() + ","; break; } - if(StringUtils.isEmpty(pregnancyOut)){ - pregnancyOut+="-,"; + if (StringUtils.isEmpty(pregnancyOut)) { + pregnancyOut += "-,"; } } } @@ -1232,8 +1251,8 @@ public class MatDeliverFacade { sex += sexEnum.getText() + ","; break; } - if(StringUtils.isEmpty(sex)){ - sex+="-,"; + if (StringUtils.isEmpty(sex)) { + sex += "-,"; } } } @@ -1241,12 +1260,12 @@ public class MatDeliverFacade { babyHeight += babyModel.getBabyHeight() == null ? "-," : babyModel.getBabyHeight() + ","; asphyxiaM += babyModel.getAsphyxiaM() == null ? "-," : babyModel.getAsphyxiaM() + ","; babyHealthy += babyModel.getBabyHealthy() == null ? "-," : babyModel.getBabyHealthy() + ","; - if(Integer.valueOf(0).equals(babyModel.getMalformation())){ - malformation+="非畸形"+","; - }else if(Integer.valueOf(1).equals(babyModel.getMalformation())){ - malformation+="畸形"+","; - }else{ - malformation+="-,"; + if (Integer.valueOf(0).equals(babyModel.getMalformation())) { + malformation += "非畸形" + ","; + } else if (Integer.valueOf(1).equals(babyModel.getMalformation())) { + malformation += "畸形" + ","; + } else { + malformation += "-,"; } Map map = JsonUtil.getMap(babyModel.getApgarScore()); if (MapUtils.isNotEmpty(map)) { @@ -1385,7 +1404,7 @@ public class MatDeliverFacade { } } heartRate += placenta.get("heartRate") == null ? "" : placenta.get("heartRate") + ","; - for (FetalEnums fetalEnums : FetalEnums.values()) { + for (FetalEnums fetalEnums : FetalEnums.values()) { if (fetalEnums.getId().equals(placenta.get("fetalPresentation"))) { fetalPresentation += fetalEnums.getName() + ","; break; @@ -1407,19 +1426,19 @@ public class MatDeliverFacade { Map prodprocessOne = prodprocessMap.get("one"); if (MapUtils.isNotEmpty(prodprocessOne)) { childbirthManagerQueryModel.setProdprocessOne(prodprocessOne.get("h") + "时," + prodprocessOne.get("m") + "分"); - }else{ + } else { childbirthManagerQueryModel.setProdprocessOne(""); } Map prodprocessTwo = prodprocessMap.get("two"); if (MapUtils.isNotEmpty(prodprocessTwo)) { childbirthManagerQueryModel.setProdprocessTwo(prodprocessTwo.get("h") + "时," + prodprocessTwo.get("m") + "分"); - }else{ + } else { childbirthManagerQueryModel.setProdprocessTwo(""); } Map prodprocessThree = prodprocessMap.get("three"); if (MapUtils.isNotEmpty(prodprocessThree)) { childbirthManagerQueryModel.setProdprocessThree(prodprocessThree.get("h") + "时," + prodprocessThree.get("m") + "分"); - }else{ + } else { childbirthManagerQueryModel.setProdprocessThree(""); } } @@ -1621,25 +1640,25 @@ public class MatDeliverFacade { @Autowired private CommonService commonService; - public BaseObjectResponse findMatDeliverData(String id){ + public BaseObjectResponse findMatDeliverData(String id) { BaseObjectResponse br = new BaseObjectResponse(); - if (org.apache.commons.lang.StringUtils.isEmpty(id)){ + if (org.apache.commons.lang.StringUtils.isEmpty(id)) { br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); br.setErrormsg("id为空"); return br; } MaternalDeliverModel data = matDeliverService.getOneMatDeliver(id); - if (data==null || data.getYn()==YnEnums.NO.getId()){ + if (data == null || data.getYn() == YnEnums.NO.getId()) { br.setErrorcode(ErrorCodeConstants.NO_DATA); br.setErrormsg("没有查询到数据"); return br; } /* 基本信息 */ - if (StringUtils.isEmpty(data.getParentId())){ + if (StringUtils.isEmpty(data.getParentId())) { br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); br.setErrormsg("数据异常"); return br; @@ -1647,46 +1666,46 @@ public class MatDeliverFacade { Patients patients = patientsService.findOnePatientById(data.getParentId()); - if (patients==null){ + if (patients == null) { br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); br.setErrormsg("数据异常"); return br; } - Map map= new HashMap<>(); - map.put("id",data.getId()); - map.put("username",patients.getUsername()); - map.put("birth",DateUtil.getyyyy_MM_dd(patients.getBirth())); - map.put("age",DateUtil.getAge(patients.getBirth())); - map.put("phone",patients.getPhone()); - map.put("fmWeek",patients.getFmWeek()); - map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); - map.put("mremark",patients.getMremark()); + Map map = new HashMap<>(); + map.put("id", data.getId()); + map.put("username", patients.getUsername()); + map.put("birth", DateUtil.getyyyy_MM_dd(patients.getBirth())); + map.put("age", DateUtil.getAge(patients.getBirth())); + map.put("phone", patients.getPhone()); + map.put("fmWeek", patients.getFmWeek()); + map.put("dueDate", DateUtil.getyyyy_MM_dd(patients.getDueDate())); + map.put("mremark", patients.getMremark()); String riskFactor = ""; - if (StringUtils.isNotEmpty(patients.getoRiskFactor())){ + if (StringUtils.isNotEmpty(patients.getoRiskFactor())) { riskFactor = patients.getoRiskFactor(); } - if (CollectionUtils.isNotEmpty(patients.getRiskFactorId())){ - if (StringUtils.isEmpty(riskFactor)){ + if (CollectionUtils.isNotEmpty(patients.getRiskFactorId())) { + if (StringUtils.isEmpty(riskFactor)) { riskFactor = commonService.resloveFactor(patients.getRiskFactorId()); - }else { + } else { riskFactor = riskFactor + "," + commonService.resloveFactor(patients.getRiskFactorId()); } } - map.put("oRiskFactor",riskFactor); + map.put("oRiskFactor", riskFactor); map.put("riskLevel", FunvCommonUtil.getBaseicConfigByid(patients.getRiskLevelId(), basicConfigService)); - map.put("riskScore",patients.getRiskScore()); + map.put("riskScore", patients.getRiskScore()); map.put("deliveryDate", data.getDueDate()); map.put("dueWeek", data.getDueWeek()); String fmHospital = ""; - if (StringUtils.isNotEmpty(data.getFmHospital())){ + if (StringUtils.isNotEmpty(data.getFmHospital())) { Organization organization = organizationService.getOrganization(Integer.parseInt(data.getFmHospital())); - if (organization!=null && organization.getYn()==YnEnums.YES.getId()){ + if (organization != null && organization.getYn() == YnEnums.YES.getId()) { fmHospital = organization.getName(); } } @@ -1695,9 +1714,9 @@ public class MatDeliverFacade { String deliverDoctor = ""; - if (StringUtils.isNotEmpty(data.getDeliverDoctor())){ + if (StringUtils.isNotEmpty(data.getDeliverDoctor())) { Users users = usersService.getUsers(Integer.parseInt(data.getDeliverDoctor())); - if (users!=null && users.getYn()==YnEnums.YES.getId()){ + if (users != null && users.getYn() == YnEnums.YES.getId()) { deliverDoctor = users.getName(); } } @@ -1708,12 +1727,12 @@ public class MatDeliverFacade { map.put("tireNumber", TaiShuEnums.getTitle(data.getTireNumber() + ""));//胎数 map.put("placenta", data.getPlacenta());//胎盘 - List> placetaList = new ArrayList<>(); + List> placetaList = new ArrayList<>(); - if (CollectionUtils.isNotEmpty(data.getPlacentas())){ + if (CollectionUtils.isNotEmpty(data.getPlacentas())) { @SuppressWarnings("unchecked") List placentas = data.getPlacentas(); - if (CollectionUtils.isNotEmpty(placentas)){ + if (CollectionUtils.isNotEmpty(placentas)) { for (Object obj : placentas) { String fetalPosition = ""; @@ -1754,10 +1773,10 @@ public class MatDeliverFacade { fetalPresentation += placenta.get("fetalPresentation") == null ? "" : placenta.get("fetalPresentation"); } } - Map placetaMap = new HashMap<>(); - placetaMap.put("fetalPosition",fetalPosition); - placetaMap.put("fetalPresentation",fetalPresentation); - placetaMap.put("heartRate",heartRate); + Map placetaMap = new HashMap<>(); + placetaMap.put("fetalPosition", fetalPosition); + placetaMap.put("fetalPresentation", fetalPresentation); + placetaMap.put("heartRate", heartRate); placetaList.add(placetaMap); } } @@ -1766,24 +1785,24 @@ public class MatDeliverFacade { map.put("placentaData", placetaList);//胎盘信息 String deliveryMode = ""; - if (StringUtils.isNotEmpty(data.getDeliveryMode())){ + if (StringUtils.isNotEmpty(data.getDeliveryMode())) { StringBuilder sb = new StringBuilder(); - Map m = JsonUtil.str2Obj(data.getDeliveryMode(),Map.class); + Map m = JsonUtil.str2Obj(data.getDeliveryMode(), Map.class); String fmfs = null; - if (m!=null){ + if (m != null) { Object b = m.get("fmfs"); - if (b!=null){ + if (b != null) { fmfs = b.toString(); - if (fmfs!=null){ - if (fmfs.equals("1")){ + if (fmfs != null) { + if (fmfs.equals("1")) { String fmName = FmTypeEnums.getFmNameById(fmfs); sb.append(fmName).append(","); String scfs = m.get("scfs").toString(); sb.append(FmTypeEnums.getFmScNameById(scfs)); deliveryMode = sb.toString(); - }else if (fmfs.equals("2")){ + } else if (fmfs.equals("2")) { String fmName = FmTypeEnums.getFmNameById(fmfs); deliveryMode = fmName; } @@ -1792,10 +1811,10 @@ public class MatDeliverFacade { } } map.put("deliveryMode", deliveryMode);//分娩方式 - map.put("operationCause", data.getOperationCause()==null ? "--":data.getOperationCause()); + map.put("operationCause", data.getOperationCause() == null ? "--" : data.getOperationCause()); findProcess(data.getProdprocess(), map);//1,2,3产程 - findTotalProcess(data.getTotalprocess(),map);//总产程 + findTotalProcess(data.getTotalprocess(), map);//总产程 map.put("perinealCondition", data.getPerinealCondition()); @@ -1805,7 +1824,7 @@ public class MatDeliverFacade { /* 产后生理 */ map.put("maternalInfo", data.getMaternalInfo()); - map.put("deathCause", data.getDeathCause()==null ? "--" : data.getDeathCause()); + map.put("deathCause", data.getDeathCause() == null ? "--" : data.getDeathCause()); // 产后血压 收缩压,舒张压 String ssy = ""; String szy = ""; @@ -1836,43 +1855,43 @@ public class MatDeliverFacade { map.put("sHloseBloodL", data.getsHloseBloodL()); map.put("loseBloodCause", data.getLoseBloodCause()); //产科并发症(需要解析) - map.put("ocs", ResolveUtils.replace(JsonUtil.str2Obj(data.getOcs(),Map.class))); + map.put("ocs", ResolveUtils.replace(JsonUtil.str2Obj(data.getOcs(), Map.class))); /* 胎盘及新生儿信息 */ //胎盘信息 - List> ExtPlacentaList = new ArrayList<>(); + List> ExtPlacentaList = new ArrayList<>(); - if (CollectionUtils.isNotEmpty(data.getExtPlacentas())){ - for (MaternalDeliverModel.ExtPlacenta temp : data.getExtPlacentas()){ - Map extMap = new HashMap<>(); + if (CollectionUtils.isNotEmpty(data.getExtPlacentas())) { + for (MaternalDeliverModel.ExtPlacenta temp : data.getExtPlacentas()) { + Map extMap = new HashMap<>(); extMap.put("tpmcType", TaiShuEnums.getTpNameById(temp.getTpmcType())); //TODO 娩出方式??? String tpSize = ""; tpSize += temp.getTpSize().get("c") + "*" + temp.getTpSize().get("k") + "*" + temp.getTpSize().get("g") + "cm"; - extMap.put("tpSize",tpSize); - extMap.put("tpWeight",temp.getTpWeight()); - extMap.put("umbilicalCordLength",temp.getUmbilicalCordLength()); + extMap.put("tpSize", tpSize); + extMap.put("tpWeight", temp.getTpWeight()); + extMap.put("umbilicalCordLength", temp.getUmbilicalCordLength()); String umbilicalCordEx = ""; String umbilicalCordExType = ""; - if (StringUtils.isNotEmpty(temp.getUmbilicalCordEx())){ - if (temp.getUmbilicalCordEx().equals("no")){ + if (StringUtils.isNotEmpty(temp.getUmbilicalCordEx())) { + if (temp.getUmbilicalCordEx().equals("no")) { umbilicalCordEx = "无"; - }else if (temp.getUmbilicalCordEx().equals("yes")){ + } else if (temp.getUmbilicalCordEx().equals("yes")) { umbilicalCordEx = "有"; - if (StringUtils.isNotEmpty(temp.getUmbilicalCordExType())){ - for (QiDaiEnums qiDaiEnums : QiDaiEnums.values()){ - if (qiDaiEnums.getId().equals(temp.getUmbilicalCordExType())){ + if (StringUtils.isNotEmpty(temp.getUmbilicalCordExType())) { + for (QiDaiEnums qiDaiEnums : QiDaiEnums.values()) { + if (qiDaiEnums.getId().equals(temp.getUmbilicalCordExType())) { umbilicalCordExType = qiDaiEnums.getName(); } } } } } - extMap.put("umbilicalCordEx",umbilicalCordEx); - extMap.put("umbilicalCordExType",umbilicalCordExType); + extMap.put("umbilicalCordEx", umbilicalCordEx); + extMap.put("umbilicalCordExType", umbilicalCordExType); ExtPlacentaList.add(extMap); } @@ -1881,19 +1900,19 @@ public class MatDeliverFacade { //新生儿信息 - List> babyList = new ArrayList<>(); + List> babyList = new ArrayList<>(); - if (CollectionUtils.isNotEmpty(data.getBaby())){ - for (MaternalDeliverModel.Baby temp : data.getBaby()){ - Map babyMap = new HashMap<>(); - babyMap.put("dueTime",temp.getDueTime()); - babyMap.put("pregnancyOut",temp.getPregnancyOut()); - babyMap.put("deformity",temp.getDeformity()==null ? "" : temp.getDeformity() == 1 ? "是" : "否"); - babyMap.put("babyGender",temp.getBabyGender() == null ? "" : SexEnum.getTextById( + if (CollectionUtils.isNotEmpty(data.getBaby())) { + for (MaternalDeliverModel.Baby temp : data.getBaby()) { + Map babyMap = new HashMap<>(); + babyMap.put("dueTime", temp.getDueTime()); + babyMap.put("pregnancyOut", temp.getPregnancyOut()); + babyMap.put("deformity", temp.getDeformity() == null ? "" : temp.getDeformity() == 1 ? "是" : "否"); + babyMap.put("babyGender", temp.getBabyGender() == null ? "" : SexEnum.getTextById( Integer.parseInt(temp.getBabyGender()))); - babyMap.put("babyWeight",temp.getBabyWeight()); - babyMap.put("babyHeight",temp.getBabyHeight()); - babyMap.put("babyHealthy",temp.getBabyHealthy()); + babyMap.put("babyWeight", temp.getBabyWeight()); + babyMap.put("babyHeight", temp.getBabyHeight()); + babyMap.put("babyHealthy", temp.getBabyHealthy()); String apgarScorePf1 = ""; String apgarScorePf5 = ""; String apgarScorePf10 = ""; @@ -1903,11 +1922,11 @@ public class MatDeliverFacade { apgarScorePf5 += map.get("pf5") == null ? "" : map.get("pf5") + "*"; apgarScorePf10 += map.get("pf10") == null ? "" : map.get("pf10"); } - babyMap.put("apgarScore",apgarScorePf1 + apgarScorePf5 + apgarScorePf10); - babyMap.put("asphyxiaM",temp.getAsphyxiaM()); - babyMap.put("contactStartM",temp.getContactStartM()); - babyMap.put("contactM",temp.getContactM()); - babyMap.put("earlySuck",temp.getEarlySuck() == null ? "" : "yes".equals(temp.getEarlySuck()) ? "是" : "否"); + babyMap.put("apgarScore", apgarScorePf1 + apgarScorePf5 + apgarScorePf10); + babyMap.put("asphyxiaM", temp.getAsphyxiaM()); + babyMap.put("contactStartM", temp.getContactStartM()); + babyMap.put("contactM", temp.getContactM()); + babyMap.put("earlySuck", temp.getEarlySuck() == null ? "" : "yes".equals(temp.getEarlySuck()) ? "是" : "否"); babyList.add(babyMap); } @@ -1922,7 +1941,7 @@ public class MatDeliverFacade { } //总产程 - public static Map findTotalProcess(String totalProcess,Map map){ + public static Map findTotalProcess(String totalProcess, Map map) { String p = ""; @@ -1930,13 +1949,13 @@ public class MatDeliverFacade { if (MapUtils.isNotEmpty(totalprocessMap)) { p = totalprocessMap.get("h") + "时," + totalprocessMap.get("m") + "分"; } - map.put("totalProcess",p); + map.put("totalProcess", p); return map; } //解析1,2,3产程 - public static Map findProcess(String process,Map map){ + public static Map findProcess(String process, Map map) { // process = "{\"one\":{\"h\":4,\"m\":20},\"two\":{\"m\":53},\"three\":{\"m\":7}}"; String one = ""; String two = ""; @@ -1956,9 +1975,9 @@ public class MatDeliverFacade { three = prodprocessOne.get("h") + "时" + prodprocessThree.get("m") + "分"; } } - map.put("one",one); - map.put("two",two); - map.put("three",three); + map.put("one", one); + map.put("two", two); + map.put("three", three); return map; }