Commit ad8d95d42679b18675002842cad8e72eb2cb7730

Authored by liquanyu
1 parent b4887a0676

荣成接口

Showing 7 changed files with 575 additions and 21 deletions

platform-dal/src/main/java/com/lyms/platform/query/AntExRecordQuery.java View file @ ad8d95d
... ... @@ -65,6 +65,9 @@
65 65 private Integer type;
66 66 private String neqId;
67 67  
  68 +
  69 + private Date modifiedStart;
  70 + private Date modifiedEnd;
68 71 //处理意见
69 72 private String treatOpinion;
70 73  
... ... @@ -234,6 +237,22 @@
234 237 return birthStart;
235 238 }
236 239  
  240 + public Date getModifiedStart() {
  241 + return modifiedStart;
  242 + }
  243 +
  244 + public void setModifiedStart(Date modifiedStart) {
  245 + this.modifiedStart = modifiedStart;
  246 + }
  247 +
  248 + public Date getModifiedEnd() {
  249 + return modifiedEnd;
  250 + }
  251 +
  252 + public void setModifiedEnd(Date modifiedEnd) {
  253 + this.modifiedEnd = modifiedEnd;
  254 + }
  255 +
237 256 public void setBirthStart(Date birthStart) {
238 257 this.birthStart = birthStart;
239 258 }
... ... @@ -689,6 +708,14 @@
689 708 c = Criteria.where("cDay").lte(cDueWeekEnd);
690 709 }
691 710 }
  711 +
  712 + if (null != modifiedStart && modifiedEnd != null) {
  713 + if (null != c) {
  714 + c = c.where("modified").gte(modifiedStart).lte(modifiedEnd);
  715 + } else {
  716 + c = Criteria.where("modified").gte(modifiedStart).lte(modifiedEnd);
  717 + }
  718 + }
692 719  
693 720 if (null != c) {
694 721 condition = condition.andCondition(new MongoCondition(c));
platform-dal/src/main/java/com/lyms/platform/query/FolicAcidQuery.java View file @ ad8d95d
... ... @@ -53,6 +53,9 @@
53 53 //患者ID
54 54 private List<String> parentIds;
55 55  
  56 + private Date modifiedStart;
  57 + private Date modifiedEnd;
  58 +
56 59 public List<String> getParentIds() {
57 60 return parentIds;
58 61 }
59 62  
... ... @@ -103,10 +106,33 @@
103 106 c1 = c1.lte(drawTimeEnd);
104 107 }
105 108 }
  109 + if (null != modifiedStart && modifiedEnd != null) {
  110 + if (null != c1) {
  111 + c1 = c1.where("modified").gte(modifiedStart).lte(modifiedEnd);
  112 + } else {
  113 + c1 = Criteria.where("modified").gte(modifiedStart).lte(modifiedEnd);
  114 + }
  115 + }
106 116 if (c1!=null) {
107 117 condition = condition.andCondition(new MongoCondition(c1));
108 118 }
109 119 return condition.toMongoQuery();
  120 + }
  121 +
  122 + public Date getModifiedStart() {
  123 + return modifiedStart;
  124 + }
  125 +
  126 + public void setModifiedStart(Date modifiedStart) {
  127 + this.modifiedStart = modifiedStart;
  128 + }
  129 +
  130 + public Date getModifiedEnd() {
  131 + return modifiedEnd;
  132 + }
  133 +
  134 + public void setModifiedEnd(Date modifiedEnd) {
  135 + this.modifiedEnd = modifiedEnd;
110 136 }
111 137  
112 138 public List<String> getHospitalList() {
platform-dal/src/main/java/com/lyms/platform/query/PremaritalCheckupQuery.java View file @ ad8d95d
... ... @@ -30,6 +30,8 @@
30 30 private Date premaritalUpTimeEnd;
31 31 //医院ID
32 32 private String hospitalId;
  33 +
  34 + private List<String> hospitalIds;
33 35 //创建时间
34 36 private Date created;
35 37 //修改时间
36 38  
... ... @@ -51,7 +53,10 @@
51 53 //建档ID
52 54 List<String> parentIds;
53 55  
  56 + private Date modifiedStart;
  57 + private Date modifiedEnd;
54 58  
  59 +
55 60 @Override
56 61 public MongoQuery convertToQuery() {
57 62 MongoCondition condition = MongoCondition.newInstance();
... ... @@ -64,6 +69,9 @@
64 69 if (StringUtils.isNotBlank(hospitalId)) {
65 70 condition = condition.and("hospitalId", hospitalId, MongoOper.IS);
66 71 }
  72 + if (CollectionUtils.isNotEmpty(hospitalIds)) {
  73 + condition = condition.and("hospitalId", hospitalIds, MongoOper.IN);
  74 + }
67 75 if(CollectionUtils.isNotEmpty(parentIds)){
68 76 condition = condition.and("parentId", parentIds, MongoOper.IN);
69 77 }
70 78  
... ... @@ -108,10 +116,42 @@
108 116 c1 = c1.lte(premaritalUpTimeEnd);
109 117 }
110 118 }
  119 + if (null != modifiedStart && modifiedEnd != null) {
  120 + if (null != c1) {
  121 + c1 = c1.where("modified").gte(modifiedStart).lte(modifiedEnd);
  122 + } else {
  123 + c1 = Criteria.where("modified").gte(modifiedStart).lte(modifiedEnd);
  124 + }
  125 + }
  126 +
111 127 if (c1!=null) {
112 128 condition = condition.andCondition(new MongoCondition(c1));
113 129 }
114 130 return condition.toMongoQuery();
  131 + }
  132 +
  133 + public Date getModifiedStart() {
  134 + return modifiedStart;
  135 + }
  136 +
  137 + public void setModifiedStart(Date modifiedStart) {
  138 + this.modifiedStart = modifiedStart;
  139 + }
  140 +
  141 + public Date getModifiedEnd() {
  142 + return modifiedEnd;
  143 + }
  144 +
  145 + public void setModifiedEnd(Date modifiedEnd) {
  146 + this.modifiedEnd = modifiedEnd;
  147 + }
  148 +
  149 + public List<String> getHospitalIds() {
  150 + return hospitalIds;
  151 + }
  152 +
  153 + public void setHospitalIds(List<String> hospitalIds) {
  154 + this.hospitalIds = hospitalIds;
115 155 }
116 156  
117 157 public List<String> getParentIds() {
platform-dal/src/main/java/com/lyms/platform/query/SieveResultQuery.java View file @ ad8d95d
... ... @@ -5,6 +5,7 @@
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  
... ... @@ -49,6 +50,9 @@
49 50 //是否通知
50 51 private Integer isNotify;
51 52  
  53 + private Date modifiedStart;
  54 + private Date modifiedEnd;
  55 +
52 56 public Integer getIsNotify() {
53 57 return isNotify;
54 58 }
55 59  
... ... @@ -123,9 +127,36 @@
123 127 if (null != renShenResult) {
124 128 condition = condition.and("renShenResult", renShenResult, MongoOper.IS);
125 129 }
  130 + Criteria c1 = null;
  131 + if (null != modifiedStart && modifiedEnd != null) {
  132 + if (null != c1) {
  133 + c1 = c1.where("modified").gte(modifiedStart).lte(modifiedEnd);
  134 + } else {
  135 + c1 = Criteria.where("modified").gte(modifiedStart).lte(modifiedEnd);
  136 + }
  137 + }
  138 + if (null != c1) {
  139 + condition = condition.andCondition(new MongoCondition(c1));
  140 + }
  141 +
126 142 return condition.toMongoQuery();
127 143 }
128 144  
  145 + public Date getModifiedStart() {
  146 + return modifiedStart;
  147 + }
  148 +
  149 + public void setModifiedStart(Date modifiedStart) {
  150 + this.modifiedStart = modifiedStart;
  151 + }
  152 +
  153 + public Date getModifiedEnd() {
  154 + return modifiedEnd;
  155 + }
  156 +
  157 + public void setModifiedEnd(Date modifiedEnd) {
  158 + this.modifiedEnd = modifiedEnd;
  159 + }
129 160  
130 161 public Integer getCqResult() {
131 162 return cqResult;
platform-operate-api/src/main/java/com/lyms/hospitalapi/rcfy/RcGlxtService.java View file @ ad8d95d
... ... @@ -4,7 +4,6 @@
4 4 import com.lyms.platform.biz.service.*;
5 5  
6 6 import com.lyms.platform.common.enums.FmTypeEnums;
7   -import com.lyms.platform.common.enums.RenShenJieJuEnums;
8 7 import com.lyms.platform.common.enums.YnEnums;
9 8 import com.lyms.platform.common.utils.DateUtil;
10 9 import com.lyms.platform.common.utils.ExceptionUtils;
11 10  
... ... @@ -20,15 +19,12 @@
20 19 import com.lyms.platform.pojo.*;
21 20 import com.lyms.platform.query.*;
22 21 import org.apache.commons.collections.MapUtils;
23   -import org.apache.commons.dbutils.QueryRunner;
24 22 import org.springframework.beans.factory.annotation.Autowired;
25 23 import org.springframework.data.domain.Sort;
26 24 import org.springframework.stereotype.Service;
27 25  
28 26 import java.sql.*;
29   -import java.util.HashMap;
30   -import java.util.List;
31   -import java.util.Map;
  27 +import java.util.*;
32 28  
33 29  
34 30 /**
... ... @@ -51,6 +47,8 @@
51 47  
52 48  
53 49 @Autowired
  50 + private PremaritalCheckupService premaritalCheckupService;
  51 + @Autowired
54 52 private AntenatalExaminationService antenatalExaminationService;
55 53  
56 54 @Autowired
57 55  
58 56  
59 57  
60 58  
61 59  
62 60  
63 61  
64 62  
... ... @@ -63,25 +61,271 @@
63 61 @Autowired
64 62 private MatDeliverService matDeliverService;
65 63  
  64 + @Autowired
  65 + private MatDeliverFollowService matDeliverFollowService;
66 66  
  67 +
67 68 @Autowired
68 69 private SieveService sieveService;
69 70  
  71 +
70 72 @Autowired
  73 + private AntExRecordService recordService;
  74 +
  75 + @Autowired
71 76 private FolicAcidService folicAcidService;
72 77  
73 78 @Autowired
74 79 private ResidentsArchiveService residentsArchiveService;
75 80  
76 81 private static Map<String,String> hospitalsMap = new HashMap<>();
77   - static {
  82 + static{
78 83 hospitalsMap.put("2100001785","371082007011");//荣成市人民医院
  84 +// hospitalsMap.put("216","216");//荣成市人民医院
79 85 hospitalsMap.put("2100001818","371082006011");//荣成市石岛人民医院
80 86 hospitalsMap.put("2100001772","371082007001");//荣成市中医院
81 87 hospitalsMap.put("2100001750","371082000011");//荣成市妇幼保健院
  88 +
82 89 }
83 90  
  91 + public List<String> getHids()
  92 + {
  93 + List<String> hids = new ArrayList<>();
  94 + for (String key : hospitalsMap.keySet())
  95 + {
  96 + hids.add(hospitalsMap.get(key));
  97 + }
  98 + return hids;
  99 + }
84 100  
  101 +
  102 +
  103 + public void saveRcPatientRiskRecord(AntExRecordModel model) {
  104 + Connection conn = null;
  105 + PreparedStatement ps = null;
  106 + try {
  107 + conn = ConnTools.makeConnection();
  108 +
  109 + Patients patients = patientsService.findOnePatientById(model.getParentId());
  110 +
  111 + List<String> risks = model.gethRisk();
  112 + List<String> screens = model.getScreenResult();
  113 + //风险妊娠
  114 + String fmInfoSql = "insert into MATERNAL_PREGNANCY_RISK(ID,ID_CARD,NAME," +
  115 + "RIS_TIME,RISK_CATE,RISK_SCREENING_PROGRAM,RISK_SCREENING_CONTENT,RISK_SCREENING_DETAIL,RISK_SCREENING_EXPLAIN,RISK_SCREENING_DETAIL3,RISK_SCREENING_DETAIL4," +
  116 + "STATUS,HOSPITAL,DOCTOR,OPERATOR,OPERAT_TIME,CREATE_TIME,UPDATE_TIME) " +
  117 + " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
  118 + if (CollectionUtils.isNotEmpty(risks))
  119 + {
  120 + for (String rid : risks)
  121 + {
  122 + ps = conn.prepareStatement("delete from MATERNAL_PREGNANCY_RISK WHERE ID='" + model.getId()+rid + "'");
  123 + ps.executeUpdate();
  124 +
  125 + ps = conn.prepareStatement(fmInfoSql);
  126 + ps.setString(1,model.getId()+rid);
  127 + ps.setString(2, patients.getCardNo());
  128 + ps.setString(3, patients.getUsername());
  129 + ps.setTimestamp(4, new Timestamp(model.getCheckTime().getTime()));
  130 + ps.setString(5, "2"); //风险评估
  131 + List<String> ids = new LinkedList<>();
  132 + getRiskInfo(rid, ids);
  133 + Collections.reverse(ids);
  134 + int size = ids.size();
  135 + ps.setString(6, size > 0 ? ids.get(0) : null);
  136 + ps.setString(7, size > 1 ? ids.get(1) : null);
  137 + ps.setString(8, size > 2 ? ids.get(2) : null);
  138 + ps.setString(9, size > 3 ? ids.get(3) : null);
  139 + ps.setString(10, size > 4 ? ids.get(4) : null);
  140 + ps.setString(11, size > 5 ? ids.get(5) : null);
  141 + String status = "";
  142 + int week = 0;
  143 + if (patients.getLastMenses() != null && model.getCheckTime() != null)
  144 + {
  145 + week = DateUtil.getWeek(patients.getLastMenses(),model.getCheckTime());
  146 +
  147 + //怀孕1~12周为早孕。 怀孕13周~27周为孕中,28周到40周围孕晚期,分娩后是产后,产后42天后不再属于孕期妇女
  148 + if (week >=0 && 12 >= week)
  149 + {
  150 + status= "1";
  151 + }
  152 + else if (week >=13 && 27 >= week)
  153 + {
  154 + status= "2";
  155 + }
  156 + else if (week >=28 && 40 >= week)
  157 + {
  158 + status= "3";
  159 + }
  160 + else
  161 + {
  162 + status= "4";
  163 + }
  164 + }
  165 + ps.setString(12, status);
  166 + ps.setString(13, CommonsHelper.getHospitalName(model.getHospitalId(), organizationService));
  167 + ps.setString(14, StringUtils.isNum(model.getCheckDoctor()) ? CommonsHelper.getUserName(model.getCheckDoctor(), usersService) : model.getCheckDoctor());
  168 + ps.setString(15, StringUtils.isNum(model.getBuildDoctor()) ? CommonsHelper.getUserName(model.getBuildDoctor(), usersService) : model.getBuildDoctor());
  169 + ps.setTimestamp(16, model.getBuildTime()== null ? new Timestamp(model.getCreated().getTime()) : new Timestamp(model.getBuildTime().getTime()));
  170 + ps.setTimestamp(17, new Timestamp(model.getCreated().getTime()));
  171 + ps.setTimestamp(18, new Timestamp(model.getModified().getTime()));
  172 +
  173 + int saveRcPatientRiskRecord = ps.executeUpdate();
  174 + System.out.println("saveRcPatientRiskRecord="+saveRcPatientRiskRecord);
  175 + }
  176 +
  177 + }
  178 +
  179 + if (CollectionUtils.isNotEmpty(screens))
  180 + {
  181 + for (String sid : screens)
  182 + {
  183 + ps = conn.prepareStatement("delete from MATERNAL_PREGNANCY_RISK WHERE ID='" + model.getId()+sid + "'");
  184 + ps.executeUpdate();
  185 +
  186 +
  187 + ps = conn.prepareStatement(fmInfoSql);
  188 + ps.setString(1, model.getId() + sid);
  189 + ps.setString(2, patients.getCardNo());
  190 + ps.setString(3, patients.getUsername());
  191 + ps.setTimestamp(4, new Timestamp(model.getCheckTime().getTime()));
  192 + ps.setString(5, "1");//风险筛查
  193 + List<String> ids = new LinkedList<>();
  194 + getScreenInfo(sid, ids);
  195 + Collections.reverse(ids);
  196 + int size = ids.size();
  197 + ps.setString(6, size > 0 ? ids.get(0) : null);
  198 + ps.setString(7, size > 1 ? ids.get(1) : null);
  199 + ps.setString(8, size > 2 ? ids.get(2) : null);
  200 + ps.setString(9, size > 3 ? ids.get(3) : null);
  201 + ps.setString(10, size > 4 ? ids.get(4) : null);
  202 + ps.setString(11, size > 5 ? ids.get(5) : null);
  203 + String status = "";
  204 + int week = 0;
  205 + if (patients.getLastMenses() != null && model.getCheckTime() != null)
  206 + {
  207 + week = DateUtil.getWeek(patients.getLastMenses(),model.getCheckTime());
  208 +
  209 + //怀孕1~12周为早孕。 怀孕13周~27周为孕中,28周到40周围孕晚期,分娩后是产后,产后42天后不再属于孕期妇女
  210 + if (week >=0 && 12 >= week)
  211 + {
  212 + status= "1";
  213 + }
  214 + else if (week >=13 && 27 >= week)
  215 + {
  216 + status= "2";
  217 + }
  218 + else if (week >=28 && 40 >= week)
  219 + {
  220 + status= "3";
  221 + }
  222 + else
  223 + {
  224 + status= "4";
  225 + }
  226 + }
  227 + ps.setString(12, status);
  228 + ps.setString(13, CommonsHelper.getHospitalName(model.getHospitalId(), organizationService));
  229 + ps.setString(14, StringUtils.isNum(model.getCheckDoctor()) ? CommonsHelper.getUserName(model.getCheckDoctor(), usersService) : model.getCheckDoctor());
  230 + ps.setString(15, StringUtils.isNum(model.getBuildDoctor()) ? CommonsHelper.getUserName(model.getBuildDoctor(), usersService) : model.getBuildDoctor());
  231 + ps.setTimestamp(16, model.getBuildTime()== null ? new Timestamp(model.getCreated().getTime()) : new Timestamp(model.getBuildTime().getTime()));
  232 + ps.setTimestamp(17, new Timestamp(model.getCreated().getTime()));
  233 + ps.setTimestamp(18, new Timestamp(model.getModified().getTime()));
  234 +
  235 + int saveRcPatientRiskRecord = ps.executeUpdate();
  236 + System.out.println("saveRcPatientRiskRecord="+saveRcPatientRiskRecord);
  237 + }
  238 + }
  239 + }
  240 + catch (Exception e)
  241 + {
  242 + ExceptionUtils.catchException(e,"saveRcPatientRiskRecord error.");
  243 + }finally {
  244 + try {
  245 + if (ps != null)
  246 + {
  247 + ps.close();
  248 + }
  249 + if (conn != null)
  250 + {
  251 + conn.close();
  252 + }
  253 + } catch (SQLException e) {
  254 + }
  255 + }
  256 +
  257 + }
  258 +
  259 + public void riskAndScreen()
  260 + {
  261 + BasicConfigQuery basicConfigQuery = new BasicConfigQuery();
  262 + basicConfigQuery.setEnable(1);
  263 + basicConfigQuery.setTypeId("5b023e73422b03d4ad2bf8af");
  264 + List<BasicConfig> list = basicConfigService.queryBasicConfig(basicConfigQuery);
  265 + for(BasicConfig base : list)
  266 + {
  267 + System.out.println(base.getId()+" "+base.getName());
  268 + }
  269 + System.out.println("======");
  270 + BasicConfigQuery basicConfigQuery1 = new BasicConfigQuery();
  271 + basicConfigQuery1.setEnable(1);
  272 + basicConfigQuery1.setTypeId("fb43fd5a-b153-4cb9-9180-c46f5612ba43");
  273 + List<BasicConfig> list1 = basicConfigService.queryBasicConfig(basicConfigQuery1);
  274 + for(BasicConfig base : list1)
  275 + {
  276 + System.out.println(base.getId()+" "+base.getName());
  277 + }
  278 + }
  279 +
  280 +
  281 + public void getScreenInfo(String id,List<String> ids)
  282 + {
  283 +
  284 + BasicConfigQuery basicConfigQuery = new BasicConfigQuery();
  285 + basicConfigQuery.setId(id);
  286 + basicConfigQuery.setEnable(1);
  287 + basicConfigQuery.setTypeId("5b023e73422b03d4ad2bf8af");
  288 + List<BasicConfig> list1 = basicConfigService.queryBasicConfig(basicConfigQuery);
  289 + if (CollectionUtils.isNotEmpty(list1))
  290 + {
  291 + String pid = list1.get(0).getpId();
  292 + if (!"筛查结果".equals(list1.get(0).getName()) && pid!= null)
  293 + {
  294 + ids.add(id);
  295 + getScreenInfo(pid, ids);
  296 + }
  297 + else
  298 + {
  299 + ids.add(id);
  300 + }
  301 + }
  302 + }
  303 +
  304 +
  305 +
  306 + public void getRiskInfo(String id,List<String> ids)
  307 + {
  308 +
  309 + BasicConfigQuery basicConfigQuery = new BasicConfigQuery();
  310 + basicConfigQuery.setId(id);
  311 + basicConfigQuery.setEnable(1);
  312 + basicConfigQuery.setTypeId("fb43fd5a-b153-4cb9-9180-c46f5612ba43");
  313 + List<BasicConfig> list1 = basicConfigService.queryBasicConfig(basicConfigQuery);
  314 + if (CollectionUtils.isNotEmpty(list1))
  315 + {
  316 + String pid = list1.get(0).getpId();
  317 + if (!"妊娠风险预警".equals(list1.get(0).getName()) && pid!= null)
  318 + {
  319 + ids.add(id);
  320 + getRiskInfo(pid, ids);
  321 + }
  322 + else
  323 + {
  324 + ids.add(id);
  325 + }
  326 + }
  327 + }
  328 +
85 329 /**
86 330 *
87 331 *
... ... @@ -103,7 +347,7 @@
103 347 * 产前筛查
104 348 * @param model
105 349 */
106   - public void saveRcSieveInfo(SieveResultModel model)
  350 + public void saveRcSieveInfo(SieveResultModel model,List<String> hids)
107 351 {
108 352 Connection conn = null;
109 353 PreparedStatement ps = null;
... ... @@ -114,7 +358,16 @@
114 358 ps.executeUpdate();
115 359  
116 360  
117   - Patients patients = patientsService.findOnePatientById(model.getParentId());
  361 + PatientsQuery patientsQuery = new PatientsQuery();
  362 + patientsQuery.setId(model.getParentId());
  363 + patientsQuery.setHospitalList(hids);
  364 + patientsQuery.setYn(YnEnums.YES.getId());
  365 + List<Patients> patientses = patientsService.queryPatient(patientsQuery);
  366 + if (!CollectionUtils.isNotEmpty(patientses))
  367 + {
  368 + return;
  369 + }
  370 + Patients patients = patientses.get(0);
118 371  
119 372 // private String tszhz;// 唐氏综合症
120 373 // private String sjgjx;// 神经管畸形
... ... @@ -420,9 +673,9 @@
420 673 ps = conn.prepareStatement(sql);
421 674 ps.setString(1,model.getId());
422 675 ps.setString(2,resident.getUsername());
423   - ps.setString(3,resident.getCertificateNum());
424   - ps.setString(4,null);
425   - ps.setString(5,null);
  676 + ps.setString(3, resident.getCertificateNum());
  677 + ps.setString(4, null);
  678 + ps.setString(5, null);
426 679 ps.setString(6,null);
427 680 ps.setString(7,null);
428 681  
... ... @@ -431,7 +684,7 @@
431 684 ps.setString(8,null);
432 685 ps.setString(9,null);
433 686 ps.setString(10,null);
434   - ps.setString(11,null);
  687 + ps.setString(11, null);
435 688 ps.setString(12,null);
436 689  
437 690 ps.setString(13, StringUtils.isNum(model.getHunJianDoctor()) ? CommonsHelper.getUserName(model.getHunJianDoctor(), usersService) : model.getHunJianDoctor());
... ... @@ -472,7 +725,7 @@
472 725 * 产后访视
473 726 * @param model
474 727 */
475   - public void saveRcMatdeliverFollowInfo(MatdeliverFollowModel model)
  728 + public void saveRcMatdeliverFollowInfo(MatdeliverFollowModel model,List<String> hids)
476 729 {
477 730 Connection conn = null;
478 731 PreparedStatement ps = null;
... ... @@ -486,6 +739,7 @@
486 739 MatDeliverQuery matDeliverQuery = new MatDeliverQuery();
487 740 matDeliverQuery.setYn(YnEnums.YES.getId());
488 741 matDeliverQuery.setId(model.getDeliverId());
  742 + matDeliverQuery.setFmHospitalList(hids);
489 743 List<MaternalDeliverModel> maternalDeliverModelList = matDeliverService.query(matDeliverQuery);
490 744 if (CollectionUtils.isEmpty(maternalDeliverModelList))
491 745 {
... ... @@ -920,6 +1174,145 @@
920 1174 } catch (SQLException e) {
921 1175 }
922 1176 }
  1177 + }
  1178 +
  1179 +
  1180 + public void taskWorker()
  1181 + {
  1182 + //十分钟执行一次
  1183 + java.util.Date end = new java.util.Date();
  1184 + java.util.Date start = new java.util.Date(end.getTime()-2*60*1000);
  1185 +
  1186 + List<String> hids = getHids();
  1187 +
  1188 + //孕妇基本信息
  1189 + PatientsQuery patientsQuery1 = new PatientsQuery();
  1190 + patientsQuery1.setYn(YnEnums.YES.getId());
  1191 + patientsQuery1.setModifiedEnd(end);
  1192 + patientsQuery1.setModifiedStart(start);
  1193 + List<Patients> patientses = patientsService.queryPatient(patientsQuery1);
  1194 + System.out.println("xxxxxxpatientses="+patientses.size()+"===="+patientsQuery1.convertToQuery().convertToMongoQuery().toString());
  1195 + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(patientses))
  1196 + {
  1197 + for (Patients pat : patientses)
  1198 + {
  1199 + saveRcPatientInfo(pat);
  1200 + }
  1201 + }
  1202 +
  1203 +
  1204 + //孕妇分娩信息
  1205 + MatDeliverQuery matDeliverQuery = new MatDeliverQuery();
  1206 + matDeliverQuery.setYn(YnEnums.YES.getId());
  1207 + matDeliverQuery.setFmHospitalList(hids);
  1208 + matDeliverQuery.setModifiedStart(start);
  1209 + matDeliverQuery.setModifiedEnd(end);
  1210 + List<MaternalDeliverModel> list2 = matDeliverService.query(matDeliverQuery);
  1211 + System.out.println("xxxxxx fm="+list2.size()+"===="+matDeliverQuery.convertToQuery().convertToMongoQuery().toString());
  1212 + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(list2))
  1213 + {
  1214 + for (MaternalDeliverModel maternalDeliverModel : list2)
  1215 + {
  1216 + saveRcFmInfo(maternalDeliverModel);
  1217 + }
  1218 + }
  1219 +
  1220 +
  1221 + //新生儿
  1222 + MatDeliverQuery matDeliverQuery1 = new MatDeliverQuery();
  1223 + matDeliverQuery1.setYn(YnEnums.YES.getId());
  1224 + matDeliverQuery1.setFmHospitalList(hids);
  1225 + matDeliverQuery1.setModifiedStart(start);
  1226 + matDeliverQuery1.setModifiedEnd(end);
  1227 + List<MaternalDeliverModel> list1 = matDeliverService.query(matDeliverQuery1);
  1228 + System.out.println("xxxxxx new baby="+list1.size()+"===="+matDeliverQuery1.convertToQuery().convertToMongoQuery().toString());
  1229 + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(list1))
  1230 + {
  1231 + for (MaternalDeliverModel maternalDeliverModel : list1)
  1232 + {
  1233 + saveRcNewBabyInfo(maternalDeliverModel);
  1234 + }
  1235 + }
  1236 +
  1237 + //产后访视
  1238 + MatDeliverFollowQuery matDeliverFollowQuery = new MatDeliverFollowQuery();
  1239 + matDeliverFollowQuery.setCreatedTimeEnd(end);
  1240 + matDeliverFollowQuery.setCreatedTimeStart(start);
  1241 + matDeliverFollowQuery.setVisitStatus(2);
  1242 + List<MatdeliverFollowModel> matdeliverFollowModels = matDeliverFollowService.query(matDeliverFollowQuery);
  1243 + System.out.println("xxxxxx fs="+matdeliverFollowModels.size()+"===="+matDeliverFollowQuery.convertToQuery().convertToMongoQuery().toString());
  1244 + if (CollectionUtils.isNotEmpty(matdeliverFollowModels))
  1245 + {
  1246 + for (MatdeliverFollowModel matdeliverFollowModel : matdeliverFollowModels)
  1247 + {
  1248 + saveRcMatdeliverFollowInfo(matdeliverFollowModel, hids);
  1249 + }
  1250 + }
  1251 +
  1252 +
  1253 + //婚检
  1254 + PremaritalCheckupQuery query = new PremaritalCheckupQuery();
  1255 + query.setYn(YnEnums.YES.getId());
  1256 + query.setModifiedStart(start);
  1257 + query.setModifiedEnd(end);
  1258 + query.setHospitalIds(hids);
  1259 + query.setSexType(1);
  1260 + List<PremaritalCheckup> checkupList = premaritalCheckupService.queryPremaritalCheckup(query);
  1261 + System.out.println("xxxxxx hj="+checkupList.size()+"===="+query.convertToQuery().convertToMongoQuery().toString());
  1262 + if (CollectionUtils.isNotEmpty(checkupList))
  1263 + {
  1264 + for (PremaritalCheckup premaritalCheckup : checkupList)
  1265 + {
  1266 + saveRcPremaritalCheckupInfo(premaritalCheckup);
  1267 + }
  1268 + }
  1269 +
  1270 + //叶酸发放
  1271 + FolicAcidQuery folicAcidQuery = new FolicAcidQuery();
  1272 + folicAcidQuery.setYn(YnEnums.YES.getId());
  1273 + folicAcidQuery.setModifiedStart(start);
  1274 + folicAcidQuery.setModifiedEnd(end);
  1275 + folicAcidQuery.setHospitalList(hids);
  1276 + List<FolicAcid> folicAcidList = folicAcidService.queryFolicAcidWithSort(folicAcidQuery, "drawTime", Sort.Direction.ASC);
  1277 + System.out.println("xxxxxx ys="+folicAcidList.size()+"===="+folicAcidQuery.convertToQuery().convertToMongoQuery().toString());
  1278 + if (CollectionUtils.isNotEmpty(folicAcidList))
  1279 + {
  1280 + for (FolicAcid folicAcid : folicAcidList)
  1281 + {
  1282 + saveRcFolicAcidInfo(folicAcid);
  1283 + }
  1284 + }
  1285 +
  1286 +
  1287 + //产筛
  1288 + SieveResultQuery sieveResultQuery = new SieveResultQuery();
  1289 + sieveResultQuery.setYn(YnEnums.YES.getId());
  1290 + sieveResultQuery.setModifiedStart(start);
  1291 + sieveResultQuery.setModifiedEnd(end);
  1292 + List<SieveResultModel> list = sieveService.queryListSieveResult(sieveResultQuery);
  1293 + System.out.println("xxxxxx sieve=" + list.size()+"===="+sieveResultQuery.convertToQuery().convertToMongoQuery().toString());
  1294 + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(list))
  1295 + {
  1296 + for (SieveResultModel sieveResultModel : list)
  1297 + {
  1298 + saveRcSieveInfo(sieveResultModel,hids);
  1299 + }
  1300 + }
  1301 +
  1302 + AntExRecordQuery antExRecordQuery = new AntExRecordQuery();
  1303 + antExRecordQuery.setHospitalList(hids);
  1304 + antExRecordQuery.setModifiedStart(start);
  1305 + antExRecordQuery.setModifiedEnd(end);
  1306 + List<AntExRecordModel> recordModels = recordService.queryAntExRecords(antExRecordQuery);
  1307 + System.out.println("xxxxxx recordModels=" + recordModels.size()+"===="+antExRecordQuery.convertToQuery().convertToMongoQuery().toString());
  1308 + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(recordModels))
  1309 + {
  1310 + for (AntExRecordModel antExRecordModel : recordModels)
  1311 + {
  1312 + saveRcPatientRiskRecord(antExRecordModel);
  1313 + }
  1314 + }
  1315 +
923 1316 }
924 1317  
925 1318 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java View file @ ad8d95d
... ... @@ -2498,12 +2498,11 @@
2498 2498 MatDeliverFollowQuery matDeliverFollowQuery = new MatDeliverFollowQuery();
2499 2499 List<MatdeliverFollowModel> matdeliverFollowModels = matDeliverFollowService.query(matDeliverFollowQuery);
2500 2500 matDeliverFollowQuery.setVisitStatus(2);
2501   -
2502 2501 if (CollectionUtils.isNotEmpty(matdeliverFollowModels))
2503 2502 {
2504 2503 for (MatdeliverFollowModel matdeliverFollowModel : matdeliverFollowModels)
2505 2504 {
2506   - rcGlxtService.saveRcMatdeliverFollowInfo(matdeliverFollowModel);
  2505 + rcGlxtService.saveRcMatdeliverFollowInfo(matdeliverFollowModel,rcGlxtService.getHids());
2507 2506 }
2508 2507 }
2509 2508 }
... ... @@ -2544,7 +2543,6 @@
2544 2543  
2545 2544 FolicAcidQuery folicAcidQuery = new FolicAcidQuery();
2546 2545 folicAcidQuery.setYn(YnEnums.YES.getId());
2547   - folicAcidQuery.setId("587621160cf248988f190469");
2548 2546  
2549 2547 List<FolicAcid> folicAcidList = folicAcidService.queryFolicAcidWithSort(folicAcidQuery, "drawTime", Sort.Direction.ASC);
2550 2548  
2551 2549  
2552 2550  
2553 2551  
... ... @@ -2557,21 +2555,43 @@
2557 2555 }
2558 2556 }
2559 2557  
2560   -
  2558 + /**
  2559 + * 孕期筛查表
  2560 + * @param hospitalId
  2561 + */
2561 2562 @RequestMapping(value = "/rcSieveInfo", method = RequestMethod.GET)
2562 2563 @ResponseBody
2563 2564 public void rcSieveInfo(@RequestParam(required = false) String hospitalId) {
2564   -
2565   -
2566 2565 SieveResultQuery sieveResultQuery = new SieveResultQuery();
2567 2566 sieveResultQuery.setYn(YnEnums.YES.getId());
2568 2567 List<SieveResultModel> list = sieveService.queryListSieveResult(sieveResultQuery);
2569   -
2570 2568 if (CollectionUtils.isNotEmpty(list))
2571 2569 {
2572 2570 for (SieveResultModel sieveResultModel : list)
2573 2571 {
2574   - rcGlxtService.saveRcSieveInfo(sieveResultModel);
  2572 + rcGlxtService.saveRcSieveInfo(sieveResultModel, rcGlxtService.getHids());
  2573 + }
  2574 + }
  2575 + }
  2576 +
  2577 +
  2578 + /**
  2579 + * 风险妊娠
  2580 + * @param hospitalId
  2581 + */
  2582 + @RequestMapping(value = "/rcPatientRiskRecord", method = RequestMethod.GET)
  2583 + @ResponseBody
  2584 + public void rcPatientRiskRecord(@RequestParam(required = false) String hospitalId) {
  2585 +
  2586 + rcGlxtService.riskAndScreen();
  2587 + AntExRecordQuery antExRecordQuery = new AntExRecordQuery();
  2588 + antExRecordQuery.setHospitalList(rcGlxtService.getHids());
  2589 + List<AntExRecordModel> recordModels = recordService.queryAntExRecords(antExRecordQuery);
  2590 + if (CollectionUtils.isNotEmpty(recordModels))
  2591 + {
  2592 + for (AntExRecordModel antExRecordModel : recordModels)
  2593 + {
  2594 + rcGlxtService.saveRcPatientRiskRecord(antExRecordModel);
2575 2595 }
2576 2596 }
2577 2597 }
platform-operate-api/src/main/resources/spring/applicationContext-quartz.xml View file @ ad8d95d
... ... @@ -347,6 +347,22 @@
347 347 </bean>
348 348  
349 349  
  350 + <!-- 荣成数据对接-->
  351 + <bean id="rcDataJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
  352 + <!-- 要调用的bean -->
  353 + <property name="targetObject" ref="rcGlxtService"/>
  354 + <!-- 要调用的Method -->
  355 + <property name="targetMethod" value="taskWorker"/>
  356 + <!-- 是否并发,false表示 如果发生错误也不影响下一次的调用 -->
  357 + <property name="concurrent" value="false"/>
  358 + </bean>
  359 +
  360 + <bean id="rcDataJobTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
  361 + <property name="jobDetail" ref="rcDataJob"/>
  362 + <property name="cronExpression" value="0 0/2 * * * ?"/>
  363 + </bean>
  364 +
  365 +
350 366 <!-- 总调度,用于启动定时器 -->
351 367 <bean id="schedulerFactory" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
352 368 <property name="triggers" >
... ... @@ -364,6 +380,7 @@
364 380 <ref bean="firstDandleAutoReachDueTrigger" />
365 381 <!--血压报告触发器 -->
366 382 <ref bean="bpReportTrigger" />
  383 + <ref bean="rcDataJobTrigger" />
367 384 <!-- 产前诊断-->
368 385 <!--<ref bean="diaSieveTrigger"/>-->
369 386 <!-- 承德公共卫生接口-->