From 1e8e6e120d0e43941d531e3347e3625cece6845b Mon Sep 17 00:00:00 2001 From: gengxiaokai Date: Mon, 27 Aug 2018 13:38:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=A6=E7=9A=87=E5=B2=9B=E5=86=A0=E6=96=B0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lyms/hospitalapi/qhdfy/QhdJbgwInterface.java | 342 +++++++++++++-------- 1 file changed, 214 insertions(+), 128 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdJbgwInterface.java b/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdJbgwInterface.java index 3772e6b..a512e2f 100644 --- a/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdJbgwInterface.java +++ b/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdJbgwInterface.java @@ -1,12 +1,12 @@ package com.lyms.hospitalapi.qhdfy; import com.lyms.platform.biz.service.*; +import com.lyms.platform.common.enums.RenShenJieJuEnums; +import com.lyms.platform.common.enums.SexEnum; import com.lyms.platform.common.enums.YnEnums; import com.lyms.platform.common.utils.DateUtil; import com.lyms.platform.common.utils.JsonUtil; -import com.lyms.platform.operate.web.utils.CommonsHelper; -import com.lyms.platform.operate.web.utils.FunvCommonUtil; -import com.lyms.platform.operate.web.utils.ResolveUtils; +import com.lyms.platform.operate.web.utils.*; import com.lyms.platform.permission.model.Organization; import com.lyms.platform.permission.model.Users; import com.lyms.platform.permission.service.OrganizationService; @@ -424,162 +424,248 @@ public class QhdJbgwInterface { if(list != null && list.size() > 0){ for(MaternalDeliverModel data : list) { Patients patients = patientsService.findOnePatientById(data.getParentId()); + + //新生儿信息 + List> babyList = new ArrayList<>(); + try { - String cDueWeek = data.getDueWeek(); - int week = Integer.parseInt(cDueWeek.substring(1, cDueWeek.indexOf("周"))); - int day = Integer.parseInt(cDueWeek.substring(cDueWeek.indexOf("+") + 1, cDueWeek.indexOf("天"))); - Map map = new HashMap(); - map.put("MATERNALCHILDBIRTHID",data.getId()); - map.put("MATERNALINFOID",patients.getId()); - map.put("NAME", patients.getUsername()); - String fmHospital = ""; - if (StringUtils.isNotEmpty(data.getFmHospital())) { - if (com.lyms.platform.common.utils.StringUtils.isNum(data.getFmHospital())) { - Organization organization = organizationService.getOrganization(Integer.parseInt(data.getFmHospital())); - if (organization != null && organization.getYn() == YnEnums.YES.getId()) { - fmHospital = organization.getName(); - } - } else { - fmHospital = data.getFmHospital(); + if (CollectionUtils.isNotEmpty(data.getBaby())) { + for (MaternalDeliverModel.Baby temp : data.getBaby()) { + Map babyMap = new HashMap<>(); + babyMap.put("nbnaNum", UnitUtils.unitSplice(temp.getNbnaNum(), UnitConstants.FEN)); + babyMap.put("jxWn", temp.isJxWn()); + babyMap.put("jxJzl", temp.isJxJzl()); + babyMap.put("jxNpc", temp.isJxNpc()); + babyMap.put("jxNjs", temp.isJxNjs()); + babyMap.put("jxEl", temp.isJxEl()); + babyMap.put("jxelSele", temp.getJxelSele()); + babyMap.put("jxCl", temp.isJxCl()); + babyMap.put("jxClSele", temp.getJxClSele()); + babyMap.put("jxClhb", temp.isJxClhb()); + babyMap.put("jxClhbSele", temp.getJxClhbSele()); + babyMap.put("jxXe", temp.isJxXe()); + babyMap.put("jxXeSele", temp.getJxXeSele()); + babyMap.put("jxWe", temp.isJxWe()); + babyMap.put("jxWeSele", temp.getJxWeSele()); + babyMap.put("jxSdbs", temp.isJxSdbs()); + babyMap.put("jxZcgm", temp.isJxZcgm()); + babyMap.put("jxNdxl", temp.isJxNdxl()); + babyMap.put("jxPwwf", temp.isJxPwwf()); + babyMap.put("jxMtn", temp.isJxMtn()); + babyMap.put("jxMtnSele", temp.getJxMtnSele()); + babyMap.put("jxDz", temp.isJxDz()); + babyMap.put("jxDzSele", temp.getJxDzSele()); + babyMap.put("jxDc", temp.isJxDc()); + babyMap.put("jxDcSele", temp.getJxDcSele()); + babyMap.put("jxBz", temp.isJxBz()); + babyMap.put("jxBzSele", temp.getJxBzSele()); + babyMap.put("jxBc", temp.isJxBc()); + babyMap.put("jxBcSele", temp.getJxBcSele()); + babyMap.put("jxZtds", temp.isJxZtds()); + babyMap.put("jxZtdsTopSele", temp.getJxZtdsTopSele()); + babyMap.put("jxZtdsBottomSele", temp.getJxZtdsBottomSele()); + babyMap.put("jxXtxe", temp.isJxXtxe()); + babyMap.put("jxQpc", temp.isJxQpc()); + babyMap.put("jxFl", temp.isJxFl()); + babyMap.put("jxLtst", temp.isJxLtst()); + babyMap.put("jxTszh", temp.isJxTszh()); + babyMap.put("jxXtx", temp.isJxXtx()); + babyMap.put("jxOther", temp.getJxOther()); + + + babyMap.put("babyId", temp.getId()); + babyMap.put("dueTime", temp.getDueTime()); + babyMap.put("pregnancyOut", temp.getPregnancyOut() == null ? "" : RenShenJieJuEnums.getTitle(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", UnitUtils.unitSplice(temp.getBabyWeight(), UnitConstants.G)); + babyMap.put("babyHeight", UnitUtils.unitSplice(temp.getBabyHeight(), UnitConstants.CM)); + babyMap.put("babyHealthy", temp.getBabyHealthy()); + babyMap.put("apgarScoreMap", temp.getApgarScore()); + String apgarScorePf1 = ""; + String apgarScorePf5 = ""; + String apgarScorePf10 = ""; + Map m = JsonUtil.getMap(temp.getApgarScore()); + if (MapUtils.isNotEmpty(m)) { + apgarScorePf1 += m.get("pf1") == null ? "" : m.get("pf1"); + apgarScorePf5 += m.get("pf5") == null ? "" : m.get("pf5"); + apgarScorePf10 += m.get("pf10") == null ? "" : m.get("pf10"); } + String apgarScore = ""; - } - map.put("LABORPLACEVALUE", fmHospital); - if(data.getDeliveryMode() != null){ - Map m = JsonUtil.str2Obj(data.getDeliveryMode(), Map.class); - Object b = m.get("fmfs"); - if(b != null){ - if("1".equals(b.toString())){ - map.put("LABORWAY","1"); - }else if("2".equals(b.toString())){ - map.put("LABORWAY","2"); + if (StringUtils.isNotEmpty(apgarScorePf1) || StringUtils.isNotEmpty(apgarScorePf5) || StringUtils.isNotEmpty(apgarScorePf10)) { + apgarScore = apgarScorePf1 + UnitConstants.FEN + " - " + apgarScorePf5 + UnitConstants.FEN + " - " + apgarScorePf10 + UnitConstants.FEN; + } + babyMap.put("apgarScore", apgarScore); + babyMap.put("asphyxiaM", UnitUtils.unitSplice(temp.getAsphyxiaM(), UnitConstants.FZ)); + babyMap.put("contactStartM", UnitUtils.unitSplice(temp.getContactStartM(), UnitConstants.FZ)); + babyMap.put("contactM", UnitUtils.unitSplice(temp.getContactM(), UnitConstants.FZ)); + babyMap.put("earlySuck", temp.getEarlySuck() == null ? "" : "yes".equals(temp.getEarlySuck()) ? "是" : "否"); + + babyList.add(babyMap); + + + String cDueWeek = data.getDueWeek(); + int week = Integer.parseInt(cDueWeek.substring(1, cDueWeek.indexOf("周"))); + int day = Integer.parseInt(cDueWeek.substring(cDueWeek.indexOf("+") + 1, cDueWeek.indexOf("天"))); + Map map = new HashMap(); + map.put("MATERNALCHILDBIRTHID", data.getId()); + map.put("MATERNALINFOID", patients.getId()); + map.put("NAME", patients.getUsername()); + String fmHospital = ""; + + if (StringUtils.isNotEmpty(data.getFmHospital())) { + if (com.lyms.platform.common.utils.StringUtils.isNum(data.getFmHospital())) { + Organization organization = organizationService.getOrganization(Integer.parseInt(data.getFmHospital())); + if (organization != null && organization.getYn() == YnEnums.YES.getId()) { + fmHospital = organization.getName(); + } + } else { + fmHospital = data.getFmHospital(); } } - } - map.put("LABORTIME",data.getDueDate()); - map.put("GESTTEEKS",String.valueOf(week)); - map.put("GESTDAYS",String.valueOf(day)); + map.put("LABORPLACEVALUE", fmHospital); + if (data.getDeliveryMode() != null) { + Map m1 = JsonUtil.str2Obj(data.getDeliveryMode(), Map.class); + Object b = m1.get("fmfs"); + if (b != null) { + if ("1".equals(b.toString())) { + map.put("LABORWAY", "1"); + } else if ("2".equals(b.toString())) { + map.put("LABORWAY", "2"); + } - Map mapcc = new HashMap<>(); - findProcess(data.getProdprocess(), mapcc); - if(StringUtils.isNotEmpty(mapcc.get("one").toString())){ - int oShi = mapcc.get("one").toString().indexOf("时"); - if(oShi == -1){ - int oFen = mapcc.get("one").toString().indexOf("分"); - if(-1 != oFen){ - map.put("BIRTHTIME1",mapcc.get("one").toString().substring(0,oFen)); - } - }else{ - Integer fen = 0; - if(StringUtils.isNotEmpty(mapcc.get("one").toString().substring(0,oShi))){ - fen = Integer.parseInt(mapcc.get("one").toString().substring(0,oShi))*60; } - int oFen = mapcc.get("one").toString().indexOf("分"); - if(-1 != oFen){ - Integer fen2 = Integer.parseInt(mapcc.get("one").toString().substring(oShi + 1, oFen)); - map.put("BIRTHTIME1",String.valueOf(fen+fen2)); - }else{ - map.put("BIRTHTIME1",String.valueOf(fen)); - } - } - } - if(StringUtils.isNotEmpty(mapcc.get("two").toString())){ - int oShi = mapcc.get("two").toString().indexOf("时"); - if(oShi == -1){ - int oFen = mapcc.get("two").toString().indexOf("分"); - if(-1 != oFen){ - map.put("BIRTHTIME2",mapcc.get("two").toString().substring(0,oFen)); - } - }else{ - Integer fen = 0; - if(StringUtils.isNotEmpty(mapcc.get("two").toString().substring(0,oShi))){ - fen = Integer.parseInt(mapcc.get("two").toString().substring(0,oShi))*60; - } - int oFen = mapcc.get("two").toString().indexOf("分"); - if(-1 != oFen){ - Integer fen2 = Integer.parseInt(mapcc.get("two").toString().substring(oShi + 1, oFen)); - map.put("BIRTHTIME2",String.valueOf(fen+fen2)); - }else{ - map.put("BIRTHTIME2",String.valueOf(fen)); + map.put("LABORTIME", temp.getDueTime()); + map.put("GESTTEEKS", String.valueOf(week)); + map.put("GESTDAYS", String.valueOf(day)); + + Map mapcc = new HashMap<>(); + findProcess(data.getProdprocess(), mapcc); + if (StringUtils.isNotEmpty(mapcc.get("one").toString())) { + int oShi = mapcc.get("one").toString().indexOf("时"); + if (oShi == -1) { + int oFen = mapcc.get("one").toString().indexOf("分"); + if (-1 != oFen) { + map.put("BIRTHTIME1", mapcc.get("one").toString().substring(0, oFen)); + } + } else { + Integer fen = 0; + if (StringUtils.isNotEmpty(mapcc.get("one").toString().substring(0, oShi))) { + fen = Integer.parseInt(mapcc.get("one").toString().substring(0, oShi)) * 60; + } + int oFen = mapcc.get("one").toString().indexOf("分"); + if (-1 != oFen) { + Integer fen2 = Integer.parseInt(mapcc.get("one").toString().substring(oShi + 1, oFen)); + map.put("BIRTHTIME1", String.valueOf(fen + fen2)); + } else { + map.put("BIRTHTIME1", String.valueOf(fen)); + } + } } - } - if(StringUtils.isNotEmpty(mapcc.get("three").toString())){ - int oShi = mapcc.get("three").toString().indexOf("时"); - if(oShi == -1){ - int oFen = mapcc.get("three").toString().indexOf("分"); - if(-1 != oFen){ - map.put("BIRTHTIME3",mapcc.get("three").toString().substring(0,oFen)); - } - }else{ - Integer fen = 0; - if(StringUtils.isNotEmpty(mapcc.get("three").toString().substring(0,oShi))){ - fen = Integer.parseInt(mapcc.get("three").toString().substring(0,oShi))*60; + if (StringUtils.isNotEmpty(mapcc.get("two").toString())) { + int oShi = mapcc.get("two").toString().indexOf("时"); + if (oShi == -1) { + int oFen = mapcc.get("two").toString().indexOf("分"); + if (-1 != oFen) { + map.put("BIRTHTIME2", mapcc.get("two").toString().substring(0, oFen)); + } + } else { + Integer fen = 0; + if (StringUtils.isNotEmpty(mapcc.get("two").toString().substring(0, oShi))) { + fen = Integer.parseInt(mapcc.get("two").toString().substring(0, oShi)) * 60; + } + int oFen = mapcc.get("two").toString().indexOf("分"); + if (-1 != oFen) { + Integer fen2 = Integer.parseInt(mapcc.get("two").toString().substring(oShi + 1, oFen)); + map.put("BIRTHTIME2", String.valueOf(fen + fen2)); + } else { + map.put("BIRTHTIME2", String.valueOf(fen)); + } } + } - int oFen = mapcc.get("three").toString().indexOf("分"); - if(-1 != oFen){ - Integer fen2 = Integer.parseInt(mapcc.get("three").toString().substring(oShi + 1, oFen)); - map.put("BIRTHTIME3",String.valueOf(fen+fen2)); - }else{ - map.put("BIRTHTIME3",String.valueOf(fen)); + if (StringUtils.isNotEmpty(mapcc.get("three").toString())) { + int oShi = mapcc.get("three").toString().indexOf("时"); + if (oShi == -1) { + int oFen = mapcc.get("three").toString().indexOf("分"); + if (-1 != oFen) { + map.put("BIRTHTIME3", mapcc.get("three").toString().substring(0, oFen)); + } + } else { + Integer fen = 0; + if (StringUtils.isNotEmpty(mapcc.get("three").toString().substring(0, oShi))) { + fen = Integer.parseInt(mapcc.get("three").toString().substring(0, oShi)) * 60; + } + + int oFen = mapcc.get("three").toString().indexOf("分"); + if (-1 != oFen) { + Integer fen2 = Integer.parseInt(mapcc.get("three").toString().substring(oShi + 1, oFen)); + map.put("BIRTHTIME3", String.valueOf(fen + fen2)); + } else { + map.put("BIRTHTIME3", String.valueOf(fen)); + } } } - } - Map totalprocessMap = JsonUtil.getMap(data.getTotalprocess()); - if(MapUtils.isNotEmpty(totalprocessMap)){ - String h = totalprocessMap.get("h") == null ? "" : totalprocessMap.get("h"); - String m = totalprocessMap.get("m") == null ? "" : totalprocessMap.get("m"); - Integer zShi = 0; - Integer zFen = 0; - if(StringUtils.isNotEmpty(h)){ - zShi = Integer.parseInt(h)*60; - } - if(StringUtils.isNotEmpty(m)){ - zFen = Integer.parseInt(m)*60; + Map totalprocessMap = JsonUtil.getMap(data.getTotalprocess()); + if (MapUtils.isNotEmpty(totalprocessMap)) { + String h = totalprocessMap.get("h") == null ? "" : totalprocessMap.get("h"); + String m2 = totalprocessMap.get("m") == null ? "" : totalprocessMap.get("m"); + Integer zShi = 0; + Integer zFen = 0; + if (StringUtils.isNotEmpty(h)) { + zShi = Integer.parseInt(h) * 60; + } + if (StringUtils.isNotEmpty(m2)) { + zFen = Integer.parseInt(m2) * 60; + } + map.put("BIRTHTOTAL", String.valueOf(zShi + zFen)); } - map.put("BIRTHTOTAL",String.valueOf(zShi+zFen)); - } - if(data.getPerinealCondition() != null){ - if("full".equals(data.getPerinealCondition())){ - map.put("PERINEUMSITUATION","1"); - } - if("split".equals(data.getPerinealCondition())){ - map.put("PERINEUMSITUATION","2"); + if (data.getPerinealCondition() != null) { + if ("full".equals(data.getPerinealCondition())) { + map.put("PERINEUMSITUATION", "1"); + } + if ("split".equals(data.getPerinealCondition())) { + map.put("PERINEUMSITUATION", "2"); + } } - } - if(data.getTireNumber().toString() != null){ - if(1 == data.getTireNumber()){ - map.put("BABYFETUSCOUNTS","1"); - } else if(2 == data.getTireNumber()){ - map.put("BABYFETUSCOUNTS","2"); - } else{ - map.put("BABYFETUSCOUNTS","3"); + if (data.getTireNumber().toString() != null) { + if (1 == data.getTireNumber()) { + map.put("BABYFETUSCOUNTS", "1"); + } else if (2 == data.getTireNumber()) { + map.put("BABYFETUSCOUNTS", "2"); + } else { + map.put("BABYFETUSCOUNTS", "3"); + } } - } /*if(data.getMaternalInfo() != null){ if("1".equals(data.getMaternalInfo())){ } }*/ - map.put("ORGCODE", patients.getHospitalId()); - String hospital = ""; - if (org.apache.commons.lang.StringUtils.isNotEmpty(patients.getHospitalId())) { - Organization organization = organizationService.getOrganization(Integer.parseInt(patients.getHospitalId())); - if (organization != null && organization.getYn() == YnEnums.YES.getId()) { - hospital = organization.getName(); + map.put("ORGCODE", patients.getHospitalId()); + String hospital = ""; + if (org.apache.commons.lang.StringUtils.isNotEmpty(patients.getHospitalId())) { + Organization organization = organizationService.getOrganization(Integer.parseInt(patients.getHospitalId())); + if (organization != null && organization.getYn() == YnEnums.YES.getId()) { + hospital = organization.getName(); + } } + map.put("ORGNAME", hospital); + mList.add(map); + } - map.put("ORGNAME",hospital); - mList.add(map); + } } catch (Exception e) { e.printStackTrace(); continue; -- 1.8.3.1