Commit 9e1dd3f7ca77fb839510337c47cc4722d8229ca7

Authored by jiangjiazhi
1 parent ad2642b9e6

1

Showing 19 changed files with 994 additions and 19 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/ISieveApplyOrderDao.java View file @ 9e1dd3f
... ... @@ -25,5 +25,12 @@
25 25 * @return
26 26 */
27 27 List<SieveApplyOrderModel> queryList(MongoQuery mongoQuery);
  28 +
  29 + /**
  30 + * 修改一条转诊信息
  31 + *
  32 + * @param sieveApplyOrderModel
  33 + */
  34 + void updateSieve(SieveApplyOrderModel sieveApplyOrderModel);
28 35 }
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/ISieveDao.java View file @ 9e1dd3f
  1 +package com.lyms.platform.biz.dal;
  2 +
  3 +import com.lyms.platform.common.dao.operator.MongoQuery;
  4 +import com.lyms.platform.pojo.SieveModel;
  5 +import com.lyms.platform.pojo.SieveResultModel;
  6 +
  7 +/**
  8 + * Created by Administrator on 2016/6/30 0030.
  9 + */
  10 +public interface ISieveDao {
  11 +
  12 + /**
  13 + * 增加产筛结果
  14 + *
  15 + * @param sieveResultModel
  16 + * @return
  17 + */
  18 + SieveResultModel addSieveResult(SieveResultModel sieveResultModel);
  19 +
  20 + /**
  21 + * 根据id查询产筛结果
  22 + *
  23 + * @param id
  24 + * @return
  25 + */
  26 + SieveResultModel findById(String id);
  27 +
  28 + /**
  29 + * 修改数据
  30 + */
  31 + void update(MongoQuery mongoQuery, SieveResultModel sieveResultModel);
  32 +
  33 + /**
  34 + * 修改产前诊断记录
  35 + *
  36 + * @param sieveModel
  37 + */
  38 + void updateChanQianSieve(SieveModel sieveModel);
  39 +
  40 + /**
  41 + * 增加产前记录
  42 + *
  43 + * @param sieveModel
  44 + */
  45 + void addChanQianSieve(SieveModel sieveModel);
  46 +
  47 +
  48 +}
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/SieveApplyOrderDaoImpl.java View file @ 9e1dd3f
... ... @@ -2,11 +2,15 @@
2 2  
3 3 import com.lyms.platform.biz.dal.ISieveApplyOrderDao;
4 4 import com.lyms.platform.common.dao.BaseMongoDAOImpl;
  5 +import com.lyms.platform.common.dao.operator.MongoCondition;
  6 +import com.lyms.platform.common.dao.operator.MongoOper;
5 7 import com.lyms.platform.common.dao.operator.MongoQuery;
  8 +import com.lyms.platform.common.enums.YnEnums;
6 9 import com.lyms.platform.pojo.ReferralApplyOrderModel;
7 10 import com.lyms.platform.pojo.SieveApplyOrderModel;
8 11 import org.springframework.stereotype.Repository;
9 12  
  13 +import java.util.Date;
10 14 import java.util.List;
11 15  
12 16 /**
13 17  
... ... @@ -19,12 +23,25 @@
19 23 public class SieveApplyOrderDaoImpl extends BaseMongoDAOImpl<SieveApplyOrderModel> implements ISieveApplyOrderDao {
20 24 @Override
21 25 public SieveApplyOrderModel addApplyOrder(SieveApplyOrderModel obj) {
  26 + obj.setStatus(0);
  27 + obj.setYn(YnEnums.YES.getId());
  28 + obj.setCreated(new Date());
  29 + obj.setModified(new Date());
22 30 return save(obj);
23 31 }
24 32  
25 33 @Override
26 34 public List<SieveApplyOrderModel> queryList(MongoQuery mongoQuery) {
27 35 return find(mongoQuery.convertToMongoQuery());
  36 + }
  37 +
  38 + /**
  39 + * 修改一条转诊信息
  40 + *
  41 + * @param sieveApplyOrderModel
  42 + */
  43 + public void updateSieve(SieveApplyOrderModel sieveApplyOrderModel){
  44 + update(new MongoQuery(new MongoCondition("id", sieveApplyOrderModel.getId(), MongoOper.IS)).convertToMongoQuery(), sieveApplyOrderModel);
28 45 }
29 46 }
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/SieveDaoImpl.java View file @ 9e1dd3f
  1 +package com.lyms.platform.biz.dal.impl;
  2 +
  3 +import com.lyms.platform.biz.dal.ISieveDao;
  4 +import com.lyms.platform.common.dao.BaseMongoDAOImpl;
  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.utils.MongoConvertHelper;
  9 +import com.lyms.platform.common.utils.ReflectionUtils;
  10 +import com.lyms.platform.pojo.SieveModel;
  11 +import com.lyms.platform.pojo.SieveResultModel;
  12 +import org.springframework.data.mongodb.core.query.Update;
  13 +import org.springframework.stereotype.Repository;
  14 +import org.springframework.util.Assert;
  15 +
  16 +/**
  17 + * Created by Administrator on 2016/6/30 0030.
  18 + */
  19 +@Repository("sieveDao")
  20 +public class SieveDaoImpl extends BaseMongoDAOImpl<SieveResultModel> implements ISieveDao {
  21 + @Override
  22 + public SieveResultModel addSieveResult(SieveResultModel sieveResultModel) {
  23 + return save(sieveResultModel);
  24 + }
  25 +
  26 + /**
  27 + * 根据id查询产筛结果
  28 + *
  29 + * @param id
  30 + * @return
  31 + */
  32 + public SieveResultModel findById(String id) {
  33 + return super.findById(id);
  34 + }
  35 +
  36 + /**
  37 + * 修改数据
  38 + */
  39 + public void update(MongoQuery mongoQuery, SieveResultModel sieveResultModel) {
  40 + update(mongoQuery.convertToMongoQuery(), sieveResultModel);
  41 + }
  42 +
  43 + public void updateChanQianSieve(SieveModel sieveModel) {
  44 + Update update = MongoConvertHelper
  45 + .convertToNativeUpdate(ReflectionUtils.getUpdateField(sieveModel));
  46 + Assert.notNull(update, "execute update method must not null.");
  47 + mongoTemplate.updateMulti(new MongoQuery(new MongoCondition("id", sieveModel.getId(), MongoOper.IS)).convertToMongoQuery(), update, SieveModel.class);
  48 + }
  49 + public void addChanQianSieve(SieveModel sieveModel){
  50 + Assert.notNull(sieveModel, "execute insert method must not null.");
  51 + mongoTemplate.insert(sieveModel);
  52 + }
  53 +}
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java View file @ 9e1dd3f
1 1 package com.lyms.platform.biz.service;
2 2  
  3 +import com.lyms.platform.biz.dal.IAntenatalExaminationDao;
3 4 import com.lyms.platform.biz.dal.IPatientDao;
4   -import com.lyms.platform.common.dao.operator.MongoCondition;
5   -import com.lyms.platform.common.dao.operator.MongoOper;
  5 +import com.lyms.platform.biz.dal.ISieveApplyOrderDao;
  6 +import com.lyms.platform.biz.dal.ISieveDao;
6 7 import com.lyms.platform.common.dao.operator.MongoQuery;
7   -import com.lyms.platform.common.dao.operator.Page;
  8 +import com.lyms.platform.common.enums.YnEnums;
  9 +import com.lyms.platform.common.utils.DateUtil;
  10 +import com.lyms.platform.common.utils.LogUtil;
  11 +import com.lyms.platform.pojo.AntenatalExaminationModel;
8 12 import com.lyms.platform.pojo.Patients;
9   -import com.lyms.platform.pojo.PuerperaModel;
  13 +import com.lyms.platform.pojo.SieveApplyOrderModel;
  14 +import com.lyms.platform.pojo.SieveModel;
  15 +import com.lyms.platform.query.AntExQuery;
10 16 import com.lyms.platform.query.PatientsQuery;
11   -import com.lyms.platform.query.PuerperaModelQuery;
  17 +import com.lyms.platform.query.SieveApplyOrderQuery;
12 18 import org.apache.commons.collections.CollectionUtils;
13 19 import org.apache.commons.lang.StringUtils;
  20 +import org.apache.commons.lang.math.NumberUtils;
14 21 import org.springframework.beans.factory.annotation.Autowired;
15 22 import org.springframework.data.domain.Sort;
16 23 import org.springframework.stereotype.Service;
17 24  
  25 +import java.util.ArrayList;
  26 +import java.util.Date;
18 27 import java.util.List;
19 28  
20 29 /**
21 30  
... ... @@ -23,8 +32,15 @@
23 32 @Service
24 33 public class PatientsService {
25 34  
  35 +
26 36 @Autowired
27 37 private IPatientDao iPatientDao;
  38 + @Autowired
  39 + private ISieveDao sieveDao;
  40 + @Autowired
  41 + private IAntenatalExaminationDao iAntenatalExaminationDao;
  42 + @Autowired
  43 + private ISieveApplyOrderDao iSieveApplyOrderDao;
28 44  
29 45 public Patients addPatient(Patients obj) {
30 46 return iPatientDao.addPatient(obj);
... ... @@ -45,7 +61,6 @@
45 61 }
46 62  
47 63  
48   -
49 64 public int queryPatientCount(PatientsQuery patientsQuery) {
50 65 return iPatientDao.queryPatientCount(patientsQuery.convertToQuery());
51 66 }
52 67  
... ... @@ -62,15 +77,112 @@
62 77 * @return
63 78 */
64 79 public Patients findOnePatientByCardNo(PatientsQuery puerperaQuery) {
65   - List<Patients> result = iPatientDao.queryPatient(puerperaQuery.convertToQuery());
66   - if(CollectionUtils.isNotEmpty(result)){
67   - return result.get(0);
  80 + List<Patients> result = iPatientDao.queryPatient(puerperaQuery.convertToQuery());
  81 + if (CollectionUtils.isNotEmpty(result)) {
  82 + return result.get(0);
68 83 }
69 84 return null;
70 85 }
71 86  
72 87 public Patients findOnePatientById(String id) {
73 88 return iPatientDao.getPatient(id);
  89 + }
  90 +
  91 + /**
  92 + * 满足孕15+3至20+6之间和有产筛申请单的数据
  93 + */
  94 + public void addSieveJob() {
  95 + //查询出满足15+3 20+6的孕妇
  96 + Date endDate = DateUtil.addDay(new Date(), -108);
  97 + Date start = DateUtil.addDay(new Date(), -146);
  98 + PatientsQuery patientsQuery = new PatientsQuery();
  99 + patientsQuery.setLastMensesEnd(endDate);
  100 + patientsQuery.setLastMensesStart(start);
  101 + patientsQuery.setYn(YnEnums.YES.getId());
  102 + List<Patients> patientses = iPatientDao.queryPatient(patientsQuery.convertToQuery());
  103 + int batchSize = 200;
  104 + if (CollectionUtils.isNotEmpty(patientses)) {
  105 + LogUtil.taskInfo("add sieve form patent job size:" + patientses.size());
  106 + int end = 0;
  107 + List<Patients> patient;
  108 + for (int i = 0; i < patientses.size(); ) {
  109 + end = i + batchSize;
  110 + if (end > patientses.size()) {
  111 + end = patientses
  112 + .size();
  113 + }
  114 + patient = patientses.subList(i, end);
  115 + i += batchSize;
  116 + new Thread(new PatientWorker(patient)).start();
  117 + }
  118 + }
  119 + SieveApplyOrderQuery sieveApplyOrderQuery = new SieveApplyOrderQuery();
  120 + sieveApplyOrderQuery.setStatus(0);
  121 + sieveApplyOrderQuery.setYn(YnEnums.YES.getId());
  122 + //查询转诊申请单
  123 + List<SieveApplyOrderModel> list = iSieveApplyOrderDao.queryList(sieveApplyOrderQuery.convertToQuery());
  124 + if (CollectionUtils.isNotEmpty(list)) {
  125 + List<String> idList = new ArrayList<>();
  126 + for (SieveApplyOrderModel orderModel : list) {
  127 + if (null != orderModel.getParentId()) {
  128 + Patients patients= iPatientDao.getPatient(orderModel.getId());
  129 + if(null!=patients){
  130 + SieveModel sieveModel = convertToModel(patients);
  131 + sieveDao.addChanQianSieve(sieveModel);
  132 + }
  133 + idList.add(orderModel.getId());
  134 + }
  135 + }
  136 + SieveApplyOrderModel sieveApplyOrderModel=new SieveApplyOrderModel();
  137 + sieveApplyOrderModel.setStatus(1);
  138 + for(String str:idList){
  139 + sieveApplyOrderModel.setId(str);
  140 + sieveApplyOrderModel.setModified(new Date());
  141 + iSieveApplyOrderDao.updateSieve(sieveApplyOrderModel);
  142 + }
  143 + }
  144 + }
  145 +
  146 + private SieveModel convertToModel(Patients patients) {
  147 + SieveModel sieveModel = new SieveModel();
  148 + sieveModel.setParentId(patients.getId());
  149 + sieveModel.setLastMenses(patients.getLastMenses());
  150 + int days = DateUtil.daysBetween(patients.getLastMenses(), new Date());
  151 + String week = (days / 7) + "";
  152 + int day = (days % 7);
  153 + String dueWeek = "孕" + week + "周" + (day > 0 ? "+" + day + "天" : "");
  154 + sieveModel.setDueWeek(dueWeek);
  155 + AntExQuery antExQuery = new AntExQuery();
  156 + antExQuery.setYn(YnEnums.YES.getId());
  157 + antExQuery.setNeed("1");
  158 + antExQuery.setPage(1);
  159 + antExQuery.setLimit(1);
  160 + List<AntenatalExaminationModel> list = iAntenatalExaminationDao.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created"));
  161 + if (CollectionUtils.isNotEmpty(list)) {
  162 + sieveModel.setTireNumber(NumberUtils.toInt(list.get(0).getTireNumber()));
  163 + }
  164 + sieveModel.setPhone(patients.getPhone());
  165 + return sieveModel;
  166 + }
  167 +
  168 + private class PatientWorker extends Thread {
  169 + private List<Patients> patientses;
  170 + private long startTime;
  171 +
  172 + private PatientWorker(List<Patients> patientses) {
  173 + this.patientses = patientses;
  174 + startTime = System.currentTimeMillis();
  175 + }
  176 +
  177 + @Override
  178 + public void run() {
  179 + LogUtil.taskInfo("add sieve PatientWorker job :" + getName() + " start.");
  180 + for (Patients patient : patientses) {
  181 + SieveModel sieveModel = convertToModel(patient);
  182 + sieveDao.addChanQianSieve(sieveModel);
  183 + }
  184 + LogUtil.taskInfo("add sieve PatientWorker job :" + getName() + " end.costTime :" + (System.currentTimeMillis() - startTime) + " ms.");
  185 + }
74 186 }
75 187 }
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/SieveService.java View file @ 9e1dd3f
  1 +package com.lyms.platform.biz.service;
  2 +
  3 +import com.lyms.platform.biz.dal.ISieveDao;
  4 +import com.lyms.platform.common.enums.YnEnums;
  5 +import com.lyms.platform.pojo.SieveModel;
  6 +import com.lyms.platform.pojo.SieveResultModel;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.stereotype.Service;
  9 +
  10 +import java.util.Date;
  11 +
  12 +/**
  13 + * Created by Administrator on 2016/6/30 0030.
  14 + */
  15 +@Service
  16 +public class SieveService {
  17 +
  18 + @Autowired
  19 + private ISieveDao iSieveDao;
  20 +
  21 + public SieveResultModel addSieve(SieveResultModel obj){
  22 + obj.setModified(new Date());
  23 + obj.setCreated(new Date());
  24 + obj.setYn(YnEnums.YES.getId());
  25 + return iSieveDao.addSieveResult(obj);
  26 + }
  27 +
  28 + public SieveResultModel findById(String id){
  29 + return iSieveDao.findById(id);
  30 + }
  31 +
  32 +
  33 + public void updateOneChanQianDiaSieve(SieveModel sieveModel){
  34 + sieveModel.setModified(new Date());
  35 + iSieveDao.updateChanQianSieve(sieveModel);
  36 + }
  37 + public void addChanQianSieve(SieveModel sieveModel){
  38 + sieveModel.setModified(new Date());
  39 + sieveModel.setCreated(new Date());
  40 + sieveModel.setYn(YnEnums.YES.getId());
  41 + iSieveDao.addChanQianSieve(sieveModel);
  42 + }
  43 +}
platform-common/src/main/java/com/lyms/platform/common/Test.java View file @ 9e1dd3f
1 1 package com.lyms.platform.common;
2 2  
  3 +import com.lyms.platform.common.utils.MessageUtil;
  4 +import org.apache.commons.httpclient.HttpClient;
  5 +import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
  6 +import org.apache.commons.httpclient.methods.PostMethod;
  7 +
3 8 public class Test {
4 9 public static void main(String[] args) {
5   -// String s="[{\"functionCode\": null,\"id\": 83,\"moduleName\": \"平台管理-医院管理\"+","+\"action\": \"View\"+","+"\"permissionName\": \"查看\",+";
6   - /* "moduleCode": null,+
7   - "functionName": "床位类型管理",+
8   - "ext": "/v1/sickbedTypes}]";*/
9   -// System.out.println(s);
  10 + String s ="<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:tem=\"http://tempuri.org/\">\n" +
  11 + " <soapenv:Header/>\n" +
  12 + " <soapenv:Body>\n" +
  13 + " <tem:EditChildMesage>\n" +
  14 + " <!--Optional:-->\n" +
  15 + " <tem:H_ID>1</tem:H_ID>\n" +
  16 + " <!--Optional:-->\n" +
  17 + " <tem:Child_ID>1</tem:Child_ID>\n" +
  18 + " <!--Optional:-->\n" +
  19 + " <tem:Child_Name>测试</tem:Child_Name>\n" +
  20 + " <!--Optional:-->\n" +
  21 + " <tem:Oper_Name>测试1</tem:Oper_Name>\n" +
  22 + " </tem:EditChildMesage>\n" +
  23 + " </soapenv:Body>\n" +
  24 + "</soapenv:Envelope>";
  25 + System.out.print(s);
  26 + HttpClient httpClient=new HttpClient();
  27 + PostMethod post = new MessageUtil.UTF8PostMethod("http://119.90.43.70:8090/WCFAPPService.svc");
  28 + post.setRequestEntity(new ByteArrayRequestEntity(s.getBytes()));
  29 + post.setRequestHeader("Content-Type", "text/xml;charset=utf-8");
  30 + post.setRequestHeader("SOAPAction","http://tempuri.org/IAppWCFService/EditChildMesage");
  31 + try {
  32 + httpClient.executeMethod(post);
  33 + String result = new String(post.getResponseBodyAsString());
  34 + System.out.print("register result : " + result);
  35 + }catch (Exception e){
  36 +
  37 + }
10 38 }
11 39 }
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java View file @ 9e1dd3f
... ... @@ -461,8 +461,10 @@
461 461 // System.out.println(getDaySeconds());
462 462  
463 463 int s = getBabyAgeMonth(parseYMD("2016-05-26"), new Date());
464   -
465   - System.out.println(getBabyAgeMonth(parseYMD("2016-05-23"), new Date()));
  464 + SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd ");
  465 +// System.out.println(getBabyAgeMonth(parseYMD("2016-05-23"), new Date()));
  466 + System.out.println(DateUtil.getyyyy_MM_dd_hms(DateUtil.addDay(new Date(),-108)));
  467 + System.out.println(DateUtil.getyyyy_MM_dd_hms(DateUtil.addDay(new Date(), -146)));
466 468 // System.out.print(1457688652-23341);
467 469 //1457711993
468 470 // 1426089600
platform-dal/src/main/java/com/lyms/platform/pojo/SieveApplyOrderModel.java View file @ 9e1dd3f
... ... @@ -22,6 +22,35 @@
22 22 private String checkDate;
23 23 //申请医生
24 24 private String applyDoctor;
  25 + //标识是否同步过数据
  26 + private Integer status;
  27 + private Integer yn;
  28 +
  29 + private Date modified;
  30 +
  31 + public Date getModified() {
  32 + return modified;
  33 + }
  34 +
  35 + public void setModified(Date modified) {
  36 + this.modified = modified;
  37 + }
  38 +
  39 + public Integer getYn() {
  40 + return yn;
  41 + }
  42 +
  43 + public void setYn(Integer yn) {
  44 + this.yn = yn;
  45 + }
  46 +
  47 + public Integer getStatus() {
  48 + return status;
  49 + }
  50 +
  51 + public void setStatus(Integer status) {
  52 + this.status = status;
  53 + }
25 54  
26 55 public Date getCreated() {
27 56 return created;
platform-dal/src/main/java/com/lyms/platform/pojo/SieveModel.java View file @ 9e1dd3f
... ... @@ -7,7 +7,7 @@
7 7  
8 8 /**
9 9 * 产前筛查
10   - *
  10 + * <p>
11 11 * Created by Administrator on 2016/6/29 0029.
12 12 */
13 13 @Document(collection = "lyms_sieve")
14 14  
... ... @@ -34,7 +34,152 @@
34 34 private String cqResult;
35 35 //妊娠结局
36 36 private String renShenResult;
  37 +
  38 + // 诊断时间
  39 + private String diaTime;
  40 + //诊断单位
  41 + private String diaUnit;
  42 + //录入人员
  43 + private String publishName;
  44 +
37 45 private Date created;
38 46 private Date modified;
  47 + private Integer yn;
  48 +
  49 + public Integer getYn() {
  50 + return yn;
  51 + }
  52 +
  53 + public void setYn(Integer yn) {
  54 + this.yn = yn;
  55 + }
  56 +
  57 + public String getCqResult() {
  58 + return cqResult;
  59 + }
  60 +
  61 + public void setCqResult(String cqResult) {
  62 + this.cqResult = cqResult;
  63 + }
  64 +
  65 + public Integer getCqStatus() {
  66 + return cqStatus;
  67 + }
  68 +
  69 + public void setCqStatus(Integer cqStatus) {
  70 + this.cqStatus = cqStatus;
  71 + }
  72 +
  73 + public Date getCreated() {
  74 + return created;
  75 + }
  76 +
  77 + public void setCreated(Date created) {
  78 + this.created = created;
  79 + }
  80 +
  81 + public String getDiaTime() {
  82 + return diaTime;
  83 + }
  84 +
  85 + public void setDiaTime(String diaTime) {
  86 + this.diaTime = diaTime;
  87 + }
  88 +
  89 + public String getDiaUnit() {
  90 + return diaUnit;
  91 + }
  92 +
  93 + public void setDiaUnit(String diaUnit) {
  94 + this.diaUnit = diaUnit;
  95 + }
  96 +
  97 + public String getDueWeek() {
  98 + return dueWeek;
  99 + }
  100 +
  101 + public void setDueWeek(String dueWeek) {
  102 + this.dueWeek = dueWeek;
  103 + }
  104 +
  105 + public String getId() {
  106 + return id;
  107 + }
  108 +
  109 + public void setId(String id) {
  110 + this.id = id;
  111 + }
  112 +
  113 + public Date getLastMenses() {
  114 + return lastMenses;
  115 + }
  116 +
  117 + public void setLastMenses(Date lastMenses) {
  118 + this.lastMenses = lastMenses;
  119 + }
  120 +
  121 + public Date getModified() {
  122 + return modified;
  123 + }
  124 +
  125 + public void setModified(Date modified) {
  126 + this.modified = modified;
  127 + }
  128 +
  129 + public String getName() {
  130 + return name;
  131 + }
  132 +
  133 + public void setName(String name) {
  134 + this.name = name;
  135 + }
  136 +
  137 + public String getParentId() {
  138 + return parentId;
  139 + }
  140 +
  141 + public void setParentId(String parentId) {
  142 + this.parentId = parentId;
  143 + }
  144 +
  145 + public String getPhone() {
  146 + return phone;
  147 + }
  148 +
  149 + public void setPhone(String phone) {
  150 + this.phone = phone;
  151 + }
  152 +
  153 + public String getPublishName() {
  154 + return publishName;
  155 + }
  156 +
  157 + public void setPublishName(String publishName) {
  158 + this.publishName = publishName;
  159 + }
  160 +
  161 + public String getRenShenResult() {
  162 + return renShenResult;
  163 + }
  164 +
  165 + public void setRenShenResult(String renShenResult) {
  166 + this.renShenResult = renShenResult;
  167 + }
  168 +
  169 + public Integer getTireNumber() {
  170 + return tireNumber;
  171 + }
  172 +
  173 + public void setTireNumber(Integer tireNumber) {
  174 + this.tireNumber = tireNumber;
  175 + }
  176 +
  177 + public Integer getZtfx() {
  178 + return ztfx;
  179 + }
  180 +
  181 + public void setZtfx(Integer ztfx) {
  182 + this.ztfx = ztfx;
  183 + }
39 184 }
platform-dal/src/main/java/com/lyms/platform/pojo/SieveResultModel.java View file @ 9e1dd3f
  1 +package com.lyms.platform.pojo;
  2 +
  3 +import com.lyms.platform.common.result.BaseModel;
  4 +import org.springframework.data.mongodb.core.mapping.Document;
  5 +
  6 +import java.util.Date;
  7 +
  8 +/**
  9 + * 产筛结果
  10 + * <p>
  11 + * Created by Administrator on 2016/6/29 0029.
  12 + */
  13 +@Document(collection = "lyms_sieveresult")
  14 +public class SieveResultModel extends BaseModel {
  15 + private String id;
  16 + private String parentId;
  17 +
  18 + private String tszhz;// 唐氏综合症
  19 + private String sjgjx;// 神经管畸形
  20 + private String sbst;// 18-三体
  21 + private String dzhpx;// 地中海贫血
  22 + private String cspj;// 产筛评价
  23 + //录入人员
  24 + private String publishName;
  25 +
  26 +
  27 + private Integer yn;
  28 + private Date created;
  29 + private Date modified;
  30 +
  31 + public Integer getYn() {
  32 + return yn;
  33 + }
  34 +
  35 + public void setYn(Integer yn) {
  36 + this.yn = yn;
  37 + }
  38 +
  39 + public Date getCreated() {
  40 + return created;
  41 + }
  42 +
  43 + public void setCreated(Date created) {
  44 + this.created = created;
  45 + }
  46 +
  47 + public String getCspj() {
  48 + return cspj;
  49 + }
  50 +
  51 + public void setCspj(String cspj) {
  52 + this.cspj = cspj;
  53 + }
  54 +
  55 + public String getDzhpx() {
  56 + return dzhpx;
  57 + }
  58 +
  59 + public void setDzhpx(String dzhpx) {
  60 + this.dzhpx = dzhpx;
  61 + }
  62 +
  63 + public String getId() {
  64 + return id;
  65 + }
  66 +
  67 + public void setId(String id) {
  68 + this.id = id;
  69 + }
  70 +
  71 + public Date getModified() {
  72 + return modified;
  73 + }
  74 +
  75 + public void setModified(Date modified) {
  76 + this.modified = modified;
  77 + }
  78 +
  79 + public String getParentId() {
  80 + return parentId;
  81 + }
  82 +
  83 + public void setParentId(String parentId) {
  84 + this.parentId = parentId;
  85 + }
  86 +
  87 + public String getPublishName() {
  88 + return publishName;
  89 + }
  90 +
  91 + public void setPublishName(String publishName) {
  92 + this.publishName = publishName;
  93 + }
  94 +
  95 + public String getSbst() {
  96 + return sbst;
  97 + }
  98 +
  99 + public void setSbst(String sbst) {
  100 + this.sbst = sbst;
  101 + }
  102 +
  103 + public String getSjgjx() {
  104 + return sjgjx;
  105 + }
  106 +
  107 + public void setSjgjx(String sjgjx) {
  108 + this.sjgjx = sjgjx;
  109 + }
  110 +
  111 + public String getTszhz() {
  112 + return tszhz;
  113 + }
  114 +
  115 + public void setTszhz(String tszhz) {
  116 + this.tszhz = tszhz;
  117 + }
  118 +}
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java View file @ 9e1dd3f
... ... @@ -61,8 +61,17 @@
61 61 private Date dueDateStart;
62 62  
63 63 private Date dueDateEnd;
  64 + /**
  65 + * 末次月经
  66 + */
  67 + private Date lastMensesStart;
64 68  
65 69 /**
  70 + * 末次月经
  71 + */
  72 + private Date lastMensesEnd;
  73 +
  74 + /**
66 75 * 地址
67 76 */
68 77 private String address;
... ... @@ -120,6 +129,22 @@
120 129  
121 130 private Integer hospitalId;
122 131  
  132 + public Date getLastMensesEnd() {
  133 + return lastMensesEnd;
  134 + }
  135 +
  136 + public void setLastMensesEnd(Date lastMensesEnd) {
  137 + this.lastMensesEnd = lastMensesEnd;
  138 + }
  139 +
  140 + public Date getLastMensesStart() {
  141 + return lastMensesStart;
  142 + }
  143 +
  144 + public void setLastMensesStart(Date lastMensesStart) {
  145 + this.lastMensesStart = lastMensesStart;
  146 + }
  147 +
123 148 public Integer getHospitalId() {
124 149 return hospitalId;
125 150 }
126 151  
... ... @@ -403,9 +428,23 @@
403 428 if (-1 != type) {
404 429 condition = condition.and("type", type, MongoOper.IS);
405 430 }
406   -
407 431 boolean isAddStart = Boolean.FALSE;
408 432 Criteria c = null;
  433 + if(null!=lastMensesStart){
  434 + c = Criteria.where("lastMenses").gte(dueDateStart);
  435 + isAddStart = Boolean.TRUE;
  436 + }
  437 + if (null != lastMensesStart) {
  438 + if (isAddStart) {
  439 + c = c.lte(lastMensesStart);
  440 + } else {
  441 + c = Criteria.where("lastMenses").lte(lastMensesStart);
  442 + }
  443 + isAddStart = Boolean.TRUE;
  444 + }
  445 + if (isAddStart) {
  446 + return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery();
  447 + }
409 448 if (null != dueDateStart) {
410 449 c = Criteria.where("dueDate").gte(dueDateStart);
411 450 isAddStart = Boolean.TRUE;
platform-dal/src/main/java/com/lyms/platform/query/SieveApplyOrderQuery.java View file @ 9e1dd3f
... ... @@ -13,9 +13,52 @@
13 13  
14 14 private String parentId;
15 15  
  16 + private Integer status;
  17 +
  18 + private Integer yn;
  19 +
  20 + private String id;
  21 +
  22 + public String getId() {
  23 + return id;
  24 + }
  25 +
  26 + public void setId(String id) {
  27 + this.id = id;
  28 + }
  29 +
  30 + public Integer getStatus() {
  31 + return status;
  32 + }
  33 +
  34 + public void setStatus(Integer status) {
  35 + this.status = status;
  36 + }
  37 +
  38 + public Integer getYn() {
  39 + return yn;
  40 + }
  41 +
  42 + public void setYn(Integer yn) {
  43 + this.yn = yn;
  44 + }
  45 +
16 46 @Override
17 47 public MongoQuery convertToQuery() {
18   - MongoCondition condition = MongoCondition.newInstance("parentId",parentId, MongoOper.IS);
  48 + MongoCondition condition = MongoCondition.newInstance();
  49 + if(null!=parentId){
  50 + condition= condition.and("parentId",parentId, MongoOper.IS);
  51 + }
  52 + if(null!=yn){
  53 + condition= condition.and("yn",yn, MongoOper.IS);
  54 + }
  55 + if(null!=status){
  56 + condition= condition.and("status",status, MongoOper.IS);
  57 + }
  58 + if(null!=id){
  59 + condition= condition.and("id",id, MongoOper.IS);
  60 + }
  61 +
19 62 return condition.toMongoQuery();
20 63 }
21 64  
platform-data-api/src/main/java/com/lyms/platform/data/controller/TaskController.java View file @ 9e1dd3f
1 1 package com.lyms.platform.data.controller;
2 2  
3 3 import com.lyms.platform.biz.service.BasicConfigService;
  4 +import com.lyms.platform.biz.service.PatientsService;
4 5 import com.lyms.platform.data.service.DataImportTaskService;
5 6 import com.lyms.platform.pojo.BasicConfig;
  7 +import com.lyms.platform.pojo.Patients;
6 8 import com.lyms.platform.query.BasicConfigQuery;
7 9 import org.apache.commons.io.FileUtils;
8 10 import org.apache.commons.lang.StringUtils;
... ... @@ -31,6 +33,8 @@
31 33  
32 34 @Autowired
33 35 private BasicConfigService basicConfigService;
  36 + @Autowired
  37 + private PatientsService patientsService;
34 38  
35 39  
36 40 @RequestMapping(value = "/index")
... ... @@ -103,6 +107,8 @@
103 107 e.printStackTrace();
104 108 }
105 109 writeString(response, "success");
  110 + }else if("addSieveJob".equals(sid)){
  111 + patientsService.addSieveJob();
106 112 }
107 113  
108 114 else {
platform-data-api/src/main/webapp/WEB-INF/vm/task/index.vm View file @ 9e1dd3f
... ... @@ -49,6 +49,14 @@
49 49 <button class="btn btn-sm btn-danger" onclick="execOne('updateCommunity')">执行</button>
50 50 </td>
51 51 </tr>
  52 + <tr>
  53 + <td>产前筛查患者数据</td>
  54 + <td></td>
  55 + <td>无</td>
  56 + <td>
  57 + <button class="btn btn-sm btn-danger" onclick="execOne('addSieveJob')">执行</button>
  58 + </td>
  59 + </tr>
52 60 </table>
53 61  
54 62 <script>
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SieveController.java View file @ 9e1dd3f
  1 +package com.lyms.platform.operate.web.controller;
  2 +
  3 +import com.lyms.platform.common.result.BaseResponse;
  4 +import com.lyms.platform.operate.web.facade.SieveFacade;
  5 +import com.lyms.platform.operate.web.request.ChanQianDiaAddRequest;
  6 +import com.lyms.platform.operate.web.request.SieveAddRequest;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.stereotype.Controller;
  9 +import org.springframework.web.bind.annotation.RequestBody;
  10 +
  11 +import javax.validation.Valid;
  12 +
  13 +/**
  14 + * 产筛接口
  15 + * <p>
  16 + * Created by Administrator on 2016/6/29 0029.
  17 + */
  18 +@Controller
  19 +public class SieveController {
  20 + @Autowired
  21 + private SieveFacade sieveFacade;
  22 +
  23 + /**
  24 + * 增加一条产筛结果记录
  25 + *
  26 + * @param sieveAddRequest
  27 + * @return
  28 + */
  29 + public BaseResponse addOneSieve(@RequestBody @Valid SieveAddRequest sieveAddRequest) {
  30 + return sieveFacade.addOneSieve(sieveAddRequest);
  31 + }
  32 +
  33 + /**
  34 + * 产前诊断
  35 + *
  36 + * @param chanQianDiaAddRequest
  37 + * @return
  38 + */
  39 + public BaseResponse addOneChanQianDiaSieve(@RequestBody @Valid ChanQianDiaAddRequest chanQianDiaAddRequest) {
  40 + return sieveFacade.addOneChanQianDiaSieve(chanQianDiaAddRequest);
  41 + }
  42 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SieveFacade.java View file @ 9e1dd3f
  1 +package com.lyms.platform.operate.web.facade;
  2 +
  3 +import com.lyms.platform.biz.service.SieveService;
  4 +import com.lyms.platform.common.constants.ErrorCodeConstants;
  5 +import com.lyms.platform.common.result.BaseResponse;
  6 +import com.lyms.platform.operate.web.request.ChanQianDiaAddRequest;
  7 +import com.lyms.platform.operate.web.request.SieveAddRequest;
  8 +import com.lyms.platform.pojo.SieveModel;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.stereotype.Component;
  11 +
  12 +/**
  13 + * 产筛门面
  14 + *
  15 + * Created by Administrator on 2016/6/30 0030.
  16 + */
  17 +@Component
  18 +public class SieveFacade {
  19 + @Autowired
  20 + private SieveService sieveService;
  21 +
  22 + /**
  23 + * 增加一条产筛结果记录
  24 + *
  25 + * @param sieveAddRequest
  26 + * @return
  27 + */
  28 + public BaseResponse addOneSieve(SieveAddRequest sieveAddRequest){
  29 + sieveService.addSieve(sieveAddRequest.convertToDataModel());
  30 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  31 + }
  32 +
  33 + /**
  34 + * 产前诊断
  35 + *
  36 + * @param chanQianDiaAddRequest
  37 + *
  38 + * @return
  39 + */
  40 + public BaseResponse addOneChanQianDiaSieve(ChanQianDiaAddRequest chanQianDiaAddRequest) {
  41 + SieveModel sieveModel=new SieveModel();
  42 + sieveModel.setId(chanQianDiaAddRequest.getId());
  43 + sieveModel.setPublishName(chanQianDiaAddRequest.getPublishName());
  44 + sieveModel.setDiaTime(chanQianDiaAddRequest.getDiaTime());
  45 + sieveModel.setDiaUnit(chanQianDiaAddRequest.getDiaUnit());
  46 + sieveModel.setCqResult(chanQianDiaAddRequest.getDiaresult());
  47 + sieveModel.setRenShenResult(chanQianDiaAddRequest.getPregnancyOutcome());
  48 + sieveService.updateOneChanQianDiaSieve(sieveModel);
  49 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  50 + }
  51 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ChanQianDiaAddRequest.java View file @ 9e1dd3f
  1 +package com.lyms.platform.operate.web.request;
  2 +
  3 +import com.lyms.platform.common.core.annotation.form.FormParam;
  4 +import com.lyms.platform.common.core.annotation.form.Form;
  5 +import org.hibernate.validator.constraints.NotEmpty;
  6 +
  7 +/**
  8 + * 产前诊断结果
  9 + * Created by Administrator on 2016/6/29 0029.
  10 + */
  11 +@Form
  12 +public class ChanQianDiaAddRequest {
  13 + @NotEmpty
  14 + private String id;
  15 + @FormParam
  16 + private String diaTime;// 诊断时间
  17 + @FormParam
  18 + private String diaUnit;// 诊断单位
  19 + @FormParam
  20 + private String diaresult;//诊断结果
  21 + @FormParam
  22 + private String pregnancyOutcome;// 妊娠结局
  23 + @FormParam
  24 + private String publishName;// 录入人员;
  25 +
  26 + public String getDiaresult() {
  27 + return diaresult;
  28 + }
  29 +
  30 + public void setDiaresult(String diaresult) {
  31 + this.diaresult = diaresult;
  32 + }
  33 +
  34 + public String getDiaTime() {
  35 + return diaTime;
  36 + }
  37 +
  38 + public void setDiaTime(String diaTime) {
  39 + this.diaTime = diaTime;
  40 + }
  41 +
  42 + public String getDiaUnit() {
  43 + return diaUnit;
  44 + }
  45 +
  46 + public void setDiaUnit(String diaUnit) {
  47 + this.diaUnit = diaUnit;
  48 + }
  49 +
  50 + public String getId() {
  51 + return id;
  52 + }
  53 +
  54 + public void setId(String id) {
  55 + this.id = id;
  56 + }
  57 +
  58 +
  59 +
  60 + public String getPregnancyOutcome() {
  61 + return pregnancyOutcome;
  62 + }
  63 +
  64 + public void setPregnancyOutcome(String pregnancyOutcome) {
  65 + this.pregnancyOutcome = pregnancyOutcome;
  66 + }
  67 +
  68 + public String getPublishName() {
  69 + return publishName;
  70 + }
  71 +
  72 + public void setPublishName(String publishName) {
  73 + this.publishName = publishName;
  74 + }
  75 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/SieveAddRequest.java View file @ 9e1dd3f
  1 +package com.lyms.platform.operate.web.request;
  2 +
  3 +import com.lyms.platform.common.base.IBasicRequestConvert;
  4 +import com.lyms.platform.pojo.SieveModel;
  5 +import com.lyms.platform.pojo.SieveResultModel;
  6 +
  7 +/**
  8 + * 增加产筛结果
  9 + *
  10 + * Created by Administrator on 2016/6/29 0029.
  11 + */
  12 +public class SieveAddRequest implements IBasicRequestConvert<SieveResultModel> {
  13 +
  14 + private String id;
  15 + private String parentId;
  16 +
  17 + private String tszhz;// 唐氏综合症
  18 + private String sjgjx;// 神经管畸形
  19 + private String sbst;// 18-三体
  20 + private String dzhpx;// 地中海贫血
  21 + private String cspj;// 产筛评价
  22 + //录入人员
  23 + private String publishName;
  24 +
  25 + public String getCspj() {
  26 + return cspj;
  27 + }
  28 +
  29 + public void setCspj(String cspj) {
  30 + this.cspj = cspj;
  31 + }
  32 +
  33 + public String getDzhpx() {
  34 + return dzhpx;
  35 + }
  36 +
  37 + public void setDzhpx(String dzhpx) {
  38 + this.dzhpx = dzhpx;
  39 + }
  40 +
  41 + public String getId() {
  42 + return id;
  43 + }
  44 +
  45 + public void setId(String id) {
  46 + this.id = id;
  47 + }
  48 +
  49 + public String getParentId() {
  50 + return parentId;
  51 + }
  52 +
  53 + public void setParentId(String parentId) {
  54 + this.parentId = parentId;
  55 + }
  56 +
  57 + public String getPublishName() {
  58 + return publishName;
  59 + }
  60 +
  61 + public void setPublishName(String publishName) {
  62 + this.publishName = publishName;
  63 + }
  64 +
  65 + public String getSbst() {
  66 + return sbst;
  67 + }
  68 +
  69 + public void setSbst(String sbst) {
  70 + this.sbst = sbst;
  71 + }
  72 +
  73 + public String getSjgjx() {
  74 + return sjgjx;
  75 + }
  76 +
  77 + public void setSjgjx(String sjgjx) {
  78 + this.sjgjx = sjgjx;
  79 + }
  80 +
  81 + public String getTszhz() {
  82 + return tszhz;
  83 + }
  84 +
  85 + public void setTszhz(String tszhz) {
  86 + this.tszhz = tszhz;
  87 + }
  88 +
  89 + @Override
  90 + public SieveResultModel convertToDataModel() {
  91 + /* private String tszhz;// 唐氏综合症
  92 + private String sjgjx;// 神经管畸形
  93 + private String sbst;// 18-三体
  94 + private String dzhpx;// 地中海贫血
  95 + private String cspj;// 产筛评价
  96 + //录入人员
  97 + private String publishName;*/
  98 + SieveResultModel sieveModel=new SieveResultModel();
  99 + sieveModel.setParentId(parentId);
  100 + sieveModel.setId(id);
  101 + sieveModel.setTszhz(tszhz);
  102 + sieveModel.setSjgjx(sjgjx);
  103 + sieveModel.setSbst(sbst);
  104 + sieveModel.setDzhpx(dzhpx);
  105 + sieveModel.setCspj(cspj);
  106 + sieveModel.setPublishName(publishName);
  107 + return sieveModel;
  108 + }
  109 +}