Commit 7c407ddb1c1441289b331b8f6a01448e0bc04484
1 parent
1b3f182249
Exists in
master
and in
6 other branches
秦皇岛工人医院就诊卡转换ID
Showing 2 changed files with 68 additions and 1 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/gryy/GryyHisService.java
View file @
7c407dd
| 1 | +package com.lyms.hospitalapi.gryy; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson.JSONObject; | |
| 4 | +import com.lyms.platform.common.utils.ExceptionUtils; | |
| 5 | +import org.apache.http.HttpResponse; | |
| 6 | +import org.apache.http.client.methods.HttpPost; | |
| 7 | +import org.apache.http.impl.client.DefaultHttpClient; | |
| 8 | +import org.apache.http.impl.conn.PoolingClientConnectionManager; | |
| 9 | +import org.apache.http.util.EntityUtils; | |
| 10 | +import org.springframework.stereotype.Service; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * Created by Administrator on 2018/4/12. | |
| 14 | + */ | |
| 15 | +@Service("gryyHisService") | |
| 16 | +public class GryyHisService { | |
| 17 | + | |
| 18 | + /** | |
| 19 | + * 秦皇岛工人医院 | |
| 20 | + * 查询病人ID | |
| 21 | + * 工人医院查询lis报告先通过就诊卡号查询到病人id | |
| 22 | + * 通过病人id到院内系统mysql中查询 vCcardNo字段 | |
| 23 | + * @param vcCardNo 就诊卡号 | |
| 24 | + * @return | |
| 25 | + */ | |
| 26 | + public String getIdByVcCardNo(String vcCardNo){ | |
| 27 | + String id = null; | |
| 28 | + String url = "http://10.35.2.77:9090/his/getGrYyIdByVcCardNo?vcCardNo="+vcCardNo; | |
| 29 | + DefaultHttpClient client = new DefaultHttpClient(new PoolingClientConnectionManager()); | |
| 30 | + try { | |
| 31 | + HttpPost httpPost = new HttpPost(url); | |
| 32 | + | |
| 33 | + //执行post请求 | |
| 34 | + HttpResponse respon = client.execute(httpPost); | |
| 35 | + if(respon != null && respon.getStatusLine().getStatusCode() == 200){ | |
| 36 | + String result= EntityUtils.toString(respon.getEntity()); | |
| 37 | + System.out.print(result); | |
| 38 | + // 生成 JSON 对象 | |
| 39 | + JSONObject obj = JSONObject.parseObject(result); | |
| 40 | + if(obj!=null){ | |
| 41 | + id = obj.getString("id"); | |
| 42 | + } | |
| 43 | + return id == null ? vcCardNo : id; | |
| 44 | + }else{ | |
| 45 | + System.out.println("传输失败!"); | |
| 46 | + } | |
| 47 | + }catch (Exception e){ | |
| 48 | + ExceptionUtils.catchException(e, "秦皇岛工人医院就诊卡号获取病人id异常"); | |
| 49 | + return vcCardNo; | |
| 50 | + } | |
| 51 | + finally { | |
| 52 | + client.close(); | |
| 53 | + } | |
| 54 | + | |
| 55 | + return vcCardNo; | |
| 56 | + } | |
| 57 | + | |
| 58 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java
View file @
7c407dd
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.hospitalapi.Cdfy.CdfyHisService; |
| 4 | 4 | import com.lyms.hospitalapi.dzfy.DzfyHisService; |
| 5 | +import com.lyms.hospitalapi.gryy.GryyHisService; | |
| 5 | 6 | import com.lyms.hospitalapi.pojo.CheckByDate; |
| 6 | 7 | import com.lyms.hospitalapi.pojo.CheckItemResponse; |
| 7 | 8 | import com.lyms.hospitalapi.pojo.CheckResponse; |
| ... | ... | @@ -70,6 +71,9 @@ |
| 70 | 71 | private WxHisService wxrmyyHisService; |
| 71 | 72 | |
| 72 | 73 | @Autowired |
| 74 | + private GryyHisService gryyHisService; | |
| 75 | + | |
| 76 | + @Autowired | |
| 73 | 77 | @Qualifier("commonThreadPool") |
| 74 | 78 | private ThreadPoolTaskExecutor commonThreadPool; |
| 75 | 79 | |
| ... | ... | @@ -389,7 +393,12 @@ |
| 389 | 393 | //威海市妇幼 因为威海市妇幼有些孕妇没有就诊卡直接用身份证,lis把身份证号码存在就诊卡号字段的 |
| 390 | 394 | else if ("22".equals(HIS_VERSION)&&perType==1) { |
| 391 | 395 | model.setVcCardNo(cardNo); |
| 392 | - } else { | |
| 396 | + } | |
| 397 | + //秦皇岛工人医院lis数据查询,就诊卡号字段保存的是病人ID | |
| 398 | + else if("26".equals(HIS_VERSION)){ | |
| 399 | + model.setVcCardNo(gryyHisService.getIdByVcCardNo(vcCardNo)); | |
| 400 | + } | |
| 401 | + else { | |
| 393 | 402 | model.setVcCardNo(vcCardNo); |
| 394 | 403 | } |
| 395 | 404 |