Commit 469f747ef4d3d32b7967e397ae0ae2fa1263cb7a
1 parent
c0910536b5
Exists in
master
and in
1 other branch
fuck ture and false
Showing 7 changed files with 79 additions and 10 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/MongoSyncService.java
- platform-common/src/main/java/com/lyms/platform/common/utils/MongoSyncUtil.java
- platform-dal/src/main/java/com/lyms/platform/pojo/LisReport.java
- platform-dal/src/main/java/com/lyms/platform/query/LisReportQuery.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyHisService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/SyncDataTaskService.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
View file @
469f747
... | ... | @@ -97,7 +97,22 @@ |
97 | 97 | // addHealthConfig(applicationContext); |
98 | 98 | // saveHospitalMsgConfig(applicationContext); |
99 | 99 | // saveHospitalMsgTemplate(applicationContext); |
100 | - queryRisk(applicationContext); | |
100 | +// queryRisk(applicationContext); | |
101 | + testtt(applicationContext); | |
102 | + } | |
103 | + | |
104 | + public static void testtt(ApplicationContext applicationContext) { | |
105 | + MongoTemplate mongoTemplate | |
106 | + =(MongoTemplate)applicationContext.getBean("mongoTemplate"); | |
107 | + mongoTemplate.getDb().authenticate("platform", "platform123".toCharArray()); | |
108 | + MongoCondition mongoCondition = MongoCondition.newInstance("hospitalId", "216", MongoOper.IS); | |
109 | + List<AssayConfig> assayConfigList = mongoTemplate.find(mongoCondition.toMongoQuery().convertToMongoQuery(), AssayConfig.class); | |
110 | + Map<String, AssayConfig> assayConfigMap = new HashMap<>(); | |
111 | + for (AssayConfig config:assayConfigList) { | |
112 | + assayConfigMap.put(config.getProjectCode(), config); | |
113 | + } | |
114 | + System.out.println(JsonUtil.obj2Str(assayConfigMap)); | |
115 | + System.out.println(JsonUtil.obj2Str(assayConfigMap.get("PLT"))); | |
101 | 116 | } |
102 | 117 | |
103 | 118 | public static void saveHospitalMsgTemplate(ApplicationContext applicationContext) { |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/MongoSyncService.java
View file @
469f747
... | ... | @@ -38,6 +38,7 @@ |
38 | 38 | |
39 | 39 | public static final String CENTER_BASE_URL= PropertiesUtils.getPropertyValue("center_base_url"); |
40 | 40 | public static final String CENTER_TOKEN = PropertiesUtils.getPropertyValue("center_token"); |
41 | + public static final String timeAtts[] = {"checkDate","nextCheckTime","created","modified","dueDate","lastMenses","nextDate","birth","fbirth","mbirth","buildDate","vipEndTime","currentVisit","nextVisitDate","publishTime","bookbuildingDate","fmDate","husbandBirth","lastThTime","LastCTime","dueWeek","received","applyDate","sendDate","stopDate","start","end","nextCheckTimeStart","nextCheckTimeEnd","gteModified","gteCreated","start","end","buildDateStart","buildDateEnd","birthStart","birthEnd","nextDateStart","nextDateEnd","createdStart","endStart"}; | |
41 | 42 | |
42 | 43 | public static String mongo_crypto_key = Config.getItem("mongo_crypto_key", "0"); |
43 | 44 |
platform-common/src/main/java/com/lyms/platform/common/utils/MongoSyncUtil.java
View file @
469f747
... | ... | @@ -102,6 +102,20 @@ |
102 | 102 | System.out.println(LymsEncodeUtil.aesDecrypt("26EB0301C4A2410E90985A3E55856E4B86730CD45542FD5129D8EDC5ED4C690D","Lymsh@2016")); |
103 | 103 | String ssss = LymsEncodeUtil.aesDecrypt("E75ACE9E5E23E6BB253B26F8F5B94156B72CCE1E6118C8A72D501E3B34BC377B013B4A8AE524B0F33E9D2FF7001FBD08A60FA406B2C0D5EBA2B923156B223A45287B1B95F7DF5905EB8FABBD537800173C423A706FACE7C63D809A2274A60120F38E5C35AEE2869F44907FFECC2EA1221223D3E0F9B5EE703446A1156A673BEE02A5E94E27A525BBDC8909E6CCCFC63A2923F29B060D2A93A732C30123F4840CE2FF2CF876A3400189C3F23C51F810DA588177B9C1A4EC224920FF3C0EF44847E3C20529445FC6093CD123BF67CA58C11367F7C8D596859803B37BC9D9057FCC605B9D6BA1173BFFCEC688CF01B423E5", "Lymsh@2016"); |
104 | 104 | System.out.println(ssss); |
105 | + System.out.println(ssss); | |
106 | + UpdateMultiData data = new UpdateMultiData(); | |
107 | + data.setMongoQuery(new MongoQuery(new MongoCondition("parentId", "57d27d83f0f09ff4e51db341", MongoOper.IS)).convertToMongoQuery()); | |
108 | + Map<String, Object> u = new HashMap<>(); | |
109 | + u.put("score", 0); | |
110 | + u.put("rRisk", "[\"年龄??35??\"]"); | |
111 | + data.setUpdate(u); | |
112 | + System.out.println("---"+JsonUtil.obj2Str(data)); | |
113 | + System.out.println(LymsEncodeUtil.aesEncrypt(JsonUtil.obj2Str(data), "Lymsh@2016")); | |
114 | + | |
115 | + | |
116 | + String s = "{\"query\":{\"parentId\":\"581a91c528b67bb1fa239ce3\"},\"update\":{\"score\":0,\"rRisk\":\"[\\\"年龄??35??\\\"]\"}}"; | |
117 | + UpdateMultiData updateMultiData = JsonUtil.str2Obj(s, UpdateMultiData.class); | |
118 | + System.out.println(JsonUtil.obj2Str(updateMultiData)); | |
105 | 119 | } |
106 | 120 | |
107 | 121 | } |
platform-dal/src/main/java/com/lyms/platform/pojo/LisReport.java
View file @
469f747
... | ... | @@ -17,6 +17,7 @@ |
17 | 17 | private String patientFid; |
18 | 18 | private String patientHid; |
19 | 19 | private String vcCardNo; |
20 | + private String phone; | |
20 | 21 | private String name; |
21 | 22 | private String sex; |
22 | 23 | private Integer age; |
... | ... | @@ -29,6 +30,14 @@ |
29 | 30 | private Date publishTime; |
30 | 31 | private Integer status;// 1:未计算危机;2:已计算危机 |
31 | 32 | private String classifyName; |
33 | + | |
34 | + public String getPhone() { | |
35 | + return phone; | |
36 | + } | |
37 | + | |
38 | + public void setPhone(String phone) { | |
39 | + this.phone = phone; | |
40 | + } | |
32 | 41 | |
33 | 42 | public String getClassifyName() { |
34 | 43 | return classifyName; |
platform-dal/src/main/java/com/lyms/platform/query/LisReportQuery.java
View file @
469f747
... | ... | @@ -16,9 +16,18 @@ |
16 | 16 | private String id; |
17 | 17 | private String hospitalId; |
18 | 18 | private String vcCardNo; |
19 | + private String phone; | |
19 | 20 | private String name; |
20 | 21 | private Integer status;// 1:未计算危机;2:已计算危机 |
21 | 22 | |
23 | + public String getPhone() { | |
24 | + return phone; | |
25 | + } | |
26 | + | |
27 | + public void setPhone(String phone) { | |
28 | + this.phone = phone; | |
29 | + } | |
30 | + | |
22 | 31 | public Integer getStatus() { |
23 | 32 | return status; |
24 | 33 | } |
... | ... | @@ -76,6 +85,9 @@ |
76 | 85 | } |
77 | 86 | if(StringUtils.isNotBlank(name)){ |
78 | 87 | condition=condition.and("name",name,MongoOper.IS); |
88 | + } | |
89 | + if(StringUtils.isNotBlank(phone)){ | |
90 | + condition=condition.and("phone",phone,MongoOper.IS); | |
79 | 91 | } |
80 | 92 | |
81 | 93 | return condition.toMongoQuery(); |
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyHisService.java
View file @
469f747
... | ... | @@ -9,17 +9,20 @@ |
9 | 9 | import com.lyms.platform.common.dao.operator.MongoOper; |
10 | 10 | import com.lyms.platform.common.enums.YnEnums; |
11 | 11 | import com.lyms.platform.common.utils.DateUtil; |
12 | +import com.lyms.platform.common.utils.JsonUtil; | |
12 | 13 | import com.lyms.platform.pojo.*; |
13 | 14 | import com.lyms.platform.query.LisReportQuery; |
14 | 15 | import com.lyms.platform.query.PatientsQuery; |
15 | 16 | import org.apache.commons.dbutils.DbUtils; |
16 | 17 | import org.apache.commons.dbutils.QueryRunner; |
17 | 18 | import org.apache.commons.dbutils.handlers.BeanListHandler; |
19 | +import org.apache.commons.io.FileUtils; | |
18 | 20 | import org.apache.commons.lang.StringUtils; |
19 | 21 | import org.joda.time.DateTime; |
20 | 22 | import org.springframework.beans.factory.annotation.Autowired; |
21 | 23 | import org.springframework.stereotype.Service; |
22 | 24 | |
25 | +import java.io.File; | |
23 | 26 | import java.sql.Connection; |
24 | 27 | import java.sql.SQLException; |
25 | 28 | import java.util.*; |
26 | 29 | |
27 | 30 | |
... | ... | @@ -63,14 +66,14 @@ |
63 | 66 | ReferConfigQuery referConfigQuery = new ReferConfigQuery(); |
64 | 67 | referConfigQuery.setYn(YnEnums.YES.getId()); |
65 | 68 | referConfigQuery.setHospitalId(hospitalId); |
69 | + referConfigQuery.setLimit(10000); | |
66 | 70 | List<ReferValue> referValueList = referConfigService.queryRefer(referConfigQuery); |
67 | 71 | Map<String, ReferValue> referValueMap = new HashMap<>(); |
68 | 72 | for (ReferValue referValue:referValueList) { |
69 | 73 | referValueMap.put(referValue.getCode(), referValue); |
70 | 74 | } |
71 | - | |
72 | 75 | PatientsQuery patientsQuery = new PatientsQuery(); |
73 | - String sql = "select top 10000 shenqinghao as hospitalId,bingrenid as patientFid,zhuyuanhao as patientHid,kahao as vcCardNo,huanzhexingming as name,xingbie as sex,nianling as age,shenqingkeshidaima as deptCode,shenqingkeshimingcheng as deptName,shenqingyishengdaima as applyDoctorCode,shenqingyishengmingcheng as applyDoctorName,jianchayishengdaima as checkDoctorCode,jianchayishengxingming as checkDoctorName,baogaofabushijian as publishTime from valllist_ex_en where kahao is not null and shenqinghao is not null order by shenqinghao desc"; | |
76 | + String sql = "select top 100000 shenqinghao as hospitalId,bingrenid as patientFid,zhuyuanhao as patientHid,kahao as vcCardNo,phone,huanzhexingming as name,xingbie as sex,nianling as age,shenqingkeshidaima as deptCode,shenqingkeshimingcheng as deptName,shenqingyishengdaima as applyDoctorCode,shenqingyishengmingcheng as applyDoctorName,jianchayishengdaima as checkDoctorCode,jianchayishengxingming as checkDoctorName,baogaofabushijian as publishTime from valllist_ex_en where phone is not null and phone !='' and shenqinghao is not null order by shenqinghao desc"; | |
74 | 77 | String subSql = "select top 1000 sheqingdanhao as id,xiangmudaima as code,xiangmumingcheng as name,xiangmujieguo as result,zifujieguo as charResult,shuzijieguo as numberResult,gaodibiaozhi as flag,cankaozhi as ref,danwei as unit,jieguoleixing as result from valresult_ex_en where sheqingdanhao='"; |
75 | 78 | Object[] params = {startDate}; |
76 | 79 | List<LisReport> list = queryRunner.query(conn, sql, new BeanListHandler<LisReport>(LisReport.class)); |
77 | 80 | |
... | ... | @@ -82,10 +85,10 @@ |
82 | 85 | assayConfigMap.put(config.getProjectCode(), config); |
83 | 86 | } |
84 | 87 | for (LisReport report:list) { |
85 | - patientsQuery.setVcCardNo(report.getVcCardNo()); | |
88 | + patientsQuery.setPhone(report.getPhone().trim()); | |
86 | 89 | int count = patientsService.queryPatientCount(patientsQuery); |
87 | 90 | LisReportQuery lisReportQuery = new LisReportQuery(); |
88 | - lisReportQuery.setVcCardNo(report.getVcCardNo()); | |
91 | + lisReportQuery.setId(hospitalId + "_" + report.getHospitalId()); | |
89 | 92 | lisReportQuery.setHospitalId(""+hospitalId); |
90 | 93 | int reportCount = lisReportService.queryLisReportCount(lisReportQuery); |
91 | 94 | if (count > 0 && reportCount == 0) { |
... | ... | @@ -122,7 +125,7 @@ |
122 | 125 | // crisis init |
123 | 126 | for (LisReportItem item:itemList) { |
124 | 127 | boolean flag = false; |
125 | - ReferValue referValue = referValueMap.get(item.getCode()); | |
128 | + ReferValue referValue = referValueMap.get(item.getCode().trim()); | |
126 | 129 | if (referValue != null) { |
127 | 130 | if (StringUtils.isNotBlank(item.getNumberResult())) { |
128 | 131 | crisisItem.setResult(item.getNumberResult()); |
129 | 132 | |
130 | 133 | |
... | ... | @@ -132,11 +135,13 @@ |
132 | 135 | crisisItem.setResult(item.getResult()); |
133 | 136 | } |
134 | 137 | try { |
135 | - if (referValue.getEmergencyChar() != null && referValue.getEmergencyChar().equals(crisisItem.getResult())) { | |
138 | + if (StringUtils.isNotBlank(referValue.getEmergencyChar()) && referValue.getEmergencyChar().equals(crisisItem.getResult())) { | |
136 | 139 | flag = true; |
137 | - } else if (referValue.getEmergencyMax() != null && Double.valueOf(referValue.getEmergencyMax()) <= Double.valueOf(crisisItem.getResult())) { | |
140 | + } | |
141 | + if (StringUtils.isNotBlank(referValue.getEmergencyMax()) && Double.valueOf(referValue.getEmergencyMax()) <= Double.valueOf(crisisItem.getResult())) { | |
138 | 142 | flag = true; |
139 | - } else if (referValue.getEmergencyMin() != null && Double.valueOf(referValue.getEmergencyMin()) >= Double.valueOf(crisisItem.getResult())) { | |
143 | + } | |
144 | + if (StringUtils.isNotBlank(referValue.getEmergencyMin()) && Double.valueOf(referValue.getEmergencyMin()) >= Double.valueOf(crisisItem.getResult())) { | |
140 | 145 | flag = true; |
141 | 146 | } |
142 | 147 | } catch (Exception e) { |
... | ... | @@ -164,7 +169,7 @@ |
164 | 169 | } |
165 | 170 | DbUtils.closeQuietly(conn); |
166 | 171 | return result; |
167 | - } catch (SQLException e) { | |
172 | + } catch (Exception e) { | |
168 | 173 | DbUtils.closeQuietly(conn); |
169 | 174 | e.printStackTrace(); |
170 | 175 | return result; |
... | ... | @@ -258,6 +263,7 @@ |
258 | 263 | List<LisCheckInfo> list = new ArrayList<>(); |
259 | 264 | if (lisReportList.size() > 0) { |
260 | 265 | for (LisReport lisReport:lisReportList) { |
266 | + // hospitalId为申请号 | |
261 | 267 | if (StringUtils.isNotBlank(lisReport.getHospitalId())) { |
262 | 268 | List<LisReportItem> lisReportItemList = queryRunner.query(conn, subSql+lisReport.getHospitalId()+"'", new BeanListHandler<LisReportItem>(LisReportItem.class)); |
263 | 269 | if (lisReportItemList != null && lisReportItemList.size() > 0) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/SyncDataTaskService.java
View file @
469f747
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | import com.lyms.platform.biz.service.*; |
4 | 4 | import com.lyms.platform.common.pojo.SyncDataModel; |
5 | +import com.lyms.platform.common.pojo.UpdateMultiData; | |
5 | 6 | import com.lyms.platform.common.utils.*; |
6 | 7 | import com.lyms.platform.operate.web.request.GuideQuery; |
7 | 8 | import com.lyms.platform.permission.model.Users; |
... | ... | @@ -9,6 +10,7 @@ |
9 | 10 | import com.lyms.platform.permission.service.UsersService; |
10 | 11 | import com.lyms.platform.pojo.*; |
11 | 12 | import com.lyms.platform.query.*; |
13 | +import com.qiniu.util.Json; | |
12 | 14 | import org.apache.commons.httpclient.HttpClient; |
13 | 15 | import org.apache.commons.httpclient.NameValuePair; |
14 | 16 | import org.apache.commons.httpclient.methods.PostMethod; |
... | ... | @@ -523,6 +525,16 @@ |
523 | 525 | for (String s:set) { |
524 | 526 | System.out.println(s); |
525 | 527 | } |
528 | + | |
529 | + AntExChuModel chuModel = new AntExChuModel(); | |
530 | + chuModel.setLastMenses(new Date()); | |
531 | + Map<String, Object> omap = ReflectionUtils.getUpdateField(chuModel); | |
532 | + for (String key:omap.keySet()) { | |
533 | + System.out.println(key+"--"+omap.get(key)); | |
534 | + } | |
535 | + UpdateMultiData data = new UpdateMultiData(); | |
536 | + data.setUpdate(omap); | |
537 | + System.out.println(JsonUtil.obj2Str(data)); | |
526 | 538 | } |
527 | 539 | |
528 | 540 | private static Map<String, String> buildRiskMap() { |