Commit 672e35d276b264b0df444510628caddb2b21cac0
1 parent
9eb88bcc3b
Exists in
master
and in
6 other branches
update
Showing 10 changed files with 147 additions and 80 deletions
- platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/hs/HsFm.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/hs/HsfyFmService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatdeliverFollowFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RiskReportFacade.java
- platform-transfer/src/main/java/com/lyms/platform/conn/BoneConnection.java
- platform-transfer/src/main/java/com/lyms/platform/worker/BoneTransferWorker.java
- platform-transfer/src/main/java/com/lyms/platform/worker/TransferAbstract.java
- platform-transfer/src/main/java/com/lyms/platform/worker/TransferWorker.java
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
672e35d
... | ... | @@ -1039,7 +1039,7 @@ |
1039 | 1039 | if (c1 != null) { |
1040 | 1040 | c1 = c1.andOperator(c.andCondition(MongoCondition.newInstance("riskFactorId", null, MongoOper.NE)).getCriteria()); |
1041 | 1041 | } else { |
1042 | - c1 = c.andCondition(MongoCondition.newInstance("riskFactorId", null, MongoOper.NE)).getCriteria(); | |
1042 | + c1 = c.andCondition(MongoCondition.newInstance("riskFactorId", Arrays.asList("d42eec03-aa86-45b8-a4e0-78a0ff365fb6"), MongoOper.NE)).getCriteria(); | |
1043 | 1043 | } |
1044 | 1044 | } else if (null != rFactorList && !rFactorList.isEmpty()) { |
1045 | 1045 | condition = condition.and("riskFactorId", rFactorList, MongoOper.IN); |
platform-operate-api/src/main/java/com/lyms/hospitalapi/hs/HsFm.java
View file @
672e35d
... | ... | @@ -43,6 +43,7 @@ |
43 | 43 | private String DELIVER_HOSPITAL; //分娩医院 |
44 | 44 | private String DELIVER_DOCTOR; //接生医生 |
45 | 45 | private String BABY_FETAL_PRESENTATION; //胎先露(头|臀|足|肩) |
46 | + private String HEART_RATE; //胎心率 | |
46 | 47 | private String BABY_FETAL_POSITION; //胎方位 |
47 | 48 | private String BABY_SEX; //新生儿性别 |
48 | 49 | private String BABY_DELIVERY_TIME; //新生儿娩出时间 |
... | ... | @@ -68,6 +69,14 @@ |
68 | 69 | private Date CREATED; //创建时间 |
69 | 70 | |
70 | 71 | private String babyDate;//接收孕妇分娩最近日期 |
72 | + | |
73 | + public String getHEART_RATE() { | |
74 | + return HEART_RATE; | |
75 | + } | |
76 | + | |
77 | + public void setHEART_RATE(String HEART_RATE) { | |
78 | + this.HEART_RATE = HEART_RATE; | |
79 | + } | |
71 | 80 | |
72 | 81 | public String getBREATH() { |
73 | 82 | return BREATH; |
platform-operate-api/src/main/java/com/lyms/hospitalapi/hs/HsfyFmService.java
View file @
672e35d
... | ... | @@ -152,6 +152,9 @@ |
152 | 152 | "BABY_TOUCH_STARTM," + |
153 | 153 | "BABY_TOUCH_LASTM," + |
154 | 154 | "UM_EXTYPE," + |
155 | + "HEART_RATE," + | |
156 | + "BABY_FETAL_PRESENTATION," + | |
157 | + "BABY_FETAL_POSITION," + | |
155 | 158 | "OH_LOSE_BLOOD, " + |
156 | 159 | "TH_LOSE_BLOOD , " + |
157 | 160 | "PLACENTA_NUM , " + |
... | ... | @@ -213,6 +216,8 @@ |
213 | 216 | Date dueDate = null; |
214 | 217 | List<MatDeliverAddRequest.Baby> babies = new ArrayList<>(); |
215 | 218 | MatDeliverAddRequest deliverAddRequest = new MatDeliverAddRequest(); |
219 | + //胎盘信息 | |
220 | + List<MatDeliverAddRequest.Placenta> placentas = new ArrayList<>(); | |
216 | 221 | for(HsFm allFm:allList){ |
217 | 222 | |
218 | 223 | if ("死胎".equals(allFm.getBABY_PREGNANCY_OUT())) |
... | ... | @@ -427,6 +432,34 @@ |
427 | 432 | deliverAddRequest.setExtPlacentas(extPlacentas); |
428 | 433 | |
429 | 434 | |
435 | + | |
436 | + MatDeliverAddRequest.Placenta placenta = new MatDeliverAddRequest.Placenta(); | |
437 | + | |
438 | + | |
439 | + if (StringUtils.isNotEmpty(allFm.getHEART_RATE())) | |
440 | + { | |
441 | + placenta.setHeartRate(Double.parseDouble(allFm.getHEART_RATE())); | |
442 | + } | |
443 | + if (StringUtils.isNotEmpty(allFm.getBABY_FETAL_POSITION())) | |
444 | + { | |
445 | + for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()){ | |
446 | + if (fetalPositionEnums.getName().contains(allFm.getBABY_FETAL_POSITION())){ | |
447 | + placenta.setFetalPosition(fetalPositionEnums.getId()); | |
448 | + break; | |
449 | + } | |
450 | + } | |
451 | + } | |
452 | + if (StringUtils.isNotEmpty(allFm.getBABY_FETAL_PRESENTATION())) | |
453 | + { | |
454 | + for (FetalEnums fetalEnums : FetalEnums.values()) { | |
455 | + if (fetalEnums.getName().equals(allFm.getBABY_FETAL_PRESENTATION())) { | |
456 | + placenta.setFetalPresentation(fetalEnums.getId()); | |
457 | + break; | |
458 | + } | |
459 | + } | |
460 | + } | |
461 | + | |
462 | + placentas.add(placenta); | |
430 | 463 | //儿童 |
431 | 464 | MatDeliverAddRequest.Baby baby = new MatDeliverAddRequest.Baby(); |
432 | 465 | Map<String, String> as = new HashMap<>(); |
... | ... | @@ -519,6 +552,7 @@ |
519 | 552 | } |
520 | 553 | |
521 | 554 | if(a==0){ |
555 | + deliverAddRequest.setPlacentas(placentas); | |
522 | 556 | deliverAddRequest.setBabies(babies); |
523 | 557 | deliverAddRequest.setFmHospital(HOSPITALID); // |
524 | 558 | ExceptionUtils.catchException("deliverAddRequest===" + deliverAddRequest); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
672e35d
... | ... | @@ -4691,5 +4691,28 @@ |
4691 | 4691 | public List<LisReportModel> getLhxfyLis(String cardNo) { |
4692 | 4692 | return lhxfyService.getLhxfyLis(cardNo); |
4693 | 4693 | } |
4694 | + | |
4695 | + | |
4696 | +// @RequestMapping(value = "/domatDeliverFollow", method = RequestMethod.GET) | |
4697 | +// @ResponseBody | |
4698 | +// public void domatDeliverFollow() { | |
4699 | +// MatDeliverFollowQuery mfQuery = new MatDeliverFollowQuery(); | |
4700 | +// mfQuery.setVisitStartDate(DateUtil.addMonth(new Date(), -10000)); | |
4701 | +// mfQuery.setVisitEndDate(new Date()); | |
4702 | +// List<MatdeliverFollowModel> maternalDeliverList = matDeliverFollowService.query(mfQuery); | |
4703 | +// if (CollectionUtils.isNotEmpty(maternalDeliverList)) { | |
4704 | +// for(MatdeliverFollowModel matdeliverFollowModel : maternalDeliverList) | |
4705 | +// { | |
4706 | +// MaternalDeliverModel maternalDeliverModel = new MaternalDeliverModel(); | |
4707 | +// maternalDeliverModel.setVisitDate(matdeliverFollowModel.getVisitDate()); | |
4708 | +// maternalDeliverModel.setId(matdeliverFollowModel.getDeliverId()); | |
4709 | +// System.out.println(matdeliverFollowModel.getDeliverId()); | |
4710 | +// matDeliverService.updateOne(maternalDeliverModel,maternalDeliverModel.getId()); | |
4711 | +// } | |
4712 | +// } | |
4713 | +// } | |
4714 | + | |
4715 | + | |
4716 | + | |
4694 | 4717 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatdeliverFollowFacade.java
View file @
672e35d
... | ... | @@ -237,9 +237,10 @@ |
237 | 237 | matDeliverFollowAddRequest.setMakeCreateDate(new Date()); |
238 | 238 | matDeliverFollowAddRequest.setCreateUser(String.valueOf(userId)); |
239 | 239 | matDeliverFollowAddRequest.setCreateDate(new Date()); |
240 | - | |
240 | + MatdeliverFollowModel matdeliverFollowModel = matDeliverFollowAddRequest.convertToDataModel(); | |
241 | + matdeliverFollowModel.setHospitalId(hospitalId); | |
241 | 242 | //新增随访记录 |
242 | - MatdeliverFollowModel matdeliverFollowModel = matDeliverFollowService.addMatDeliverFollow(matDeliverFollowAddRequest.convertToDataModel()); | |
243 | + matdeliverFollowModel = matDeliverFollowService.addMatDeliverFollow(matdeliverFollowModel); | |
243 | 244 | |
244 | 245 | //获取分娩记录 |
245 | 246 | MaternalDeliverModel maternalDeliverModel = matDeliverService.getOneMatDeliver(matDeliverFollowAddRequest.getDeliverId()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RiskReportFacade.java
View file @
672e35d
... | ... | @@ -463,6 +463,7 @@ |
463 | 463 | //包含国家高危的自定义高危人数 |
464 | 464 | int otherPatientCount = patientsService.queryPatientCount(query); |
465 | 465 | |
466 | + System.out.println(patientsQuery.convertToQuery().convertToMongoQuery().toString()); | |
466 | 467 | //总的孕妇条数(国家标准高危) |
467 | 468 | int allPatientCount = patientsService.queryPatientCount(patientsQuery); |
468 | 469 | // allPatientCount += riskPatientCount; |
platform-transfer/src/main/java/com/lyms/platform/conn/BoneConnection.java
View file @
672e35d
1 | 1 | package com.lyms.platform.conn; |
2 | 2 | |
3 | 3 | import com.lyms.platform.conn.inf.BaseConnection; |
4 | +import org.slf4j.Logger; | |
5 | +import org.slf4j.LoggerFactory; | |
4 | 6 | |
5 | 7 | import java.sql.*; |
6 | 8 | |
... | ... | @@ -8,7 +10,7 @@ |
8 | 10 | * 骨密度连接 |
9 | 11 | */ |
10 | 12 | public class BoneConnection extends BaseConnection { |
11 | - | |
13 | + private static final Logger logger = LoggerFactory.getLogger(BoneConnection.class); | |
12 | 14 | private String path; |
13 | 15 | protected BoneConnection(String path) |
14 | 16 | { |
... | ... | @@ -24,7 +26,7 @@ |
24 | 26 | String url = "jdbc:Access:///"+path; |
25 | 27 | conn = DriverManager.getConnection(url, "", ""); |
26 | 28 | } catch (Exception e) { |
27 | - e.printStackTrace(); | |
29 | + logger.error("getConnection error."+e.toString()); | |
28 | 30 | } |
29 | 31 | return conn; |
30 | 32 | } |
platform-transfer/src/main/java/com/lyms/platform/worker/BoneTransferWorker.java
View file @
672e35d
... | ... | @@ -29,77 +29,74 @@ |
29 | 29 | |
30 | 30 | @Override |
31 | 31 | public void doTransfer() { |
32 | - logger.info("getBoneRecords start"); | |
33 | - Connection conn = null; | |
34 | - Statement sta = null; | |
35 | - ResultSet rst = null; | |
36 | - ConnectionFactoryMethod factoryMethod = new BoneConnectionFactory(); | |
37 | - IConnection iConnection = null; | |
38 | - try { | |
39 | - iConnection = factoryMethod.createConnection(properties.getDataPath()); | |
40 | - conn = iConnection.getConnection(); | |
41 | - sta = conn.createStatement(); | |
42 | - String sql = "select PatientID,ZScore,TScore,dbSos,dbBqi,dbRrf,dbEoa,YoungAdult,ageMatched,dbAge,PartDisplayName,PatientName from PatientInfo where status is null and DayTimeOfSave > "+ DateUtil.formatDate(new Date(),"yyyy-MM-dd"); | |
43 | - logger.info("getBoneRecords sql="+sql); | |
44 | - rst = sta.executeQuery(sql); | |
45 | - while (rst.next()) { | |
32 | + while (true) | |
33 | + { | |
34 | + logger.info("getBoneRecords start"); | |
35 | + Connection conn = null; | |
36 | + Statement sta = null; | |
37 | + ResultSet rst = null; | |
38 | + ConnectionFactoryMethod factoryMethod = new BoneConnectionFactory(); | |
39 | + IConnection iConnection = null; | |
40 | + try { | |
41 | + iConnection = factoryMethod.createConnection(properties.getDataPath()); | |
42 | + conn = iConnection.getConnection(); | |
43 | + sta = conn.createStatement(); | |
44 | + String sql = "select PatientID,ZScore,TScore,dbSos,dbBqi,dbRrf,dbEoa,YoungAdult,ageMatched,dbAge,PartDisplayName,PatientName from PatientInfo where status is null and DayTimeOfSave > "+ DateUtil.formatDate(new Date(),"yyyy-MM-dd"); | |
45 | + rst = sta.executeQuery(sql); | |
46 | + while (rst.next()) { | |
47 | + Map map = new HashMap(); | |
48 | + String PatientID = rst.getString("PatientID"); //身份证后八位 | |
49 | + map.put("cardNo",PatientID); | |
46 | 50 | |
51 | + String PartDisplayName = rst.getString("PartDisplayName"); | |
52 | + map.put("position",PartDisplayName); | |
47 | 53 | |
48 | - Map map = new HashMap(); | |
54 | + String PatientName = rst.getString("PatientName"); //孕妇姓名 | |
55 | + map.put("username",PatientName); | |
49 | 56 | |
50 | - String PatientID = rst.getString("PatientID"); //身份证后八位 | |
57 | + String ZScore = rst.getString("ZScore"); | |
58 | + String TScore = rst.getString("TScore"); | |
59 | + String dbSos = rst.getString("dbSos"); | |
51 | 60 | |
52 | - logger.info("getBoneRecords PatientID"+PatientID); | |
61 | + String bqi = rst.getString("dbBqi"); | |
62 | + String rrf = rst.getString("dbRrf"); | |
63 | + String eoa = rst.getString("dbEoa"); | |
53 | 64 | |
54 | - map.put("cardNo",PatientID); | |
65 | + String adultPercent = rst.getString("YoungAdult"); | |
66 | + String agePercent = rst.getString("ageMatched"); | |
67 | + String age = rst.getString("dbAge"); | |
55 | 68 | |
56 | - String PartDisplayName = rst.getString("PartDisplayName"); | |
57 | - map.put("position",PartDisplayName); | |
69 | + map.put("zvalue",ZScore); | |
70 | + map.put("tvalue",TScore); | |
71 | + map.put("sos",dbSos); | |
58 | 72 | |
59 | - String PatientName = rst.getString("PatientName"); //孕妇姓名 | |
60 | - map.put("username",PatientName); | |
73 | + map.put("bqi",bqi); | |
74 | + map.put("rrf",rrf); | |
75 | + map.put("eoa",eoa); | |
61 | 76 | |
62 | - String ZScore = rst.getString("ZScore"); | |
63 | - String TScore = rst.getString("TScore"); | |
64 | - String dbSos = rst.getString("dbSos"); | |
77 | + map.put("adultPercent",adultPercent); | |
78 | + map.put("agePercent",agePercent); | |
79 | + map.put("age",age); | |
80 | + map.put("type",properties.getType()); // | |
81 | + map.put("hospitalId",properties.getHospitalId()); // | |
65 | 82 | |
66 | - String bqi = rst.getString("dbBqi"); | |
67 | - String rrf = rst.getString("dbRrf"); | |
68 | - String eoa = rst.getString("dbEoa"); | |
69 | - | |
70 | - String adultPercent = rst.getString("YoungAdult"); | |
71 | - String agePercent = rst.getString("ageMatched"); | |
72 | - String age = rst.getString("dbAge"); | |
73 | - | |
74 | - map.put("zvalue",ZScore); | |
75 | - map.put("tvalue",TScore); | |
76 | - map.put("sos",dbSos); | |
77 | - | |
78 | - map.put("bqi",bqi); | |
79 | - map.put("rrf",rrf); | |
80 | - map.put("eoa",eoa); | |
81 | - | |
82 | - map.put("adultPercent",adultPercent); | |
83 | - map.put("agePercent",agePercent); | |
84 | - map.put("age",age); | |
85 | - map.put("type",properties.getType()); // | |
86 | - map.put("hospitalId",properties.getHospitalId()); // | |
87 | - | |
88 | - if (map.size() > 0 && PatientID != null) | |
89 | - { | |
90 | - String response = send(map, properties.getUrl() + "/saveBone"); | |
91 | - if (response.contains("0")) | |
83 | + if (map.size() > 0 && PatientID != null) | |
92 | 84 | { |
93 | - sta.executeUpdate("update PatientInfo set status='1' where PatientID='"+PatientID+"'"); | |
94 | - conn.commit(); | |
85 | + String response = send(map, properties.getUrl() + "/saveBone"); | |
86 | + if (response.contains("0")) | |
87 | + { | |
88 | + sta.executeUpdate("update PatientInfo set status='1' where PatientID='"+PatientID+"'"); | |
89 | + conn.commit(); | |
90 | + } | |
95 | 91 | } |
96 | 92 | } |
93 | + Thread.sleep(10000); | |
94 | + } catch (Exception e) { | |
95 | + logger.error("getBoneRecords Exception. "+e.toString()); | |
97 | 96 | } |
98 | - } catch (Exception e) { | |
99 | - logger.error("getBoneRecords Exception. "+e.toString()); | |
100 | - } | |
101 | - finally { | |
102 | - iConnection.close(conn, sta,rst); | |
97 | + finally { | |
98 | + iConnection.close(conn, sta,rst); | |
99 | + } | |
103 | 100 | } |
104 | 101 | } |
105 | 102 | } |
platform-transfer/src/main/java/com/lyms/platform/worker/TransferAbstract.java
View file @
672e35d
platform-transfer/src/main/java/com/lyms/platform/worker/TransferWorker.java
View file @
672e35d
1 | 1 | package com.lyms.platform.worker; |
2 | 2 | |
3 | +import org.springframework.beans.factory.InitializingBean; | |
3 | 4 | import org.springframework.beans.factory.annotation.Autowired; |
4 | 5 | import org.springframework.scheduling.annotation.EnableScheduling; |
5 | 6 | import org.springframework.scheduling.annotation.Scheduled; |
6 | 7 | |
7 | 8 | |
8 | 9 | |
9 | 10 | |
... | ... | @@ -9,20 +10,20 @@ |
9 | 10 | * Created by Administrator on 2020-03-23. |
10 | 11 | */ |
11 | 12 | @Component |
12 | -@EnableScheduling | |
13 | -public class TransferWorker extends TransferAbstract implements ITransfer { | |
13 | +public class TransferWorker extends TransferAbstract implements ITransfer,InitializingBean { | |
14 | 14 | |
15 | 15 | @Autowired |
16 | 16 | private BoneTransferWorker boneTransferWorker; |
17 | 17 | |
18 | - @Autowired | |
19 | - private MicroelementTransferWorker microelementTransferWorker; | |
20 | - | |
21 | 18 | @Override |
22 | - @Scheduled(cron = "0 0/1 * * * ?") | |
19 | +// @Scheduled(cron = "0 0/1 * * * ?",fixedDelay = 10000) | |
23 | 20 | public void doTransfer() { |
24 | - boneTransferWorker.doTransfer(); | |
21 | + | |
25 | 22 | } |
26 | 23 | |
24 | + @Override | |
25 | + public void afterPropertiesSet() throws Exception { | |
26 | + boneTransferWorker.doTransfer(); | |
27 | + } | |
27 | 28 | } |