Commit 9f86387b4405c4f877de7b5fceee1fa1149b5eae
1 parent
07ea90dfdb
Exists in
master
and in
8 other branches
add risk enum color
Showing 4 changed files with 108 additions and 10 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/v1/ConnTools.java
View file @
9f86387
... | ... | @@ -8,24 +8,66 @@ |
8 | 8 | * Created by Administrator on 2016/9/9 0009. |
9 | 9 | */ |
10 | 10 | public class ConnTools { |
11 | - private static String dirverClassName = "com.mysql.jdbc.Driver"; | |
12 | - private static String url = "jdbc:mysql://192.168.104.101:3306/testdb?useUnicode=true&characterEncoding=utf8"; | |
13 | - private static String user = "root"; | |
14 | - private static String password = "leizhimin"; | |
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"; | |
15 | 15 | |
16 | - public static Connection makeConnection() { | |
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 | + private static String lisDirverClassName = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; | |
22 | + private static String lisUrl = "jdbc:sqlserver://172.0.1.20:1433; DatabaseName=rmlis6"; | |
23 | + private static String lisUser = "sa"; | |
24 | + private static String lisPassword = "skhis168"; | |
25 | + | |
26 | + public static Connection makeHisConnection() { | |
17 | 27 | Connection conn = null; |
18 | 28 | try { |
19 | - Class.forName(dirverClassName); | |
29 | + Class.forName(hisDirverClassName); | |
20 | 30 | } catch (ClassNotFoundException e) { |
21 | 31 | e.printStackTrace(); |
22 | 32 | } |
23 | 33 | try { |
24 | - conn = DriverManager.getConnection(url, user, password); | |
34 | + conn = DriverManager.getConnection(hisUrl, hisUser, hisPassword); | |
25 | 35 | } catch (SQLException e) { |
26 | 36 | e.printStackTrace(); |
27 | 37 | } |
28 | 38 | return conn; |
29 | 39 | } |
40 | + | |
41 | + public static Connection makePacsConnection() { | |
42 | + Connection conn = null; | |
43 | + try { | |
44 | + Class.forName(pacsDirverClassName); | |
45 | + } catch (ClassNotFoundException e) { | |
46 | + e.printStackTrace(); | |
47 | + } | |
48 | + try { | |
49 | + conn = DriverManager.getConnection(pacsUrl, pacsUser, pacsPassword); | |
50 | + } catch (SQLException e) { | |
51 | + e.printStackTrace(); | |
52 | + } | |
53 | + return conn; | |
54 | + } | |
55 | + | |
56 | + public static Connection makeLisConnection() { | |
57 | + Connection conn = null; | |
58 | + try { | |
59 | + Class.forName(lisDirverClassName); | |
60 | + } catch (ClassNotFoundException e) { | |
61 | + e.printStackTrace(); | |
62 | + } | |
63 | + try { | |
64 | + conn = DriverManager.getConnection(lisUrl, lisUser, lisPassword); | |
65 | + } catch (SQLException e) { | |
66 | + e.printStackTrace(); | |
67 | + } | |
68 | + return conn; | |
69 | + } | |
70 | + | |
71 | + | |
30 | 72 | } |
platform-operate-api/src/main/java/com/lyms/hospitalapi/v1/HisService.java
View file @
9f86387
1 | +package com.lyms.hospitalapi.v1; | |
2 | + | |
3 | +import com.lyms.hospitalapi.pojo.LisCheckInfo; | |
4 | +import com.lyms.hospitalapi.pojo.LisCheckResult; | |
5 | +import com.lyms.hospitalapi.v2.*; | |
6 | +import com.lyms.platform.common.utils.DateUtil; | |
7 | +import org.apache.commons.dbutils.DbUtils; | |
8 | +import org.apache.commons.dbutils.QueryRunner; | |
9 | +import org.apache.commons.dbutils.handlers.BeanListHandler; | |
10 | +import org.apache.commons.lang.StringUtils; | |
11 | +import org.springframework.stereotype.Service; | |
12 | + | |
13 | +import java.sql.Connection; | |
14 | +import java.sql.SQLException; | |
15 | +import java.util.List; | |
16 | + | |
17 | +/** | |
18 | + * Created by Administrator on 2016/9/9 0009. | |
19 | + */ | |
20 | +@Service("hisServiceV1") | |
21 | +public class HisService { | |
22 | + | |
23 | + public void queryLisCheckList(String cardNo) { | |
24 | + if (StringUtils.isNotBlank(cardNo)) { | |
25 | + Connection conn = com.lyms.hospitalapi.v2.ConnTools.makeHisConnection(); | |
26 | + QueryRunner queryRunner = new QueryRunner(); | |
27 | + try { | |
28 | + List<LisCheckInfo> list = queryRunner.query(conn, "select * from lis_check_info where P_CARD = '"+cardNo+"'", new BeanListHandler<LisCheckInfo>(LisCheckInfo.class)); | |
29 | + if (list.size() > 0) { | |
30 | + for (LisCheckInfo info:list) { | |
31 | + if (StringUtils.isNotBlank(info.getP_APPLICATIONNUM())) { | |
32 | + List<LisCheckResult> resultList = queryRunner.query(conn, "select * from lis_check_result where P_APPLICATIONNUM = '"+info.getP_APPLICATIONNUM()+"'", new BeanListHandler<LisCheckResult>(LisCheckResult.class)); | |
33 | + if (resultList != null && resultList.size() > 0) { | |
34 | + | |
35 | + } | |
36 | + } | |
37 | + } | |
38 | + } | |
39 | + DbUtils.closeQuietly(conn); | |
40 | + } catch (SQLException e) { | |
41 | + DbUtils.closeQuietly(conn); | |
42 | + e.printStackTrace(); | |
43 | + } | |
44 | + } | |
45 | + } | |
46 | + | |
47 | +} |
platform-operate-api/src/main/java/com/lyms/hospitalapi/v2/ConnTools.java
View file @
9f86387
... | ... | @@ -8,7 +8,7 @@ |
8 | 8 | * Created by Administrator on 2016/9/9 0009. |
9 | 9 | */ |
10 | 10 | public class ConnTools { |
11 | - private static String hisDirverClassName = "com.mysql.jdbc.Driver"; | |
11 | + private static String hisDirverClassName = "oracle.jdbc.driver.OracleDriver"; | |
12 | 12 | private static String hisUrl = "jdbc:oracle:thin:@192.190.10.11:1521:xlsyy"; |
13 | 13 | private static String hisUser = "mmbb"; |
14 | 14 | private static String hisPassword = "mmbb"; |
platform-operate-api/src/main/java/com/lyms/hospitalapi/v2/HisService.java
View file @
9f86387
1 | 1 | package com.lyms.hospitalapi.v2; |
2 | 2 | |
3 | 3 | import com.lyms.platform.common.utils.DateUtil; |
4 | +import org.apache.commons.dbutils.DbUtils; | |
4 | 5 | import org.apache.commons.dbutils.QueryRunner; |
5 | 6 | import org.apache.commons.dbutils.handlers.BeanListHandler; |
6 | 7 | import org.apache.commons.lang.StringUtils; |
7 | 8 | import org.springframework.stereotype.Service; |
8 | 9 | |
10 | +import java.sql.Connection; | |
9 | 11 | import java.sql.SQLException; |
10 | 12 | import java.util.ArrayList; |
11 | 13 | import java.util.HashMap; |
12 | 14 | |
... | ... | @@ -21,9 +23,10 @@ |
21 | 23 | public Map<String,Object> getPatientInfo(String cardNo){ |
22 | 24 | Map<String,Object> map = new HashMap<>(); |
23 | 25 | if (StringUtils.isNotBlank(cardNo)) { |
26 | + Connection conn = ConnTools.makeHisConnection(); | |
24 | 27 | QueryRunner queryRunner = new QueryRunner(); |
25 | 28 | try { |
26 | - List<XinlePregPatientinfo> list = queryRunner.query(ConnTools.makeHisConnection(), "select * from v_preg_patientinfo where IC_CARD_ID = '"+cardNo+"'", new BeanListHandler<XinlePregPatientinfo>(XinlePregPatientinfo.class)); | |
29 | + List<XinlePregPatientinfo> list = queryRunner.query(conn, "select * from v_preg_patientinfo where IC_CARD_ID = '"+cardNo+"'", new BeanListHandler<XinlePregPatientinfo>(XinlePregPatientinfo.class)); | |
27 | 30 | if (list.size() > 0) { |
28 | 31 | XinlePregPatientinfo info = list.get(0); |
29 | 32 | map.put("sickType", info.getSICKTYPE()); |
30 | 33 | |
... | ... | @@ -33,7 +36,9 @@ |
33 | 36 | map.put("cardNo", info.getIC_CARD_ID()); |
34 | 37 | map.put("birth", DateUtil.getyyyy_MM_dd(info.getBIRTHDATE())); |
35 | 38 | } |
39 | + DbUtils.closeQuietly(conn); | |
36 | 40 | } catch (SQLException e) { |
41 | + DbUtils.closeQuietly(conn); | |
37 | 42 | e.printStackTrace(); |
38 | 43 | } |
39 | 44 | } |
40 | 45 | |
... | ... | @@ -43,9 +48,10 @@ |
43 | 48 | public List<Map<String,Object>> getPatientInfoList(String cardNo){ |
44 | 49 | List<Map<String,Object>> result = new ArrayList<>(); |
45 | 50 | if (StringUtils.isNotBlank(cardNo)) { |
51 | + Connection conn = ConnTools.makeHisConnection(); | |
46 | 52 | QueryRunner queryRunner = new QueryRunner(); |
47 | 53 | try { |
48 | - List<XinlePregPatientinfo> list = queryRunner.query(ConnTools.makeHisConnection(), "select * from v_preg_patientinfo where IC_CARD_ID = '"+cardNo+"'", new BeanListHandler<XinlePregPatientinfo>(XinlePregPatientinfo.class)); | |
54 | + List<XinlePregPatientinfo> list = queryRunner.query(conn, "select * from v_preg_patientinfo where IC_CARD_ID = '"+cardNo+"'", new BeanListHandler<XinlePregPatientinfo>(XinlePregPatientinfo.class)); | |
49 | 55 | if (list.size() > 0) { |
50 | 56 | for (XinlePregPatientinfo info:list) { |
51 | 57 | Map<String,Object> map = new HashMap<>(); |
52 | 58 | |
53 | 59 | |
... | ... | @@ -54,11 +60,14 @@ |
54 | 60 | map.put("sex", info.getSEX()); |
55 | 61 | map.put("name", info.getNAME()); |
56 | 62 | map.put("cardNo", info.getIC_CARD_ID()); |
63 | + map.put("phone", info.getASSOCIATION_PHONE()); | |
57 | 64 | map.put("birth", DateUtil.getyyyy_MM_dd(info.getBIRTHDATE())); |
58 | 65 | result.add(map); |
59 | 66 | } |
60 | 67 | } |
68 | + DbUtils.closeQuietly(conn); | |
61 | 69 | } catch (SQLException e) { |
70 | + DbUtils.closeQuietly(conn); | |
62 | 71 | e.printStackTrace(); |
63 | 72 | } |
64 | 73 | } |