Commit b4887a0676d0e3d9d8cfdc410b09775f4759f4c4

Authored by liquanyu
1 parent 0d0b3e0d47

荣成接口

Showing 2 changed files with 968 additions and 39 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/rcfy/RcGlxtService.java View file @ b4887a0
... ... @@ -3,22 +3,32 @@
3 3  
4 4 import com.lyms.platform.biz.service.*;
5 5  
  6 +import com.lyms.platform.common.enums.FmTypeEnums;
  7 +import com.lyms.platform.common.enums.RenShenJieJuEnums;
  8 +import com.lyms.platform.common.enums.YnEnums;
6 9 import com.lyms.platform.common.utils.DateUtil;
7 10 import com.lyms.platform.common.utils.ExceptionUtils;
  11 +import com.lyms.platform.common.utils.JsonUtil;
  12 +import com.lyms.platform.common.utils.StringUtils;
8 13 import com.lyms.platform.operate.web.facade.AntenatalExaminationFacade;
9 14  
  15 +import com.lyms.platform.operate.web.result.HighScoreResult;
  16 +import com.lyms.platform.operate.web.utils.CollectionUtils;
10 17 import com.lyms.platform.operate.web.utils.CommonsHelper;
11 18 import com.lyms.platform.permission.service.OrganizationService;
12 19 import com.lyms.platform.permission.service.UsersService;
13   -import com.lyms.platform.pojo.Patients;
  20 +import com.lyms.platform.pojo.*;
  21 +import com.lyms.platform.query.*;
  22 +import org.apache.commons.collections.MapUtils;
14 23 import org.apache.commons.dbutils.QueryRunner;
15 24 import org.springframework.beans.factory.annotation.Autowired;
  25 +import org.springframework.data.domain.Sort;
16 26 import org.springframework.stereotype.Service;
17 27  
18   -import java.sql.Connection;
19   -import java.sql.Date;
20   -import java.sql.PreparedStatement;
21   -import java.sql.SQLException;
  28 +import java.sql.*;
  29 +import java.util.HashMap;
  30 +import java.util.List;
  31 +import java.util.Map;
22 32  
23 33  
24 34 /**
25 35  
26 36  
... ... @@ -39,9 +49,716 @@
39 49 @Autowired
40 50 private UsersService usersService;
41 51  
  52 +
42 53 @Autowired
  54 + private AntenatalExaminationService antenatalExaminationService;
  55 +
  56 + @Autowired
  57 + private BabyService babyService;
  58 +
  59 + @Autowired
43 60 private AntenatalExaminationFacade antenatalExaminationFacade;
44 61  
  62 +
  63 + @Autowired
  64 + private MatDeliverService matDeliverService;
  65 +
  66 +
  67 + @Autowired
  68 + private SieveService sieveService;
  69 +
  70 + @Autowired
  71 + private FolicAcidService folicAcidService;
  72 +
  73 + @Autowired
  74 + private ResidentsArchiveService residentsArchiveService;
  75 +
  76 + private static Map<String,String> hospitalsMap = new HashMap<>();
  77 + static {
  78 + hospitalsMap.put("2100001785","371082007011");//荣成市人民医院
  79 + hospitalsMap.put("2100001818","371082006011");//荣成市石岛人民医院
  80 + hospitalsMap.put("2100001772","371082007001");//荣成市中医院
  81 + hospitalsMap.put("2100001750","371082000011");//荣成市妇幼保健院
  82 + }
  83 +
  84 +
  85 + /**
  86 + *
  87 + *
  88 + * 1、筛查类型、筛查类型名称,按照以下字段对应(对应你方系统如截图内容:产筛分项评价。注:组合成两个字段):
  89 + 2001 唐氏综合征(21三体)
  90 + 2002 18三体综合征
  91 + 2003 开放性神经缺陷
  92 + 2004 耳聋基因筛查
  93 +
  94 + 2、筛查结果:(对应你方系统如截图内容:产筛分项评价)存在风险即为阳性,没有风险即为阴性
  95 +
  96 + 3、筛查医疗机构代码,按照以下字段对应:
  97 + 371082007011 荣成市人民医院
  98 + 371082006011 荣成市石岛人民医院
  99 + 371082007001 荣成市中医院
  100 + 371082000011 荣成市妇幼保健院
  101 +
  102 + 4、筛查结果内容:(对应你方系统如截图内容:高危因素内容)
  103 + * 产前筛查
  104 + * @param model
  105 + */
  106 + public void saveRcSieveInfo(SieveResultModel model)
  107 + {
  108 + Connection conn = null;
  109 + PreparedStatement ps = null;
  110 + try {
  111 + conn = ConnTools.makeConnection();
  112 +
  113 + ps = conn.prepareStatement("delete from PREGNANCY_EXAMINATION_INFO WHERE ID like '" + model.getId() + "%'");
  114 + ps.executeUpdate();
  115 +
  116 +
  117 + Patients patients = patientsService.findOnePatientById(model.getParentId());
  118 +
  119 + // private String tszhz;// 唐氏综合症
  120 + // private String sjgjx;// 神经管畸形
  121 + // private String sbst;// 18-三体
  122 +
  123 + Map<String,String> map = new HashMap<>();
  124 + if (StringUtils.isNotEmpty(model.getTszhz()))
  125 + {
  126 + map.put("tszhz",model.getTszhz());
  127 + }
  128 + if (StringUtils.isNotEmpty(model.getSjgjx()))
  129 + {
  130 + map.put("sjgjx",model.getSjgjx());
  131 + }
  132 + if (StringUtils.isNotEmpty(model.getSbst()))
  133 + {
  134 + map.put("sbst",model.getSbst());
  135 + }
  136 +
  137 + if (map.size() > 0)
  138 + {
  139 +
  140 + for (String key : map.keySet())
  141 + {
  142 + //产前筛查
  143 + String sql = "insert into PREGNANCY_EXAMINATION_INFO(ID,NAME,ID_CARD,EXAM_DATE,SCREENING_CATE,SCREENING_CATE_NAME,IS_TOLL,SCREENING_RESULT," +
  144 + "EXAM_HOSPITAL,RESP_DOCTOR,EXAM_INFO,IS_SEND_REMIND,REFERRAL_STATUS,HIGH_RISK," +
  145 + "HANDING_SUGGESTION,REFERTO_ORG_NAME,REFERRAL_REASON,IS_SIGN_PROTOCOL,REFERRAL_CASE,REFERRAL_TRACK_DOCTOR," +
  146 + "OPERATOR,OPERAT_TIME,STATUS,CHECK_TYPE,IS_BULID_MANUAL,PREGNANCY,APPOINTMENT,CREATE_TIME,UPDATE_TIME) " +
  147 + " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
  148 + ps = conn.prepareStatement(sql);
  149 + ps.setString(1,model.getId()+key);
  150 + ps.setString(2,patients.getUsername());
  151 + ps.setString(3,patients.getCardNo());
  152 + ps.setTimestamp(4, new Timestamp(model.getCreated().getTime()));
  153 +
  154 + String type = "";
  155 + String typeName = "";
  156 + if ("tszhz".equals(key))
  157 + {
  158 + type = "2001";
  159 + typeName= "唐氏综合征(21三体)";
  160 + } else if ("sjgjx".equals(key))
  161 + {
  162 + type = "2003";
  163 + typeName= "开放性神经缺陷";
  164 + }
  165 + else if ("sbst".equals(key))
  166 + {
  167 + type = "2002";
  168 + typeName= "18三体综合征";
  169 + }
  170 + ps.setString(5,type);
  171 + ps.setString(6, typeName);
  172 + ps.setString(7, null);
  173 +
  174 +// SieveQuery sieveQuery = new SieveQuery();
  175 +// sieveQuery.setYn(YnEnums.YES.getId());
  176 +// sieveQuery.setParentId(model.getParentId());
  177 +// List<SieveModel> modelList = sieveService.queryList(sieveQuery);
  178 +// String sieveResult= "";
  179 +// if (CollectionUtils.isNotEmpty(modelList))
  180 +// {
  181 +// Integer result = modelList.get(0).getCqResult();
  182 +// if (result != null)
  183 +// {
  184 +// sieveResult = result == 0 ? "1" :"2";
  185 +// }
  186 +// }
  187 +
  188 + String sieveResult= "";
  189 + if (map.get(key) != null)
  190 + {
  191 + Integer result = Integer.parseInt(map.get(key));
  192 + if (result != null)
  193 + {
  194 + sieveResult = result == 0 ? "2" :"1";
  195 + }
  196 + }
  197 +
  198 +
  199 + ps.setString(8, sieveResult);
  200 + ps.setString(9, hospitalsMap.get(patients.getHospitalId()));
  201 + ps.setString(10, StringUtils.isNum(model.getPublishName()) ? CommonsHelper.getUserName(model.getPublishName(), usersService) : model.getPublishName());
  202 + HighScoreResult highScoreResult = antenatalExaminationFacade.findLastRisk(patients.getPid(), false);
  203 + ps.setString(11, highScoreResult.gethighRiskStr());
  204 + ps.setString(12, null);
  205 + ps.setString(13, null);
  206 + ps.setString(14, highScoreResult.gethighRiskStr());
  207 + ps.setString(15, null);
  208 + ps.setString(16, null);
  209 + ps.setString(17, null);
  210 + ps.setString(18, null);
  211 + ps.setString(19, null);
  212 + ps.setString(20, null);
  213 + ps.setString(21, StringUtils.isNum(model.getPublishName()) ? CommonsHelper.getUserName(model.getPublishName(), usersService) : model.getPublishName());
  214 + ps.setTimestamp(22, new Timestamp(model.getCreated().getTime()));
  215 +
  216 + String status = "";
  217 + int week = 0;
  218 + if (patients.getLastMenses() != null && model.getCreated() != null)
  219 + {
  220 + week = DateUtil.getWeek(patients.getLastMenses(),model.getCreated());
  221 +
  222 + //怀孕1~12周为早孕。 怀孕13周~27周为孕中,28周到40周围孕晚期,分娩后是产后,产后42天后不再属于孕期妇女
  223 + if (week >=0 && 12 >= week)
  224 + {
  225 + status= "1";
  226 + }
  227 + else if (week >=13 && 27 >= week)
  228 + {
  229 + status= "2";
  230 + }
  231 + else if (week >=28 && 40 >= week)
  232 + {
  233 + status= "3";
  234 + }
  235 + else
  236 + {
  237 + status= "4";
  238 + }
  239 + }
  240 + ps.setString(23, status);
  241 + ps.setString(24, status);
  242 + ps.setString(25, "0");
  243 + ps.setString(26, String.valueOf(week));
  244 + ps.setString(27, null);
  245 + ps.setTimestamp(28, new Timestamp(model.getCreated().getTime()));
  246 + ps.setTimestamp(29, new Timestamp(model.getModified().getTime()));
  247 +
  248 + int saveRcSieveInfoCount = ps.executeUpdate();
  249 + System.out.println("saveRcSieveInfoCount="+saveRcSieveInfoCount);
  250 + }
  251 + }
  252 + }
  253 + catch (Exception e)
  254 + {
  255 + ExceptionUtils.catchException(e,"saveRcSieveInfoCount error.");
  256 + }finally {
  257 + try {
  258 + if (ps != null)
  259 + {
  260 + ps.close();
  261 + }
  262 + if (conn != null)
  263 + {
  264 + conn.close();
  265 + }
  266 + } catch (SQLException e) {
  267 + }
  268 + }
  269 + }
  270 +
  271 +
  272 + /**
  273 + * 叶酸发放
  274 + * @param model
  275 + */
  276 + public void saveRcFolicAcidInfo(FolicAcid model)
  277 + {
  278 + Connection conn = null;
  279 + PreparedStatement ps = null;
  280 + try {
  281 + conn = ConnTools.makeConnection();
  282 +
  283 + ps = conn.prepareStatement("delete from FOLIC_ACID_RECORD WHERE ID='" + model.getId() + "'");
  284 + ps.executeUpdate();
  285 +
  286 +
  287 + ResidentsArchiveQuery archiveQuery = new ResidentsArchiveQuery();
  288 + archiveQuery.setYn(YnEnums.YES.getId());
  289 + archiveQuery.setId(model.getParentId());
  290 + List<ResidentsArchiveModel> residentsArchiveModels = residentsArchiveService.queryResident(archiveQuery);
  291 + if (CollectionUtils.isEmpty(residentsArchiveModels))
  292 + {
  293 + return;
  294 + }
  295 + ResidentsArchiveModel resident = residentsArchiveModels.get(0);
  296 +
  297 + //婚检
  298 + String sql = "insert into FOLIC_ACID_RECORD(ID,CARD_NO,TIMES,NUM,PROVIDER,HOSPITAL,RECEIVER,PROVIDER_TIME,OPERATOR," +
  299 + "OPERAT_TIME,ID_CARD,NAME,STATUS,IS_SEND_REMIND,CREATE_TIME,UPDATE_TIME) " +
  300 + " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
  301 + ps = conn.prepareStatement(sql);
  302 + ps.setString(1, model.getId());
  303 + ps.setString(2, resident.getVcCardNo());
  304 +
  305 + FolicAcidQuery folicAcidQuery = new FolicAcidQuery();
  306 + folicAcidQuery.setYn(YnEnums.YES.getId());
  307 + folicAcidQuery.setParentId(resident.getId());
  308 +
  309 + Integer timmes = 1;
  310 + List<FolicAcid> folicAcidList = folicAcidService.queryFolicAcidWithSort(folicAcidQuery, "drawTime", Sort.Direction.ASC);
  311 + if (CollectionUtils.isNotEmpty(folicAcidList))
  312 + {
  313 + for (int i=0;i<folicAcidList.size();i++)
  314 + {
  315 + if (model.getId().equals(folicAcidList.get(i).getId()))
  316 + {
  317 + timmes += i;
  318 + break;
  319 + }
  320 + }
  321 + }
  322 +
  323 + ps.setString(3,String.valueOf(timmes));
  324 + ps.setString(4,model.getDrawCount());
  325 +
  326 + ps.setString(5, StringUtils.isNum(model.getOperatorId()) ? CommonsHelper.getUserName(model.getOperatorId(), usersService) : model.getOperatorId());
  327 +
  328 +
  329 + ps.setString(6, CommonsHelper.getHospitalName(model.getHospitalId(), organizationService));
  330 + ps.setString(7,resident.getUsername());
  331 + ps.setTimestamp(8, new Timestamp(model.getDrawTime().getTime()));
  332 + ps.setString(9, StringUtils.isNum(model.getOperatorId()) ? CommonsHelper.getUserName(model.getOperatorId(), usersService) : model.getOperatorId());
  333 + ps.setTimestamp(10, new Timestamp(model.getCreated().getTime()));
  334 + ps.setString(11, resident.getCertificateNum());
  335 + ps.setString(12, resident.getUsername());
  336 +
  337 + String status="";
  338 + if (model.getPregnancyType() == 2)
  339 + {
  340 + int week = Integer.parseInt(model.getPregnancyWeeks());
  341 + //怀孕1~12周为早孕。 怀孕13周~27周为孕中,28周到40周围孕晚期,分娩后是产后,产后42天后不再属于孕期妇女
  342 + if (week >=0 && 12 >= week)
  343 + {
  344 + status= "1";
  345 + }
  346 + else if (week >=13 && 27 >= week)
  347 + {
  348 + status= "2";
  349 + }
  350 + else if (week >=28 && 40 >= week)
  351 + {
  352 + status= "3";
  353 + }
  354 + else
  355 + {
  356 + status= "4";
  357 + }
  358 + }
  359 + ps.setString(13, status);
  360 + ps.setString(14, null);
  361 + ps.setTimestamp(15, new Timestamp(model.getCreated().getTime()));
  362 + ps.setTimestamp(16, new Timestamp(model.getModified().getTime()));
  363 +
  364 + int saveRcFolicAcidInfo = ps.executeUpdate();
  365 + System.out.println("saveRcFolicAcidInfo="+saveRcFolicAcidInfo);
  366 + }
  367 + catch (Exception e)
  368 + {
  369 + ExceptionUtils.catchException(e,"saveRcFolicAcidInfo error.");
  370 + }finally {
  371 + try {
  372 + if (ps != null)
  373 + {
  374 + ps.close();
  375 + }
  376 + if (conn != null)
  377 + {
  378 + conn.close();
  379 + }
  380 + } catch (SQLException e) {
  381 + }
  382 + }
  383 + }
  384 +
  385 +
  386 +
  387 + /**
  388 + * 婚检
  389 + * @param model
  390 + */
  391 + public void saveRcPremaritalCheckupInfo(PremaritalCheckup model)
  392 + {
  393 + Connection conn = null;
  394 + PreparedStatement ps = null;
  395 + try {
  396 + conn = ConnTools.makeConnection();
  397 +
  398 + ps = conn.prepareStatement("delete from PRE_MARRIAGE_PHYSICAL WHERE ID='" + model.getId() + "'");
  399 + ps.executeUpdate();
  400 +
  401 +
  402 + ResidentsArchiveQuery archiveQuery = new ResidentsArchiveQuery();
  403 + archiveQuery.setYn(YnEnums.YES.getId());
  404 + archiveQuery.setId(model.getParentId());
  405 + List<ResidentsArchiveModel> residentsArchiveModels = residentsArchiveService.queryResident(archiveQuery);
  406 + if (CollectionUtils.isEmpty(residentsArchiveModels))
  407 + {
  408 + return;
  409 + }
  410 + ResidentsArchiveModel resident = residentsArchiveModels.get(0);
  411 +
  412 + //婚检
  413 + String sql = "insert into PRE_MARRIAGE_PHYSICAL(ID,NAME,ID_CARD,VAGINAL_DISCHARGE_CHARACTER,\n" +
  414 + "VAGINAL_DISCHARGE_COLOR,VAGINAL_DISCHARGE_AMOUNT," +
  415 + "VAGINAL_MEDICAL,X_RAY_RESULT,TREPONEMA_PALLIDUN," +
  416 + "GPT,HBSAG_TEST_RESULT_CODE,HIV_SCREEN_RESULT," +
  417 + "VISIT_DOCTIR,VISIT_DATE,CHECK_HOSPITAL_NAME,CHECK_HOSPITAL_ID," +
  418 + "CREATE_TIME,UPDATE_TIME,OPERATOR,OPERAT_TIME) " +
  419 + " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
  420 + ps = conn.prepareStatement(sql);
  421 + ps.setString(1,model.getId());
  422 + ps.setString(2,resident.getUsername());
  423 + ps.setString(3,resident.getCertificateNum());
  424 + ps.setString(4,null);
  425 + ps.setString(5,null);
  426 + ps.setString(6,null);
  427 + ps.setString(7,null);
  428 +
  429 +// ps.setString(6, model.getGcFenMiWu());
  430 +// ps.setString(7, model.getJianChaJieGuo() == 1 ? "异常":"正常");
  431 + ps.setString(8,null);
  432 + ps.setString(9,null);
  433 + ps.setString(10,null);
  434 + ps.setString(11,null);
  435 + ps.setString(12,null);
  436 +
  437 + ps.setString(13, StringUtils.isNum(model.getHunJianDoctor()) ? CommonsHelper.getUserName(model.getHunJianDoctor(), usersService) : model.getHunJianDoctor());
  438 + ps.setTimestamp(14, new Timestamp(model.getPremaritalUpTime().getTime()));
  439 + ps.setString(15, CommonsHelper.getHospitalName(model.getHospitalId(), organizationService));
  440 + ps.setString(16, hospitalsMap.get(model.getHospitalId()));
  441 +
  442 + ps.setTimestamp(17, new Timestamp(model.getCreated().getTime()));
  443 + ps.setTimestamp(18, new Timestamp(model.getModified().getTime()));
  444 + ps.setString(19, StringUtils.isNum(model.getHunJianDoctor()) ? CommonsHelper.getUserName(model.getHunJianDoctor(), usersService) : model.getHunJianDoctor());
  445 + ps.setTimestamp(20, new Timestamp(model.getCreated().getTime()));
  446 +
  447 + int saveRcPremaritalCheckupInfo = ps.executeUpdate();
  448 + System.out.println("saveRcPremaritalCheckupCount="+saveRcPremaritalCheckupInfo);
  449 + }
  450 + catch (Exception e)
  451 + {
  452 + ExceptionUtils.catchException(e,"saveRcPremaritalCheckupInfo error.");
  453 + }finally {
  454 + try {
  455 + if (ps != null)
  456 + {
  457 + ps.close();
  458 + }
  459 + if (conn != null)
  460 + {
  461 + conn.close();
  462 + }
  463 + } catch (SQLException e) {
  464 + }
  465 + }
  466 + }
  467 +
  468 +
  469 +
  470 +
  471 + /**
  472 + * 产后访视
  473 + * @param model
  474 + */
  475 + public void saveRcMatdeliverFollowInfo(MatdeliverFollowModel model)
  476 + {
  477 + Connection conn = null;
  478 + PreparedStatement ps = null;
  479 + try {
  480 + conn = ConnTools.makeConnection();
  481 +
  482 + ps = conn.prepareStatement("delete from PUERPERANT_VISIT_INFO WHERE ID='" + model.getId() + "'");
  483 + ps.executeUpdate();
  484 +
  485 +
  486 + MatDeliverQuery matDeliverQuery = new MatDeliverQuery();
  487 + matDeliverQuery.setYn(YnEnums.YES.getId());
  488 + matDeliverQuery.setId(model.getDeliverId());
  489 + List<MaternalDeliverModel> maternalDeliverModelList = matDeliverService.query(matDeliverQuery);
  490 + if (CollectionUtils.isEmpty(maternalDeliverModelList))
  491 + {
  492 + return;
  493 + }
  494 +
  495 + MaternalDeliverModel maternalDeliverModel = maternalDeliverModelList.get(0);
  496 +
  497 + Patients patients = patientsService.findOnePatientById(maternalDeliverModel.getParentId());
  498 +
  499 + //产后访视
  500 + String fmInfoSql = "insert into PUERPERANT_VISIT_INFO(ID,PUERPERANT_ID,PUERPERANT_NAME,PUERPERANT_ID_CARD,VISIT_DATE,VISIT_RESULT," +
  501 + "VISIT_DOCTOR,VISIT_HOSPITAL,OPERATOR,OPERAT_TIME,CREATE_TIME,UPDATE_TIME) " +
  502 + " values(?,?,?,?,?,?,?,?,?,?,?,?)";
  503 + ps = conn.prepareStatement(fmInfoSql);
  504 + ps.setString(1,model.getId());
  505 + ps.setString(2, maternalDeliverModel.getId());
  506 + ps.setString(3, patients.getUsername());
  507 + ps.setString(4, patients.getCardNo());
  508 + ps.setTimestamp(5, model.getVisitDate() == null ? new Timestamp(model.getCreateDate().getTime()) : new Timestamp(model.getVisitDate().getTime()));
  509 + ps.setString(6, model.getVisitRemark());
  510 +
  511 +
  512 + ps.setString(7, StringUtils.isNum(model.getVisitDoctor()) ? CommonsHelper.getUserName(model.getVisitDoctor(), usersService) : model.getVisitDoctor());
  513 + ps.setString(8, CommonsHelper.getHospitalName(maternalDeliverModel.getFmHospital(), organizationService));
  514 + ps.setString(9, StringUtils.isNum(model.getVisitCreateUser()) ? CommonsHelper.getUserName(model.getVisitCreateUser(), usersService) : model.getVisitCreateUser());
  515 +
  516 + ps.setTimestamp(10, model.getVisitDate()== null ? new Timestamp(model.getCreateDate().getTime()) : new Timestamp(model.getVisitDate().getTime()));
  517 + ps.setTimestamp(11, new Timestamp(model.getCreateDate().getTime()));
  518 + ps.setTimestamp(12, new Timestamp(model.getUpdateDate().getTime()));
  519 +
  520 + int saveFollowCount = ps.executeUpdate();
  521 + System.out.println("saveFollowCount="+saveFollowCount);
  522 + }
  523 + catch (Exception e)
  524 + {
  525 + ExceptionUtils.catchException(e,"saveRcMatdeliverFollowInfo error.");
  526 + }finally {
  527 + try {
  528 + if (ps != null)
  529 + {
  530 + ps.close();
  531 + }
  532 + if (conn != null)
  533 + {
  534 + conn.close();
  535 + }
  536 + } catch (SQLException e) {
  537 + }
  538 + }
  539 + }
  540 +
  541 +
  542 + public void saveRcNewBabyInfo(MaternalDeliverModel model)
  543 + {
  544 + Connection conn = null;
  545 + PreparedStatement ps = null;
  546 + try {
  547 + conn = ConnTools.makeConnection();
  548 +
  549 +
  550 + Patients patients = patientsService.findOnePatientById(model.getParentId());
  551 +
  552 + List<MaternalDeliverModel.Baby> babies = model.getBaby();
  553 + if (CollectionUtils.isNotEmpty(babies))
  554 + {
  555 + for (MaternalDeliverModel.Baby baby : babies)
  556 + {
  557 + try {
  558 + ps = conn.prepareStatement("delete from NEW_BORN_INFO WHERE ID='" + baby.getId() + "'");
  559 + ps.executeUpdate();
  560 + if (!"0".equals(baby.getPregnancyOut()))
  561 + {
  562 + continue;
  563 + }
  564 + //孕妇分娩信息
  565 + String fmInfoSql = "insert into NEW_BORN_INFO(ID,PUERPERANT_ID,PUERPERANT_NAME,PUERPERANT_ID_CARD,CHILD_NAME,GENDER,BIRTH_TIME,BIRTH_HEIGHT," +
  566 + "BIRTH_GEST_WEEKS,BIRTH_WEIGHT,APGAR_SCORE,WEAKNESS,HOSPITAL,MIDWIFE_DOCTOR,PREGNANT_ADDRESS," +
  567 + "CREATE_TIME,UPDATE_TIME) " +
  568 + " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
  569 + ps = conn.prepareStatement(fmInfoSql);
  570 + ps.setString(1,baby.getId() == null ? StringUtils.uuid() : baby.getId());
  571 + ps.setString(2,model.getId());
  572 + ps.setString(3,patients.getUsername());
  573 + ps.setString(4,patients.getCardNo());
  574 +
  575 + String babyName = "";
  576 + BabyModelQuery babyModelQuery = new BabyModelQuery();
  577 + babyModelQuery.setId(baby.getId());
  578 + List<BabyModel> babyModels = babyService.queryBabyWithQuery(babyModelQuery);
  579 + if (CollectionUtils.isNotEmpty(babyModels)) {
  580 + babyName = babyModels.get(0).getName();
  581 + }
  582 +
  583 + ps.setString(5,babyName);
  584 + ps.setString(6,baby.getBabyGender()==null ? null : (Integer.parseInt(baby.getBabyGender())+1)+"");
  585 + ps.setString(7,baby.getDueTime());
  586 + ps.setString(8,baby.getBabyHeight());
  587 + ps.setString(9,model.getDueWeek());
  588 + ps.setString(10,baby.getBabyWeight());
  589 + String p1Score = null;
  590 + if (baby.getApgarScore() != null)
  591 + {
  592 + Map<String, String> map = JsonUtil.getMap(baby.getApgarScore());
  593 + p1Score = map.get("pf1");
  594 + }
  595 + ps.setString(11,p1Score == null ? null : p1Score);
  596 + ps.setString(12,null);//缺陷
  597 + ps.setString(13, CommonsHelper.getHospitalName(model.getFmHospital(), organizationService));
  598 + ps.setString(14, CommonsHelper.getUserName(model.getDeliverDoctor(), usersService));
  599 + String postAddress = CommonsHelper.getResidence(patients.getProvincePostRestId(), patients.getCityPostRestId(),
  600 + patients.getAreaPostRestId(), patients.getStreetPostRestId(), patients.getAddressPostRest(), basicConfigService);
  601 + ps.setString(15, postAddress);
  602 +
  603 + ps.setTimestamp(16, new Timestamp(model.getCreated().getTime()));
  604 + ps.setTimestamp(17, new Timestamp(model.getModified().getTime()));
  605 +
  606 + int saveRcNewBabyInfoCount = ps.executeUpdate();
  607 + System.out.println("saveRcNewBabyInfo="+saveRcNewBabyInfoCount);
  608 + }catch (Exception e)
  609 + {
  610 + ExceptionUtils.catchException(e,"saveRcNewBabyInfo error.");
  611 + continue;
  612 + }
  613 +
  614 + }
  615 + }
  616 + }
  617 + catch (Exception e)
  618 + {
  619 + ExceptionUtils.catchException(e,"saveRcNewBabyInfo error.");
  620 + }finally {
  621 + try {
  622 + if (ps != null)
  623 + {
  624 + ps.close();
  625 + }
  626 + if (conn != null)
  627 + {
  628 + conn.close();
  629 + }
  630 + } catch (SQLException e) {
  631 + }
  632 + }
  633 + }
  634 +
  635 +
  636 +
  637 + public void saveRcFmInfo(MaternalDeliverModel model)
  638 + {
  639 + Connection conn = null;
  640 + PreparedStatement ps = null;
  641 + try {
  642 + conn = ConnTools.makeConnection();
  643 +
  644 + ps = conn.prepareStatement("delete from PUERPERANT_RECORD WHERE ID='" + model.getId() + "'");
  645 + ps.executeUpdate();
  646 +
  647 + Patients patients = patientsService.findOnePatientById(model.getParentId());
  648 +
  649 + //孕妇分娩信息
  650 + String fmInfoSql = "insert into PUERPERANT_RECORD(ID,PUERPERANT_NAME,PUERPERANT_ID_CARD,PREGNANT_TIMES,PUERPERANT_TIMES,BIRTH_TYPE,PREGNANCY,HIGH_RISK_FLAG" +
  651 + ",FETUS_NUMBER,REPORTER_DATE,DELIVER_DOCTOR,HOSPITAL,OPERATOR,OPERAT_TIME,CREATE_TIME,UPDATE_TIME) " +
  652 + " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
  653 + ps = conn.prepareStatement(fmInfoSql);
  654 + ps.setString(1,model.getId());
  655 + ps.setString(2,patients.getUsername());
  656 + ps.setString(3,patients.getCardNo());
  657 +
  658 + AntExChuQuery antExChuQuery = new AntExChuQuery();
  659 + antExChuQuery.setYn(YnEnums.YES.getId());
  660 + antExChuQuery.setParentId(patients.getId());
  661 + List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery);
  662 + String yc =null;
  663 + String cc =null;
  664 + if (CollectionUtils.isNotEmpty(antExChuModels))
  665 + {
  666 + AntExChuModel antExChuModel = antExChuModels.get(0);
  667 + yc = antExChuModel.getPregnancyTimes() == null ? "" : String.valueOf(antExChuModel.getPregnancyTimes());
  668 + cc = antExChuModel.getProdTime() == null ? "" : String.valueOf(antExChuModel.getProdTime());
  669 + }
  670 + ps.setString(4, yc);
  671 + ps.setString(5, cc);
  672 +
  673 + String fmType="";
  674 + String deliveryModeJson = model.getDeliveryMode();
  675 + Map<String, String> deliveryModeMap = JsonUtil.getMap(deliveryModeJson);
  676 + if (MapUtils.isNotEmpty(deliveryModeMap) && org.apache.commons.lang.StringUtils.isNotEmpty(deliveryModeMap.get("fmfs"))) {
  677 + for (FmTypeEnums fmTypeEnums : FmTypeEnums.values()) {
  678 + if (fmTypeEnums.getId().equals(deliveryModeMap.get("fmfs"))) {
  679 + if (fmTypeEnums.getId().equals("1"))
  680 + {
  681 + fmType = "1";
  682 + }
  683 + else if (fmTypeEnums.getId().equals("2"))
  684 + {
  685 + fmType = "3";
  686 + }
  687 + break;
  688 + }
  689 + }
  690 + }
  691 +
  692 + ps.setString(6,fmType);
  693 +
  694 + String status = "";
  695 + if (patients.getLastMenses() != null && patients.getBookbuildingDate() != null)
  696 + {
  697 + int week = DateUtil.getWeek(patients.getLastMenses(),patients.getBookbuildingDate());
  698 +
  699 + //怀孕1~12周为早孕。 怀孕13周~27周为孕中,28周到40周围孕晚期,分娩后是产后,产后42天后不再属于孕期妇女
  700 + if (week >=0 && 12 >= week)
  701 + {
  702 + status= "1";
  703 + }
  704 + else if (week >=13 && 27 >= week)
  705 + {
  706 + status= "2";
  707 + }
  708 + else if (week >=28 && 40 >= week)
  709 + {
  710 + status= "3";
  711 + }
  712 + else
  713 + {
  714 + status= "4";
  715 + }
  716 + }
  717 +
  718 + ps.setString(7, status);
  719 +
  720 + String isRisk="否";
  721 + if ((CollectionUtils.isNotEmpty(patients.getRiskFactorId()) && !patients.getRiskFactorId().contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6"))
  722 + || patients.getoRiskFactor() != null)
  723 + {
  724 + isRisk="是";
  725 + }
  726 + ps.setString(8,isRisk);
  727 + ps.setString(9, model.getTireNumber() == null ? null : String.valueOf(model.getTireNumber()));
  728 +
  729 + ps.setTimestamp(10, new Timestamp(model.getCreated().getTime()));
  730 +
  731 +
  732 + ps.setString(11, StringUtils.isNum(model.getDeliverDoctor()) ? CommonsHelper.getUserName(model.getDeliverDoctor(), usersService) : model.getDeliverDoctor());
  733 + ps.setString(12, CommonsHelper.getHospitalName(model.getFmHospital(), organizationService));
  734 + ps.setString(13, CommonsHelper.getUserName(model.getDeliverDoctor(), usersService));
  735 +
  736 + ps.setTimestamp(14, new Timestamp(model.getCreated().getTime()));
  737 + ps.setTimestamp(15, new Timestamp(model.getCreated().getTime()));
  738 + ps.setTimestamp(16, new Timestamp(model.getModified().getTime()));
  739 +
  740 + int saveFmCount = ps.executeUpdate();
  741 + System.out.println("saveFmCount="+saveFmCount);
  742 + }
  743 + catch (Exception e)
  744 + {
  745 + ExceptionUtils.catchException(e,"saveRcFmInfo error.");
  746 + }finally {
  747 + try {
  748 + if (ps != null)
  749 + {
  750 + ps.close();
  751 + }
  752 + if (conn != null)
  753 + {
  754 + conn.close();
  755 + }
  756 + } catch (SQLException e) {
  757 + }
  758 + }
  759 + }
  760 +
  761 +
45 762 public void saveRcPatientInfo(Patients patients)
46 763 {
47 764 Connection conn = null;
48 765  
49 766  
... ... @@ -50,19 +767,44 @@
50 767 conn = ConnTools.makeConnection();
51 768  
52 769 ps = conn.prepareStatement("delete from PREGNANT_BASE_INFO WHERE ID='"+patients.getId()+"'");
53   - ps.executeQuery();
  770 + ps.executeUpdate();
54 771  
55 772 //孕妇基本信息
56   - String baseInfoSql = "insert into PREGNANT_BASE_INFO(ID,NAME,ID_CARD,CERTIFICATE_TYPE,CERTIFICATE_NO,COMPANY,COUNTRY,TELPHONE,RESIDENCE_ADDRESS,RESIDENCE_PROVINCE," +
57   - "RESIDENCE_CITY,RESIDENCE_COUNTRY,RESIDENCE_TOWN,RESIDENCE_VILIAGE,REGISTER_ADDRESS,REGISTER_PROVINCE,REGISTER_CITY,REGISTER_COUNTRY,REGISTER_TOWN,REGISTER_VILIAGE," +
58   - "BIRTH_DATE,CONTACT_NAME,CONTACT_TEL_NO,HUSBAND_NAME,HUSBAND_ID_CARD,HUSBAND_TEL,HUSBAND_CERTIFICATE_TYPE,HUSBAND_CERTIFICATE_NO,HUSBAND_RESIDENCE_ADDRESS,HUSBAND_COMPANY," +
59   - "STATUS,DATA_FROM_HOSPITAL,CREATE_TIME,UPDATE_TIME,OPERATOR,OPERAT_TIME,HEALTH_RECORD) " +
60   - " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
  773 + String baseInfoSql = "insert into PREGNANT_BASE_INFO(ID,NAME,ID_CARD,CERTIFICATE_TYPE,CERTIFICATE_NO,COMPANY,COUNTRY," +
  774 + "RESIDENCE_ADDRESS,RESIDENCE_PROVINCE, RESIDENCE_CITY,RESIDENCE_COUNTRY,RESIDENCE_TOWN,RESIDENCE_HOURCE_NO," +
  775 + "REGISTER_ADDRESS, REGISTER_PROVINCE,REGISTER_CITY,REGISTER_COUNTRY,REGISTER_TOWN,REGISTER_HOURCE_NO," +
  776 + "BIRTH_DATE,CONTACT_NAME,CONTACT_TEL_NO,HUSBAND_NAME,HUSBAND_ID_CARD,HUSBAND_TEL,HUSBAND_CERTIFICATE_TYPE," +
  777 + "HUSBAND_CERTIFICATE_NO,HUSBAND_RESIDENCE_ADDRESS,HUSBAND_COMPANY," +
  778 + "STATUS,DATA_FROM_HOSPITAL,CREATE_TIME,UPDATE_TIME,OPERATOR,OPERAT_TIME,HEALTH_RECORD,TELPHONE) " +
  779 + " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
61 780 ps = conn.prepareStatement(baseInfoSql);
62 781 ps.setString(1,patients.getId());
63 782 ps.setString(2,patients.getUsername());
64 783 ps.setString(3,patients.getCardNo());
65   - ps.setString(4, CommonsHelper.getName1(patients.getPcerteTypeId(), basicConfigService));
  784 +
  785 + String pcertType = "";
  786 + if (StringUtils.isNotEmpty(patients.getPcerteTypeId()))
  787 + {
  788 + String name = CommonsHelper.getName1(patients.getPcerteTypeId(), basicConfigService);
  789 + if ("身份证".equals(name))
  790 + {
  791 + pcertType = "1";
  792 + }
  793 + else if ("护照".equals(name))
  794 + {
  795 + pcertType = "3";
  796 + }
  797 + else if ("军官证".equals(name))
  798 + {
  799 + pcertType = "4";
  800 + }
  801 + else
  802 + {
  803 + pcertType = "9";
  804 + }
  805 + }
  806 +
  807 + ps.setString(4, pcertType);
66 808 ps.setString(5,patients.getCardNo());
67 809 ps.setString(6,patients.getPworkUnit());
68 810 ps.setString(7, CommonsHelper.getName1(patients.getPcountryId(), basicConfigService));
69 811  
70 812  
71 813  
72 814  
73 815  
74 816  
75 817  
... ... @@ -84,50 +826,81 @@
84 826 ps.setString(14,addressRegister);
85 827 ps.setString(15,CommonsHelper.getName1(patients.getProvinceRegisterId(), basicConfigService));
86 828 ps.setString(16,CommonsHelper.getName1(patients.getCityRegisterId(), basicConfigService));
87   - ps.setString(17,CommonsHelper.getName1(patients.getAreaRegisterId(), basicConfigService));
  829 + ps.setString(17, CommonsHelper.getName1(patients.getAreaRegisterId(), basicConfigService));
88 830 ps.setString(18, CommonsHelper.getName1(patients.getStreetRegisterId(), basicConfigService));
89 831 ps.setString(19, patients.getAddressRegister());
90 832  
91   - ps.setDate(20, new Date(patients.getBirth().getTime()));
  833 + ps.setTimestamp(20, patients.getBirth() != null ? new Timestamp(patients.getBirth().getTime()) : null);
92 834 ps.setString(21, patients.getUsername());
93 835 ps.setString(22, patients.getPhone());
94 836 ps.setString(23, patients.getHusbandName());
95 837 ps.setString(24, patients.getHcertificateNum());
96 838 ps.setString(25,patients.getHusbandPhone());
97   - ps.setString(26,CommonsHelper.getName1(patients.getHcertificateTypeId(), basicConfigService));
  839 +
  840 +
  841 + String hcertType = "";
  842 + if (StringUtils.isNotEmpty(patients.getPcerteTypeId()))
  843 + {
  844 + String name = CommonsHelper.getName1(patients.getHcertificateTypeId(), basicConfigService);
  845 + if ("身份证".equals(name))
  846 + {
  847 + hcertType = "1";
  848 + }
  849 + else if ("护照".equals(name))
  850 + {
  851 + hcertType = "3";
  852 + }
  853 + else if ("军官证".equals(name))
  854 + {
  855 + hcertType = "4";
  856 + }
  857 + else
  858 + {
  859 + hcertType = "9";
  860 + }
  861 + }
  862 +
  863 +
  864 + ps.setString(26,hcertType);
98 865 ps.setString(27, patients.getHcertificateNum());
99 866 //户籍地址
100 867 String haddressRegister = CommonsHelper.getResidence(patients.getHprovinceRegisterId(), patients.getHcityRegisterId(),
101 868 patients.getHareaRegisterId(), patients.getHstreetRegisterId(), patients.getHaddressRegister(), basicConfigService);
102 869 ps.setString(28, haddressRegister);
103   - int week = DateUtil.getWeek(patients.getLastMenses(),patients.getBookbuildingDate());
  870 + ps.setString(29, patients.getHworkUnit());
104 871 String status = "";
105   - //怀孕1~12周为早孕。 怀孕13周~27周为孕中,28周到40周围孕晚期,分娩后是产后,产后42天后不再属于孕期妇女
106   - if (week >=0 && 12 >= week)
  872 + if (patients.getLastMenses() != null && patients.getBookbuildingDate() != null)
107 873 {
108   - status= "1";
  874 + int week = DateUtil.getWeek(patients.getLastMenses(),patients.getBookbuildingDate());
  875 +
  876 + //怀孕1~12周为早孕。 怀孕13周~27周为孕中,28周到40周围孕晚期,分娩后是产后,产后42天后不再属于孕期妇女
  877 + if (week >=0 && 12 >= week)
  878 + {
  879 + status= "1";
  880 + }
  881 + else if (week >=13 && 27 >= week)
  882 + {
  883 + status= "2";
  884 + }
  885 + else if (week >=28 && 40 >= week)
  886 + {
  887 + status= "3";
  888 + }
  889 + else
  890 + {
  891 + status= "4";
  892 + }
109 893 }
110   - else if (week >=13 && 27 >= week)
111   - {
112   - status= "2";
113   - }
114   - else if (week >=28 && 40 >= week)
115   - {
116   - status= "3";
117   - }
118   - else
119   - {
120   - status= "4";
121   - }
122   - ps.setString(29, status);
123   - ps.setString(30, CommonsHelper.getHospitalName(patients.getHospitalId(), organizationService));
124 894  
125   - ps.setDate(31, new Date(patients.getCreated().getTime()));
126   - ps.setDate(32, new Date(patients.getModified().getTime()));
127   - ps.setString(33, CommonsHelper.getUserName(patients.getBookbuildingDoctor(), usersService));
128   - ps.setDate(34, new Date(patients.getCreated().getTime()));
129   - ps.setString(35, patients.getFileCode());
130   - System.out.print(baseInfoSql);
  895 + ps.setString(30, status);
  896 + ps.setString(31, CommonsHelper.getHospitalName(patients.getHospitalId(), organizationService));
  897 +
  898 + ps.setTimestamp(32, new Timestamp(patients.getCreated().getTime()));
  899 + ps.setTimestamp(33, patients.getModified() == null ? new Timestamp(patients.getCreated().getTime()) : new Timestamp(patients.getModified().getTime()));
  900 + ps.setString(34, CommonsHelper.getUserName(patients.getBookbuildingDoctor(), usersService));
  901 + ps.setTimestamp(35, new Timestamp(patients.getCreated().getTime()));
  902 + ps.setString(36, patients.getFileCode());
  903 + ps.setString(37, patients.getPhone());
131 904 int saveCount = ps.executeUpdate();
132 905 System.out.println("saveCount="+saveCount);
133 906 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java View file @ b4887a0
... ... @@ -159,6 +159,8 @@
159 159  
160 160 @Autowired
161 161 private RcGlxtService rcGlxtService;
  162 + @Autowired
  163 + private FolicAcidService folicAcidService;
162 164  
163 165 @Autowired
164 166 private MatDeliverFacade matDeliverFacade;
... ... @@ -2419,6 +2421,160 @@
2419 2421 }
2420 2422 }
2421 2423  
  2424 + @RequestMapping(value = "/rcFmInfo", method = RequestMethod.GET)
  2425 + @ResponseBody
  2426 + public void rcFmInfo(@RequestParam(required = false) String hospitalId) {
  2427 +
  2428 + OrganizationQuery organizationQuery = new OrganizationQuery();
  2429 + organizationQuery.setYn(YnEnums.YES.getId());
  2430 + if (StringUtils.isNotEmpty(hospitalId)) {
  2431 + organizationQuery.setId(Integer.parseInt(hospitalId));
  2432 + }
  2433 + List<Organization> organizationList = organizationService.queryOrganization(organizationQuery);
  2434 +
  2435 + MatDeliverQuery matDeliverQuery = new MatDeliverQuery();
  2436 + matDeliverQuery.setYn(YnEnums.YES.getId());
  2437 + if (CollectionUtils.isNotEmpty(organizationList)) {
  2438 + List<String> hids = new ArrayList<>();
  2439 + for (Organization org :organizationList)
  2440 + {
  2441 + hids.add(org.getId()+"");
  2442 + }
  2443 + matDeliverQuery.setFmHospitalList(hids);
  2444 + }
  2445 + List<MaternalDeliverModel> list2 = matDeliverService.query(matDeliverQuery);
  2446 +
  2447 + if (CollectionUtils.isNotEmpty(list2))
  2448 + {
  2449 + for (MaternalDeliverModel maternalDeliverModel : list2)
  2450 + {
  2451 + rcGlxtService.saveRcFmInfo(maternalDeliverModel);
  2452 + }
  2453 + }
  2454 + }
  2455 +
  2456 +
  2457 + @RequestMapping(value = "/rcNewBabyInfo", method = RequestMethod.GET)
  2458 + @ResponseBody
  2459 + public void rcNewBabyInfo(@RequestParam(required = false) String hospitalId) {
  2460 +
  2461 + OrganizationQuery organizationQuery = new OrganizationQuery();
  2462 + organizationQuery.setYn(YnEnums.YES.getId());
  2463 + if (StringUtils.isNotEmpty(hospitalId)) {
  2464 + organizationQuery.setId(Integer.parseInt(hospitalId));
  2465 + }
  2466 + List<Organization> organizationList = organizationService.queryOrganization(organizationQuery);
  2467 +
  2468 + MatDeliverQuery matDeliverQuery = new MatDeliverQuery();
  2469 + matDeliverQuery.setYn(YnEnums.YES.getId());
  2470 + if (CollectionUtils.isNotEmpty(organizationList)) {
  2471 + List<String> hids = new ArrayList<>();
  2472 + for (Organization org :organizationList)
  2473 + {
  2474 + hids.add(org.getId()+"");
  2475 + }
  2476 + matDeliverQuery.setFmHospitalList(hids);
  2477 + }
  2478 + List<MaternalDeliverModel> list2 = matDeliverService.query(matDeliverQuery);
  2479 +
  2480 + if (CollectionUtils.isNotEmpty(list2))
  2481 + {
  2482 + for (MaternalDeliverModel maternalDeliverModel : list2)
  2483 + {
  2484 + rcGlxtService.saveRcNewBabyInfo(maternalDeliverModel);
  2485 + }
  2486 + }
  2487 + }
  2488 +
  2489 +
  2490 + /**
  2491 + *产后访视
  2492 + * @param hospitalId
  2493 + */
  2494 + @RequestMapping(value = "/rcFmFollowInfo", method = RequestMethod.GET)
  2495 + @ResponseBody
  2496 + public void rcFmFollowInfo(@RequestParam(required = false) String hospitalId) {
  2497 +
  2498 + MatDeliverFollowQuery matDeliverFollowQuery = new MatDeliverFollowQuery();
  2499 + List<MatdeliverFollowModel> matdeliverFollowModels = matDeliverFollowService.query(matDeliverFollowQuery);
  2500 + matDeliverFollowQuery.setVisitStatus(2);
  2501 +
  2502 + if (CollectionUtils.isNotEmpty(matdeliverFollowModels))
  2503 + {
  2504 + for (MatdeliverFollowModel matdeliverFollowModel : matdeliverFollowModels)
  2505 + {
  2506 + rcGlxtService.saveRcMatdeliverFollowInfo(matdeliverFollowModel);
  2507 + }
  2508 + }
  2509 + }
  2510 + @Autowired
  2511 + private PremaritalCheckupService premaritalCheckupService;
  2512 +
  2513 + /**
  2514 + * 婚前检查
  2515 + * @param hospitalId
  2516 + */
  2517 + @RequestMapping(value = "/rcPremaritalCheckup", method = RequestMethod.GET)
  2518 + @ResponseBody
  2519 + public void rcPremaritalCheckup(@RequestParam(required = false) String hospitalId) {
  2520 +
  2521 + PremaritalCheckupQuery query = new PremaritalCheckupQuery();
  2522 + query.setYn(YnEnums.YES.getId());
  2523 + query.setHospitalId(hospitalId);
  2524 + query.setSexType(1);
  2525 + List<PremaritalCheckup> checkupList = premaritalCheckupService.queryPremaritalCheckup(query);
  2526 +
  2527 + if (CollectionUtils.isNotEmpty(checkupList))
  2528 + {
  2529 + for (PremaritalCheckup premaritalCheckup : checkupList)
  2530 + {
  2531 + rcGlxtService.saveRcPremaritalCheckupInfo(premaritalCheckup);
  2532 + }
  2533 + }
  2534 + }
  2535 +
  2536 +
  2537 + /**
  2538 + * 叶酸发放
  2539 + * @param hospitalId
  2540 + */
  2541 + @RequestMapping(value = "/rcFolicAcidInfo", method = RequestMethod.GET)
  2542 + @ResponseBody
  2543 + public void rcFolicAcidInfo(@RequestParam(required = false) String hospitalId) {
  2544 +
  2545 + FolicAcidQuery folicAcidQuery = new FolicAcidQuery();
  2546 + folicAcidQuery.setYn(YnEnums.YES.getId());
  2547 + folicAcidQuery.setId("587621160cf248988f190469");
  2548 +
  2549 + List<FolicAcid> folicAcidList = folicAcidService.queryFolicAcidWithSort(folicAcidQuery, "drawTime", Sort.Direction.ASC);
  2550 +
  2551 + if (CollectionUtils.isNotEmpty(folicAcidList))
  2552 + {
  2553 + for (FolicAcid folicAcid : folicAcidList)
  2554 + {
  2555 + rcGlxtService.saveRcFolicAcidInfo(folicAcid);
  2556 + }
  2557 + }
  2558 + }
  2559 +
  2560 +
  2561 + @RequestMapping(value = "/rcSieveInfo", method = RequestMethod.GET)
  2562 + @ResponseBody
  2563 + public void rcSieveInfo(@RequestParam(required = false) String hospitalId) {
  2564 +
  2565 +
  2566 + SieveResultQuery sieveResultQuery = new SieveResultQuery();
  2567 + sieveResultQuery.setYn(YnEnums.YES.getId());
  2568 + List<SieveResultModel> list = sieveService.queryListSieveResult(sieveResultQuery);
  2569 +
  2570 + if (CollectionUtils.isNotEmpty(list))
  2571 + {
  2572 + for (SieveResultModel sieveResultModel : list)
  2573 + {
  2574 + rcGlxtService.saveRcSieveInfo(sieveResultModel);
  2575 + }
  2576 + }
  2577 + }
2422 2578  
2423 2579 }