Commit 30c4ef2a14ae1c181fb9187af8d6c6dc280dde90

Authored by liquanyu
1 parent ad8d95d426

荣成接口

Showing 2 changed files with 197 additions and 2 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/rcfy/RcGlxtService.java View file @ 30c4ef2
... ... @@ -79,15 +79,39 @@
79 79 private ResidentsArchiveService residentsArchiveService;
80 80  
81 81 private static Map<String,String> hospitalsMap = new HashMap<>();
  82 + private static Map<String,String> KEY_MAP = new HashMap<>();
  83 + private static Map<String,String> CHECK_STATUS = new HashMap<>();
  84 + private static Map<String,String> CHECK_TYPE = new HashMap<>();
82 85 static{
83   - hospitalsMap.put("2100001785","371082007011");//荣成市人民医院
84   -// hospitalsMap.put("216","216");//荣成市人民医院
  86 +// hospitalsMap.put("2100001785","371082007011");//荣成市人民医院
  87 + hospitalsMap.put("216","216");//测试用的秦皇岛医院
85 88 hospitalsMap.put("2100001818","371082006011");//荣成市石岛人民医院
86 89 hospitalsMap.put("2100001772","371082007001");//荣成市中医院
87 90 hospitalsMap.put("2100001750","371082000011");//荣成市妇幼保健院
88 91  
  92 + KEY_MAP.put("syjg","梅毒");
  93 + KEY_MAP.put("ygekt" , "乙肝e抗体");
  94 + KEY_MAP.put("ygeky" , "乙肝e抗原");
  95 + KEY_MAP.put("yghxkt" , "乙肝核心抗体");
  96 + KEY_MAP.put("ygbmky" , "乙肝表面抗原");
  97 + KEY_MAP.put("hivkt" , "艾滋病");
  98 + KEY_MAP.put("ygbmkt" ,"乙肝表面抗体");
  99 +
  100 + CHECK_STATUS.put("yang" , "阳性");
  101 + CHECK_STATUS.put("ruoyang" , "弱阳");
  102 + CHECK_STATUS.put("yin" ,"阴性");
  103 +
  104 + CHECK_TYPE.put("syjg","1009");
  105 + CHECK_TYPE.put("ygekt" , "1010");
  106 + CHECK_TYPE.put("ygeky" , "1010");
  107 + CHECK_TYPE.put("yghxkt" , "1010");
  108 + CHECK_TYPE.put("ygbmky" , "1010");
  109 + CHECK_TYPE.put("hivkt" , "1008");
  110 + CHECK_TYPE.put("ygbmkt" ,"1010");
89 111 }
90 112  
  113 +
  114 +
91 115 public List<String> getHids()
92 116 {
93 117 List<String> hids = new ArrayList<>();
... ... @@ -96,6 +120,149 @@
96 120 hids.add(hospitalsMap.get(key));
97 121 }
98 122 return hids;
  123 + }
  124 +
  125 +
  126 + /**
  127 + * 孕产妇母婴阻断检查信息
  128 + * @param model
  129 + */
  130 + public void saveRcZdInfo(AntExChuModel model)
  131 + {
  132 +
  133 + Connection conn = null;
  134 + PreparedStatement ps = null;
  135 + try {
  136 + conn = ConnTools.makeConnection();
  137 +
  138 +
  139 + Map<String,String> map = new HashMap();
  140 +
  141 + if (StringUtils.isNotEmpty(model.getSyjg()))
  142 + {
  143 + map.put("syjg",model.getSyjg());
  144 + }
  145 + if (StringUtils.isNotEmpty(model.getYgekt()))
  146 + {
  147 + map.put("ygekt",model.getYgekt());
  148 + }
  149 + if (StringUtils.isNotEmpty(model.getYgeky()))
  150 + {
  151 + map.put("ygeky",model.getYgeky());
  152 + }
  153 + if (StringUtils.isNotEmpty(model.getYghxkt()))
  154 + {
  155 + map.put("yghxkt",model.getYghxkt());
  156 + }
  157 + if (StringUtils.isNotEmpty(model.getYgbmky()))
  158 + {
  159 + map.put("ygbmky",model.getYgbmky());
  160 + }
  161 + if (StringUtils.isNotEmpty(model.getHivkt()))
  162 + {
  163 + map.put("hivkt",model.getHivkt());
  164 + }
  165 + if (StringUtils.isNotEmpty(model.getYgbmkt()))
  166 + {
  167 + map.put("ygbmkt",model.getYgbmkt());
  168 + }
  169 + if (map.size() == 0)
  170 + {
  171 + return;
  172 + }
  173 +
  174 + String sql = "insert into MOTHER_CHILD_BLOCK_CHECK(ID,ID_CARD,NAME,STATUS,RIS_TIME,MATERNAL_CHILD_BLOCK_CATE,MATERNAL_CHILD_BLOCK_CATE_NAME," +
  175 + "IS_TOLL,IS_SEND_REMIND,CHECK_RESULT,HOSPITAL,DOCTOR,OPERATOR,OPERAT_TIME,CREATE_TIME,UPDATE_TIME) " +
  176 + " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
  177 +
  178 + Patients patients = patientsService.findOnePatientById(model.getParentId());
  179 + if (patients == null)
  180 + {
  181 + return;
  182 + }
  183 +
  184 + if (map.size() > 0)
  185 + {
  186 + for (String key : map.keySet())
  187 + {
  188 + ps = conn.prepareStatement("delete from MOTHER_CHILD_BLOCK_CHECK WHERE ID ='" + model.getId()+key + "'");
  189 + ps.executeUpdate();
  190 +
  191 + ps = conn.prepareStatement(sql);
  192 + ps.setString(1,model.getId()+key);
  193 + ps.setString(2,patients.getCardNo());
  194 + ps.setString(3,patients.getUsername());
  195 + String status = "";
  196 + int week = 0;
  197 + if (patients.getLastMenses() != null && model.getCreated() != null)
  198 + {
  199 + week = DateUtil.getWeek(patients.getLastMenses(),model.getCreated());
  200 +
  201 + //怀孕1~12周为早孕。 怀孕13周~27周为孕中,28周到40周围孕晚期,分娩后是产后,产后42天后不再属于孕期妇女
  202 + if (week >=0 && 12 >= week)
  203 + {
  204 + status= "1";
  205 + }
  206 + else if (week >=13 && 27 >= week)
  207 + {
  208 + status= "2";
  209 + }
  210 + else if (week >=28 && 40 >= week)
  211 + {
  212 + status= "3";
  213 + }
  214 + else
  215 + {
  216 + status = "4";
  217 + }
  218 + }
  219 + ps.setString(4, status);
  220 + ps.setTimestamp(5, new Timestamp(model.getCheckTime().getTime()));
  221 +
  222 + ps.setString(6, CHECK_TYPE.get(key));
  223 + ps.setString(7, KEY_MAP.get(key));
  224 + ps.setString(8, null);
  225 + ps.setString(9, null);
  226 +
  227 + String value = map.get(key);
  228 + String result = CHECK_STATUS.get(value);
  229 + if ("syjg".equals(key) && StringUtils.isNotEmpty(model.getSyjgSelect()))
  230 + {
  231 + result+= model.getSyjgSelect().equals("1") ? "(初诊结果)" : "(已确诊)";
  232 + }
  233 + else if ("hivkt".equals(key) && StringUtils.isNotEmpty(model.getHivktSelect()))
  234 + {
  235 + result+= model.getHivktSelect().equals("1") ? "(初诊结果)" : "(已确诊)";
  236 + }
  237 + ps.setString(10, result);
  238 + ps.setString(11, CommonsHelper.getHospitalName(model.getHospitalId(), organizationService));
  239 + ps.setString(12, StringUtils.isNum(model.getProdDoctor()) ? CommonsHelper.getUserName(model.getProdDoctor(), usersService) : model.getProdDoctor());
  240 + ps.setString(13, CommonsHelper.getUserName(model.getOperator()+"", usersService));
  241 + ps.setTimestamp(14, new Timestamp(model.getCreated().getTime()));
  242 + ps.setTimestamp(15, new Timestamp(model.getCreated().getTime()));
  243 + ps.setTimestamp(16, new Timestamp(model.getModified().getTime()));
  244 + int saveRcZdInfoCount = ps.executeUpdate();
  245 + System.out.println("saveRcZdInfoCount="+saveRcZdInfoCount);
  246 + }
  247 + }
  248 +
  249 + }
  250 + catch (Exception e)
  251 + {
  252 + ExceptionUtils.catchException(e,"saveRcZdInfoCount error.");
  253 + }finally {
  254 + try {
  255 + if (ps != null)
  256 + {
  257 + ps.close();
  258 + }
  259 + if (conn != null)
  260 + {
  261 + conn.close();
  262 + }
  263 + } catch (SQLException e) {
  264 + }
  265 + }
99 266 }
100 267  
101 268  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java View file @ 30c4ef2
... ... @@ -2596,5 +2596,33 @@
2596 2596 }
2597 2597 }
2598 2598  
  2599 +
  2600 + /**
  2601 + * 母婴阻断
  2602 + * @param hospitalId
  2603 + */
  2604 + @RequestMapping(value = "/rcZdInfo", method = RequestMethod.GET)
  2605 + @ResponseBody
  2606 + public void rcZdInfo(@RequestParam(required = false) String hospitalId) {
  2607 +
  2608 + AntExChuQuery antExChuQuery = new AntExChuQuery();
  2609 + antExChuQuery.setYn(YnEnums.YES.getId());
  2610 + antExChuQuery.setHospitalList(rcGlxtService.getHids());
  2611 + antExChuQuery.setCreatedTimeStart(DateUtil.addMonth(new Date(),-2));
  2612 + antExChuQuery.setCreatedTimeEnd(new Date());
  2613 + List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery);
  2614 + if (CollectionUtils.isNotEmpty(antExChuModels))
  2615 + {
  2616 + for (AntExChuModel chuModel : antExChuModels)
  2617 + {
  2618 + rcGlxtService.saveRcZdInfo(chuModel);
  2619 + }
  2620 + }
  2621 + }
  2622 +
  2623 +
  2624 +
  2625 +
  2626 +
2599 2627 }