diff --git a/platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java b/platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java index c95fa8c..3030473 100644 --- a/platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java +++ b/platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java @@ -174,6 +174,8 @@ public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery { private Integer buildType = -1; + private Integer buildTypeEq; + public Integer getBuildType() { return buildType; } @@ -182,6 +184,15 @@ public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery { this.buildType = buildType; } + + public Integer getBuildTypeEq() { + return buildTypeEq; + } + + public void setBuildTypeEq(Integer buildTypeEq) { + this.buildTypeEq = buildTypeEq; + } + public String getHcertificateNum() { return hcertificateNum; } @@ -440,6 +451,10 @@ public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery { if (buildType != -1) { condition = condition.and("buildType", buildType, MongoOper.NE); } + + if (buildTypeEq != null) { + condition = condition.and("buildType", buildTypeEq, MongoOper.IS); + } if (visitstatus != -1) { condition = condition.and("isVisit", visitstatus, MongoOper.IS); } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java index 37cf748..dbe6944 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java @@ -197,7 +197,7 @@ public class BabyBookbuildingFacade { { //查询儿童基本信息 PersonModelQuery personModelQuery = new PersonModelQuery(); - personModelQuery.setPhone(request.getMommyPhone()); +// personModelQuery.setPhone(request.getMommyPhone()); personModelQuery.setYn(YnEnums.YES.getId()); personModelQuery.setName(request.getBabyName()); personModelQuery.setType(2); @@ -256,12 +256,11 @@ public class BabyBookbuildingFacade { if (patients.getType() == 1) { //判断在儿童建档的时候,是否设置到这个儿童对应的孕妇 设置成产妇 - //计算规则 儿童生日 >= 孕妇预产期 + 24周 设置成分娩 (高帆 2016-08-04 17:34定) - Date dueDate = patients.getDueDate(); - if (dueDate != null && request.getBabyBirthday() != null) { + //计算规则 儿童生日 >= 孕妇末次月经 + 24周 设置成分娩 (高帆 2016-08-09 16:47定 ) + Date lastMenses = patients.getLastMenses(); + if (lastMenses != null && request.getBabyBirthday() != null) { Date brith = DateUtil.parseYMD(request.getBabyBirthday()); -// Date tempDate = DateUtil.addMonth(dueDate, -2); - Date tempDate = DateUtil.addWeek(dueDate, 24); + Date tempDate = DateUtil.addWeek(lastMenses, 24); if (brith.getTime() >= tempDate.getTime()) { //设置孕妇已分娩 Patients patientUpdate = new Patients(); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java index 1631fad..e8d9229 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java @@ -83,7 +83,8 @@ public class BookbuildingFacade { patientsQuery.setYn(YnEnums.YES.getId()); patientsQuery.setType(1); patientsQuery.setHospitalId(yunRequest.getHospitalId()); - patientsQuery.setBuildType(0); + patientsQuery.setBuildTypeEq(0); + patientsQuery.setDueStatus(0); if (yunRequest.getPregnantCertificateNum() != null) { @@ -797,7 +798,15 @@ public class BookbuildingFacade { List patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); if (CollectionUtils.isNotEmpty(patients)) { - pat = patients.get(0); + Patients vcCardNoPat = patients.get(0); + patientsQuery.setHospitalId(null); + patientsQuery.setVcCardNo(null); + patientsQuery.setCardNo(vcCardNoPat.getCardNo()); + List cardNoPat = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); + if (CollectionUtils.isNotEmpty(cardNoPat)) + { + pat = cardNoPat.get(0); + } } } BaseObjectResponse objectResponse = new BaseObjectResponse();