Commit 37b3c3491e5281d7579a69107eb1209d722683d0

Authored by liquanyu
1 parent 2f91184307

孕产妇管理列表修改

Showing 9 changed files with 191 additions and 25 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IPatientDao.java View file @ 37b3c34
... ... @@ -30,5 +30,7 @@
30 30 void updatePatientByPid(Patients patientUpdate, String pid);
31 31  
32 32 void findAndModify(MongoQuery query,Patients obj);
  33 +
  34 + void updatePatientOneCol(String id, String colName, Object colValue);
33 35 }
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/PatientDaoImpl.java View file @ 37b3c34
... ... @@ -7,6 +7,7 @@
7 7 import com.lyms.platform.common.dao.operator.MongoQuery;
8 8 import com.lyms.platform.common.dao.operator.Page;
9 9 import com.lyms.platform.pojo.AntenatalExaminationModel;
  10 +import com.lyms.platform.pojo.BabyModel;
10 11 import com.lyms.platform.pojo.Patients;
11 12 import org.bson.types.ObjectId;
12 13 import org.springframework.data.mongodb.core.aggregation.Aggregation;
... ... @@ -15,6 +16,7 @@
15 16 import org.springframework.data.mongodb.core.aggregation.Field;
16 17 import org.springframework.data.mongodb.core.query.Criteria;
17 18 import org.springframework.data.mongodb.core.query.Query;
  19 +import org.springframework.data.mongodb.core.query.Update;
18 20 import org.springframework.stereotype.Repository;
19 21  
20 22 import java.util.List;
... ... @@ -34,6 +36,12 @@
34 36 public void findAndModify(MongoQuery query,Patients obj){
35 37 updateMulti(query.convertToMongoQuery(),obj);
36 38 }
  39 +
  40 + @Override
  41 + public void updatePatientOneCol(String id, String colName, Object colValue) {
  42 + this.mongoTemplate.updateFirst(new Query(Criteria.where("id").is(id)), Update.update(colName, colValue), BabyModel.class);
  43 + }
  44 +
37 45 @Override
38 46 public void updatePatient(Patients obj, String id) {
39 47 update(new MongoQuery(new MongoCondition("id", id, MongoOper.IS)).convertToMongoQuery(), obj);
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java View file @ 37b3c34
... ... @@ -101,6 +101,11 @@
101 101 return iPatientDao.getPatient(id);
102 102 }
103 103  
  104 + public void updatePatientOneCol(String id,String colName,Object colValue)
  105 + {
  106 + iPatientDao.updatePatientOneCol(id,colName,colValue);
  107 + }
  108 +
104 109 /**
105 110 * 满足孕15+3至20+6之间和有产筛申请单的数据
106 111 */
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java View file @ 37b3c34
... ... @@ -794,11 +794,11 @@
794 794 // Date startDate = getRangeDate(parseYMD("2016-09-07"),2,"周",-1);
795 795 // System.out.println(getyyyy_MM_dd(startDate));
796 796  
797   -// int a = daysBetween(parseYMD("2013-09-13"),new Date())/7;
798   -// System.out.println(a);
  797 + int a = daysBetween(parseYMD("2016-10-01"),new Date())/7;
  798 + System.out.println(a);
799 799  
800   - Date dueDate = DateUtil.addDay(DateUtil.addMonth(parseYMD("2016-02-08"), 9), 7);
801   - System.out.println(getyyyy_MM_dd(dueDate));
  800 +// Date dueDate = DateUtil.addDay(DateUtil.addMonth(parseYMD("2016-02-08"), 9), 7);
  801 +// System.out.println(getyyyy_MM_dd(dueDate));
802 802 } catch (Exception e)
803 803 {
804 804  
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java View file @ 37b3c34
... ... @@ -153,6 +153,17 @@
153 153 this.hospitalList = hospitalList;
154 154 }
155 155  
  156 + //查询号
  157 + private String queryNo;
  158 +
  159 + public String getQueryNo() {
  160 + return queryNo;
  161 + }
  162 +
  163 + public void setQueryNo(String queryNo) {
  164 + this.queryNo = queryNo;
  165 + }
  166 +
156 167 public Integer getPostViewTimes() {
157 168 return postViewTimes;
158 169 }
... ... @@ -301,6 +312,8 @@
301 312  
302 313 private Date fmDateStart;
303 314 private Date fmDateEnd;
  315 + private Date nextCheckTimeStart;
  316 + private Date nextCheckTimeEnd;
304 317  
305 318 //大于修改时间
306 319 private Date gteModified;
307 320  
... ... @@ -308,7 +321,45 @@
308 321 //大于创建时间
309 322 private Date gteCreated;
310 323  
  324 + //最后一次产检医生职工ID
  325 + private String lastCheckEmployeeId;
311 326  
  327 + //建档医生
  328 + private String bookbuildingDoctor;
  329 +
  330 +
  331 + public String getLastCheckEmployeeId() {
  332 + return lastCheckEmployeeId;
  333 + }
  334 +
  335 + public void setLastCheckEmployeeId(String lastCheckEmployeeId) {
  336 + this.lastCheckEmployeeId = lastCheckEmployeeId;
  337 + }
  338 +
  339 + public String getBookbuildingDoctor() {
  340 + return bookbuildingDoctor;
  341 + }
  342 +
  343 + public void setBookbuildingDoctor(String bookbuildingDoctor) {
  344 + this.bookbuildingDoctor = bookbuildingDoctor;
  345 + }
  346 +
  347 + public Date getNextCheckTimeStart() {
  348 + return nextCheckTimeStart;
  349 + }
  350 +
  351 + public void setNextCheckTimeStart(Date nextCheckTimeStart) {
  352 + this.nextCheckTimeStart = nextCheckTimeStart;
  353 + }
  354 +
  355 + public Date getNextCheckTimeEnd() {
  356 + return nextCheckTimeEnd;
  357 + }
  358 +
  359 + public void setNextCheckTimeEnd(Date nextCheckTimeEnd) {
  360 + this.nextCheckTimeEnd = nextCheckTimeEnd;
  361 + }
  362 +
312 363 public Date getLastCTimeStart() {
313 364 return lastCTimeStart;
314 365 }
... ... @@ -633,6 +684,7 @@
633 684  
634 685 public MongoQuery convertToQuery() {
635 686 MongoCondition condition = MongoCondition.newInstance();
  687 +
636 688 if (null != keyword) {
637 689 MongoCondition con1 = MongoCondition.newInstance("phone", "^" + keyword, MongoOper.LIKE);
638 690 MongoCondition con = MongoCondition.newInstance("username", "^" + keyword, MongoOper.LIKE);
639 691  
640 692  
... ... @@ -656,15 +708,19 @@
656 708 } else if (null != buildTypeList) {
657 709 MongoCondition mongoCondition = MongoCondition.newInstance("buildType", 3, MongoOper.IS);
658 710 MongoCondition condition1 = mongoCondition.and("enable", "1", MongoOper.IS);
659   -
660 711 MongoCondition condition2 = MongoCondition.newInstance("buildType", buildTypeList, MongoOper.IN);
661   -
662 712 condition = condition.orCondition(new MongoCondition[]{condition1, condition2});
663 713 }
664 714  
665 715 if (buildTypeEq != null) {
666 716 condition = condition.and("buildType", buildTypeEq, MongoOper.IS);
667 717 }
  718 + if (lastCheckEmployeeId != null) {
  719 + condition = condition.and("lastCheckEmployeeId", lastCheckEmployeeId, MongoOper.IS);
  720 + }
  721 + if (bookbuildingDoctor != null) {
  722 + condition = condition.and("bookbuildingDoctor", bookbuildingDoctor, MongoOper.IS);
  723 + }
668 724 if (visitstatus != -1) {
669 725 condition = condition.and("isVisit", visitstatus, MongoOper.IS);
670 726 }
... ... @@ -742,6 +798,14 @@
742 798 condition = condition.and("pid", pid, MongoOper.IS);
743 799 }
744 800 Criteria c1 = null;
  801 + if (null != queryNo) {
  802 + MongoCondition c = MongoCondition.newInstance();
  803 + MongoCondition con1 = MongoCondition.newInstance("phone", queryNo, MongoOper.IS);
  804 + MongoCondition con2 = MongoCondition.newInstance("username", queryNo, MongoOper.IS);
  805 + MongoCondition con3 = MongoCondition.newInstance("cardNo", queryNo, MongoOper.IS);
  806 + c1= c.orCondition(new MongoCondition[]{con1, con2, con3}).getCriteria();
  807 + }
  808 +
745 809 if (fmDateStart != null && fmDateEnd != null) {
746 810 c1 = Criteria.where("fmDate").gte(fmDateStart).lte(fmDateEnd);
747 811 }
... ... @@ -807,6 +871,24 @@
807 871 c1 = Criteria.where("lastRhTime").lte(lastRhTimeEnd);
808 872 }
809 873 }
  874 +
  875 + if (null != nextCheckTimeStart) {
  876 + if (null != c1) {
  877 + c1 = c1.and("nextCheckTime").gte(nextCheckTimeStart);
  878 + } else {
  879 + c1 = Criteria.where("nextCheckTime").gte(nextCheckTimeStart);
  880 + }
  881 + }
  882 +
  883 + if (null != nextCheckTimeEnd) {
  884 + if (null != c1) {
  885 + c1 = c1.lte(nextCheckTimeEnd);
  886 + } else {
  887 + c1 = Criteria.where("nextCheckTime").lte(nextCheckTimeEnd);
  888 + }
  889 + }
  890 +
  891 +
810 892 if (null != hScoreStart) {
811 893 if (null != hScoreStart) {
812 894 if (null != c1) {
813 895  
... ... @@ -915,7 +997,9 @@
915 997 }
916 998 if (null != c1) {
917 999 condition = condition.andCondition(new MongoCondition(c1));
  1000 +
918 1001 }
  1002 +
919 1003 return condition.toMongoQuery();
920 1004 }
921 1005  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/Test.java View file @ 37b3c34
... ... @@ -26,23 +26,24 @@
26 26  
27 27 public static void main(String[] args){
28 28 PatientsQuery patientsQuery1 = new PatientsQuery();
29   - patientsQuery1.setPid("pid");
  29 + patientsQuery1.setHospitalId("221");
30 30 patientsQuery1.setYn(YnEnums.YES.getId());
31 31 patientsQuery1.setType(1);
32   - Patients patients1 = new Patients();
33   - patients1.setModified(new Date());
34 32  
35   - List<String> ids = new ArrayList<>();
36   - ids.add("id1");
37   - ids.add("id12");
38   - ids.add("id134");
39   - patients1.setRiskScore(12);
40   - patients1.setRiskFactorId(ids);
41   - patients1.setRiskLevelId(JsonUtil.array2JsonString(ids));
42   - Update update = MongoConvertHelper
43   - .convertToNativeUpdate(ReflectionUtils.getUpdateField(patients1));
44   - System.out.println(JsonUtil.obj2JsonString(patientsQuery1.convertToQuery().convertToMongoQuery()));
45   - System.out.println(JsonUtil.obj2JsonString(update));
  33 + List buildType = new ArrayList();
  34 + buildType.add(0);
  35 + buildType.add(2);
  36 + patientsQuery1.setBuildTypeList(buildType);
  37 +
  38 + patientsQuery1.setQueryNo("q");
  39 +
  40 +
  41 +
  42 + patientsQuery1.setBookbuildingDateStart(DateUtil.parseYMD("1999-11-11"));
  43 + patientsQuery1.setBookbuildingDateEnd(DateUtil.parseYMD("2016-12-08"));
  44 +
  45 +
  46 + System.out.println(patientsQuery1.convertToQuery().convertToMongoQuery());
46 47  
47 48 }
48 49 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ 37b3c34
... ... @@ -136,7 +136,7 @@
136 136 Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId());
137 137  
138 138 patients.setLastCheckEmployeeId(antExAddRequest.getCheckDoctor());
139   -
  139 + patientsService.updatePatientOneCol(patients.getId(), "nextCheckTime", com.lyms.platform.common.utils.StringUtils.isEmpty(antExAddRequest.getNextCheckTime()) == true ? null : DateUtil.parseYMD(antExAddRequest.getNextCheckTime()));
140 140 patientsService.updatePatient(patients);
141 141 //修改孕妇高危等级
142 142 updateLastRisk(antExAddRequest.getParentId());
... ... @@ -160,6 +160,7 @@
160 160 }
161 161 Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId());
162 162 patients.setLastCheckEmployeeId(antExAddRequest.getCheckDoctor());
  163 + patientsService.updatePatientOneCol(patients.getId(), "nextCheckTime", com.lyms.platform.common.utils.StringUtils.isEmpty(antExAddRequest.getNextCheckTime()) == true ? null : DateUtil.parseYMD(antExAddRequest.getNextCheckTime()));
163 164 model.setPid(patients.getPid());
164 165 if (StringUtils.isNotEmpty(patients.getEnable()) && "0".equals(patients.getEnable())) {
165 166 patients.setEnable("1");
... ... @@ -247,7 +248,7 @@
247 248  
248 249 Patients patients = patientsService.findOnePatientById(excAddRequest.getParentId());
249 250 patients.setLastCheckEmployeeId(excAddRequest.getProdDoctor());
250   -
  251 + patientsService.updatePatientOneCol(patients.getId(), "nextCheckTime", com.lyms.platform.common.utils.StringUtils.isEmpty(excAddRequest.getNextCheckTime()) == true ? null : DateUtil.parseYMD(excAddRequest.getNextCheckTime()));
251 252 if (StringUtils.isNotEmpty(patients.getEnable()) && "0".equals(patients.getEnable())) {
252 253 patients.setEnable("1");
253 254 }
... ... @@ -291,6 +292,7 @@
291 292 antExChuModel.setHospitalId(autoMatchFacade.getHospitalId(userId));
292 293 antenatalExaminationService.addOneAntEx(antExChuModel);
293 294 //修改患者风险等级
  295 + patientsService.updatePatientOneCol(patients.getId(), "nextCheckTime", com.lyms.platform.common.utils.StringUtils.isEmpty(excAddRequest.getNextCheckTime()) == true ? null : DateUtil.parseYMD(excAddRequest.getNextCheckTime()));
294 296 patients.setLastCheckEmployeeId(excAddRequest.getProdDoctor());
295 297 // updatePatientRiskLevel(antExChuModel, patients);
296 298 patientsService.updatePatient(patients);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java View file @ 37b3c34
... ... @@ -257,6 +257,20 @@
257 257 }
258 258 }
259 259  
  260 + //下次预约时间
  261 + if (StringUtils.isNotEmpty(riskPatientsQueryRequest.getNextCheckTime())) {
  262 + String nextDateStr = riskPatientsQueryRequest.getNextCheckTime();
  263 + String[] dates = nextDateStr.split(" - ");
  264 + patientsQuery.setNextCheckTimeStart(DateUtil.parseYMD(dates[0]));
  265 + if (dates.length == 2) {
  266 + patientsQuery.setNextCheckTimeEnd(DateUtil.parseYMD(dates[1]));
  267 + }
  268 + }
  269 + patientsQuery.setBookbuildingDoctor(riskPatientsQueryRequest.getBuildUserId());
  270 + patientsQuery.setLastCheckEmployeeId(riskPatientsQueryRequest.getLastCheckDoctorId());
  271 +
  272 +
  273 +
260 274 patientsQuery.setrLevel(riskPatientsQueryRequest.getrLevel());
261 275 patientsQuery.setLastMensesStart(riskPatientsQueryRequest.capEnd());
262 276 patientsQuery.setLastMensesEnd(riskPatientsQueryRequest.capStart());
... ... @@ -369,6 +383,9 @@
369 383 patientsQuery.setHospitalId(hospital);
370 384 }
371 385 patientsQuery.setNeed(needPage);
  386 +
  387 + patientsQuery.setQueryNo(riskPatientsQueryRequest.getQueryNo());
  388 +
372 389 return patientsQuery;
373 390 }
374 391  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/RiskPatientsQueryRequest.java View file @ 37b3c34
... ... @@ -61,8 +61,6 @@
61 61 //体验会员 0非会员 1会员
62 62 @FormParam
63 63 private Integer expVip;
64   - //建档时间
65   - private String buildTime;
66 64 //最后一次医院定义的高危
67 65 private String lastRhTime;
68 66 //本院最后一次产检时间
69 67  
... ... @@ -93,7 +91,29 @@
93 91 // 医院id
94 92 private String hId;
95 93  
  94 + //建档时间
  95 + private String buildTime;
96 96  
  97 + //下次预约时间
  98 + private String nextCheckTime;
  99 +
  100 + //查询号
  101 + private String queryNo;
  102 +
  103 + //建档人
  104 + private String buildUserId;
  105 +
  106 + //产检医生
  107 + private String lastCheckDoctorId;
  108 +
  109 + public String getQueryNo() {
  110 + return queryNo;
  111 + }
  112 +
  113 + public void setQueryNo(String queryNo) {
  114 + this.queryNo = queryNo;
  115 + }
  116 +
97 117 public String getProvinceRegisterId() {
98 118 return provinceRegisterId;
99 119 }
... ... @@ -172,6 +192,33 @@
172 192  
173 193 public void sethId(String hId) {
174 194 this.hId = hId;
  195 + }
  196 +
  197 +
  198 +
  199 +
  200 + public String getNextCheckTime() {
  201 + return nextCheckTime;
  202 + }
  203 +
  204 + public void setNextCheckTime(String nextCheckTime) {
  205 + this.nextCheckTime = nextCheckTime;
  206 + }
  207 +
  208 + public String getBuildUserId() {
  209 + return buildUserId;
  210 + }
  211 +
  212 + public void setBuildUserId(String buildUserId) {
  213 + this.buildUserId = buildUserId;
  214 + }
  215 +
  216 + public String getLastCheckDoctorId() {
  217 + return lastCheckDoctorId;
  218 + }
  219 +
  220 + public void setLastCheckDoctorId(String lastCheckDoctorId) {
  221 + this.lastCheckDoctorId = lastCheckDoctorId;
175 222 }
176 223  
177 224 public Integer getPostViewTimes() {