Commit 7a31c883b50982ac38a907acbdee72460f84160e
1 parent
37b8415994
Exists in
master
and in
6 other branches
承德妇幼根据就诊卡号转换为ID
Showing 3 changed files with 64 additions and 2 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/Cdfy/CdfyHisService.java
View file @
7a31c88
| 1 | 1 | package com.lyms.hospitalapi.Cdfy; |
| 2 | 2 | |
| 3 | +import com.alibaba.fastjson.JSONObject; | |
| 3 | 4 | import com.lyms.hospitalapi.pojo.DzReplace; |
| 4 | 5 | import com.lyms.platform.common.utils.ExceptionUtils; |
| 6 | +import com.lyms.platform.operate.web.utils.HttpClientUtil; | |
| 5 | 7 | import org.apache.commons.collections.CollectionUtils; |
| 6 | 8 | import org.apache.commons.dbutils.DbUtils; |
| 7 | 9 | import org.apache.commons.dbutils.QueryRunner; |
| 8 | 10 | import org.apache.commons.dbutils.handlers.BeanListHandler; |
| 9 | 11 | import org.apache.commons.lang.StringUtils; |
| 12 | +import org.apache.http.HttpEntity; | |
| 13 | +import org.apache.http.HttpResponse; | |
| 14 | +import org.apache.http.client.methods.HttpPost; | |
| 15 | +import org.apache.http.entity.StringEntity; | |
| 16 | +import org.apache.http.impl.client.DefaultHttpClient; | |
| 17 | +import org.apache.http.impl.conn.PoolingClientConnectionManager; | |
| 18 | +import org.apache.http.util.EntityUtils; | |
| 10 | 19 | import org.springframework.stereotype.Service; |
| 11 | 20 | |
| 12 | 21 | import java.sql.Connection; |
| ... | ... | @@ -56,6 +65,45 @@ |
| 56 | 65 | DbUtils.closeQuietly(conn); |
| 57 | 66 | } |
| 58 | 67 | return "vcCardNo"; |
| 68 | + } | |
| 69 | + | |
| 70 | + | |
| 71 | + public String getIdByVcCardNo(String vcCardNo){ | |
| 72 | + String id = null; | |
| 73 | + String url = "http://10.0.200.2:9090/his/getCdFyHis?vcCardNo="+vcCardNo; | |
| 74 | + DefaultHttpClient client = new DefaultHttpClient(new PoolingClientConnectionManager()); | |
| 75 | + try { | |
| 76 | + | |
| 77 | + HttpPost httpPost = new HttpPost(url); | |
| 78 | + /*StringEntity se = new StringEntity(vcCardNo,"UTF-8"); | |
| 79 | + se.setContentType("text/json"); | |
| 80 | + httpPost.setEntity(se);*/ | |
| 81 | + | |
| 82 | + //执行post请求 | |
| 83 | + HttpResponse respon = client.execute(httpPost); | |
| 84 | + if(respon != null && respon.getStatusLine().getStatusCode() == 200){ | |
| 85 | + String result= EntityUtils.toString(respon.getEntity()); | |
| 86 | + System.out.print(result); | |
| 87 | + // 生成 JSON 对象 | |
| 88 | + JSONObject obj = JSONObject.parseObject(result); | |
| 89 | + if(obj!=null){ | |
| 90 | + id = obj.getString("id"); | |
| 91 | + } | |
| 92 | + | |
| 93 | + return id; | |
| 94 | + }else{ | |
| 95 | + System.out.println("传输失败!"); | |
| 96 | + } | |
| 97 | + | |
| 98 | + | |
| 99 | + }catch (Exception e){ | |
| 100 | + e.printStackTrace(); | |
| 101 | + } | |
| 102 | + | |
| 103 | + | |
| 104 | + return id; | |
| 105 | + | |
| 106 | + | |
| 59 | 107 | } |
| 60 | 108 | |
| 61 | 109 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
7a31c88
| 1 | 1 | package com.lyms.platform.operate.web.controller; |
| 2 | 2 | |
| 3 | 3 | import com.alibaba.fastjson.JSON; |
| 4 | +import com.lyms.hospitalapi.Cdfy.CdfyHisService; | |
| 4 | 5 | import com.lyms.hospitalapi.dzfy.DzfyFmService; |
| 5 | 6 | import com.lyms.hospitalapi.qhdfy.QhdfyFmService; |
| 6 | 7 | import com.lyms.hospitalapi.qhdfy.QhdfyHisService; |
| 7 | 8 | |
| ... | ... | @@ -131,7 +132,10 @@ |
| 131 | 132 | @Autowired |
| 132 | 133 | private PatientMedicalRecordFacade patientMedicalRecordFacade; |
| 133 | 134 | |
| 135 | + @Autowired | |
| 136 | + private CdfyHisService cdfyHisService; | |
| 134 | 137 | |
| 138 | + | |
| 135 | 139 | static Map<String, String> highRisks = new HashMap<>(); |
| 136 | 140 | |
| 137 | 141 | static { |
| ... | ... | @@ -1673,5 +1677,15 @@ |
| 1673 | 1677 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 1674 | 1678 | return patientMedicalRecordFacade.findAntExListTwo(exListQueryRequest,loginState.getId()); |
| 1675 | 1679 | } |
| 1680 | + | |
| 1681 | + | |
| 1682 | + @RequestMapping("/test") | |
| 1683 | + @ResponseBody | |
| 1684 | + public String test(String code){ | |
| 1685 | + | |
| 1686 | + return cdfyHisService.getIdByVcCardNo(code); | |
| 1687 | + } | |
| 1688 | + | |
| 1689 | + | |
| 1676 | 1690 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java
View file @
7a31c88
| ... | ... | @@ -388,8 +388,8 @@ |
| 388 | 388 | //承德查询lis |
| 389 | 389 | else if ("16".equals(HIS_VERSION)) |
| 390 | 390 | { |
| 391 | - model.setVcCardNo(vcCardNo); | |
| 392 | - //model.setVcCardNo(cdfyHisService.getPatientIdByVcCardNo(vcCardNo)); | |
| 391 | + //model.setVcCardNo(vcCardNo); | |
| 392 | + model.setVcCardNo(cdfyHisService.getIdByVcCardNo(vcCardNo)); | |
| 393 | 393 | } |
| 394 | 394 | //威县人民医院lis |
| 395 | 395 | else if ("20".equals(HIS_VERSION)) |