Commit fece080c94bbc4a19fcb0227d56833dfd24487a8

Authored by gengxiaokai
1 parent ded50602de

诸城妇幼分娩接口测试改动

Showing 2 changed files with 77 additions and 53 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/zcfy/ZcfyFmService.java View file @ fece080
... ... @@ -116,6 +116,31 @@
116 116 public void queryFmPatient(String start,String end,String phone) {
117 117  
118 118  
  119 + Fm fm1 = new Fm();
  120 + fm1.setBHNUM("1801520");
  121 + fm1.setNAME("何蒙蒙");
  122 + fm1.setPHONE("10279889449");
  123 + fm1.setIDCARD("451023198706122487");
  124 + fm1.setADDR("河北省秦皇岛市海港区西港镇地址");
  125 + fm1.setDUE_WEEK("38");
  126 + fm1.setDUE_DAY("");
  127 + fm1.setFETUS_NUM(1);
  128 + fm1.setDELIVERY_MODE("剖宫产");
  129 + fm1.setDELIVER_HOSPITAL("诸城市妇幼保健院");
  130 + fm1.setDELIVER_DOCTOR("王芳萍");
  131 + fm1.setBABY_SEX("女");
  132 + fm1.setBABY_DELIVERY_TIME("2018/1/4 14:54:25");
  133 + fm1.setBABY_PREGNANCY_OUT("活胎");
  134 + fm1.setBABY_WEIGHT(4300);
  135 + fm1.setBABY_HEIGHT(56);
  136 + fm1.setBABY_APGAR_SCORE_ONE(10);
  137 + fm1.setBABY_APGAR_SCORE_FIVE(10);
  138 + fm1.setBABY_APGAR_SCORE_TEN(10);
  139 +
  140 +
  141 +
  142 +
  143 +
119 144 String cloumns = " 住院编号 as BHNUM,\n" +
120 145 " PHONE as PHONE,\n" +
121 146 " NAME as NAME,\n" +
122 147  
123 148  
124 149  
125 150  
126 151  
127 152  
128 153  
... ... @@ -123,53 +148,45 @@
123 148 " CREATED as CREATED,\t\n" +
124 149 " to_char(BABY_DELIVERY_TIME,'yyyy-mm-dd hh24:mi:ss') as BABY_DELIVERY_TIME,\n" +
125 150 " BABY_SEX as BABY_SEX,\n" +
126   - " DUE_WEEK as DUE_WEEK,\n" +
127   - " 胎次 as FETUS_NUM,\n" +
128   - " 窒息 as BABY_ASPHYXIAM,\n" +
129   - " CONVERT(int,left(体重,len(体重)-1)) as BABY_WEIGHT,\n" +
130   - " CONVERT(int,left(身长,len(身长)-2)) as BABY_HEIGHT,\n" +
131   - " CONVERT(int,left(Apgar评分1,len(Apgar评分1)-1)) as BABY_APGAR_SCORE_ONE,\n" +
132   - " CONVERT(int,left(Apgar评分5,len(Apgar评分5)-1)) as BABY_APGAR_SCORE_FIVE,\n" +
133   - " CONVERT(int,left(Apgar评分10,len(Apgar评分10)-1)) as BABY_APGAR_SCORE_TEN,\n" +
134   - " 妊娠结局 as BABY_PREGNANCY_OUT,\n" +
135   - " 分娩方式 as TMCSIDE,\n" +
136   - // " TMCTYPE as TMCTYPE,\n" +
137   - " 产妇离开产室情况 as MATERNAL_INFO,\n" +
138   - " 会阴切开术 as PERINEAL_CONDITION,\n" +
139   - //" 失血量 as SH_LOSE_BLOOD,\n" +
140   - " 失血量 as sxl,\n" +
141   - // " TH_LOSE_BLOOD as TH_LOSE_BLOOD,\n" +
142   - // " 接生者 as DELIVER_DOCTOR,\n" +
143   - // " 产程第一期 as PROD_PROCESS_ONE,\n" +
144   - " 产程第一期 as ccOne,\n" +
  151 + " substr(DUE_WEEK,0,2) as DUE_WEEK,\n" +
  152 + " substr(DUE_WEEK,4) as DUE_DAY, \n"+
  153 + " FETUS_NUM as FETUS_NUM,\n" +
  154 + " to_number(BABY_WEIGHT) as BABY_WEIGHT,\n" +
  155 + " to_number(BABY_HEIGHT) as BABY_HEIGHT,\n" +
  156 + " to_number(BABY_APGAR_SCORE_ONE) as BABY_APGAR_SCORE_ONE,\n" +
  157 + " to_number(BABY_APGAR_SCORE_FIVE) as BABY_APGAR_SCORE_FIVE,\n" +
  158 + " to_number(BABY_APGAR_SCORE_TEN) as BABY_APGAR_SCORE_TEN,\n" +
  159 + " BABY_PREGNANCY_OUT as BABY_PREGNANCY_OUT,\n" +
  160 + " DELIVERY_MODE as DELIVERY_MODE,\n" +
  161 + " MATERNAL_INFO as MATERNAL_INFO,\n" +
  162 + " PERINEAL_CONDITION as PERINEAL_CONDITION,\n" +
  163 + //" DELIVER_DOCTOR as DELIVER_DOCTOR,\n" +
  164 + //" PROD_PROCESS_ONE as PROD_PROCESS_ONE,\n" +
145 165 // " 第二期 as PROD_PROCESS_TWO,\n" +
146   - " 第二期 as ccTwo,\n" +
147 166 // " 第三期 as PROD_PROCESS_THREE,\n" +
148   - " 第三期 as ccThree,\n" +
149 167 //" 总计 as TOTAL_PROCESS,\n" +
150   - " 总计 as total,\n" +
151   - " CONVERT(int,胎盘数量) as PLACENTA_NUM,\n" +
152   - //" DELIVER_HOSPITAL as DELIVER_HOSPITAL,\n" +
153   - " 产妇居住地址 as ADDR,\n"+
154   - " 接生者 as DELIVER_DOCTOR";
  168 + //" CONVERT(int,胎盘数量) as PLACENTA_NUM,\n" +
  169 + " DELIVER_HOSPITAL as DELIVER_HOSPITAL,\n" +
  170 + " ADDR as ADDR,\n"+
  171 + " DELIVER_DOCTOR as DELIVER_DOCTOR";
155 172  
156 173  
157   - Connection conn = com.lyms.hospitalapi.zcfy.ConnTools.makeFmConnection();
  174 + //Connection conn = com.lyms.hospitalapi.zcfy.ConnTools.makeFmConnection();
158 175 QueryRunner queryRunner = new QueryRunner();
159 176 SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
160 177 try {
161 178  
162 179 String sql ="select "+cloumns+" from zcfybjy.v_deliveryinfo where " +
163   - " CREATED > to_date('"+start+"', 'yyyy-mm-dd hh24:mi:ss') and CREATED <= to_date('"+end+"', 'yyyy-mm-dd hh24:mi:ss')" ;
  180 + " CREATED > to_date('"+start+"', 'yyyy-mm-dd hh24:mi:ss') and CREATED <= to_date('"+end+"', 'yyyy-mm-dd hh24:mi:ss') " ;
164 181 if (phone != null)
165 182 {
166 183 sql+=" and 手机号码 = '"+phone+"'";
167 184 }
168   - List<Fm> list = queryRunner.query(conn, sql, new BeanListHandler<Fm>(Fm.class));
169   - ExceptionUtils.catchException("size====" + list.size());
  185 + //List<Fm> list = queryRunner.query(conn, sql, new BeanListHandler<Fm>(Fm.class));
  186 + //ExceptionUtils.catchException("size====" + list.size());
170 187  
171   - /*List<Fm> list=new ArrayList<Fm>();
172   - list.add(fm1);*/
  188 + List<Fm> list=new ArrayList<Fm>();
  189 + list.add(fm1);
173 190 if(CollectionUtils.isNotEmpty(list)){
174 191  
175 192 for(Fm fm:list){
176 193  
177 194  
... ... @@ -177,14 +194,14 @@
177 194 int a = 0;//用来判断是否建了儿童档案,如果建了儿童档案就不保存分娩记录
178 195 int count = 0;
179 196 List<Users> users = new ArrayList<Users>();
180   - String id = fm.getID();//获取所有的孕妇ID,方便孕妇产下双胞胎而用
  197 + String idCard = fm.getIDCARD();//获取所有的孕妇身份证号,方便孕妇产下双胞胎而用
181 198  
182 199 //用来查询这个孕妇分娩的最近日期的sql
183   - String dateSql = "select max(CONVERT(char(19),CREATED,120)) as babyDate from xlhhis..v_fmjl where " +
184   - " ID='"+id+"'" ;
  200 + String dateSql = "select max(to_char(created,'yyyy-mm-dd hh24:mi:ss')) as babyDate from zcfybjy.v_deliveryinfo where " +
  201 + " IDCARD ='"+idCard+"'" ;
185 202  
186 203 //获取到这个孕妇的最近的分娩日期
187   - List<Fm> dateList = queryRunner.query(conn, dateSql, new BeanListHandler<Fm>(Fm.class));
  204 + /*List<Fm> dateList = queryRunner.query(conn, dateSql, new BeanListHandler<Fm>(Fm.class));
188 205 Calendar calendar = Calendar.getInstance();
189 206 calendar.setTime(fmt.parse(dateList.get(0).getBabyDate()));
190 207 calendar.add(Calendar.DAY_OF_MONTH, -1);
191 208  
192 209  
... ... @@ -193,15 +210,15 @@
193 210 String endDate = dateList.get(0).getBabyDate();
194 211  
195 212 //查询这个孕妇最近日期所有分娩记录的sql
196   - String allSql = "select "+cloumns+" from xlhhis..v_fmjl where " +
197   - " CREATED > CONVERT(char(19),'"+startDate+"',120) and CREATED <= CONVERT(char(19),'"+endDate+"',120)" +
198   - " and ID='"+id+"'" ;
  213 + String allSql = "select "+cloumns+" from zcfybjy.v_deliveryinfo where " +
  214 + " CREATED > to_date('"+startDate+"', 'yyyy-mm-dd hh24:mi:ss') and CREATED <= to_date('"+endDate+"', 'yyyy-mm-dd hh24:mi:ss')" +
  215 + " and IDCARD='"+idCard+"'" ;
199 216  
200   - //查出这个ID对应孕妇在这个时间段的分娩记录
201   - List<Fm> allList = queryRunner.query(conn, allSql, new BeanListHandler<Fm>(Fm.class));
  217 + //查出这个IDCARD对应孕妇在这个时间段的分娩记录
  218 + List<Fm> allList = queryRunner.query(conn, allSql, new BeanListHandler<Fm>(Fm.class));*/
202 219  
203   - /*List<Fm> allList = new ArrayList<Fm>();
204   - allList.add(fm);*/
  220 + List<Fm> allList = new ArrayList<Fm>();
  221 + allList.add(fm);
205 222  
206 223 Date dueDate = null;
207 224 List<MatDeliverAddRequest.Baby> babies = new ArrayList<>();
... ... @@ -218,7 +235,7 @@
218 235 }
219 236  
220 237 //将中间字段的值整理赋值到正式字段中
221   - int sxl = allFm.getSxl().length();
  238 + /*int sxl = allFm.getSxl().length();
222 239 allFm.setSH_LOSE_BLOOD(Integer.parseInt(allFm.getSxl().substring(0,sxl-2)));//失血量
223 240  
224 241 String[] oneShi = allFm.getCcOne().split("时");
225 242  
... ... @@ -240,8 +257,8 @@
240 257 int total = Integer.parseInt(totalShi[0])*60;
241 258 String[] totalFen = totalShi[1].split("分");
242 259 allFm.setTOTAL_PROCESS(String.valueOf(total+Integer.parseInt(totalFen[0])));//总产程
  260 +*/
243 261  
244   -
245 262 PatientsQuery query = new PatientsQuery();
246 263 query.setYn(YnEnums.YES.getId());
247 264 query.setType(1); //孕妇
248 265  
... ... @@ -299,11 +316,14 @@
299 316 map.put("three",map3);
300 317 }
301 318  
302   - int hProcess = Integer.parseInt(allFm.getTOTAL_PROCESS())/60;//总产程小时数
303   - int mProcess = Integer.parseInt(allFm.getTOTAL_PROCESS())%60;//总产程分钟数
304   - totalMap.put("h",String.valueOf(hProcess));
305   - totalMap.put("m",String.valueOf(mProcess));
  319 + if(allFm.getTOTAL_PROCESS()!=null){
  320 + int hProcess = Integer.parseInt(allFm.getTOTAL_PROCESS())/60;//总产程小时数
  321 + int mProcess = Integer.parseInt(allFm.getTOTAL_PROCESS())%60;//总产程分钟数
  322 + totalMap.put("h",String.valueOf(hProcess));
  323 + totalMap.put("m",String.valueOf(mProcess));
  324 + }
306 325  
  326 +
307 327 deliverAddRequest.setProdprocess(map);
308 328 deliverAddRequest.setTotalprocess(totalMap);
309 329 deliverAddRequest.setDeliverDoctor(allFm.getDELIVER_DOCTOR());
... ... @@ -421,7 +441,7 @@
421 441 }
422 442 }else{
423 443 a=1;
424   - //乐陵服务器有分娩记录,但是在这边系统没有对应孕妇 取分娩信息建档儿童数据
  444 + //诸城服务器有分娩记录,但是在这边系统没有对应孕妇 取分娩信息建档儿童数据
425 445 List<String> names = buildBabyName(allList);
426 446  
427 447 Date dateTime = fmt.parse(allFm.getBABY_DELIVERY_TIME());
428 448  
... ... @@ -486,12 +506,12 @@
486 506 }
487 507 }
488 508 }
489   - DbUtils.closeQuietly(conn);
  509 + //DbUtils.closeQuietly(conn);
490 510 } catch (Exception e) {
491 511 ExceptionUtils.catchException(e, "sql执行异常");
492 512 e.printStackTrace();
493 513 } finally {
494   - DbUtils.closeQuietly(conn);
  514 + //DbUtils.closeQuietly(conn);
495 515 }
496 516 }
497 517  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntenatalExaminationController.java View file @ fece080
... ... @@ -6,6 +6,7 @@
6 6 import com.lyms.hospitalapi.llfy.LlfyFmService;
7 7 import com.lyms.hospitalapi.qhdfy.QhdfyHisService;
8 8 import com.lyms.hospitalapi.v1.HisService;
  9 +import com.lyms.hospitalapi.zcfy.ZcfyFmService;
9 10 import com.lyms.platform.biz.service.PatientCheckTicketService;
10 11 import com.lyms.platform.common.annotation.TokenRequired;
11 12 import com.lyms.platform.common.base.BaseController;
12 13  
... ... @@ -57,7 +58,10 @@
57 58 private DzfyFmService dzfyFmService;
58 59 @Autowired
59 60 private LlfyFmService llfyFmService;
  61 + @Autowired
  62 + private ZcfyFmService zcfyFmService;
60 63  
  64 +
61 65 @Autowired
62 66 private NczxyyLisService nczxyyLisService;
63 67  
... ... @@ -101,7 +105,7 @@
101 105 @RequestMapping(method = RequestMethod.GET, value = "/fm")
102 106 @ResponseBody
103 107 public String getFm(String start,String end,String syxh){
104   - llfyFmService.queryFmPatient(start,end,syxh);
  108 + zcfyFmService.queryFmPatient(start,end,syxh);
105 109 return "1";
106 110 }
107 111