Commit d5f42f14dee193db601e62af5b5eb44c32b13763
1 parent
597f00b5f4
Exists in
master
and in
6 other branches
新增终止妊娠接口
Showing 3 changed files with 111 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java
View file @
d5f42f1
| ... | ... | @@ -105,6 +105,17 @@ |
| 105 | 105 | return viewFacade.findDischargeAbstractData(id); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | + /** | |
| 109 | + * 查看终止妊娠 | |
| 110 | + * @param id | |
| 111 | + * @return | |
| 112 | + */ | |
| 113 | + @RequestMapping(value = "/findStopPregData", method = RequestMethod.GET) | |
| 114 | + @ResponseBody | |
| 115 | +// @TokenRequired | |
| 116 | + public BaseObjectResponse findStopPregData(@RequestParam("id")String id){ | |
| 117 | + return viewFacade.findStopPregData(id); | |
| 118 | + } | |
| 108 | 119 | |
| 109 | 120 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
d5f42f1
| ... | ... | @@ -16,6 +16,7 @@ |
| 16 | 16 | import com.lyms.platform.pojo.*; |
| 17 | 17 | import com.lyms.platform.query.BabyModelQuery; |
| 18 | 18 | import com.lyms.platform.query.DischargeAbstractBabyQuery; |
| 19 | +import com.lyms.platform.query.StopPregQuery; | |
| 19 | 20 | import org.apache.commons.collections.CollectionUtils; |
| 20 | 21 | import org.apache.commons.collections.MapUtils; |
| 21 | 22 | import org.apache.commons.lang.StringUtils; |
| ... | ... | @@ -54,6 +55,8 @@ |
| 54 | 55 | private DischargeAbstractBabyService dischargeAbstractBabyService; |
| 55 | 56 | @Autowired |
| 56 | 57 | private BabyService babyService; |
| 58 | + @Autowired | |
| 59 | + private StopPregnancyService stopPregnancyService; | |
| 57 | 60 | |
| 58 | 61 | |
| 59 | 62 | public BaseObjectResponse findPatientData(String id) { |
| 60 | 63 | |
| ... | ... | @@ -1251,7 +1254,62 @@ |
| 1251 | 1254 | return br; |
| 1252 | 1255 | } |
| 1253 | 1256 | |
| 1257 | + public BaseObjectResponse findStopPregData(String id){ | |
| 1258 | + BaseObjectResponse br = new BaseObjectResponse(); | |
| 1259 | + if (org.apache.commons.lang.StringUtils.isEmpty(id)){ | |
| 1260 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 1261 | + br.setErrormsg("id为空"); | |
| 1262 | + return br; | |
| 1263 | + } | |
| 1264 | + StopPregQuery stopPregQuery = new StopPregQuery(); | |
| 1265 | + stopPregQuery.setYn(YnEnums.YES.getId()); | |
| 1266 | + stopPregQuery.setId(id); | |
| 1267 | + List<StopPregModel> stopPregModelList = stopPregnancyService.queryStopPreg(stopPregQuery); | |
| 1268 | + if (CollectionUtils.isEmpty(stopPregModelList)){ | |
| 1269 | + br.setErrorcode(ErrorCodeConstants.NO_DATA); | |
| 1270 | + br.setErrormsg("没有查询到数据"); | |
| 1271 | + return br; | |
| 1272 | + } | |
| 1254 | 1273 | |
| 1274 | + StopPregModel data = stopPregModelList.get(0); | |
| 1275 | + | |
| 1276 | + if (StringUtils.isEmpty(data.getPatientId())){ | |
| 1277 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 1278 | + br.setErrormsg("数据异常"); | |
| 1279 | + return br; | |
| 1280 | + } | |
| 1281 | + Patients patients = patientsService.findOnePatientById(data.getPatientId()); | |
| 1282 | + if (patients==null){ | |
| 1283 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 1284 | + br.setErrormsg("数据异常"); | |
| 1285 | + return br; | |
| 1286 | + } | |
| 1287 | + | |
| 1288 | + Map<String,Object> map= new HashMap<>(); | |
| 1289 | + map.put("id",data.getId()); | |
| 1290 | + String stopReason = ""; | |
| 1291 | + if (StringUtils.isNotEmpty(data.getStopReason())){ | |
| 1292 | + Map stopMap = JsonUtil.jkstr2Obj(data.getStopReason(), Map.class); | |
| 1293 | + stopReason = ResolveUtils.replaceStopPreg(stopMap); | |
| 1294 | + } | |
| 1295 | + map.put("stopReason",stopReason); | |
| 1296 | + map.put("remark",data.getRemark()); | |
| 1297 | + map.put("stopDate",DateUtil.getyyyy_MM_dd(data.getStopDate())); | |
| 1298 | + | |
| 1299 | + String inPerson = ""; | |
| 1300 | + | |
| 1301 | + if (StringUtils.isNotEmpty(data.getInPerson()) && FunvCommonUtil.isNumeric(data.getInPerson())){ | |
| 1302 | + Users users = usersService.getUsers(Integer.parseInt(data.getInPerson())); | |
| 1303 | + if (users!=null && users.getYn()==YnEnums.YES.getId()){ | |
| 1304 | + inPerson = users.getName(); | |
| 1305 | + } | |
| 1306 | + } | |
| 1307 | + map.put("inPerson",inPerson); | |
| 1308 | + br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 1309 | + br.setErrormsg("成功"); | |
| 1310 | + br.setData(map); | |
| 1311 | + return br; | |
| 1312 | + } | |
| 1255 | 1313 | |
| 1256 | 1314 | |
| 1257 | 1315 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/ResolveUtils.java
View file @
d5f42f1
| ... | ... | @@ -36,7 +36,49 @@ |
| 36 | 36 | content.put("qt", "其他"); |
| 37 | 37 | content.put("jsjmj", "假丝酵母菌"); |
| 38 | 38 | content.put("dc", "滴虫"); |
| 39 | + | |
| 40 | + content.put("gfxgw", "高风险高危"); | |
| 41 | + content.put("pttzfy", "胚胎停止发育"); | |
| 42 | + content.put("rszqfyyw", "妊娠早期服用药物"); | |
| 43 | + content.put("cqzdyx", "产前诊断阳性"); | |
| 39 | 44 | } |
| 45 | + | |
| 46 | + public static String replaceStopPreg(Map map) { | |
| 47 | + if (null == map) { | |
| 48 | + return ""; | |
| 49 | + } | |
| 50 | + StringBuilder sb = new StringBuilder(); | |
| 51 | + try { | |
| 52 | + Set<Map.Entry<String, Object>> m = map.entrySet(); | |
| 53 | + Iterator<Map.Entry<String, Object>> it = m.iterator(); | |
| 54 | + while (it.hasNext()) { | |
| 55 | + Map.Entry<String, Object> ma = it.next(); | |
| 56 | + if ("true".equals(ma.getValue() + "")) { | |
| 57 | + if (content.containsKey(ma.getKey())) { | |
| 58 | + sb.append(content.get(ma.getKey())).append(','); | |
| 59 | + } | |
| 60 | + } | |
| 61 | + } | |
| 62 | + String bigSB = sb.toString(); | |
| 63 | + | |
| 64 | + if (bigSB.contains("其他,")){ | |
| 65 | + if (map.containsKey("qtText")){ | |
| 66 | + bigSB = bigSB.replace("其他,","其他:" + map.get("qtText")); | |
| 67 | + } | |
| 68 | + } | |
| 69 | + | |
| 70 | + if (bigSB.endsWith(",")) { | |
| 71 | + bigSB = bigSB.substring(0, bigSB.length() - 1); | |
| 72 | + } | |
| 73 | + return bigSB; | |
| 74 | + }catch (Exception e){ | |
| 75 | + e.printStackTrace(); | |
| 76 | + } | |
| 77 | + return ""; | |
| 78 | + } | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 40 | 82 | |
| 41 | 83 | /** |
| 42 | 84 | * 解析产科并发症 |