Commit c1296f37b46d79a6f25b761aa0590fd46c291d7f
1 parent
7b3535cd25
Exists in
master
and in
6 other branches
测量
Showing 5 changed files with 237 additions and 36 deletions
- platform-biz-service/src/main/resources/mainOrm/master/MasterLis.xml
- platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/ConnTools.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/MeasurePatientInfo.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java
platform-biz-service/src/main/resources/mainOrm/master/MasterLis.xml
View file @
c1296f3
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/ConnTools.java
View file @
c1296f3
... | ... | @@ -35,6 +35,12 @@ |
35 | 35 | private static String fmUser = "LYMS"; |
36 | 36 | private static String fmPassword = "LYMS"; |
37 | 37 | |
38 | + | |
39 | + private static String clDirverClassName = "oracle.jdbc.driver.OracleDriver"; | |
40 | + private static String clUrl = "jdbc:oracle:thin:@168.254.0.80:1521:jhemr"; | |
41 | + private static String clUser = "lyms"; | |
42 | + private static String clPassword = "lyms"; | |
43 | + | |
38 | 44 | public static Connection makeHisConnection() { |
39 | 45 | Connection conn = null; |
40 | 46 | try { |
... | ... | @@ -95,6 +101,22 @@ |
95 | 101 | return conn; |
96 | 102 | } |
97 | 103 | |
104 | + | |
105 | + | |
106 | + public static Connection makeClConnection() { | |
107 | + Connection conn = null; | |
108 | + try { | |
109 | + Class.forName(clDirverClassName); | |
110 | + } catch (ClassNotFoundException e) { | |
111 | + e.printStackTrace(); | |
112 | + } | |
113 | + try { | |
114 | + conn = DriverManager.getConnection(clUrl, clUser, clPassword); | |
115 | + } catch (SQLException e) { | |
116 | + e.printStackTrace(); | |
117 | + } | |
118 | + return conn; | |
119 | + } | |
98 | 120 | |
99 | 121 | } |
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/MeasurePatientInfo.java
View file @
c1296f3
1 | +package com.lyms.hospitalapi.qhdfy; | |
2 | + | |
3 | +/** | |
4 | + * Created by Administrator on 2018-01-22. | |
5 | + */ | |
6 | +public class MeasurePatientInfo { | |
7 | + private String patientId; | |
8 | + private String userName; | |
9 | + private String certType; | |
10 | + private String certNo; | |
11 | + private String sex; | |
12 | + private String age; | |
13 | + private String vcCardNo; | |
14 | + private String phone; | |
15 | + private String zyNo; | |
16 | + private String visitId; | |
17 | + | |
18 | + public String getPatientId() { | |
19 | + return patientId; | |
20 | + } | |
21 | + | |
22 | + public void setPatientId(String patientId) { | |
23 | + this.patientId = patientId; | |
24 | + } | |
25 | + | |
26 | + public String getUserName() { | |
27 | + return userName; | |
28 | + } | |
29 | + | |
30 | + public void setUserName(String userName) { | |
31 | + this.userName = userName; | |
32 | + } | |
33 | + | |
34 | + public String getCertType() { | |
35 | + return certType; | |
36 | + } | |
37 | + | |
38 | + public void setCertType(String certType) { | |
39 | + this.certType = certType; | |
40 | + } | |
41 | + | |
42 | + public String getCertNo() { | |
43 | + return certNo; | |
44 | + } | |
45 | + | |
46 | + public void setCertNo(String certNo) { | |
47 | + this.certNo = certNo; | |
48 | + } | |
49 | + | |
50 | + public String getSex() { | |
51 | + return sex; | |
52 | + } | |
53 | + | |
54 | + public void setSex(String sex) { | |
55 | + this.sex = sex; | |
56 | + } | |
57 | + | |
58 | + public String getAge() { | |
59 | + return age; | |
60 | + } | |
61 | + | |
62 | + public void setAge(String age) { | |
63 | + this.age = age; | |
64 | + } | |
65 | + | |
66 | + public String getVcCardNo() { | |
67 | + return vcCardNo; | |
68 | + } | |
69 | + | |
70 | + public void setVcCardNo(String vcCardNo) { | |
71 | + this.vcCardNo = vcCardNo; | |
72 | + } | |
73 | + | |
74 | + public String getPhone() { | |
75 | + return phone; | |
76 | + } | |
77 | + | |
78 | + public void setPhone(String phone) { | |
79 | + this.phone = phone; | |
80 | + } | |
81 | + | |
82 | + public String getZyNo() { | |
83 | + return zyNo; | |
84 | + } | |
85 | + | |
86 | + public void setZyNo(String zyNo) { | |
87 | + this.zyNo = zyNo; | |
88 | + } | |
89 | + | |
90 | + public String getVisitId() { | |
91 | + return visitId; | |
92 | + } | |
93 | + | |
94 | + public void setVisitId(String visitId) { | |
95 | + this.visitId = visitId; | |
96 | + } | |
97 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
c1296f3
... | ... | @@ -730,27 +730,28 @@ |
730 | 730 | } |
731 | 731 | |
732 | 732 | |
733 | - final String bId = model.getId(); | |
733 | + String bId = model.getId(); | |
734 | 734 | if (model == null || bId == null) { |
735 | 735 | br.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); |
736 | 736 | br.setErrormsg("保存失败"); |
737 | 737 | return br; |
738 | 738 | } |
739 | - //创建建档短信、推送/业务推广 | |
740 | - new Thread(new Runnable() { | |
741 | - @Override | |
742 | - public void run() { | |
743 | - BabyModelQuery babyQuery = new BabyModelQuery(); | |
744 | - babyQuery.setYn(YnEnums.YES.getId()); | |
745 | - babyQuery.setId(bId); | |
746 | - List<BabyModel> list = babyBookbuildingService.queryBabyBuildByCond(babyQuery); | |
747 | - if (CollectionUtils.isNotEmpty(list)) | |
748 | - { | |
749 | - createBuildMsg(list.get(0)); | |
750 | -// createExtensionMsg(list.get(0)); | |
751 | - } | |
752 | - } | |
753 | - },"babyBuildMsgThead").start(); | |
739 | + //创建建档短信 | |
740 | + createBuildMsg(model); | |
741 | +// new Thread(new Runnable() { | |
742 | +// @Override | |
743 | +// public void run() { | |
744 | +// BabyModelQuery babyQuery = new BabyModelQuery(); | |
745 | +// babyQuery.setYn(YnEnums.YES.getId()); | |
746 | +// babyQuery.setId(bId); | |
747 | +// List<BabyModel> list = babyBookbuildingService.queryBabyBuildByCond(babyQuery); | |
748 | +// if (CollectionUtils.isNotEmpty(list)) | |
749 | +// { | |
750 | +// createBuildMsg(list.get(0)); | |
751 | +//// createExtensionMsg(list.get(0)); | |
752 | +// } | |
753 | +// } | |
754 | +// },"babyBuildMsgThead").start(); | |
754 | 755 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |
755 | 756 | br.setErrormsg("成功"); |
756 | 757 | br.setData(bId); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java
View file @
c1296f3
1 | 1 | package com.lyms.platform.operate.web.facade; |
2 | 2 | |
3 | +import com.lyms.hospitalapi.pojo.PregPatientinfo; | |
4 | +import com.lyms.hospitalapi.qhdfy.MeasurePatientInfo; | |
3 | 5 | import com.lyms.platform.biz.service.BasicConfigService; |
4 | 6 | import com.lyms.platform.biz.service.DataPermissionService; |
5 | 7 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
... | ... | @@ -8,6 +10,7 @@ |
8 | 10 | import com.lyms.platform.common.result.BaseListResponse; |
9 | 11 | import com.lyms.platform.common.result.BaseResponse; |
10 | 12 | import com.lyms.platform.common.utils.DateUtil; |
13 | +import com.lyms.platform.common.utils.ExceptionUtils; | |
11 | 14 | import com.lyms.platform.operate.web.request.MeasureInfoRequest; |
12 | 15 | import com.lyms.platform.operate.web.result.MeasureInfoResult; |
13 | 16 | import com.lyms.platform.permission.model.Organization; |
14 | 17 | |
... | ... | @@ -18,10 +21,14 @@ |
18 | 21 | import com.lyms.platform.query.DataPermissionsModelQuery; |
19 | 22 | import com.lyms.platform.query.MeasureInfoQuery; |
20 | 23 | import org.apache.commons.collections.CollectionUtils; |
24 | +import org.apache.commons.dbutils.DbUtils; | |
25 | +import org.apache.commons.dbutils.QueryRunner; | |
26 | +import org.apache.commons.dbutils.handlers.BeanListHandler; | |
21 | 27 | import org.apache.commons.lang.StringUtils; |
22 | 28 | import org.springframework.beans.factory.annotation.Autowired; |
23 | 29 | import org.springframework.stereotype.Component; |
24 | 30 | |
31 | +import java.sql.Connection; | |
25 | 32 | import java.util.*; |
26 | 33 | |
27 | 34 | /** |
... | ... | @@ -171,7 +178,12 @@ |
171 | 178 | model.setRecordTime(new Date()); |
172 | 179 | model.setModified(new Date()); |
173 | 180 | model.setId(measureInfoModel.getId()); |
174 | - model.setRecordCount(measureInfoModel.getRecordCount()+1); | |
181 | + model.setRecordCount(measureInfoModel.getRecordCount() + 1); | |
182 | + if ("216".equals(model.getHospitalId())) | |
183 | + { | |
184 | + //把住院号转换成病人id | |
185 | + model.setZyNo(getPatientIdByZyNo(model.getZyNo(), model.getVisitId())); | |
186 | + } | |
175 | 187 | mysqlMeasureInfoService.updateMeasureInfo(model); |
176 | 188 | } |
177 | 189 | else |
... | ... | @@ -180,6 +192,11 @@ |
180 | 192 | model.setCreated(new Date()); |
181 | 193 | model.setModified(new Date()); |
182 | 194 | model.setTodayCount(todayCount); |
195 | + if ("216".equals(model.getHospitalId())) | |
196 | + { | |
197 | + //把住院号转换成病人id | |
198 | + model.setZyNo(getPatientIdByZyNo(model.getZyNo(), model.getVisitId())); | |
199 | + } | |
183 | 200 | mysqlMeasureInfoService.addMeasureInfo(model); |
184 | 201 | } |
185 | 202 | } |
... | ... | @@ -208,6 +225,28 @@ |
208 | 225 | return map; |
209 | 226 | } |
210 | 227 | |
228 | + public String getPatientIdByZyNo(String zyNo,String zyCs) | |
229 | + { | |
230 | + Connection conn = com.lyms.hospitalapi.qhdfy.ConnTools.makeClConnection(); | |
231 | + try { | |
232 | + QueryRunner queryRunner = new QueryRunner(); | |
233 | + List<MeasurePatientInfo> list = queryRunner.query(conn, " select ZJH as certNo,XM as userName,NL as age,XB as sex,SJH as phone,INP_NO as zyNo,visit_id as visitId,PATIENT_ID as patientId from lyms where INP_NO='"+zyNo | |
234 | + +"' and visit_id='"+zyCs+"' order by visit_id desc", new BeanListHandler<MeasurePatientInfo>(MeasurePatientInfo.class)); | |
235 | + if (CollectionUtils.isNotEmpty(list)) | |
236 | + { | |
237 | + MeasurePatientInfo model = list.get(0); | |
238 | + return model.getPatientId(); | |
239 | + } | |
240 | + }catch (Exception e) | |
241 | + { | |
242 | + ExceptionUtils.catchException(e,"查询基本信息出错"); | |
243 | + }finally { | |
244 | + DbUtils.closeQuietly(conn); | |
245 | + } | |
246 | + return ""; | |
247 | + } | |
248 | + | |
249 | + | |
211 | 250 | public BaseResponse updateMeasureInfo(MeasureInfoRequest measureInfoRequest) { |
212 | 251 | MeasureInfoModel model = getModel(measureInfoRequest); |
213 | 252 | MeasureInfoQuery query = new MeasureInfoQuery(); |
214 | 253 | |
... | ... | @@ -260,25 +299,66 @@ |
260 | 299 | |
261 | 300 | public Map queryClBaseInfo(String certType, String certNo,String hospitalId) { |
262 | 301 | Map<String,String> map = new HashMap<>(); |
263 | - MeasureInfoQuery query = new MeasureInfoQuery(); | |
264 | - query.setHospitalId(hospitalId); | |
265 | - query.setCertType(certType); | |
266 | - query.setCertNo(certNo); | |
267 | - query.setSort(" record_time desc "); | |
268 | - query.setNeed("true"); | |
269 | - List<MeasureInfoModel> list = mysqlMeasureInfoService.queryMeasureInfoList(query); | |
270 | - if (CollectionUtils.isNotEmpty(list)) | |
302 | + System.out.println("certType=" + certType + ";certNo=" + certNo + ";hospitalId="+hospitalId); | |
303 | + if ("216".equals(hospitalId)) | |
271 | 304 | { |
272 | - MeasureInfoModel model = list.get(0); | |
273 | - map.put("userName",model.getUserName() == null ? "" : model.getUserName()); | |
274 | - map.put("certType",model.getCertType() == null ? "" : model.getCertType()); | |
275 | - map.put("certNo",model.getCertNo() == null ? "" : model.getCertNo()); | |
276 | - map.put("sex",String.valueOf(model.getSex())); | |
277 | - map.put("age",model.getAge() == null ? "" : String.valueOf(model.getAge())); | |
278 | - map.put("vcCardNo",model.getVcCardNo() == null ? "" : model.getVcCardNo()); | |
279 | - map.put("phone",model.getPhone() == null ? "" : model.getPhone()); | |
280 | - map.put("zyNo",model.getZyNo() == null ? "" : model.getZyNo()); | |
281 | - map.put("visitId",model.getVisitId() == null ? "" : model.getVisitId()); | |
305 | + Connection conn = com.lyms.hospitalapi.qhdfy.ConnTools.makeClConnection(); | |
306 | + try { | |
307 | + QueryRunner queryRunner = new QueryRunner(); | |
308 | + List<MeasurePatientInfo> list = queryRunner.query(conn, "select ZJH as certNo,XM as userName,NL as age,XB as sex,SJH as phone,INP_NO as zyNo,visit_id as visitId from lyms where ZJH='"+certNo+"' order by visit_id desc ", new BeanListHandler<MeasurePatientInfo>(MeasurePatientInfo.class)); | |
309 | + if (CollectionUtils.isNotEmpty(list)) | |
310 | + { | |
311 | + MeasurePatientInfo model = list.get(0); | |
312 | + map.put("userName",model.getUserName() == null ? "" : model.getUserName()); | |
313 | + map.put("certType",certType); | |
314 | + map.put("certNo",model.getCertNo() == null ? "" : model.getCertNo()); | |
315 | + map.put("sex","女".equals(model.getSex().trim()) ? "0" : "1"); | |
316 | + String age = ""; | |
317 | + if (StringUtils.isNotEmpty(model.getAge())) | |
318 | + { | |
319 | + try { | |
320 | + age = model.getAge().substring(0,model.getAge().length() - 1); | |
321 | + Integer.valueOf(age); | |
322 | + }catch (Exception e) | |
323 | + { | |
324 | + System.out.print(model.getAge()+":年龄解析错误"+e.toString()); | |
325 | + } | |
326 | + } | |
327 | + map.put("age",age); | |
328 | + map.put("vcCardNo",model.getVcCardNo() == null ? "" : model.getVcCardNo()); | |
329 | + map.put("phone",model.getPhone() == null ? "" : model.getPhone()); | |
330 | + map.put("zyNo",model.getZyNo() == null ? "" : model.getZyNo()); | |
331 | + map.put("visitId",model.getVisitId() == null ? "" : model.getVisitId()); | |
332 | + } | |
333 | + }catch (Exception e) | |
334 | + { | |
335 | + ExceptionUtils.catchException(e,"查询基本信息出错"); | |
336 | + }finally { | |
337 | + DbUtils.closeQuietly(conn); | |
338 | + } | |
339 | + } | |
340 | + else | |
341 | + { | |
342 | + MeasureInfoQuery query = new MeasureInfoQuery(); | |
343 | + query.setHospitalId(hospitalId); | |
344 | + query.setCertType(certType); | |
345 | + query.setCertNo(certNo); | |
346 | + query.setSort(" record_time desc "); | |
347 | + query.setNeed("true"); | |
348 | + List<MeasureInfoModel> list = mysqlMeasureInfoService.queryMeasureInfoList(query); | |
349 | + if (CollectionUtils.isNotEmpty(list)) | |
350 | + { | |
351 | + MeasureInfoModel model = list.get(0); | |
352 | + map.put("userName",model.getUserName() == null ? "" : model.getUserName()); | |
353 | + map.put("certType",model.getCertType() == null ? "" : model.getCertType()); | |
354 | + map.put("certNo",model.getCertNo() == null ? "" : model.getCertNo()); | |
355 | + map.put("sex",String.valueOf(model.getSex())); | |
356 | + map.put("age",model.getAge() == null ? "" : String.valueOf(model.getAge())); | |
357 | + map.put("vcCardNo",model.getVcCardNo() == null ? "" : model.getVcCardNo()); | |
358 | + map.put("phone",model.getPhone() == null ? "" : model.getPhone()); | |
359 | + map.put("zyNo",model.getZyNo() == null ? "" : model.getZyNo()); | |
360 | + map.put("visitId",model.getVisitId() == null ? "" : model.getVisitId()); | |
361 | + } | |
282 | 362 | } |
283 | 363 | return map; |
284 | 364 | } |