Commit 99cea41d59b9039073e977023c729c2db4435673

Authored by liquanyu
1 parent d51a624932

肌萎缩

Showing 10 changed files with 275 additions and 116 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java View file @ 99cea41
... ... @@ -37,8 +37,6 @@
37 37 private MatDeliverService matDeliverService;
38 38  
39 39 @Autowired
40   - private MongoTemplate mongoTemplate;
41   - @Autowired
42 40 private IPatientDao iPatientDao;
43 41 @Autowired
44 42 private ISieveDao sieveDao;
45 43  
... ... @@ -199,36 +197,7 @@
199 197 iPatientDao.updatePatientLastCheckEmployeeIdOne(id, lastCheckEmployeeId);
200 198 }
201 199  
202   - /**
203   - * 添加肌萎缩 10 -14周
204   - */
205   - public void addSmnJob() {
206   - Date endDate = DateUtil.addDay(DateUtil.formatDate(new Date()), -70);
207   - Date start = DateUtil.addDay(DateUtil.formatDate(new Date()), -98);
208   - PatientsQuery patientsQuery = new PatientsQuery();
209   - patientsQuery.setLastMensesEnd(endDate);
210   - patientsQuery.setLastMensesStart(start);
211   - patientsQuery.setYn(YnEnums.YES.getId());
212   - patientsQuery.setDueStatus(0);
213   - patientsQuery.setType(1);
214   - List<Patients> patientses = iPatientDao.queryPatient(patientsQuery.convertToQuery());
215   - int batchSize = 200;
216   - if (CollectionUtils.isNotEmpty(patientses)) {
217 200  
218   - int end = 0;
219   - List<Patients> patient;
220   - for (int i = 0; i < patientses.size(); ) {
221   - end = i + batchSize;
222   - if (end > patientses.size()) {
223   - end = patientses
224   - .size();
225   - }
226   - patient = patientses.subList(i, end);
227   - i += batchSize;
228   - new Thread(new PatientSmnWorker(patient)).start();
229   - }
230   - }
231   - }
232 201  
233 202 /**
234 203 * 满足孕15+3至20+6之间和有产筛申请单的数据
235 204  
... ... @@ -1010,38 +979,7 @@
1010 979 public List<PredictedStatisticsCountModel> predictedStatistics() {
1011 980 return iPatientDao.predictedStatistics();
1012 981 }
1013   - private class PatientSmnWorker extends Thread {
1014 982  
1015   - private List<Patients> patientses;
1016   - private long startTime;
1017   -
1018   - private PatientSmnWorker(List<Patients> patientses) {
1019   - this.patientses = patientses;
1020   - startTime = System.currentTimeMillis();
1021   - }
1022   -
1023   - @Override
1024   - public void run() {
1025   - if (CollectionUtils.isNotEmpty(patientses))
1026   - {
1027   - for (Patients patient : patientses) {
1028   - Query query = Query.query(Criteria.where("patientId").is(patient.getId()));
1029   - List<SmnModel> smnModels = mongoTemplate.find(query, SmnModel.class);
1030   - if (CollectionUtils.isEmpty(smnModels))
1031   - {
1032   - SmnModel smnModel = new SmnModel();
1033   - BeanUtils.copyProperties(patient,smnModel);
1034   - smnModel.setStatus(1);
1035   - smnModel.setCreated(new Date());
1036   - smnModel.setPatientId(patient.getId());
1037   - smnModel.setId(null);
1038   - smnModel.setYn(YnEnums.YES.getId());
1039   - mongoTemplate.save(smnModel);
1040   - }
1041   - }
1042   - }
1043   - }
1044   - }
1045 983 private class PatientWorker extends Thread {
1046 984  
1047 985 private List<Patients> patientses;
platform-dal/src/main/java/com/lyms/platform/pojo/SmnModel.java View file @ 99cea41
... ... @@ -3,6 +3,7 @@
3 3 import org.springframework.data.mongodb.core.mapping.Document;
4 4  
5 5 import java.util.Date;
  6 +import java.util.Map;
6 7  
7 8 @Document(collection = "lyms_smn")
8 9 public class SmnModel {
... ... @@ -15,6 +16,8 @@
15 16 private String phone;
16 17 private Date birth;
17 18 private String vcCardNo;
  19 + //孕妇民族Id
  20 + private String pnationId;
18 21 /**
19 22 * 身份证号码
20 23 */
21 24  
22 25  
... ... @@ -38,14 +41,18 @@
38 41 private String areaRegisterId;
39 42 private String streetRegisterId;
40 43  
  44 + private String orgProvinceId;
  45 + private String orgCityId;
  46 + private String orgAreaId;
41 47  
42   - private String mzNum; //门诊号
43   - private String bedNum;//床号
  48 +
44 49 private String ybType;//样本类型 外周血
45 50 private String ybNum;//样本号
46 51 private Date sendDate;//送检时间
47 52 private String sendDoctor;//送检医生
48 53 private String diagnose;//诊断
  54 + private Map<String,Object> familyHistory;//家族史
  55 + private String marriage;//父母是否近亲结婚 1 是 2 否
49 56  
50 57 private Integer status; //1 未申请 2 已申请 3 已接收 4 已筛查 5 不合格
51 58  
... ... @@ -70,6 +77,54 @@
70 77 private Date checkDate;//检查日期
71 78 private Date created;//创建记录时间
72 79  
  80 + public String getOrgProvinceId() {
  81 + return orgProvinceId;
  82 + }
  83 +
  84 + public void setOrgProvinceId(String orgProvinceId) {
  85 + this.orgProvinceId = orgProvinceId;
  86 + }
  87 +
  88 + public String getOrgCityId() {
  89 + return orgCityId;
  90 + }
  91 +
  92 + public void setOrgCityId(String orgCityId) {
  93 + this.orgCityId = orgCityId;
  94 + }
  95 +
  96 + public String getOrgAreaId() {
  97 + return orgAreaId;
  98 + }
  99 +
  100 + public void setOrgAreaId(String orgAreaId) {
  101 + this.orgAreaId = orgAreaId;
  102 + }
  103 +
  104 + public String getPnationId() {
  105 + return pnationId;
  106 + }
  107 +
  108 + public void setPnationId(String pnationId) {
  109 + this.pnationId = pnationId;
  110 + }
  111 +
  112 + public Map<String, Object> getFamilyHistory() {
  113 + return familyHistory;
  114 + }
  115 +
  116 + public void setFamilyHistory(Map<String, Object> familyHistory) {
  117 + this.familyHistory = familyHistory;
  118 + }
  119 +
  120 + public String getMarriage() {
  121 + return marriage;
  122 + }
  123 +
  124 + public void setMarriage(String marriage) {
  125 + this.marriage = marriage;
  126 + }
  127 +
73 128 public Integer getYn() {
74 129 return yn;
75 130 }
... ... @@ -236,22 +291,6 @@
236 291  
237 292 public void setStreetRegisterId(String streetRegisterId) {
238 293 this.streetRegisterId = streetRegisterId;
239   - }
240   -
241   - public String getMzNum() {
242   - return mzNum;
243   - }
244   -
245   - public void setMzNum(String mzNum) {
246   - this.mzNum = mzNum;
247   - }
248   -
249   - public String getBedNum() {
250   - return bedNum;
251   - }
252   -
253   - public void setBedNum(String bedNum) {
254   - this.bedNum = bedNum;
255 294 }
256 295  
257 296 public String getYbType() {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java View file @ 99cea41
... ... @@ -87,7 +87,7 @@
87 87 Integer userId = loginState.getId();
88 88 String hospitalId = autoMatchFacade.getHospitalId(userId);
89 89  
90   - if (request != null && !StringUtils.isEmpty(request.getId()) && ((request.getDataStatus() != null && !"1".equals(request.getDataStatus().toString())))) {
  90 + if (request != null && !StringUtils.isEmpty(request.getId())) {
91 91 return babyBookbuildingFacade.updateBabyBookbuilding(request, userId);
92 92 }
93 93 return babyBookbuildingFacade.addBabyBookbuilding(request, loginState.getId());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java View file @ 99cea41
... ... @@ -80,6 +80,8 @@
80 80 private ResidentsArchiveService residentsArchiveService;
81 81 @Autowired
82 82 private PatientsService patientsService;
  83 + @Autowired
  84 + private SmnTaskFacade smnTaskFacade;
83 85  
84 86 @Autowired
85 87 private UsersService usersService;
86 88  
... ... @@ -608,14 +610,13 @@
608 610 @RequestMapping(value = "/addSmnJob", method = RequestMethod.GET)
609 611 @ResponseBody
610 612 public String addSmnJob() {
611   - patientsService.addSmnJob();
  613 + smnTaskFacade.addSmnJob();
612 614 return "finish";
613 615 }
614 616 @RequestMapping(value = "/autoMatDeliver", method = RequestMethod.GET)
615 617 @ResponseBody
616 618 public String autoMatDeliver() {
617 619 patientsService.autoMatDeliver();
618   - ;
619 620 return "finish";
620 621 }
621 622  
... ... @@ -623,7 +624,6 @@
623 624 @ResponseBody
624 625 public String delSieve() {
625 626 patientsService.delSieve();
626   - ;
627 627 return "finish";
628 628 }
629 629  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ 99cea41
... ... @@ -3956,6 +3956,7 @@
3956 3956 List <AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery());
3957 3957  
3958 3958 antexListResult.convertToResult(list, patients, antExChulist);
  3959 + antexListResult.setPnationStr(CommonsHelper.getName1(patients.getPnationId(),basicConfigService));
3959 3960 antexListResult.setData(handlAntData(antExChulist, list));
3960 3961 //围场产筛12-30孕周 显示 申请产筛按钮 标记字段isSieve(cap方法增加了hospitalId 参数)
3961 3962 antexListResult.setIsSieve(cap(patients.getLastMenses(), patients.getId(),StringUtils.isNotEmpty(hospitalId)?Integer.valueOf(hospitalId):null));
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SmnFacade.java View file @ 99cea41
... ... @@ -13,6 +13,7 @@
13 13 import com.lyms.platform.operate.web.request.SmnRequest;
14 14 import com.lyms.platform.operate.web.result.SmnResult;
15 15 import com.lyms.platform.operate.web.utils.CommonsHelper;
  16 +import com.lyms.platform.permission.service.OrganizationService;
16 17 import com.lyms.platform.pojo.Patients;
17 18 import com.lyms.platform.pojo.SmnModel;
18 19 import com.lyms.platform.query.PatientsQuery;
... ... @@ -37,6 +38,8 @@
37 38 private AutoMatchFacade autoMatchFacade;
38 39  
39 40 @Autowired
  41 + private OrganizationService organizationService;
  42 + @Autowired
40 43 private MongoTemplate mongoTemplate;
41 44 @Autowired
42 45 private BasicConfigService basicConfigService;
43 46  
44 47  
45 48  
46 49  
... ... @@ -129,18 +132,16 @@
129 132 {
130 133 query.addCriteria(Criteria.where("hospitalId").is(hospitalId));
131 134 }
132   - else if (param.getQueryType() == 2)
  135 + else if (param.getQueryType() == 3)
133 136 {
134   - query.addCriteria(Criteria.where("sendHospitalId").is(hospitalId));
135   - if (StringUtils.isNotEmpty(param.getHospitalId()))
136   - {
137   - query.addCriteria(Criteria.where("hospitalId").is(param.getHospitalId()));
138   - }
  137 + query.addCriteria(Criteria.where("status").gte(2));
139 138 }
140   - else
  139 +
  140 + if (StringUtils.isNotEmpty(param.getSendHospitalId()))
141 141 {
142   - query.addCriteria(Criteria.where("status").gte(2));
  142 + query.addCriteria(Criteria.where("sendHospitalId").is(param.getSendHospitalId()));
143 143 }
  144 +
144 145 String pid = param.getPid();
145 146 if (StringUtils.isNotEmpty(pid)) {
146 147 query.addCriteria(Criteria.where("pid").is(pid));
147 148  
148 149  
... ... @@ -153,14 +154,23 @@
153 154 if (StringUtils.isNotEmpty(patientId)) {
154 155 query.addCriteria(Criteria.where("patientId").is(patientId));
155 156 }
156   - String mzNum = param.getMzNum();
157   - if (StringUtils.isNotEmpty(mzNum)) {
158   - query.addCriteria(Criteria.where("mzNum").is(mzNum));
  157 +
  158 + String orgProvinceId = param.getOrgProvinceId();
  159 + if (StringUtils.isNotEmpty(orgProvinceId)) {
  160 + query.addCriteria(Criteria.where("orgProvinceId").is(orgProvinceId));
159 161 }
160   - String bedNum = param.getBedNum();
161   - if (StringUtils.isNotEmpty(bedNum)) {
162   - query.addCriteria(Criteria.where("bedNum").is(bedNum));
  162 +
  163 + String orgCityId = param.getOrgCityId();
  164 + if (StringUtils.isNotEmpty(orgCityId)) {
  165 + query.addCriteria(Criteria.where("orgCityId").is(orgCityId));
163 166 }
  167 +
  168 + String orgAreaId = param.getOrgAreaId();
  169 + if (StringUtils.isNotEmpty(orgAreaId)) {
  170 + query.addCriteria(Criteria.where("orgAreaId").is(orgAreaId));
  171 + }
  172 +
  173 +
164 174 String ybNum = param.getYbNum();
165 175 if (StringUtils.isNotEmpty(ybNum)) {
166 176 query.addCriteria(Criteria.where("ybNum").is(ybNum));
... ... @@ -185,6 +195,15 @@
185 195 query.addCriteria(Criteria.where("sendDate").gte(start).lte(end));
186 196 }
187 197  
  198 + String created = param.getCreated();
  199 + if (StringUtils.isNotEmpty(created)) {
  200 + String[] arrs = created.split(" - ");
  201 + Date start = DateUtil.parseYMD(arrs[0]);
  202 + Date end = DateUtil.parseYMD(arrs[1]);
  203 + end = DateUtil.getDayLastSecond(end);
  204 + query.addCriteria(Criteria.where("created").gte(start).lte(end));
  205 + }
  206 +
188 207 String checkDate = param.getCheckDate();
189 208 if (StringUtils.isNotEmpty(checkDate)) {
190 209 String[] arrs = checkDate.split(" - ");
191 210  
192 211  
... ... @@ -214,12 +233,15 @@
214 233 SmnResult re = new SmnResult();
215 234 BeanUtils.copyProperties(model, re);
216 235  
  236 + re.setSendHospital(organizationService.getOrganizationName(model.getSendHospitalId()));
217 237 re.setApplyWeek(DateUtil.getWeekDesc(model.getLastMenses(),model.getSendDate()));
  238 + re.setCurrentWeek(DateUtil.getWeekDesc(model.getLastMenses(),new Date()));
218 239 re.setAddressRegisterStr(CommonsHelper.getResidence(model.getProvinceRegisterId(),
219 240 model.getCityRegisterId(),
220 241 model.getAreaRegisterId(),
221 242 model.getStreetRegisterId(),
222 243 model.getAddressRegister(), basicConfigService));
  244 + re.setPnationStr(CommonsHelper.getName1(model.getPnationId(),basicConfigService));
223 245 results.add(re);
224 246 }
225 247 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SmnTaskFacade.java View file @ 99cea41
  1 +package com.lyms.platform.operate.web.facade;
  2 +
  3 +import com.lyms.platform.biz.service.PatientsService;
  4 +import com.lyms.platform.common.enums.YnEnums;
  5 +import com.lyms.platform.common.utils.DateUtil;
  6 +import com.lyms.platform.permission.model.Organization;
  7 +import com.lyms.platform.permission.service.OrganizationService;
  8 +import com.lyms.platform.pojo.Patients;
  9 +import com.lyms.platform.pojo.SmnModel;
  10 +import com.lyms.platform.query.PatientsQuery;
  11 +import org.apache.commons.collections.CollectionUtils;
  12 +import org.springframework.beans.BeanUtils;
  13 +import org.springframework.beans.factory.annotation.Autowired;
  14 +import org.springframework.data.mongodb.core.MongoTemplate;
  15 +import org.springframework.data.mongodb.core.query.Criteria;
  16 +import org.springframework.data.mongodb.core.query.Query;
  17 +import org.springframework.stereotype.Component;
  18 +
  19 +import java.util.Date;
  20 +import java.util.List;
  21 +
  22 +@Component
  23 +public class SmnTaskFacade {
  24 +
  25 + @Autowired
  26 + private MongoTemplate mongoTemplate;
  27 + @Autowired
  28 + private PatientsService patientService;
  29 + @Autowired
  30 + private OrganizationService organizationService;
  31 +
  32 + /**
  33 + * 添加肌萎缩 10 -14周
  34 + */
  35 + public void addSmnJob() {
  36 + Date endDate = DateUtil.addDay(DateUtil.formatDate(new Date()), -70);
  37 + Date start = DateUtil.addDay(DateUtil.formatDate(new Date()), -98);
  38 + PatientsQuery patientsQuery = new PatientsQuery();
  39 + patientsQuery.setLastMensesEnd(endDate);
  40 + patientsQuery.setLastMensesStart(start);
  41 + patientsQuery.setYn(YnEnums.YES.getId());
  42 + patientsQuery.setDueStatus(0);
  43 + //排查本院隐藏建档
  44 + patientsQuery.setExtEnable(false);
  45 + patientsQuery.setBuildTypeNot(1);
  46 + patientsQuery.setType(1);
  47 + List<Patients> patientses = patientService.queryPatient(patientsQuery);
  48 + int batchSize = 200;
  49 + if (CollectionUtils.isNotEmpty(patientses)) {
  50 +
  51 + int end = 0;
  52 + List<Patients> patient;
  53 + for (int i = 0; i < patientses.size(); ) {
  54 + end = i + batchSize;
  55 + if (end > patientses.size()) {
  56 + end = patientses
  57 + .size();
  58 + }
  59 + patient = patientses.subList(i, end);
  60 + i += batchSize;
  61 + new Thread(new PatientSmnWorker(patient)).start();
  62 + }
  63 + }
  64 + }
  65 +
  66 + private class PatientSmnWorker extends Thread {
  67 +
  68 + private List<Patients> patientses;
  69 + private long startTime;
  70 +
  71 + private PatientSmnWorker(List<Patients> patientses) {
  72 + this.patientses = patientses;
  73 + startTime = System.currentTimeMillis();
  74 + }
  75 +
  76 + @Override
  77 + public void run() {
  78 + if (CollectionUtils.isNotEmpty(patientses))
  79 + {
  80 + for (Patients patient : patientses) {
  81 + Query query = Query.query(Criteria.where("patientId").is(patient.getId()));
  82 + List<SmnModel> smnModels = mongoTemplate.find(query, SmnModel.class);
  83 + if (CollectionUtils.isEmpty(smnModels))
  84 + {
  85 + Organization org = organizationService.getOrganization(Integer.parseInt(patient.getHospitalId()));
  86 + SmnModel smnModel = new SmnModel();
  87 + smnModel.setOrgProvinceId(org.getProvinceId());
  88 + smnModel.setOrgCityId(org.getCityId());
  89 + smnModel.setOrgAreaId(org.getAreaId());
  90 + BeanUtils.copyProperties(patient,smnModel);
  91 + smnModel.setStatus(1);
  92 + smnModel.setCreated(new Date());
  93 + smnModel.setPatientId(patient.getId());
  94 + smnModel.setId(null);
  95 + smnModel.setYn(YnEnums.YES.getId());
  96 + mongoTemplate.save(smnModel);
  97 + }
  98 + }
  99 + }
  100 + }
  101 + }
  102 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/SmnQueryRequest.java View file @ 99cea41
... ... @@ -10,8 +10,6 @@
10 10 private String pid;
11 11 private String queryNo;//查询号 身份证号码,手机号码,姓名
12 12 private String sendDate;//送检时间
13   - private String mzNum; //门诊号
14   - private String bedNum;//床号
15 13 private String ybNum;//样本号
16 14  
17 15 private String hospitalId;//申请机构id
... ... @@ -24,6 +22,43 @@
24 22  
25 23 private String checkDate;//检查日期
26 24  
  25 + private String created;//应检查时间
  26 + private String orgProvinceId;
  27 + private String orgCityId;
  28 + private String orgAreaId;
  29 +
  30 + public String getOrgProvinceId() {
  31 + return orgProvinceId;
  32 + }
  33 +
  34 + public void setOrgProvinceId(String orgProvinceId) {
  35 + this.orgProvinceId = orgProvinceId;
  36 + }
  37 +
  38 + public String getOrgCityId() {
  39 + return orgCityId;
  40 + }
  41 +
  42 + public void setOrgCityId(String orgCityId) {
  43 + this.orgCityId = orgCityId;
  44 + }
  45 +
  46 + public String getOrgAreaId() {
  47 + return orgAreaId;
  48 + }
  49 +
  50 + public void setOrgAreaId(String orgAreaId) {
  51 + this.orgAreaId = orgAreaId;
  52 + }
  53 +
  54 + public String getCreated() {
  55 + return created;
  56 + }
  57 +
  58 + public void setCreated(String created) {
  59 + this.created = created;
  60 + }
  61 +
27 62 public String getId() {
28 63 return id;
29 64 }
... ... @@ -70,22 +105,6 @@
70 105  
71 106 public void setSendDate(String sendDate) {
72 107 this.sendDate = sendDate;
73   - }
74   -
75   - public String getMzNum() {
76   - return mzNum;
77   - }
78   -
79   - public void setMzNum(String mzNum) {
80   - this.mzNum = mzNum;
81   - }
82   -
83   - public String getBedNum() {
84   - return bedNum;
85   - }
86   -
87   - public void setBedNum(String bedNum) {
88   - this.bedNum = bedNum;
89 108 }
90 109  
91 110 public String getYbNum() {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntexListResult.java View file @ 99cea41
... ... @@ -90,6 +90,17 @@
90 90 //预约建档舒张压(低压)
91 91 private String qhdjdszy;
92 92  
  93 + //孕妇民族
  94 + private String pnationStr;
  95 +
  96 + public String getPnationStr() {
  97 + return pnationStr;
  98 + }
  99 +
  100 + public void setPnationStr(String pnationStr) {
  101 + this.pnationStr = pnationStr;
  102 + }
  103 +
93 104 public String getQhdjdheight() {
94 105 return qhdjdheight;
95 106 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/SmnResult.java View file @ 99cea41
... ... @@ -9,6 +9,33 @@
9 9  
10 10 private String addressRegisterStr; //居住地址
11 11 private String applyWeek; //申请孕周
  12 + private String currentWeek; //当前孕周
  13 + private String pnationStr; //民族
  14 + private String sendHospital;//送检医院
  15 +
  16 + public String getSendHospital() {
  17 + return sendHospital;
  18 + }
  19 +
  20 + public void setSendHospital(String sendHospital) {
  21 + this.sendHospital = sendHospital;
  22 + }
  23 +
  24 + public String getCurrentWeek() {
  25 + return currentWeek;
  26 + }
  27 +
  28 + public void setCurrentWeek(String currentWeek) {
  29 + this.currentWeek = currentWeek;
  30 + }
  31 +
  32 + public String getPnationStr() {
  33 + return pnationStr;
  34 + }
  35 +
  36 + public void setPnationStr(String pnationStr) {
  37 + this.pnationStr = pnationStr;
  38 + }
12 39  
13 40 public String getApplyWeek() {
14 41 return applyWeek;