Commit 2adff031f0a2edbadc21c9e700192fc533177f61
1 parent
aea1e127bb
Exists in
master
and in
8 other branches
add qinglongxian get his patient info api
Showing 4 changed files with 90 additions and 15 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/qinglongxian/ConnTools.java
View file @
2adff03
... | ... | @@ -9,19 +9,19 @@ |
9 | 9 | */ |
10 | 10 | public class ConnTools { |
11 | 11 | private static String hisDirverClassName = "oracle.jdbc.driver.OracleDriver"; |
12 | - private static String hisUrl = "jdbc:oracle:thin:@192.190.10.11:1521:xlsyy"; | |
13 | - private static String hisUser = "mmbb"; | |
14 | - private static String hisPassword = "mmbb"; | |
12 | + private static String hisUrl = "jdbc:oracle:thin:@132.132.132.6:1521:tphy"; | |
13 | + private static String hisUser = "tpsoft"; | |
14 | + private static String hisPassword = "tphy"; | |
15 | 15 | |
16 | - private static String pacsDirverClassName = "oracle.jdbc.driver.OracleDriver"; | |
17 | - private static String pacsUrl = "jdbc:oracle:thin:@172.0.1.17:1521:ris"; | |
18 | - private static String pacsUser = "YunYing"; | |
19 | - private static String pacsPassword = "maroland"; | |
20 | - | |
21 | 16 | private static String lisDirverClassName = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; |
22 | - private static String lisUrl = "jdbc:sqlserver://172.0.1.20:1433; DatabaseName=rmlis6"; | |
17 | + private static String lisUrl = "jdbc:sqlserver://132.132.132.19:1433; DatabaseName=lis_tphy"; | |
23 | 18 | private static String lisUser = "sa"; |
24 | - private static String lisPassword = "skhis168"; | |
19 | + private static String lisPassword = "sa"; | |
20 | + | |
21 | + private static String pacsDirverClassName = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; | |
22 | + private static String pacsUrl = "jdbc:sqlserver://132.132.132.17:1433; DatabaseName=UNIRIS"; | |
23 | + private static String pacsUser = "sa"; | |
24 | + private static String pacsPassword = "admin_123"; | |
25 | 25 | |
26 | 26 | public static Connection makeHisConnection() { |
27 | 27 | Connection conn = null; |
platform-operate-api/src/main/java/com/lyms/hospitalapi/qinglongxian/QingLongXianHisService.java
View file @
2adff03
1 | 1 | package com.lyms.hospitalapi.qinglongxian; |
2 | 2 | |
3 | +import com.lyms.hospitalapi.v2.XinlePregPatientinfo; | |
4 | +import com.lyms.platform.common.utils.DateUtil; | |
5 | +import org.apache.commons.dbutils.DbUtils; | |
6 | +import org.apache.commons.dbutils.QueryRunner; | |
7 | +import org.apache.commons.dbutils.handlers.BeanListHandler; | |
8 | +import org.apache.commons.lang.StringUtils; | |
3 | 9 | import org.springframework.stereotype.Service; |
4 | 10 | |
11 | +import java.sql.Connection; | |
12 | +import java.sql.SQLException; | |
13 | +import java.util.ArrayList; | |
14 | +import java.util.HashMap; | |
15 | +import java.util.List; | |
16 | +import java.util.Map; | |
17 | + | |
5 | 18 | /** |
6 | 19 | * Created by Administrator on 2016/9/20. |
7 | 20 | */ |
8 | 21 | @Service("qingLongXianHisService") |
9 | 22 | public class QingLongXianHisService { |
23 | + | |
24 | + public Map<String,Object> getPatientInfo(String cardNo){ | |
25 | + Map<String,Object> map = new HashMap<>(); | |
26 | + if (StringUtils.isNotBlank(cardNo)) { | |
27 | + Connection conn = ConnTools.makeHisConnection(); | |
28 | + QueryRunner queryRunner = new QueryRunner(); | |
29 | + try { | |
30 | + List<XinlePregPatientinfo> list = queryRunner.query(conn, "select * from v_patientinfo where IC_CARD_ID = '"+cardNo+"'", new BeanListHandler<XinlePregPatientinfo>(XinlePregPatientinfo.class)); | |
31 | + if (list.size() > 0) { | |
32 | + XinlePregPatientinfo info = list.get(0); | |
33 | + map.put("sickType", info.getSICKTYPE()); | |
34 | + map.put("sickId", info.getSICK_ID()); | |
35 | + map.put("sex", info.getSEX()); | |
36 | + map.put("name", info.getNAME()); | |
37 | + map.put("cardNo", info.getIC_CARD_ID()); | |
38 | + map.put("phone", info.getASSOCIATION_PHONE()); | |
39 | + map.put("birth", DateUtil.getyyyy_MM_dd(info.getBIRTHDATE())); | |
40 | + } | |
41 | + DbUtils.closeQuietly(conn); | |
42 | + } catch (SQLException e) { | |
43 | + DbUtils.closeQuietly(conn); | |
44 | + e.printStackTrace(); | |
45 | + } | |
46 | + } | |
47 | + return map; | |
48 | + } | |
49 | + | |
50 | + public List<Map<String,Object>> getPatientInfoList(String cardNo){ | |
51 | + List<Map<String,Object>> result = new ArrayList<>(); | |
52 | + if (StringUtils.isNotBlank(cardNo)) { | |
53 | + Connection conn = ConnTools.makeHisConnection(); | |
54 | + QueryRunner queryRunner = new QueryRunner(); | |
55 | + try { | |
56 | + List<XinlePregPatientinfo> list = queryRunner.query(conn, "select * from v_patientinfo where IC_CARD_ID = '"+cardNo+"'", new BeanListHandler<XinlePregPatientinfo>(XinlePregPatientinfo.class)); | |
57 | + if (list.size() > 0) { | |
58 | + for (XinlePregPatientinfo info:list) { | |
59 | + Map<String,Object> map = new HashMap<>(); | |
60 | + map.put("sickType", info.getSICKTYPE()); | |
61 | + map.put("sickId", info.getSICK_ID()); | |
62 | + map.put("sex", info.getSEX()); | |
63 | + map.put("name", info.getNAME()); | |
64 | + map.put("cardNo", info.getIC_CARD_ID()); | |
65 | + map.put("phone", info.getASSOCIATION_PHONE()); | |
66 | + map.put("birth", DateUtil.getyyyy_MM_dd(info.getBIRTHDATE())); | |
67 | + result.add(map); | |
68 | + } | |
69 | + } | |
70 | + DbUtils.closeQuietly(conn); | |
71 | + } catch (SQLException e) { | |
72 | + DbUtils.closeQuietly(conn); | |
73 | + e.printStackTrace(); | |
74 | + } | |
75 | + } | |
76 | + return result; | |
77 | + } | |
78 | + | |
10 | 79 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
2adff03
1 | 1 | package com.lyms.platform.operate.web.facade; |
2 | 2 | |
3 | +import com.lyms.hospitalapi.qinglongxian.QingLongXianHisService; | |
3 | 4 | import com.lyms.hospitalapi.v2.HisService; |
4 | 5 | import com.lyms.platform.biz.dal.IPersonDao; |
5 | 6 | import com.lyms.platform.biz.service.*; |
... | ... | @@ -82,6 +83,9 @@ |
82 | 83 | @Autowired |
83 | 84 | private HisService hisServiceV2; |
84 | 85 | |
86 | + @Autowired | |
87 | + private QingLongXianHisService qingLongXianHisService; | |
88 | + | |
85 | 89 | /** |
86 | 90 | * 添加孕妇建档 |
87 | 91 | * @param yunRequest |
... | ... | @@ -521,6 +525,8 @@ |
521 | 525 | else { |
522 | 526 | if ("2".equals(HIS_VERSION)) { |
523 | 527 | typeMap.put("hisPatient", hisServiceV2.getPatientInfoList(bookbuildingQueryRequest.getVcCardNo())); |
528 | + } else if ("3".equals(HIS_VERSION)) { | |
529 | + typeMap.put("hisPatient", qingLongXianHisService.getPatientInfoList(bookbuildingQueryRequest.getVcCardNo())); | |
524 | 530 | } |
525 | 531 | } |
526 | 532 | } |
pom.xml
View file @
2adff03
... | ... | @@ -524,11 +524,11 @@ |
524 | 524 | <artifactId>commons-dbutils</artifactId> |
525 | 525 | <version>1.6</version> |
526 | 526 | </dependency> |
527 | - <!--<dependency>--> | |
528 | - <!--<groupId>com.microsoft.sqlserver</groupId>--> | |
529 | - <!--<artifactId>sqljdbc4</artifactId>--> | |
530 | - <!--<version>4.0</version>--> | |
531 | - <!--</dependency>--> | |
527 | + <dependency> | |
528 | + <groupId>com.microsoft.sqlserver</groupId> | |
529 | + <artifactId>sqljdbc4</artifactId> | |
530 | + <version>4.0</version> | |
531 | + </dependency> | |
532 | 532 | |
533 | 533 | </dependencies> |
534 | 534 | </project> |