Commit 06f6e5cf0418753d83cc2734462830a4cd3db092
1 parent
06848e148c
Exists in
master
and in
6 other branches
分娩
Showing 1 changed file with 5 additions and 109 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java
View file @
06f6e5c
... | ... | @@ -923,11 +923,14 @@ |
923 | 923 | public MaternalDeliverResult queryFmPatient(String idCardNo) |
924 | 924 | { |
925 | 925 | |
926 | - SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMddHH:mm:ss"); | |
927 | 926 | SimpleDateFormat fmt2 = new SimpleDateFormat("yyyy-MM-dd"); |
928 | 927 | SimpleDateFormat fmt1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
929 | 928 | MaternalDeliverResult maternalDeliverResult = new MaternalDeliverResult(); |
930 | 929 | |
930 | + SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
931 | + Date startTime = DateUtil.addMonth(new Date(),8); | |
932 | + String start = fmt.format(startTime); | |
933 | + | |
931 | 934 | Connection conn = ConnTools.makeFmConnection(); |
932 | 935 | QueryRunner queryRunner = new QueryRunner(); |
933 | 936 | if(idCardNo != null){ |
934 | 937 | |
... | ... | @@ -976,114 +979,8 @@ |
976 | 979 | " SRKS as srks,\n" + |
977 | 980 | " JSZ as jsz"; |
978 | 981 | |
979 | - String itemSql ="select "+cloumns+" from JHMK_FMJL_LYMS where " + | |
980 | - " 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 <> '' " + | |
981 | - " and (SFFZRSTDT = ' 是 ' or SFSTDT = ' 是 ')) and SYXH='"+patInfo.getSyxh()+"'"; | |
982 | + 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()+"'"; | |
982 | 983 | |
983 | - List<FmItem> itemList = queryRunner.query(conn, itemSql, new BeanListHandler<FmItem>(FmItem.class)); | |
984 | - | |
985 | - //单胎 | |
986 | - if(CollectionUtils.isNotEmpty(itemList)){ | |
987 | - List<MaternalDeliverResult.Baby> babys = new ArrayList<MaternalDeliverResult.Baby>(); | |
988 | - for(FmItem fmItem : itemList){ | |
989 | - System.out.println("单胎:"+fmItem); | |
990 | - try{ | |
991 | - | |
992 | - Map deliveryMode = new HashMap(); //分娩方式 | |
993 | - if (!("活产".equals(fmItem.getCcqk()) || "死胎".equals(fmItem.getCcqk()))) | |
994 | - { | |
995 | - continue; | |
996 | - } | |
997 | - | |
998 | - Date dueDate = fmt.parse(fmItem.getCsrq()); | |
999 | - String dutTime = fmt1.format(dueDate); | |
1000 | - | |
1001 | - maternalDeliverResult.setDueDate(fmt2.format(dueDate)); | |
1002 | - maternalDeliverResult.setDueWeek(fmItem.getRc()); | |
1003 | - maternalDeliverResult.setTireNumber(Integer.parseInt(fmItem.getDjt())); | |
1004 | - //没有胎盘默认为1 | |
1005 | - maternalDeliverResult.setPlacenta("1"); | |
1006 | - String fmfs = ""; | |
1007 | - if (fmItem.getFmfs() != null && "剖宫产".equals(fmItem.getFmfs())) | |
1008 | - { | |
1009 | - fmfs = FmTypeEnums.O1.getId(); | |
1010 | - } | |
1011 | - else | |
1012 | - { | |
1013 | - fmfs = FmTypeEnums.O.getId(); | |
1014 | - } | |
1015 | - deliveryMode.put("fmfs",fmfs); | |
1016 | - maternalDeliverResult.setDeliveryMode(deliveryMode); | |
1017 | - | |
1018 | - if ("完好".equals(fmItem.getHyqk()) || "".equals(fmItem.getHyqk())) { | |
1019 | - maternalDeliverResult.setPerinealCondition("full"); | |
1020 | - } else if ("会阴切开".equals(fmItem.getHyqk()) || "侧切".equals(fmItem.getHyqk())) { | |
1021 | - maternalDeliverResult.setPerinealCondition("split"); | |
1022 | - } | |
1023 | - if ("一度裂伤".equals(fmItem.getHyqk())) { | |
1024 | - maternalDeliverResult.setSiLielevel(1); | |
1025 | - } else if ("二度裂伤".equals(fmItem.getHyqk())) { | |
1026 | - maternalDeliverResult.setSiLielevel(2); | |
1027 | - } else if ("三度裂伤".equals(fmItem.getHyqk())) { | |
1028 | - maternalDeliverResult.setSiLielevel(3); | |
1029 | - } | |
1030 | - if (StringUtils.isNotEmpty(fmItem.getChexxsxl())) { | |
1031 | - maternalDeliverResult.settHloseBloodL(Double.parseDouble(fmItem.getChexxsxl())); | |
1032 | - } | |
1033 | - | |
1034 | - //儿童 | |
1035 | - MaternalDeliverResult.Baby baby = maternalDeliverResult.new Baby(); | |
1036 | - Map<String, String> as = new HashMap<>(); | |
1037 | - String pf1 = fmItem.getYfz(); | |
1038 | - String pf5 = fmItem.getWfz(); | |
1039 | - String pf10 = fmItem.getSfz(); | |
1040 | - if(pf1!=null){ | |
1041 | - as.put("pf1", pf1); | |
1042 | - } | |
1043 | - if(pf5!=null){ | |
1044 | - as.put("pf5", pf5); | |
1045 | - } | |
1046 | - if(pf10!=null){ | |
1047 | - as.put("pf10", pf10); | |
1048 | - } | |
1049 | - baby.setApgarScore(as); | |
1050 | - baby.setBabyGender("男".equals(fmItem.getYexb()) ? "1" : "0"); | |
1051 | - String babyHeight = fmItem.getSc(); | |
1052 | - String babyWeight = fmItem.getTz(); | |
1053 | - String baby_Asphyxiam = fmItem.getZx(); | |
1054 | - if(babyHeight!=null){ | |
1055 | - baby.setBabyHeight(babyHeight);//新生儿生长 | |
1056 | - } | |
1057 | - if(babyWeight!=null){ | |
1058 | - baby.setBabyWeight(babyWeight);//新生儿重量 | |
1059 | - } | |
1060 | - if(baby_Asphyxiam!=null){ | |
1061 | - baby.setAsphyxiaM(baby_Asphyxiam); //窒息分钟 | |
1062 | - } | |
1063 | - //baby.setDeformity((fmItem.getJx()==null?0:1)); //畸形 0非畸形 1畸形 | |
1064 | - | |
1065 | - String baby_Pregnancy_Out = fmItem.getCcqk(); | |
1066 | - if(baby_Pregnancy_Out!=null && StringUtils.isNotEmpty(baby_Pregnancy_Out)){ | |
1067 | - baby.setPregnancyOut(RenShenJieJuEnums.getIdByName(fmItem.getCcqk())); // 妊娠结局 | |
1068 | - } | |
1069 | - | |
1070 | - baby.setDueTime(dutTime);//分娩时间 | |
1071 | - babys.add(baby); | |
1072 | - | |
1073 | - | |
1074 | - }catch (Exception e){ | |
1075 | - e.printStackTrace(); | |
1076 | - continue; | |
1077 | - } | |
1078 | - } | |
1079 | - maternalDeliverResult.setBabies(babys); | |
1080 | - } | |
1081 | - //多胎 | |
1082 | - else | |
1083 | - { | |
1084 | - 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 <> '' " + | |
1085 | - " and SH is not null and (SFFZRSTDT = ' 是 ' or SFSTDT = ' 是 ') and SYXH='"+patInfo.getSyxh()+"'"; | |
1086 | - | |
1087 | 984 | List<FmItem> duoTaiList = queryRunner.query(conn,sql1 |
1088 | 985 | , new BeanListHandler<FmItem>(FmItem.class)); |
1089 | 986 | |
... | ... | @@ -1204,7 +1101,6 @@ |
1204 | 1101 | } |
1205 | 1102 | } |
1206 | 1103 | } |
1207 | - } | |
1208 | 1104 | }catch (Exception e){ |
1209 | 1105 | e.printStackTrace(); |
1210 | 1106 | }finally { |