Commit 20c1aca556cdf6d57563268f8eef6ed949405793
Exists in
master
and in
8 other branches
Merge remote-tracking branch 'origin/master'
Showing 12 changed files
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IGuidelinesDao.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/GuidelinesDaoImpl.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/GuidelinesService.java
- platform-biz-patient-service/src/main/resources/database.properties
- platform-common/src/main/java/com/lyms/platform/common/enums/FmTypeEnums.java
- platform-dal/src/main/java/com/lyms/platform/pojo/Guidelines.java
- platform-dal/src/main/java/com/lyms/platform/query/GuidelinesQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntexListResult.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
View file @
20c1aca
1 | 1 | package com.lyms.platform.biz; |
2 | 2 | |
3 | +import java.io.File; | |
4 | +import java.io.IOException; | |
3 | 5 | import java.text.SimpleDateFormat; |
4 | 6 | import java.util.*; |
5 | 7 | |
6 | -import com.lyms.platform.pojo.DataPermissionsModel; | |
8 | +import com.lyms.platform.biz.service.GuidelinesService; | |
9 | +import com.lyms.platform.common.enums.YnEnums; | |
10 | +import com.lyms.platform.common.utils.JsonUtil; | |
11 | +import com.lyms.platform.common.utils.SystemConfig; | |
12 | +import com.lyms.platform.pojo.*; | |
13 | +import org.apache.commons.io.FileUtils; | |
7 | 14 | import org.springframework.context.ApplicationContext; |
8 | 15 | import org.springframework.context.support.ClassPathXmlApplicationContext; |
9 | 16 | |
10 | 17 | import com.lyms.platform.biz.service.BabyService; |
11 | 18 | import com.lyms.platform.biz.service.PuerperaService; |
12 | 19 | import com.lyms.platform.biz.service.VisitService; |
13 | -import com.lyms.platform.pojo.BabyModel; | |
14 | -import com.lyms.platform.pojo.PuerperaModel; | |
15 | -import com.lyms.platform.pojo.VisitModel; | |
16 | 20 | import com.lyms.platform.query.PuerperaModelQuery; |
17 | 21 | import org.springframework.data.mongodb.core.MongoTemplate; |
18 | 22 | |
... | ... | @@ -71,7 +75,111 @@ |
71 | 75 | System.out.println(users2.toString()); |
72 | 76 | }*/ |
73 | 77 | // addDataPermission(applicationContext); |
74 | - addVisit(applicationContext); | |
78 | +// addVisit(applicationContext); | |
79 | + addKidsGuidelines(applicationContext); | |
80 | + } | |
81 | + | |
82 | + public static void addKidsGuidelines(ApplicationContext applicationContext) { | |
83 | + MongoTemplate mongoTemplate | |
84 | + =(MongoTemplate)applicationContext.getBean("mongoTemplate"); | |
85 | + mongoTemplate.getDb().authenticate("platform", "platform123".toCharArray()); | |
86 | + Set<String> set = mongoTemplate.getCollectionNames(); | |
87 | + for (String s:set) { | |
88 | + System.out.println(s); | |
89 | + } | |
90 | + try { | |
91 | + List<String> list = FileUtils.readLines(new File("E:\\temp\\儿童指导意见.csv")); | |
92 | + int i=0; | |
93 | + for (String line:list) { | |
94 | + i++; | |
95 | + String[] array = line.split(","); | |
96 | + if (array.length == 3) { | |
97 | + Guidelines guidelines = new Guidelines(); | |
98 | + guidelines.setYn(YnEnums.YES.getId()); | |
99 | + guidelines.setCategory(array[1]); | |
100 | + guidelines.setContent(array[2]); | |
101 | + guidelines.setType(3); | |
102 | + guidelines.setStart(Integer.valueOf(array[0])); | |
103 | + guidelines.setEnd(guidelines.getStart()); | |
104 | + System.out.println(i+" == "+JsonUtil.obj2JsonString(guidelines)); | |
105 | + mongoTemplate.save(guidelines); | |
106 | + } | |
107 | + } | |
108 | + } catch (IOException e) { | |
109 | + e.printStackTrace(); | |
110 | + } | |
111 | + } | |
112 | + | |
113 | + public static void addGuidelines(ApplicationContext applicationContext) { | |
114 | + MongoTemplate mongoTemplate | |
115 | + =(MongoTemplate)applicationContext.getBean("mongoTemplate"); | |
116 | + mongoTemplate.getDb().authenticate("platform", "platform123".toCharArray()); | |
117 | + Set<String> set = mongoTemplate.getCollectionNames(); | |
118 | + for (String s:set) { | |
119 | + System.out.println(s); | |
120 | + } | |
121 | + try { | |
122 | + List<String> list = FileUtils.readLines(new File("E:\\temp\\孕产报告指导意见.csv")); | |
123 | + int i=0; | |
124 | + for (String line:list) { | |
125 | + i++; | |
126 | + String[] array = line.split(","); | |
127 | + if (line.startsWith("孕")) { | |
128 | + if (array.length == 3) { | |
129 | + Guidelines guidelines = new Guidelines(); | |
130 | + guidelines.setYn(YnEnums.YES.getId()); | |
131 | + guidelines.setCategory(array[1]); | |
132 | + guidelines.setContent(array[2]); | |
133 | + guidelines.setType(1); | |
134 | + String[] subArray = array[0].split("-|—"); | |
135 | + if (subArray.length == 2) { | |
136 | + guidelines.setStart(Integer.valueOf(subArray[0].replace("孕","").replace("周",""))); | |
137 | + guidelines.setEnd(Integer.valueOf(subArray[1].replace("孕","").replace("周",""))); | |
138 | + } else { | |
139 | + guidelines.setStart(Integer.valueOf(array[0].replace("孕","").replace("周",""))); | |
140 | + guidelines.setEnd(guidelines.getStart()); | |
141 | + } | |
142 | +//TODO mongoTemplate.save(guidelines); | |
143 | + } | |
144 | + } else if (line.startsWith("产后")) { | |
145 | + if (array.length == 3) { | |
146 | + Guidelines guidelines = new Guidelines(); | |
147 | + guidelines.setYn(YnEnums.YES.getId()); | |
148 | + guidelines.setCategory(array[1]); | |
149 | + guidelines.setContent(array[2]); | |
150 | + guidelines.setType(2); | |
151 | + if (array[0].endsWith("剖宫产")) { | |
152 | + array[0] = array[0].replace("——剖宫产", ""); | |
153 | + guidelines.setDeliveryType("2"); | |
154 | + } else if (array[0].endsWith("顺产")) { | |
155 | + array[0] = array[0].replace("——顺产", ""); | |
156 | + guidelines.setDeliveryType("1"); | |
157 | + } | |
158 | + String[] subArray = array[0].split("-|—"); | |
159 | + if (subArray.length == 2) { | |
160 | + guidelines.setStart(Integer.valueOf(subArray[0].replace("产后","").replace("天",""))); | |
161 | + guidelines.setEnd(Integer.valueOf(subArray[1].replace("产后","").replace("天",""))); | |
162 | + } else { | |
163 | + guidelines.setStart(Integer.valueOf(array[0].replace("产后","").replace("天",""))); | |
164 | + guidelines.setEnd(guidelines.getStart()); | |
165 | + } | |
166 | + if (guidelines.getDeliveryType() == null) { | |
167 | + // 存两个 | |
168 | + guidelines.setDeliveryType("1"); | |
169 | + mongoTemplate.save(guidelines); | |
170 | + guidelines.setDeliveryType("2"); | |
171 | + guidelines.setId(null); | |
172 | + mongoTemplate.save(guidelines); | |
173 | + } else { | |
174 | + mongoTemplate.save(guidelines); | |
175 | + } | |
176 | + System.out.println(i + " == " + JsonUtil.obj2JsonString(guidelines)); | |
177 | + } | |
178 | + } | |
179 | + } | |
180 | + } catch (IOException e) { | |
181 | + e.printStackTrace(); | |
182 | + } | |
75 | 183 | } |
76 | 184 | |
77 | 185 | public static void addDataPermission(ApplicationContext applicationContext){ |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IGuidelinesDao.java
View file @
20c1aca
1 | +package com.lyms.platform.biz.dal; | |
2 | + | |
3 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
4 | +import com.lyms.platform.common.dao.operator.Page; | |
5 | +import com.lyms.platform.pojo.BasicConfig; | |
6 | +import com.lyms.platform.pojo.Guidelines; | |
7 | + | |
8 | +import java.util.Collection; | |
9 | +import java.util.List; | |
10 | + | |
11 | +/** | |
12 | + * Created by Administrator on 2016/8/2 0002. | |
13 | + */ | |
14 | +public interface IGuidelinesDao { | |
15 | + | |
16 | + public Guidelines addGuidelines(Guidelines obj); | |
17 | + | |
18 | + public void updateGuidelines(Guidelines obj, String id); | |
19 | + | |
20 | + public void deleteGuidelines(String id); | |
21 | + | |
22 | + public Guidelines getGuidelines(String id); | |
23 | + | |
24 | + public int queryGuidelinesCount(MongoQuery query); | |
25 | + | |
26 | + public List<Guidelines> queryGuidelines(MongoQuery query); | |
27 | + | |
28 | + public Page<Guidelines> findPage(MongoQuery query); | |
29 | + | |
30 | + public Guidelines getOneGuidelinesById(String id); | |
31 | + | |
32 | +} |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/GuidelinesDaoImpl.java
View file @
20c1aca
1 | +package com.lyms.platform.biz.dal.impl; | |
2 | + | |
3 | +import com.lyms.platform.biz.dal.IBasicConfigDao; | |
4 | +import com.lyms.platform.biz.dal.IGuidelinesDao; | |
5 | +import com.lyms.platform.common.dao.BaseMongoDAOImpl; | |
6 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
7 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
8 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
9 | +import com.lyms.platform.common.dao.operator.Page; | |
10 | +import com.lyms.platform.pojo.BasicConfig; | |
11 | +import com.lyms.platform.pojo.Guidelines; | |
12 | +import org.springframework.stereotype.Repository; | |
13 | + | |
14 | +import java.util.List; | |
15 | + | |
16 | +/** | |
17 | + * Created by Administrator on 2016/8/2 0002. | |
18 | + */ | |
19 | +@Repository("guidelinesDao") | |
20 | +public class GuidelinesDaoImpl extends BaseMongoDAOImpl<Guidelines> implements IGuidelinesDao { | |
21 | + @Override | |
22 | + public Guidelines addGuidelines(Guidelines obj) { | |
23 | + return save(obj); | |
24 | + } | |
25 | + | |
26 | + @Override | |
27 | + public void updateGuidelines(Guidelines obj, String id) { | |
28 | + update(new MongoQuery(new MongoCondition("id", id, MongoOper.IS)).convertToMongoQuery(), obj); | |
29 | + } | |
30 | + | |
31 | + @Override | |
32 | + public void deleteGuidelines(String id) { | |
33 | + delete(new MongoQuery(new MongoCondition("id", id, MongoOper.IS)).convertToMongoQuery()); | |
34 | + } | |
35 | + | |
36 | + @Override | |
37 | + public Guidelines getGuidelines(String id) { | |
38 | + return findById(id); | |
39 | + } | |
40 | + | |
41 | + @Override | |
42 | + public int queryGuidelinesCount(MongoQuery query) { | |
43 | + return (int) count(query.convertToMongoQuery()); | |
44 | + } | |
45 | + | |
46 | + @Override | |
47 | + public List<Guidelines> queryGuidelines(MongoQuery query) { | |
48 | + return find(query.convertToMongoQuery()); | |
49 | + } | |
50 | + | |
51 | + @Override | |
52 | + public Page<Guidelines> findPage(MongoQuery query) { | |
53 | + return findPage(query.convertToMongoQuery()); | |
54 | + } | |
55 | + | |
56 | + @Override | |
57 | + public Guidelines getOneGuidelinesById(String id) { | |
58 | + return findById(id); | |
59 | + } | |
60 | +} |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/GuidelinesService.java
View file @
20c1aca
1 | +package com.lyms.platform.biz.service; | |
2 | + | |
3 | +import com.google.common.cache.CacheLoader; | |
4 | +import com.google.common.cache.LoadingCache; | |
5 | +import com.lyms.platform.biz.dal.IGuidelinesDao; | |
6 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
7 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
8 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
9 | +import com.lyms.platform.common.dao.operator.Page; | |
10 | +import com.lyms.platform.common.enums.YnEnums; | |
11 | +import com.lyms.platform.common.utils.CacheHelper; | |
12 | +import com.lyms.platform.pojo.BasicConfig; | |
13 | +import com.lyms.platform.pojo.Guidelines; | |
14 | +import com.lyms.platform.query.BasicConfigQuery; | |
15 | +import com.lyms.platform.query.GuidelinesQuery; | |
16 | +import org.apache.commons.lang.StringUtils; | |
17 | +import org.springframework.beans.factory.InitializingBean; | |
18 | +import org.springframework.beans.factory.annotation.Autowired; | |
19 | +import org.springframework.data.domain.Sort; | |
20 | +import org.springframework.stereotype.Service; | |
21 | + | |
22 | +import java.util.Collection; | |
23 | +import java.util.List; | |
24 | + | |
25 | +/** | |
26 | + * Created by Administrator on 2016/8/2 0002. | |
27 | + */ | |
28 | +@Service("guidelinesService") | |
29 | +public class GuidelinesService implements InitializingBean { | |
30 | + | |
31 | + private LoadingCache<String, Guidelines> cached=null; | |
32 | + | |
33 | + @Autowired | |
34 | + private IGuidelinesDao guidelinesDao; | |
35 | + | |
36 | + public void addGuidelines(Guidelines obj) { | |
37 | + guidelinesDao.addGuidelines(obj); | |
38 | + } | |
39 | + | |
40 | + public void updateGuidelines(Guidelines obj) { | |
41 | + guidelinesDao.updateGuidelines(obj, obj.getId()); | |
42 | + } | |
43 | + | |
44 | + public List<Guidelines> queryGuidelines(GuidelinesQuery guidelinesQuery) { | |
45 | + MongoQuery query = guidelinesQuery.convertToQuery(); | |
46 | + if (StringUtils.isNotEmpty(guidelinesQuery.getNeed())) { | |
47 | + guidelinesQuery.mysqlBuild(guidelinesDao.queryGuidelinesCount(guidelinesQuery.convertToQuery())); | |
48 | + query.start(guidelinesQuery.getOffset()).end(guidelinesQuery.getLimit()); | |
49 | + } | |
50 | + | |
51 | + return guidelinesDao.queryGuidelines(query.addOrder(Sort.Direction.ASC, "id")); | |
52 | + } | |
53 | + | |
54 | + public Guidelines getOneGuidelinesById(String id) { | |
55 | + try{ | |
56 | + return cached.get(id); | |
57 | + }catch (Exception e){ | |
58 | + } | |
59 | + return null; | |
60 | + } | |
61 | + | |
62 | + @Override | |
63 | + public void afterPropertiesSet() throws Exception { | |
64 | + //cache size 为400 缓存3分钟 | |
65 | + cached = CacheHelper.cached(new CacheLoader<String, Guidelines>() { | |
66 | + @Override | |
67 | + public Guidelines load(String key) throws Exception { | |
68 | + return guidelinesDao.getOneGuidelinesById(key); | |
69 | + } | |
70 | + }, 400, 3); | |
71 | + } | |
72 | +} |
platform-biz-patient-service/src/main/resources/database.properties
View file @
20c1aca
platform-common/src/main/java/com/lyms/platform/common/enums/FmTypeEnums.java
View file @
20c1aca
platform-dal/src/main/java/com/lyms/platform/pojo/Guidelines.java
View file @
20c1aca
1 | +package com.lyms.platform.pojo; | |
2 | + | |
3 | +import com.lyms.platform.common.result.BaseModel; | |
4 | +import org.springframework.data.annotation.Id; | |
5 | +import org.springframework.data.mongodb.core.mapping.Document; | |
6 | + | |
7 | +/** | |
8 | + * Created by Administrator on 2016/8/2 0002. | |
9 | + * 指导意见 | |
10 | + */ | |
11 | +@Document(collection="lyms_guidelines") | |
12 | +public class Guidelines extends BaseModel { | |
13 | + | |
14 | + private static final long serialVersionUID = 1L; | |
15 | + @Id | |
16 | + private String id; | |
17 | + /* 1:孕期,2:产后,3:儿童 */ | |
18 | + private Integer type; | |
19 | + | |
20 | + /*分娩方式 FmTypeEnums*/ | |
21 | + private String deliveryType; | |
22 | + | |
23 | + /* 孕期:周;产后:天;儿童:月 */ | |
24 | + private Integer start; | |
25 | + private Integer end; | |
26 | + | |
27 | + private String category; | |
28 | + private String content; | |
29 | + private Integer yn; | |
30 | + | |
31 | + public String getDeliveryType() { | |
32 | + return deliveryType; | |
33 | + } | |
34 | + | |
35 | + public void setDeliveryType(String deliveryType) { | |
36 | + this.deliveryType = deliveryType; | |
37 | + } | |
38 | + | |
39 | + public String getId() { | |
40 | + return id; | |
41 | + } | |
42 | + | |
43 | + public void setId(String id) { | |
44 | + this.id = id; | |
45 | + } | |
46 | + | |
47 | + public Integer getType() { | |
48 | + return type; | |
49 | + } | |
50 | + | |
51 | + public void setType(Integer type) { | |
52 | + this.type = type; | |
53 | + } | |
54 | + | |
55 | + public Integer getStart() { | |
56 | + return start; | |
57 | + } | |
58 | + | |
59 | + public void setStart(Integer start) { | |
60 | + this.start = start; | |
61 | + } | |
62 | + | |
63 | + public Integer getEnd() { | |
64 | + return end; | |
65 | + } | |
66 | + | |
67 | + public void setEnd(Integer end) { | |
68 | + this.end = end; | |
69 | + } | |
70 | + | |
71 | + public String getCategory() { | |
72 | + return category; | |
73 | + } | |
74 | + | |
75 | + public void setCategory(String category) { | |
76 | + this.category = category; | |
77 | + } | |
78 | + | |
79 | + public String getContent() { | |
80 | + return content; | |
81 | + } | |
82 | + | |
83 | + public void setContent(String content) { | |
84 | + this.content = content; | |
85 | + } | |
86 | + | |
87 | + public Integer getYn() { | |
88 | + return yn; | |
89 | + } | |
90 | + | |
91 | + public void setYn(Integer yn) { | |
92 | + this.yn = yn; | |
93 | + } | |
94 | +} |
platform-dal/src/main/java/com/lyms/platform/query/GuidelinesQuery.java
View file @
20c1aca
1 | +package com.lyms.platform.query; | |
2 | + | |
3 | +import com.lyms.platform.common.base.IConvertToNativeQuery; | |
4 | +import com.lyms.platform.common.dao.BaseQuery; | |
5 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
6 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
7 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
8 | +import com.lyms.platform.common.enums.YnEnums; | |
9 | + | |
10 | +/** | |
11 | + * Created by Administrator on 2016/8/2 0002. | |
12 | + */ | |
13 | +public class GuidelinesQuery extends BaseQuery implements IConvertToNativeQuery { | |
14 | + | |
15 | + @Override | |
16 | + public MongoQuery convertToQuery() { | |
17 | + MongoCondition condition = MongoCondition.newInstance("yn", YnEnums.YES.getId(), MongoOper.IS); | |
18 | + if (null != id) { | |
19 | + condition = condition.and("id", id, MongoOper.IS); | |
20 | + } | |
21 | + if (null != type) { | |
22 | + condition = condition.and("type", type, MongoOper.IS); | |
23 | + } | |
24 | + if (null != deliveryType) { | |
25 | + condition = condition.and("deliveryType", deliveryType, MongoOper.IS); | |
26 | + } | |
27 | + if (null != maxStart) { | |
28 | + condition = condition.and("start", maxStart, MongoOper.LTE); | |
29 | + } | |
30 | + if (null != minStart) { | |
31 | + condition = condition.and("start", minStart, MongoOper.GTE); | |
32 | + } | |
33 | + if (null != maxEnd) { | |
34 | + condition = condition.and("end", maxEnd, MongoOper.LTE); | |
35 | + } | |
36 | + if (null != minEnd) { | |
37 | + condition = condition.and("end", minEnd, MongoOper.GTE); | |
38 | + } | |
39 | + return condition.toMongoQuery(); | |
40 | + } | |
41 | + | |
42 | + private String id; | |
43 | + /* 1:孕期,2:产后,3:儿童 */ | |
44 | + private Integer type; | |
45 | + | |
46 | + /* 孕期:周;产后:天;儿童:?TODO */ | |
47 | + private Integer maxStart; | |
48 | + private Integer minStart; | |
49 | + private Integer maxEnd; | |
50 | + private Integer minEnd; | |
51 | + /*分娩方式 FmTypeEnums*/ | |
52 | + private String deliveryType; | |
53 | + | |
54 | + public String getDeliveryType() { | |
55 | + return deliveryType; | |
56 | + } | |
57 | + | |
58 | + public void setDeliveryType(String deliveryType) { | |
59 | + this.deliveryType = deliveryType; | |
60 | + } | |
61 | + | |
62 | + public String getId() { | |
63 | + return id; | |
64 | + } | |
65 | + | |
66 | + public void setId(String id) { | |
67 | + this.id = id; | |
68 | + } | |
69 | + | |
70 | + public Integer getType() { | |
71 | + return type; | |
72 | + } | |
73 | + | |
74 | + public void setType(Integer type) { | |
75 | + this.type = type; | |
76 | + } | |
77 | + | |
78 | + public Integer getMaxStart() { | |
79 | + return maxStart; | |
80 | + } | |
81 | + | |
82 | + public void setMaxStart(Integer maxStart) { | |
83 | + this.maxStart = maxStart; | |
84 | + } | |
85 | + | |
86 | + public Integer getMinStart() { | |
87 | + return minStart; | |
88 | + } | |
89 | + | |
90 | + public void setMinStart(Integer minStart) { | |
91 | + this.minStart = minStart; | |
92 | + } | |
93 | + | |
94 | + public Integer getMaxEnd() { | |
95 | + return maxEnd; | |
96 | + } | |
97 | + | |
98 | + public void setMaxEnd(Integer maxEnd) { | |
99 | + this.maxEnd = maxEnd; | |
100 | + } | |
101 | + | |
102 | + public Integer getMinEnd() { | |
103 | + return minEnd; | |
104 | + } | |
105 | + | |
106 | + public void setMinEnd(Integer minEnd) { | |
107 | + this.minEnd = minEnd; | |
108 | + } | |
109 | +} |
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
20c1aca
... | ... | @@ -219,11 +219,11 @@ |
219 | 219 | this.serviceStatus = serviceStatus; |
220 | 220 | } |
221 | 221 | |
222 | - public int getType() { | |
222 | + public Integer getType() { | |
223 | 223 | return type; |
224 | 224 | } |
225 | 225 | |
226 | - public void setType(int type) { | |
226 | + public void setType(Integer type) { | |
227 | 227 | this.type = type; |
228 | 228 | } |
229 | 229 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
20c1aca
... | ... | @@ -15,7 +15,6 @@ |
15 | 15 | import com.lyms.platform.permission.service.OrganizationService; |
16 | 16 | import com.lyms.platform.pojo.*; |
17 | 17 | import com.lyms.platform.query.*; |
18 | -import com.sun.javafx.collections.MappingChange; | |
19 | 18 | import org.apache.commons.collections.CollectionUtils; |
20 | 19 | import org.apache.commons.lang.StringUtils; |
21 | 20 | import org.apache.commons.lang.math.NumberUtils; |
... | ... | @@ -226,6 +225,9 @@ |
226 | 225 | if (CollectionUtils.isNotEmpty(list)) { |
227 | 226 | antexListResult.convertToResult(null, list.get(0), null); |
228 | 227 | for (Patients patients : list) { |
228 | + HighScoreResult highScoreResult = findLastRisk(patients.getId()); | |
229 | + antexListResult.setRiskFactor(highScoreResult.getHighRisk()); | |
230 | + antexListResult.setRiskScore(highScoreResult.getScore()+""); | |
229 | 231 | List<StopPregModel> stopPregs = null; |
230 | 232 | List<AntData> data = new ArrayList<>(); |
231 | 233 | MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); |
... | ... | @@ -254,7 +256,7 @@ |
254 | 256 | } |
255 | 257 | } |
256 | 258 | PostReviewQuery postReviewQuery = new PostReviewQuery(); |
257 | - ; | |
259 | + ;postReviewQuery.setYn(YnEnums.YES.getId()); | |
258 | 260 | if (StringUtils.isNotEmpty(dueDate)) { |
259 | 261 | Date date = DateUtil.parseYMD(dueDate); |
260 | 262 | //初诊记录 |
... | ... | @@ -272,6 +274,7 @@ |
272 | 274 | data.add(new AntData(an, null != organization ? organization.getName() : "")); |
273 | 275 | } |
274 | 276 | } |
277 | + | |
275 | 278 | //复诊记录 |
276 | 279 | AntExQuery antExQuery = new AntExQuery(); |
277 | 280 | antExQuery.setYn(YnEnums.YES.getId()); |
278 | 281 | |
279 | 282 | |
... | ... | @@ -288,16 +291,15 @@ |
288 | 291 | } |
289 | 292 | } |
290 | 293 | |
291 | - postReviewQuery.setYn(YnEnums.YES.getId()); | |
294 | + | |
292 | 295 | if (list.size() - 1 > i) { |
293 | 296 | postReviewQuery.setStart(date); |
294 | 297 | //下次建档记录前都是产后复查,如果没有下个产程的数据就直接显示 |
295 | 298 | // postReviewQuery.setEnd(list.size() - 1 > i ? list.get(i).getCreated() :null/* new Date()*/); |
296 | 299 | postReviewQuery.setEnd(list.get(i).getCreated()); |
297 | 300 | } |
298 | - | |
299 | - postReviewQuery.setParentId(patients.getId()); | |
300 | 301 | } |
302 | + postReviewQuery.setParentId(patients.getId()); | |
301 | 303 | i++; |
302 | 304 | //分娩记录 |
303 | 305 | if (CollectionUtils.isNotEmpty(modelList)) { |
... | ... | @@ -356,7 +358,7 @@ |
356 | 358 | * @param vcCardNo |
357 | 359 | * @return |
358 | 360 | */ |
359 | - public Patients findOnePatient(String cardNo, String vcCardNo, String id, String hospitalId) { | |
361 | + public Patients findOnePatient(String cardNo, String vcCardNo, String id, String hospitalId,Integer type) { | |
360 | 362 | PatientsQuery patientsQuery = new PatientsQuery(); |
361 | 363 | if (StringUtils.isNotEmpty(cardNo)) { |
362 | 364 | patientsQuery.setCardNo(cardNo); |
... | ... | @@ -365,6 +367,7 @@ |
365 | 367 | } else if (StringUtils.isNotEmpty(id)) { |
366 | 368 | patientsQuery.setId(id); |
367 | 369 | } |
370 | + patientsQuery.setType(type); | |
368 | 371 | patientsQuery.setHospitalId(hospitalId); |
369 | 372 | patientsQuery.setYn(YnEnums.YES.getId()); |
370 | 373 | Patients patients = null; |
... | ... | @@ -435,8 +438,8 @@ |
435 | 438 | hospital = list1.get(0) + ""; |
436 | 439 | } |
437 | 440 | //查询产妇数据 |
438 | - patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospital); | |
439 | - patients1 = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, null); | |
441 | + patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospital,1); | |
442 | + patients1 = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, null,1); | |
440 | 443 | } |
441 | 444 | |
442 | 445 | if (null == patients) { |
443 | 446 | |
444 | 447 | |
... | ... | @@ -471,13 +474,34 @@ |
471 | 474 | } |
472 | 475 | data.add(); |
473 | 476 | }*/ |
474 | - | |
475 | - | |
476 | 477 | antexListResult.convertToResult(list, patients, antExChulist); |
478 | + antexListResult.setData(handlAntData(antExChulist,list)); | |
477 | 479 | antexListResult.setIsSieve(cap(patients.getLastMenses(), patients.getId())); |
478 | 480 | antexListResult.setRiskFactor(highScoreResult.getHighRisk()); |
479 | 481 | antexListResult.setRiskScore(highScoreResult.getScore()+""); |
480 | 482 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(antexListResult); |
483 | + } | |
484 | + | |
485 | + public List handlAntData(List<AntExChuModel> antExChulist,List<AntenatalExaminationModel> list){ | |
486 | + List<AntData> dataList = new ArrayList<>(); | |
487 | + Organization organization=null; | |
488 | + if(CollectionUtils.isNotEmpty(antExChulist)){ | |
489 | + for(AntExChuModel antExChuModel1:antExChulist){ | |
490 | + if (null != antExChuModel1.getHospitalId()) { | |
491 | + organization = organizationService.getOrganization(Integer.valueOf(antExChuModel1.getHospitalId())); | |
492 | + } | |
493 | + dataList.add(new AntData(antExChuModel1,null != organization ? organization.getName() : "")); | |
494 | + } | |
495 | + } | |
496 | + if(CollectionUtils.isNotEmpty(list)){ | |
497 | + for(AntenatalExaminationModel model:list){ | |
498 | + if (null != model.getHospitalId()) { | |
499 | + organization = organizationService.getOrganization(Integer.valueOf(model.getHospitalId())); | |
500 | + } | |
501 | + dataList.add(new AntData(model, null != organization ? organization.getName() : "")); | |
502 | + } | |
503 | + } | |
504 | + return dataList; | |
481 | 505 | } |
482 | 506 | |
483 | 507 | private List queryRiskName(List l) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
20c1aca
... | ... | @@ -251,7 +251,7 @@ |
251 | 251 | hospital= list1.get(0) + ""; |
252 | 252 | } |
253 | 253 | //获取 |
254 | - Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null,hospital); | |
254 | + Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null,hospital,3); | |
255 | 255 | if (null == patients) { |
256 | 256 | return new BaseResponse().setErrormsg("没有相关的产妇记录").setErrorcode(ErrorCodeConstants.BUSINESS_ERROR); |
257 | 257 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntexListResult.java
View file @
20c1aca
... | ... | @@ -159,7 +159,6 @@ |
159 | 159 | setName(patients.getUsername()); |
160 | 160 | setPhone(patients.getPhone()); |
161 | 161 | setRemarks(patients.getMremark()); |
162 | - setRiskScore("60"); | |
163 | 162 | setCardNo(patients.getCardNo()); |
164 | 163 | |
165 | 164 | setVcCardNo(patients.getVcCardNo()); |
... | ... | @@ -170,18 +169,7 @@ |
170 | 169 | if(null!=patients.getLastMenses()){ |
171 | 170 | setLastMenses(DateUtil.getyyyy_MM_dd(patients.getLastMenses())); |
172 | 171 | } |
173 | - List<AntData> dataList = new ArrayList<>(); | |
174 | - if(CollectionUtils.isNotEmpty(antExChuModel)){ | |
175 | - for(AntExChuModel antExChuModel1:antExChuModel){ | |
176 | - dataList.add(new AntData(antExChuModel1,"")); | |
177 | - } | |
178 | - } | |
179 | - if(CollectionUtils.isNotEmpty(destModel)){ | |
180 | - for(AntenatalExaminationModel model:destModel){ | |
181 | - dataList.add(new AntData(model,"")); | |
182 | - } | |
183 | - } | |
184 | - setData(dataList); | |
172 | + | |
185 | 173 | return this; |
186 | 174 | } |
187 | 175 |