Commit 293bab5b81111863f0a4e31df845861de7c210d9
1 parent
fb74a679ac
Exists in
master
and in
8 other branches
修改新电子病历
Showing 5 changed files with 89 additions and 48 deletions
- platform-common/src/main/java/com/lyms/platform/common/dao/BaseQuery.java
 - platform-dal/src/main/java/com/lyms/platform/pojo/MaternalDeliverModel.java
 - platform-dal/src/main/java/com/lyms/platform/query/MatDeliverQuery.java
 - platform-dal/src/main/java/com/lyms/platform/query/StopPregQuery.java
 - platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
 
platform-common/src/main/java/com/lyms/platform/common/dao/BaseQuery.java
View file @
293bab5
| ... | ... | @@ -34,11 +34,11 @@ | 
| 34 | 34 | |
| 35 | 35 | private int startNum; | 
| 36 | 36 | private int endNum; | 
| 37 | - | |
| 37 | +/* | |
| 38 | 38 | private Date startTimeStart; | 
| 39 | 39 | private Date startTimeEnd; | 
| 40 | 40 | private Date endTimeStart; | 
| 41 | - private Date endTimeEnd; | |
| 41 | + private Date endTimeEnd;*/ | |
| 42 | 42 | |
| 43 | 43 | public String getKeyword() { | 
| 44 | 44 | return keyword; | 
| 45 | 45 | |
| ... | ... | @@ -48,37 +48,7 @@ | 
| 48 | 48 | this.keyword = keyword; | 
| 49 | 49 | } | 
| 50 | 50 | |
| 51 | - public Date getStartTimeStart() { | |
| 52 | - return startTimeStart; | |
| 53 | - } | |
| 54 | 51 | |
| 55 | - public void setStartTimeStart(Date startTimeStart) { | |
| 56 | - this.startTimeStart = startTimeStart; | |
| 57 | - } | |
| 58 | - | |
| 59 | - public Date getStartTimeEnd() { | |
| 60 | - return startTimeEnd; | |
| 61 | - } | |
| 62 | - | |
| 63 | - public void setStartTimeEnd(Date startTimeEnd) { | |
| 64 | - this.startTimeEnd = startTimeEnd; | |
| 65 | - } | |
| 66 | - | |
| 67 | - public Date getEndTimeStart() { | |
| 68 | - return endTimeStart; | |
| 69 | - } | |
| 70 | - | |
| 71 | - public void setEndTimeStart(Date endTimeStart) { | |
| 72 | - this.endTimeStart = endTimeStart; | |
| 73 | - } | |
| 74 | - | |
| 75 | - public Date getEndTimeEnd() { | |
| 76 | - return endTimeEnd; | |
| 77 | - } | |
| 78 | - | |
| 79 | - public void setEndTimeEnd(Date endTimeEnd) { | |
| 80 | - this.endTimeEnd = endTimeEnd; | |
| 81 | - } | |
| 82 | 52 | |
| 83 | 53 | public int getCount() { | 
| 84 | 54 | return count; | 
platform-dal/src/main/java/com/lyms/platform/pojo/MaternalDeliverModel.java
View file @
293bab5
| ... | ... | @@ -21,6 +21,8 @@ | 
| 21 | 21 | private String pid; | 
| 22 | 22 | //分娩时间 | 
| 23 | 23 | private String dueDate; | 
| 24 | + | |
| 25 | + private Date dueDate1; | |
| 24 | 26 | //分娩孕周 | 
| 25 | 27 | private String dueWeek; | 
| 26 | 28 | //台数 | 
| ... | ... | @@ -109,6 +111,14 @@ | 
| 109 | 111 | |
| 110 | 112 | public void setHospitalId(String hospitalId) { | 
| 111 | 113 | this.hospitalId = hospitalId; | 
| 114 | + } | |
| 115 | + | |
| 116 | + public Date getDueDate1() { | |
| 117 | + return dueDate1; | |
| 118 | + } | |
| 119 | + | |
| 120 | + public void setDueDate1(Date dueDate1) { | |
| 121 | + this.dueDate1 = dueDate1; | |
| 112 | 122 | } | 
| 113 | 123 | |
| 114 | 124 | public Date getCreated() { | 
platform-dal/src/main/java/com/lyms/platform/query/MatDeliverQuery.java
View file @
293bab5
| ... | ... | @@ -5,13 +5,13 @@ | 
| 5 | 5 | import com.lyms.platform.common.dao.operator.MongoCondition; | 
| 6 | 6 | import com.lyms.platform.common.dao.operator.MongoOper; | 
| 7 | 7 | import com.lyms.platform.common.dao.operator.MongoQuery; | 
| 8 | +import org.springframework.data.mongodb.core.query.Criteria; | |
| 8 | 9 | |
| 9 | 10 | import java.util.Date; | 
| 10 | 11 | |
| 11 | 12 | /** | 
| 12 | - * | |
| 13 | 13 | * 产妇分娩记录查询 | 
| 14 | - * | |
| 14 | + * <p> | |
| 15 | 15 | * Created by Administrator on 2016/6/17 0017. | 
| 16 | 16 | */ | 
| 17 | 17 | public class MatDeliverQuery extends BaseQuery implements IConvertToNativeQuery { | 
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | |
| ... | ... | @@ -63,27 +63,48 @@ | 
| 63 | 63 | |
| 64 | 64 | @Override | 
| 65 | 65 | public MongoQuery convertToQuery() { | 
| 66 | - MongoCondition condition=MongoCondition.newInstance(); | |
| 67 | - if(null!=id){ | |
| 68 | - condition=condition.and("id",id, MongoOper.IS); | |
| 66 | + MongoCondition condition = MongoCondition.newInstance(); | |
| 67 | + if (null != id) { | |
| 68 | + condition = condition.and("id", id, MongoOper.IS); | |
| 69 | 69 | } | 
| 70 | - if(null!=pid){ | |
| 71 | - condition=condition.and("pid",pid, MongoOper.IS); | |
| 70 | + if (null != pid) { | |
| 71 | + condition = condition.and("pid", pid, MongoOper.IS); | |
| 72 | 72 | } | 
| 73 | - if(null!=vcCardNo){ | |
| 74 | - condition=condition.and("vcCardNo",vcCardNo,MongoOper.IS); | |
| 73 | + if (null != vcCardNo) { | |
| 74 | + condition = condition.and("vcCardNo", vcCardNo, MongoOper.IS); | |
| 75 | 75 | } | 
| 76 | - if(null!=dueDate){ | |
| 77 | - condition=condition.and("dueDate",dueDate,MongoOper.IS); | |
| 76 | + if (null != dueDate) { | |
| 77 | + condition = condition.and("dueDate", dueDate, MongoOper.IS); | |
| 78 | 78 | } | 
| 79 | - if(null!=cardNo) { | |
| 79 | + | |
| 80 | + | |
| 81 | + if (null != cardNo) { | |
| 80 | 82 | condition = condition.and("cardNo", cardNo, MongoOper.IS); | 
| 81 | 83 | } | 
| 82 | - if(null!=yn){ | |
| 84 | + if (null != yn) { | |
| 83 | 85 | condition = condition.and("yn", yn, MongoOper.IS); | 
| 84 | 86 | } | 
| 85 | - if(null!=parentId){ | |
| 87 | + if (null != parentId) { | |
| 86 | 88 | condition = condition.and("parentId", parentId, MongoOper.IS); | 
| 89 | + } | |
| 90 | + Criteria c = null; | |
| 91 | + | |
| 92 | + Boolean isAddStart = Boolean.FALSE; | |
| 93 | + | |
| 94 | + if (null != createdStart) { | |
| 95 | + c = Criteria.where("dueDate1").gte(createdStart); | |
| 96 | + isAddStart = Boolean.TRUE; | |
| 97 | + } | |
| 98 | + if (null != endStart) { | |
| 99 | + if (isAddStart) { | |
| 100 | + c = c.lte(endStart); | |
| 101 | + } else { | |
| 102 | + c = Criteria.where("dueDate1").lte(endStart); | |
| 103 | + } | |
| 104 | + isAddStart = Boolean.TRUE; | |
| 105 | + } | |
| 106 | + if (isAddStart) { | |
| 107 | + return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery(); | |
| 87 | 108 | } | 
| 88 | 109 | return condition.toMongoQuery(); | 
| 89 | 110 | } | 
platform-dal/src/main/java/com/lyms/platform/query/StopPregQuery.java
View file @
293bab5
| ... | ... | @@ -8,7 +8,9 @@ | 
| 8 | 8 | import com.lyms.platform.common.result.BaseModel; | 
| 9 | 9 | import org.bson.types.ObjectId; | 
| 10 | 10 | import org.springframework.data.mongodb.core.mapping.Document; | 
| 11 | +import org.springframework.data.mongodb.core.query.Criteria; | |
| 11 | 12 | |
| 13 | +import java.util.Date; | |
| 12 | 14 | import java.util.List; | 
| 13 | 15 | |
| 14 | 16 | /** | 
| 15 | 17 | |
| ... | ... | @@ -29,12 +31,30 @@ | 
| 29 | 31 | //终止妊娠日期 | 
| 30 | 32 | private String stopDate; | 
| 31 | 33 | |
| 34 | + private Date stopDateStart; | |
| 35 | + private Date stopDateEnd; | |
| 32 | 36 | //录入人 | 
| 33 | 37 | private String inPerson; | 
| 34 | 38 | |
| 35 | 39 | private Integer yn=-1; | 
| 36 | 40 | private String pid; | 
| 37 | 41 | |
| 42 | + public Date getStopDateEnd() { | |
| 43 | + return stopDateEnd; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public void setStopDateEnd(Date stopDateEnd) { | |
| 47 | + this.stopDateEnd = stopDateEnd; | |
| 48 | + } | |
| 49 | + | |
| 50 | + public Date getStopDateStart() { | |
| 51 | + return stopDateStart; | |
| 52 | + } | |
| 53 | + | |
| 54 | + public void setStopDateStart(Date stopDateStart) { | |
| 55 | + this.stopDateStart = stopDateStart; | |
| 56 | + } | |
| 57 | + | |
| 38 | 58 | @Override | 
| 39 | 59 | public MongoQuery convertToQuery() { | 
| 40 | 60 | MongoCondition condition = MongoCondition.newInstance(); | 
| ... | ... | @@ -50,6 +70,23 @@ | 
| 50 | 70 | } | 
| 51 | 71 | if (null!= pid) { | 
| 52 | 72 | condition = condition.and("pid", pid, MongoOper.IS); | 
| 73 | + } | |
| 74 | + Criteria c=null; | |
| 75 | + Boolean isAddStart = Boolean.FALSE; | |
| 76 | + if (null != stopDateStart) { | |
| 77 | + c = Criteria.where("stopDate").gte(stopDateStart); | |
| 78 | + isAddStart = Boolean.TRUE; | |
| 79 | + } | |
| 80 | + if (null != stopDateEnd) { | |
| 81 | + if (isAddStart) { | |
| 82 | + c = c.lte(stopDateEnd); | |
| 83 | + } else { | |
| 84 | + c = Criteria.where("stopDate").lte(stopDateEnd); | |
| 85 | + } | |
| 86 | + isAddStart = Boolean.TRUE; | |
| 87 | + } | |
| 88 | + if (isAddStart) { | |
| 89 | + return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery(); | |
| 53 | 90 | } | 
| 54 | 91 | return condition.toMongoQuery(); | 
| 55 | 92 | } | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
293bab5
| ... | ... | @@ -538,7 +538,9 @@ | 
| 538 | 538 | |
| 539 | 539 | MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); | 
| 540 | 540 | matDeliverQuery.setPid(patients.getPid()); | 
| 541 | - matDeliverQuery.setYn(YnEnums.YES.getId()); | |
| 541 | + matDeliverQuery.setCreatedStart(patients.getLastMenses()); | |
| 542 | +// matDeliverQuery.setYn(YnEnums.YES.getId()); | |
| 543 | +// matDeliverQuery.setspatients.getFmDate(); | |
| 542 | 544 | List<MaternalDeliverModel> list = matDeliverService.query(matDeliverQuery); | 
| 543 | 545 | MatDeliverListResult matDeliverListResult = new MatDeliverListResult(); | 
| 544 | 546 | matDeliverListResult.convertToResult(patients); | 
| 545 | 547 | |
| ... | ... | @@ -572,8 +574,9 @@ | 
| 572 | 574 | matDeliverListResult.setData(list12); | 
| 573 | 575 | } else { | 
| 574 | 576 | StopPregQuery stopPregQuery = new StopPregQuery(); | 
| 575 | - stopPregQuery.setYn(YnEnums.YES.getId()); | |
| 577 | +// stopPregQuery.setYn(YnEnums.YES.getId()); | |
| 576 | 578 | stopPregQuery.setPatientId(patients.getId()); | 
| 579 | + stopPregQuery.setStopDateStart(patients.getLastMenses()); | |
| 577 | 580 | List<StopPregModel> list2 = stopPregnancyService.queryStopPreg(stopPregQuery); | 
| 578 | 581 | if (CollectionUtils.isEmpty(list2)) { | 
| 579 | 582 | matDeliverListResult.setDueType("1"); |