diff --git a/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java b/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java index 19153f1..3e54403 100644 --- a/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java +++ b/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java @@ -923,11 +923,14 @@ public class QhdfyFmService { public MaternalDeliverResult queryFmPatient(String idCardNo) { - SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMddHH:mm:ss"); SimpleDateFormat fmt2 = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat fmt1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); MaternalDeliverResult maternalDeliverResult = new MaternalDeliverResult(); + SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date startTime = DateUtil.addMonth(new Date(),8); + String start = fmt.format(startTime); + Connection conn = ConnTools.makeFmConnection(); QueryRunner queryRunner = new QueryRunner(); if(idCardNo != null){ @@ -976,113 +979,7 @@ public class QhdfyFmService { " SRKS as srks,\n" + " JSZ as jsz"; - String itemSql ="select "+cloumns+" from JHMK_FMJL_LYMS where " + - " and SYXH not in (select SYXH from JHMK_FMJL_LYMS where JSZ is not null and SC is not null and TZ is not null and YFZ is not null and SH is not null and CCQK is not null and CCQK <> '' " + - " and (SFFZRSTDT = ' 是 ' or SFSTDT = ' 是 ')) and SYXH='"+patInfo.getSyxh()+"'"; - - List itemList = queryRunner.query(conn, itemSql, new BeanListHandler(FmItem.class)); - - //单胎 - if(CollectionUtils.isNotEmpty(itemList)){ - List babys = new ArrayList(); - for(FmItem fmItem : itemList){ - System.out.println("单胎:"+fmItem); - try{ - - Map deliveryMode = new HashMap(); //分娩方式 - if (!("活产".equals(fmItem.getCcqk()) || "死胎".equals(fmItem.getCcqk()))) - { - continue; - } - - Date dueDate = fmt.parse(fmItem.getCsrq()); - String dutTime = fmt1.format(dueDate); - - maternalDeliverResult.setDueDate(fmt2.format(dueDate)); - maternalDeliverResult.setDueWeek(fmItem.getRc()); - maternalDeliverResult.setTireNumber(Integer.parseInt(fmItem.getDjt())); - //没有胎盘默认为1 - maternalDeliverResult.setPlacenta("1"); - String fmfs = ""; - if (fmItem.getFmfs() != null && "剖宫产".equals(fmItem.getFmfs())) - { - fmfs = FmTypeEnums.O1.getId(); - } - else - { - fmfs = FmTypeEnums.O.getId(); - } - deliveryMode.put("fmfs",fmfs); - maternalDeliverResult.setDeliveryMode(deliveryMode); - - if ("完好".equals(fmItem.getHyqk()) || "".equals(fmItem.getHyqk())) { - maternalDeliverResult.setPerinealCondition("full"); - } else if ("会阴切开".equals(fmItem.getHyqk()) || "侧切".equals(fmItem.getHyqk())) { - maternalDeliverResult.setPerinealCondition("split"); - } - if ("一度裂伤".equals(fmItem.getHyqk())) { - maternalDeliverResult.setSiLielevel(1); - } else if ("二度裂伤".equals(fmItem.getHyqk())) { - maternalDeliverResult.setSiLielevel(2); - } else if ("三度裂伤".equals(fmItem.getHyqk())) { - maternalDeliverResult.setSiLielevel(3); - } - if (StringUtils.isNotEmpty(fmItem.getChexxsxl())) { - maternalDeliverResult.settHloseBloodL(Double.parseDouble(fmItem.getChexxsxl())); - } - - //儿童 - MaternalDeliverResult.Baby baby = maternalDeliverResult.new Baby(); - Map as = new HashMap<>(); - String pf1 = fmItem.getYfz(); - String pf5 = fmItem.getWfz(); - String pf10 = fmItem.getSfz(); - if(pf1!=null){ - as.put("pf1", pf1); - } - if(pf5!=null){ - as.put("pf5", pf5); - } - if(pf10!=null){ - as.put("pf10", pf10); - } - baby.setApgarScore(as); - baby.setBabyGender("男".equals(fmItem.getYexb()) ? "1" : "0"); - String babyHeight = fmItem.getSc(); - String babyWeight = fmItem.getTz(); - String baby_Asphyxiam = fmItem.getZx(); - if(babyHeight!=null){ - baby.setBabyHeight(babyHeight);//新生儿生长 - } - if(babyWeight!=null){ - baby.setBabyWeight(babyWeight);//新生儿重量 - } - if(baby_Asphyxiam!=null){ - baby.setAsphyxiaM(baby_Asphyxiam); //窒息分钟 - } - //baby.setDeformity((fmItem.getJx()==null?0:1)); //畸形 0非畸形 1畸形 - - String baby_Pregnancy_Out = fmItem.getCcqk(); - if(baby_Pregnancy_Out!=null && StringUtils.isNotEmpty(baby_Pregnancy_Out)){ - baby.setPregnancyOut(RenShenJieJuEnums.getIdByName(fmItem.getCcqk())); // 妊娠结局 - } - - baby.setDueTime(dutTime);//分娩时间 - babys.add(baby); - - - }catch (Exception e){ - e.printStackTrace(); - continue; - } - } - maternalDeliverResult.setBabies(babys); - } - //多胎 - else - { - String sql1="select "+cloumns+" from JHMK_FMJL_LYMS where JSZ is not null and SC is not null and TZ is not null and YFZ is not null and CCQK is not null and CCQK <> '' " + - " and SH is not null and (SFFZRSTDT = ' 是 ' or SFSTDT = ' 是 ') and SYXH='"+patInfo.getSyxh()+"'"; + String sql1="select "+cloumns+" from JHMK_FMJL_LYMS where JSZ is not null and SC is not null and TZ is not null and CONVERT(DATETIME,left(JLRQ,8)+' '+RIGHT(JLRQ,8),20) > CONVERT(DATETIME,'"+start+"', 120) and SYXH='"+patInfo.getSyxh()+"'"; List duoTaiList = queryRunner.query(conn,sql1 , new BeanListHandler(FmItem.class)); @@ -1204,7 +1101,6 @@ public class QhdfyFmService { } } } - } }catch (Exception e){ e.printStackTrace(); }finally {