Commit 06a5ea308f38a65c8ced62635ad68d01240e667f

Authored by liquanyu
1 parent 24417d1418
Exists in master and in 1 other branch dev

检查项

Showing 4 changed files with 203 additions and 23 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/lcfy/LisService.java View file @ 06a5ea3
1 1 package com.lyms.hospitalapi.lcfy;
2 2  
3 3 import com.lyms.platform.common.utils.DateUtil;
  4 +import com.lyms.platform.common.utils.SystemConfig;
4 5 import com.lyms.platform.pojo.PreEugenicsBaseModel;
  6 +import com.lyms.platform.pojo.ResidentsArchiveModel;
5 7 import org.apache.commons.dbutils.DbUtils;
6 8 import org.springframework.stereotype.Service;
7 9  
8 10  
9 11  
10 12  
11 13  
... ... @@ -9,35 +11,51 @@
9 11 import java.sql.PreparedStatement;
10 12 import java.sql.ResultSet;
11 13 import java.sql.SQLException;
12   -import java.util.Date;
13   -import java.util.HashMap;
14   -import java.util.Map;
  14 +import java.util.*;
15 15  
16 16 /**
  17 + * 陵城妇幼保存检查项到lis系统中
17 18 * Created by Administrator on 2016/9/9 0009.
18 19 */
19 20 @Service("lcfyLisService")
20 21 public class LisService {
21 22  
  23 + /**
  24 + * 孕前优生检查时候保存检查项到lis系统中
  25 + * @param model
  26 + * @return
  27 + */
22 28 public Map<String,Object> save(PreEugenicsBaseModel model){
23 29 Map<String,String> itemsWamen = new HashMap<>();
24   - itemsWamen.put("lyms001","白带检查");
25   - itemsWamen.put("lyms002","血细胞分析");
26   - itemsWamen.put("lyms003","血型");
27   - itemsWamen.put("lyms004","血糖");
28   - itemsWamen.put("lyms005","乙肝血清学检查");
29   - itemsWamen.put("lyms006","肝肾功能检测");
30   - itemsWamen.put("lyms007","甲状腺功能检测");
31   - itemsWamen.put("lyms008","病毒筛查");
32   - itemsWamen.put("lyms009","尿常规检查");
  30 + itemsWamen.put("lyms001","白带常规检查");
  31 + itemsWamen.put("lyms002","淋球菌检测");
  32 + itemsWamen.put("lyms003","沙眼衣原体检测");
  33 + itemsWamen.put("lyms004","血液常规检验");
  34 + itemsWamen.put("lyms005","尿液常规检验");
  35 + itemsWamen.put("lyms006","ABO红细胞定型");
  36 + itemsWamen.put("lyms007","RH血型鉴定");
  37 + itemsWamen.put("lyms008","血清葡萄糖检测");
  38 + itemsWamen.put("lyms009","乙型肝炎血清五项检测");
  39 + itemsWamen.put("lyms010","肝功能检测(谷丙转氨酶)");
  40 + itemsWamen.put("lyms011","肾功能检测(肌酐)");
  41 + itemsWamen.put("lyms012","甲状腺功能(促甲状腺激素)");
  42 + itemsWamen.put("lyms013","梅毒螺旋体筛查");
  43 + itemsWamen.put("lyms014","风疹病毒IgG抗体测定");
  44 + itemsWamen.put("lyms015","巨细胞病毒IgM测定");
  45 + itemsWamen.put("lyms016","巨细胞病毒IgG测定");
  46 + itemsWamen.put("lyms017","弓形体IgM测定");
  47 + itemsWamen.put("lyms018","弓形体IgG测定");
  48 + itemsWamen.put("lyms019","妇科超声常规检查");
33 49  
34 50  
35 51 Map<String,String> itemsMan = new HashMap<>();
36   - itemsMan.put("lyms003","血型");
37   - itemsMan.put("lyms009","尿常规检查");
38   - itemsMan.put("lyms010","梅毒螺旋体筛查");
39   - itemsMan.put("lyms011","乙肝血清学检查");
40   - itemsMan.put("lyms012","肝肾功能检测");
  52 + itemsMan.put("lyms005","尿液常规检验");
  53 + itemsMan.put("lyms006","ABO红细胞定型");
  54 + itemsMan.put("lyms007","RH血型鉴定");
  55 + itemsMan.put("lyms009","乙型肝炎血清五项检测");
  56 + itemsMan.put("lyms010","肝功能检测(谷丙转氨酶)");
  57 + itemsMan.put("lyms011","肾功能检测(肌酐)");
  58 + itemsMan.put("lyms013","梅毒螺旋体筛查");
41 59 Connection conn = null;
42 60 String sql = "insert into TI_申请信息孕(v患者类别,v患者编号,v患者ID号,v患者姓名,v性别,v年龄,v年龄类型,v申请项目编码,v申请项目名称,v唯一标识号,iTag,v手机号,v身份证号,d申请时间,v申请日期,i项目数量) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
43 61 PreparedStatement ps = null;
44 62  
... ... @@ -103,12 +121,143 @@
103 121 e1.printStackTrace();
104 122 }
105 123 DbUtils.closeQuietly(conn);
106   -
107 124 e.printStackTrace();
108 125 System.out.println(e.getMessage());
109 126 }
110 127 return null;
111 128 }
112 129  
  130 +
  131 + /**
  132 + * 婚检中保存检查项 到lis系统中
  133 + * @param residentsArchiveModel
  134 + * @return
  135 + */
  136 + public Map<String,Object> save(ResidentsArchiveModel residentsArchiveModel ){
  137 + Map<String,String> itemsWamen = new HashMap<>();
  138 + itemsWamen.put("lymsh001","白带常规检查");
  139 + itemsWamen.put("lymsh002","淋球菌检测");
  140 + itemsWamen.put("lymsh003","沙眼衣原体检测");
  141 + itemsWamen.put("lymsh004","血液常规检验");
  142 + itemsWamen.put("lymsh005","尿液常规检验");
  143 + itemsWamen.put("lymsh006","ABO红细胞定型");
  144 + itemsWamen.put("lymsh007","RH血型鉴定");
  145 + itemsWamen.put("lymsh008","血清葡萄糖检测");
  146 + itemsWamen.put("lymsh009","乙型肝炎血清五项检测");
  147 + itemsWamen.put("lymsh010","肝功能检测(谷丙转氨酶)");
  148 + itemsWamen.put("lymsh011","肾功能检测(肌酐)");
  149 + itemsWamen.put("lymsh012","甲状腺功能(促甲状腺激素)");
  150 + itemsWamen.put("lymsh013","梅毒螺旋体筛查");
  151 + itemsWamen.put("lymsh014","风疹病毒IgG抗体测定");
  152 + itemsWamen.put("lymsh015","巨细胞病毒IgM测定");
  153 + itemsWamen.put("lymsh016","巨细胞病毒IgG测定");
  154 + itemsWamen.put("lymsh017","弓形体IgM测定");
  155 + itemsWamen.put("lymsh018","弓形体IgG测定");
  156 + itemsWamen.put("lymsh019","妇科超声常规检查");
  157 +
  158 +
  159 + Map<String,String> itemsWamenj = new HashMap<>();
  160 + itemsWamenj.put("lymsh004","血液常规检验");
  161 + itemsWamenj.put("lymsh005","尿液常规检验");
  162 + itemsWamenj.put("lymsh009","乙型肝炎血清五项检测");
  163 + itemsWamenj.put("lymsh010","肝功能检测(谷丙转氨酶)");
  164 + itemsWamenj.put("lymsh013","梅毒螺旋体筛查");
  165 + itemsWamenj.put("lymsh019","妇科超声常规检查");
  166 + itemsWamenj.put("lymsh020","人免疫缺陷病毒抗体测定");
  167 +
  168 + Map<String,String> itemsMan = new HashMap<>();
  169 + itemsMan.put("lymsh004","血液常规检验");
  170 + itemsMan.put("lymsh005","尿液常规检验");
  171 + itemsMan.put("lymsh006","ABO红细胞定型");
  172 + itemsMan.put("lymsh007","RH血型鉴定");
  173 + itemsMan.put("lymsh009","乙型肝炎血清五项检测");
  174 + itemsMan.put("lymsh010","肝功能检测(谷丙转氨酶)");
  175 + itemsMan.put("lymsh011","肾功能检测(肌酐)");
  176 + itemsMan.put("lymsh013","梅毒螺旋体筛查");
  177 + Connection conn = null;
  178 + String sql = "insert into TI_申请信息孕(v患者类别,v患者编号,v患者ID号,v患者姓名,v性别,v年龄,v年龄类型,v申请项目编码,v申请项目名称,v唯一标识号,iTag,v手机号,v身份证号,d申请时间,v申请日期,i项目数量) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
  179 + PreparedStatement ps = null;
  180 + ResultSet rs = null;
  181 + try {
  182 + conn = ConnTools.makeLisConnection();
  183 + if (SystemConfig.WOMAN_ID.equals(residentsArchiveModel.getSex()))
  184 + {
  185 + String wId = com.lyms.platform.common.utils.StringUtils.uuid();
  186 + Set<String> sets = new HashSet<>();
  187 + if (residentsArchiveModel.getMilitary() != null && residentsArchiveModel.getMilitary() == 1)
  188 + {
  189 + sets.addAll(itemsWamenj.keySet());
  190 + }
  191 + else
  192 + {
  193 + sets.addAll(itemsWamen.keySet());
  194 + }
  195 + for (String key : sets)
  196 + {
  197 + ps = conn.prepareStatement(sql);
  198 + ps.setString(1,"TJ");
  199 + ps.setString(2,wId);
  200 + ps.setString(3,wId);
  201 + ps.setString(4, residentsArchiveModel.getUsername());
  202 + ps.setString(5, "女");
  203 + ps.setString(6, residentsArchiveModel.getBirthday() != null ? DateUtil.getAge(residentsArchiveModel.getBirthday())+"" : "");
  204 + ps.setString(7, "岁");
  205 + ps.setString(8, key);
  206 + ps.setString(9, itemsWamen.get(key));
  207 + ps.setString(10, com.lyms.platform.common.utils.StringUtils.uuid());
  208 + ps.setString(11,"0");
  209 + ps.setString(12,residentsArchiveModel.getPhone());
  210 + ps.setString(13,residentsArchiveModel.getCertificateNum());
  211 + ps.setDate(14, new java.sql.Date(new Date().getTime()));
  212 + ps.setString(15,DateUtil.getyyyy_MM_dd(new Date()));
  213 + ps.setInt(16, 1);
  214 + int inCount = ps.executeUpdate();
  215 + System.out.println("女性保存"+inCount);
  216 + }
  217 + }
  218 + else
  219 + {
  220 + String mid = com.lyms.platform.common.utils.StringUtils.uuid();
  221 + for (String key : itemsMan.keySet())
  222 + {
  223 + ps = conn.prepareStatement(sql);
  224 + ps.setString(1,"TJ");
  225 + ps.setString(2,mid);
  226 + ps.setString(3,mid);
  227 + ps.setString(4, residentsArchiveModel.getUsername());
  228 + ps.setString(5, "男");
  229 + ps.setString(6, residentsArchiveModel.getBirthday() != null ? DateUtil.getAge(residentsArchiveModel.getBirthday())+"" : "");
  230 + ps.setString(7, "岁");
  231 + ps.setString(8, key);
  232 + ps.setString(9, itemsMan.get(key));
  233 + ps.setString(10, com.lyms.platform.common.utils.StringUtils.uuid());
  234 + ps.setString(11,"0");
  235 + ps.setString(12,residentsArchiveModel.getPhone());
  236 + ps.setString(13,residentsArchiveModel.getCertificateNum());
  237 + ps.setDate(14, new java.sql.Date(new Date().getTime()));
  238 + ps.setString(15, DateUtil.getyyyy_MM_dd(new Date()));
  239 + ps.setInt(16, 1);
  240 + int inCount = ps.executeUpdate();
  241 + System.out.println("男性性保存"+inCount);
  242 + }
  243 + }
  244 + }
  245 + catch (Exception e)
  246 + {
  247 + try {
  248 + if (rs != null)
  249 + {
  250 + rs.close();
  251 + }
  252 + } catch (SQLException e1) {
  253 + e1.printStackTrace();
  254 + }
  255 + DbUtils.closeQuietly(conn);
  256 +
  257 + e.printStackTrace();
  258 + System.out.println(e.getMessage());
  259 + }
  260 + return null;
  261 + }
113 262 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ResidentsArchiveController.java View file @ 06a5ea3
... ... @@ -110,7 +110,7 @@
110 110 @TokenRequired
111 111 public BaseObjectResponse querySpouseInfoByName(@RequestParam("name")String name,@RequestParam("sexId")String sexId,HttpServletRequest request){
112 112 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
113   - BaseObjectResponse objectResponse = residentsArchiveFacade.querySpouseInfoByName(name,sexId, loginState.getId());
  113 + BaseObjectResponse objectResponse = residentsArchiveFacade.querySpouseInfoByName(name, sexId, loginState.getId());
114 114 return objectResponse;
115 115 }
116 116  
... ... @@ -126,6 +126,19 @@
126 126 public BaseObjectResponse queryResidentsArchiveById(@PathVariable("id")String id){
127 127 BaseObjectResponse objectResponse = residentsArchiveFacade.queryResidentsArchiveById(id);
128 128 return objectResponse;
  129 + }
  130 +
  131 +
  132 + /**
  133 + * 保存lis检查项到lis系统中
  134 + * @param id
  135 + * @return
  136 + */
  137 + @RequestMapping(value = "/setResidentsCheckItem/{id}", method = RequestMethod.GET)
  138 + @ResponseBody
  139 + @TokenRequired
  140 + public BaseResponse setResidentsCheckItem(@PathVariable("id")String id){
  141 + return residentsArchiveFacade.setResidentsCheckItem(id);
129 142 }
130 143  
131 144 /**
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java View file @ 06a5ea3
1 1 package com.lyms.platform.operate.web.facade;
2 2  
  3 +import com.lyms.hospitalapi.lcfy.LisService;
3 4 import com.lyms.platform.beans.MsgRequest;
4 5 import com.lyms.platform.biz.service.*;
5 6 import com.lyms.platform.common.constants.ErrorCodeConstants;
6 7  
... ... @@ -63,13 +64,14 @@
63 64 @Autowired
64 65 private SmsConfigFacade smsConfigFacade;
65 66 @Autowired
66   - private SyncDataService syncDataService;
67   - @Autowired
68 67 private ITrackDownService trackDownService;
69 68 @Autowired
70 69 private PostVisitHospitalService postVisitHospitalService;
71 70  
72 71 @Autowired
  72 + private LisService lcfyLisService;
  73 +
  74 + @Autowired
73 75 private TrackDownRecordService trackDownRecordService;
74 76  
75 77 public BaseObjectResponse findResidentsArchive(ResidentsArchiveQueryRequest queryRequest, Integer userId) {
... ... @@ -1060,6 +1062,18 @@
1060 1062 }
1061 1063 }
1062 1064 return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(list);
  1065 + }
  1066 +
  1067 +
  1068 + public BaseResponse setResidentsCheckItem(String id) {
  1069 + ResidentsArchiveQuery query = new ResidentsArchiveQuery();
  1070 + query.setYn(YnEnums.YES.getId());
  1071 + query.setId(id);
  1072 + List<ResidentsArchiveModel> modelList = residentsArchiveService.queryResident(query);
  1073 + if (CollectionUtils.isNotEmpty(modelList)) {
  1074 + lcfyLisService.save(modelList.get(0));
  1075 + }
  1076 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
1063 1077 }
1064 1078 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PreEugebicsServiceImpl.java View file @ 06a5ea3
... ... @@ -166,8 +166,12 @@
166 166 model.setHospitalId(hospitalId);
167 167 model.setCreated(new Date());
168 168 mongoTemplate.insert(model);
169   - System.out.println(model.getId());
170   - saveLis(model);
  169 + //陵城区妇幼保健院
  170 + if ("2100002042".equals(hospitalId))
  171 + {
  172 + saveLis(model);
  173 + }
  174 +
171 175 return new BaseResponse();
172 176 }
173 177