Commit a6c824a53fb9146db7881c182566ac58ea73b443
1 parent
d5890fc611
Exists in
master
and in
6 other branches
update
Showing 7 changed files with 165 additions and 8 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
- platform-dal/src/main/java/com/lyms/platform/pojo/BoneConfigModel.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/lcfy/LisService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BoneFacade.java
- platform-transfer/src/main/java/com/lyms/platform/worker/BoneWorker.java
- platform-transfer/src/main/java/com/lyms/platform/worker/MicroelementWorker.java
- platform-transfer/src/main/resources/application.yml
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
View file @
a6c824a
... | ... | @@ -6560,6 +6560,60 @@ |
6560 | 6560 | } |
6561 | 6561 | } |
6562 | 6562 | |
6563 | + | |
6564 | + public static void saveBabyBone(String fileName) { | |
6565 | + ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/spring/applicationContext_biz_patient1.xml"); | |
6566 | + MongoTemplate mongoTemplate | |
6567 | + = (MongoTemplate) applicationContext.getBean("mongoTemplate"); | |
6568 | + mongoTemplate.getDb().authenticate("platform", "platform123".toCharArray()); | |
6569 | + File file = new File(fileName); | |
6570 | + Workbook wb = null; | |
6571 | + try { | |
6572 | + wb = Workbook.getWorkbook(file); | |
6573 | + | |
6574 | + Sheet s = wb.getSheet(0); | |
6575 | + System.out.println(s.getName() + " : "); | |
6576 | + int rows = s.getRows(); | |
6577 | + if (rows > 0) { | |
6578 | + //遍历每行 | |
6579 | + for (int i = 1; i < rows; i++) { | |
6580 | + System.out.println("rows=" + i); | |
6581 | + BoneConfigModel model = new BoneConfigModel(); | |
6582 | + model.setType(1); | |
6583 | + Cell[] cells = s.getRow(i); | |
6584 | + if (cells.length > 0) { | |
6585 | + for (int j = 0; j < cells.length; j++) { | |
6586 | + String str = cells[j].getContents().trim(); | |
6587 | + switch (j) { | |
6588 | + case 0: | |
6589 | + String[] arrs = str.split("-"); | |
6590 | + model.setStart(Integer.parseInt(arrs[0])); | |
6591 | + model.setEnd(Integer.parseInt(arrs[1])); | |
6592 | + continue; | |
6593 | + case 1: | |
6594 | + List<String> list2 = Arrays.asList(str.split("\n")); | |
6595 | + model.setNormals(list2); | |
6596 | + continue; | |
6597 | + case 2: | |
6598 | + List<String> list3 = Arrays.asList(str.split("\n")); | |
6599 | + model.setReduces(list3); | |
6600 | + continue; | |
6601 | + case 3: | |
6602 | + List<String> list4 = Arrays.asList(str.split("\n")); | |
6603 | + model.setSerious(list4); | |
6604 | + continue; | |
6605 | + | |
6606 | + } | |
6607 | + } | |
6608 | + } | |
6609 | + mongoTemplate.save(model); | |
6610 | + } | |
6611 | + } | |
6612 | + } catch (Exception e) { | |
6613 | + e.printStackTrace(); | |
6614 | + } | |
6615 | + } | |
6616 | + | |
6563 | 6617 | public static void main(String[] args) { |
6564 | 6618 | // getData(); |
6565 | 6619 | //weightWeek("F:\\体重与营养管理\\体重与营养管理第三版(北方)改标红“、冰淇淋”-晓萌.xls"); |
... | ... | @@ -6607,7 +6661,8 @@ |
6607 | 6661 | //saveDiteSuggest("F:\\儿童营养报告\\秦皇岛儿童膳食营养报告\\每类食物不爱吃的指导建议.xls"); |
6608 | 6662 | //saveDiteDoctorSuggest("F:\\儿童营养报告\\秦皇岛儿童膳食营养报告\\医生建议内容.xls"); |
6609 | 6663 | //saveMicroelements("E:\\dev\\微量元素指导报告模板.xls"); |
6610 | - saveBabyMicroelements("F:\\技术文档\\儿童微量元素\\儿童微量元素指导报告模板.xls"); | |
6664 | + //saveBabyMicroelements("F:\\技术文档\\儿童微量元素\\儿童微量元素指导报告模板.xls"); | |
6665 | + saveBabyBone("F:\\技术文档\\骨密度\\儿童骨密度报告模板内容表.xls"); | |
6611 | 6666 | |
6612 | 6667 | } |
6613 | 6668 |
platform-dal/src/main/java/com/lyms/platform/pojo/BoneConfigModel.java
View file @
a6c824a
1 | +package com.lyms.platform.pojo; | |
2 | + | |
3 | +import com.lyms.platform.common.result.BaseModel; | |
4 | +import org.springframework.data.mongodb.core.mapping.Document; | |
5 | + | |
6 | +import java.util.List; | |
7 | + | |
8 | +/** | |
9 | + * 骨密度 | |
10 | + * | |
11 | + */ | |
12 | +@Document(collection = "lyms_bone_config") | |
13 | +public class BoneConfigModel extends BaseModel { | |
14 | + | |
15 | + | |
16 | + private String id; | |
17 | + | |
18 | + private Integer start; | |
19 | + private Integer end; | |
20 | + //正常 | |
21 | + private List<String> normals; | |
22 | + //减少 | |
23 | + private List<String> reduces; | |
24 | + //严重 | |
25 | + private List<String> serious; | |
26 | + | |
27 | + | |
28 | + //0 孕前 1 儿童 | |
29 | + private Integer type; | |
30 | + | |
31 | + | |
32 | + public String getId() { | |
33 | + return id; | |
34 | + } | |
35 | + | |
36 | + public void setId(String id) { | |
37 | + this.id = id; | |
38 | + } | |
39 | + | |
40 | + public Integer getStart() { | |
41 | + return start; | |
42 | + } | |
43 | + | |
44 | + public void setStart(Integer start) { | |
45 | + this.start = start; | |
46 | + } | |
47 | + | |
48 | + public Integer getEnd() { | |
49 | + return end; | |
50 | + } | |
51 | + | |
52 | + public void setEnd(Integer end) { | |
53 | + this.end = end; | |
54 | + } | |
55 | + | |
56 | + public List<String> getNormals() { | |
57 | + return normals; | |
58 | + } | |
59 | + | |
60 | + public void setNormals(List<String> normals) { | |
61 | + this.normals = normals; | |
62 | + } | |
63 | + | |
64 | + public List<String> getReduces() { | |
65 | + return reduces; | |
66 | + } | |
67 | + | |
68 | + public void setReduces(List<String> reduces) { | |
69 | + this.reduces = reduces; | |
70 | + } | |
71 | + | |
72 | + public List<String> getSerious() { | |
73 | + return serious; | |
74 | + } | |
75 | + | |
76 | + public void setSerious(List<String> serious) { | |
77 | + this.serious = serious; | |
78 | + } | |
79 | + | |
80 | + public Integer getType() { | |
81 | + return type; | |
82 | + } | |
83 | + | |
84 | + public void setType(Integer type) { | |
85 | + this.type = type; | |
86 | + } | |
87 | +} |
platform-operate-api/src/main/java/com/lyms/hospitalapi/lcfy/LisService.java
View file @
a6c824a
... | ... | @@ -57,7 +57,7 @@ |
57 | 57 | itemsMan.put("lyms011","肾功能检测(肌酐)"); |
58 | 58 | itemsMan.put("lyms013","梅毒螺旋体筛查"); |
59 | 59 | Connection conn = null; |
60 | - String sql = "insert into TI_申请信息孕(v患者类别,v患者编号,v患者ID号,v患者姓名,v性别,v年龄,v年龄类型,v申请项目编码,v申请项目名称," + | |
60 | + String sql = "insert into TI_申请信息(v患者类别,v患者编号,v患者ID号,v患者姓名,v性别,v年龄,v年龄类型,v申请项目编码,v申请项目名称," + | |
61 | 61 | "v唯一标识号,iTag,v手机号,v身份证号,d申请时间,v申请日期,i项目数量) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; |
62 | 62 | PreparedStatement ps = null; |
63 | 63 | ResultSet rs = null; |
... | ... | @@ -176,7 +176,7 @@ |
176 | 176 | itemsMan.put("lymsh011","肾功能检测(肌酐)"); |
177 | 177 | itemsMan.put("lymsh013","梅毒螺旋体筛查"); |
178 | 178 | Connection conn = null; |
179 | - String sql = "insert into TI_申请信息孕(v患者类别,v患者编号,v患者ID号,v患者姓名,v性别,v年龄,v年龄类型,v申请项目编码,v申请项目名称," + | |
179 | + String sql = "insert into TI_申请信息(v患者类别,v患者编号,v患者ID号,v患者姓名,v性别,v年龄,v年龄类型,v申请项目编码,v申请项目名称," + | |
180 | 180 | "v唯一标识号,iTag,v手机号,v身份证号,d申请时间,v申请日期,i项目数量) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; |
181 | 181 | PreparedStatement ps = null; |
182 | 182 | ResultSet rs = null; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BoneFacade.java
View file @
a6c824a
... | ... | @@ -278,6 +278,11 @@ |
278 | 278 | boneModel.setModified(new Date()); |
279 | 279 | BoneService.add(boneModel); |
280 | 280 | } |
281 | + else | |
282 | + { | |
283 | + return new BaseResponse(). | |
284 | + setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("没有关联数据"); | |
285 | + } | |
281 | 286 | } |
282 | 287 | //儿童骨密度 |
283 | 288 | else |
... | ... | @@ -302,6 +307,11 @@ |
302 | 307 | boneModel.setResult(result); |
303 | 308 | } |
304 | 309 | BoneService.add(boneModel); |
310 | + } | |
311 | + else | |
312 | + { | |
313 | + new BaseResponse(). | |
314 | + setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("没有关联数据"); | |
305 | 315 | } |
306 | 316 | } |
307 | 317 | return new BaseResponse(). |
platform-transfer/src/main/java/com/lyms/platform/worker/BoneWorker.java
View file @
a6c824a
... | ... | @@ -6,6 +6,7 @@ |
6 | 6 | import com.lyms.platform.conn.BoneConnectionFactory; |
7 | 7 | import com.lyms.platform.conn.inf.ConnectionFactoryMethod; |
8 | 8 | import com.lyms.platform.conn.inf.IConnection; |
9 | +import org.apache.commons.httpclient.util.DateUtil; | |
9 | 10 | import org.springframework.beans.factory.annotation.Autowired; |
10 | 11 | import org.springframework.scheduling.annotation.Scheduled; |
11 | 12 | import org.springframework.stereotype.Component; |
... | ... | @@ -14,6 +15,7 @@ |
14 | 15 | import java.sql.ResultSet; |
15 | 16 | import java.sql.SQLException; |
16 | 17 | import java.sql.Statement; |
18 | +import java.util.Date; | |
17 | 19 | import java.util.HashMap; |
18 | 20 | import java.util.Map; |
19 | 21 | |
20 | 22 | |
21 | 23 | |
... | ... | @@ -39,15 +41,17 @@ |
39 | 41 | |
40 | 42 | conn = iConnection.getConnection(); |
41 | 43 | sta = conn.createStatement(); |
42 | - rst = sta.executeQuery("select PatientID,ZScore,TScore,dbSos,dbBqi,dbRrf,dbEoa,YoungAdult,ageMatched,dbAge from PatientInfo where status is null"); | |
44 | + rst = sta.executeQuery("select PatientID,ZScore,TScore,dbSos,dbBqi,dbRrf,dbEoa,YoungAdult,ageMatched,dbAge,PartDisplayName from PatientInfo where status is null and DayTimeOfSave > #"+ DateUtil.formatDate(new Date(),"yyyy-MM-dd")+"#"); | |
43 | 45 | while (rst.next()) { |
44 | 46 | Map map = new HashMap(); |
45 | 47 | |
46 | 48 | String PatientID = rst.getString("PatientID"); //身份证后八位 |
47 | 49 | //String position = rst.getString(""); |
48 | 50 | map.put("cardNo",PatientID); |
49 | - map.put("position","左侧桡骨远端1/3处"); | |
50 | 51 | |
52 | + String PartDisplayName = rst.getString("PartDisplayName"); | |
53 | + map.put("position",PartDisplayName); | |
54 | + | |
51 | 55 | String ZScore = rst.getString("ZScore"); |
52 | 56 | String TScore = rst.getString("TScore"); |
53 | 57 | String dbSos = rst.getString("dbSos"); |
... | ... | @@ -71,6 +75,7 @@ |
71 | 75 | map.put("adultPercent",adultPercent); |
72 | 76 | map.put("agePercent",agePercent); |
73 | 77 | map.put("age",age); |
78 | + map.put("type",1); // | |
74 | 79 | |
75 | 80 | if (map.size() > 0 && PatientID != null) |
76 | 81 | { |
platform-transfer/src/main/java/com/lyms/platform/worker/MicroelementWorker.java
View file @
a6c824a
platform-transfer/src/main/resources/application.yml
View file @
a6c824a
... | ... | @@ -4,9 +4,9 @@ |
4 | 4 | |
5 | 5 | param: |
6 | 6 | #微量元素access路径 |
7 | - microelement-path: D://EK-8800181001-net_Plus//System//Patient.mdb | |
7 | + microelement-path: D://tc.mdb | |
8 | 8 | #骨密度access数据库路径 |
9 | - bone-path: D://tc.mdb | |
9 | + bone-path: D://EK-8800181001-net_Plus//System//Patient.mdb | |
10 | 10 | #区域url地址 |
11 | 11 | url: https://dev-rp-api.healthbaby.com.cn |
12 | 12 | type: 0 # 0孕妇 1儿童 |