Commit abd95d99f1953638fdb34822a3b9f241edd3e07e
1 parent
e26083c871
Exists in
master
and in
7 other branches
修改初诊bug
Showing 2 changed files with 139 additions and 14 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java
View file @
abd95d9
| ... | ... | @@ -81,6 +81,19 @@ |
| 81 | 81 | return viewFacade.findPatientData(id); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | + /** | |
| 85 | + * 查看复查接口 | |
| 86 | + * @param id | |
| 87 | + * @return | |
| 88 | + */ | |
| 89 | + @RequestMapping(value = "/findPostReviewData", method = RequestMethod.GET) | |
| 90 | + @ResponseBody | |
| 91 | +// @TokenRequired | |
| 92 | + public BaseObjectResponse findPostReviewData(@RequestParam("id")String id){ | |
| 93 | + return viewFacade.findPostReviewData(id); | |
| 94 | + } | |
| 95 | + | |
| 96 | + //查看出院小结接口 | |
| 84 | 97 | |
| 85 | 98 | |
| 86 | 99 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
abd95d9
| ... | ... | @@ -43,6 +43,8 @@ |
| 43 | 43 | private CommonService commonService; |
| 44 | 44 | @Autowired |
| 45 | 45 | private MatDeliverService matDeliverService; |
| 46 | + @Autowired | |
| 47 | + private PostReviewService postReviewService; | |
| 46 | 48 | |
| 47 | 49 | |
| 48 | 50 | public BaseObjectResponse findPatientData(String id) { |
| 49 | 51 | |
| 50 | 52 | |
| 51 | 53 | |
| ... | ... | @@ -289,24 +291,62 @@ |
| 289 | 291 | map.put("fuwei", UnitUtils.unitSplice(data.getFuwei(),UnitConstants.CM)); |
| 290 | 292 | map.put("tireNumber", TaiShuEnums.getTitle(data.getTireNumber())); |
| 291 | 293 | //胎儿情况 |
| 292 | - List<Map> placentas = new ArrayList<>(); | |
| 294 | + List<Map> placetaList = new ArrayList<>(); | |
| 293 | 295 | if (CollectionUtils.isNotEmpty(data.getPlacentas())){ |
| 294 | - for (Object temp : data.getPlacentas()){ | |
| 295 | - Map<String,String> tire = JsonUtil.getMap(temp.toString()); | |
| 296 | - String heartRate = tire.get("heartRate"); | |
| 297 | - String fetalPosition = tire.get("fetalPosition"); | |
| 298 | - String fetalPresentation = tire.get("fetalPresentation"); | |
| 299 | - String join = tire.get("join"); | |
| 296 | + List<MatDeliverAddRequest.Placenta> placentas = data.getPlacentas(); | |
| 297 | + if (CollectionUtils.isNotEmpty(placentas)){ | |
| 298 | + for (Object obj : placentas) { | |
| 300 | 299 | |
| 301 | - Map<String,Object> tireMap = new HashMap<>(); | |
| 302 | - tireMap.put("heartRate",UnitUtils.unitSplice(heartRate, UnitConstants.CIFEN)); | |
| 303 | - tireMap.put("fetalPosition", FetalPositionEnums.getTitle(fetalPosition)); | |
| 304 | - tireMap.put("fetalPresentation", FetalEnums.getTitle(fetalPresentation)); | |
| 305 | - tireMap.put("join", JoinEnums.getTitle(join)); | |
| 306 | - placentas.add(tireMap); | |
| 300 | + String fetalPosition = ""; | |
| 301 | + String fetalPresentation = ""; | |
| 302 | + String heartRate = ""; | |
| 303 | + String join = ""; | |
| 304 | + | |
| 305 | + if ("com.lyms.platform.operate.web.request.MatDeliverAddRequest$Placenta".equals(obj.getClass().getName())) { | |
| 306 | + //转换类型 | |
| 307 | + MatDeliverAddRequest.Placenta placenta = (MatDeliverAddRequest.Placenta) obj; | |
| 308 | + //胎方位 | |
| 309 | + if (StringUtils.isNotEmpty(placenta.getFetalPosition())) { | |
| 310 | + for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) { | |
| 311 | + if (fetalPositionEnums.getId().equals(placenta.getFetalPosition())) { | |
| 312 | + fetalPosition += fetalPositionEnums.getName(); | |
| 313 | + break; | |
| 314 | + } | |
| 315 | + } | |
| 316 | + } | |
| 317 | + //胎先露 | |
| 318 | + fetalPresentation += placenta.getFetalPresentation() == null ? "" : placenta.getFetalPresentation(); | |
| 319 | + //胎心率 | |
| 320 | + heartRate += placenta.getHeartRate() == null ? "" : placenta.getHeartRate().toString(); | |
| 321 | + join = placenta.getJoin(); | |
| 322 | + } | |
| 323 | + | |
| 324 | + if ("java.util.LinkedHashMap".equals(obj.getClass().getName())) { | |
| 325 | + Map<String, String> placenta = JsonUtil.getMap(obj.toString()); | |
| 326 | + if (MapUtils.isNotEmpty(placenta)) { | |
| 327 | + if (placenta.get("fetalPosition") != null) { | |
| 328 | + for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) { | |
| 329 | + if (fetalPositionEnums.getId().equals(placenta.get("fetalPosition"))) { | |
| 330 | + fetalPosition += fetalPositionEnums.getName(); | |
| 331 | + break; | |
| 332 | + } | |
| 333 | + } | |
| 334 | + } | |
| 335 | + heartRate += placenta.get("heartRate") == null ? "" : placenta.get("heartRate"); | |
| 336 | + fetalPresentation += placenta.get("fetalPresentation") == null ? "" : placenta.get("fetalPresentation"); | |
| 337 | + join = placenta.get("join"); | |
| 338 | + } | |
| 339 | + } | |
| 340 | + Map<String,Object> placetaMap = new HashMap<>(); | |
| 341 | + placetaMap.put("fetalPosition",fetalPosition); | |
| 342 | + placetaMap.put("fetalPresentation",fetalPresentation); | |
| 343 | + placetaMap.put("heartRate",UnitUtils.unitSplice(heartRate,UnitConstants.CIFEN)); | |
| 344 | + placetaMap.put("join",JoinEnums.getTitle(join)); | |
| 345 | + placetaList.add(placetaMap); | |
| 346 | + } | |
| 307 | 347 | } |
| 308 | 348 | } |
| 309 | - map.put("placentas",placentas); | |
| 349 | + map.put("placentas",placetaList); | |
| 310 | 350 | |
| 311 | 351 | /* 辅助检查 */ |
| 312 | 352 | map.put("xhdb",UnitUtils.unitSplice(data.getXhdb(),UnitConstants.GL)); |
| ... | ... | @@ -911,6 +951,78 @@ |
| 911 | 951 | map.put("three",three); |
| 912 | 952 | return map; |
| 913 | 953 | } |
| 954 | + | |
| 955 | + | |
| 956 | + public BaseObjectResponse findPostReviewData(String id){ | |
| 957 | + BaseObjectResponse br = new BaseObjectResponse(); | |
| 958 | + if (org.apache.commons.lang.StringUtils.isEmpty(id)){ | |
| 959 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 960 | + br.setErrormsg("id为空"); | |
| 961 | + return br; | |
| 962 | + } | |
| 963 | + | |
| 964 | + PostReviewModel data = postReviewService.findOneById(id); | |
| 965 | + if (data==null || data.getYn()==YnEnums.NO.getId()){ | |
| 966 | + br.setErrorcode(ErrorCodeConstants.NO_DATA); | |
| 967 | + br.setErrormsg("没有查询到数据"); | |
| 968 | + return br; | |
| 969 | + } | |
| 970 | + | |
| 971 | + /* 基本信息 */ | |
| 972 | + if (StringUtils.isEmpty(data.getParentId())){ | |
| 973 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 974 | + br.setErrormsg("数据异常"); | |
| 975 | + return br; | |
| 976 | + } | |
| 977 | + | |
| 978 | + Patients patients = patientsService.findOnePatientById(data.getParentId()); | |
| 979 | + if (patients==null){ | |
| 980 | + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 981 | + br.setErrormsg("数据异常"); | |
| 982 | + return br; | |
| 983 | + } | |
| 984 | + Map<String,Object> map= new HashMap<>(); | |
| 985 | + /* 基础信息 */ | |
| 986 | + map.put("id",data.getId()); | |
| 987 | + map.put("username",patients.getUsername()); | |
| 988 | + map.put("birth",DateUtil.getyyyy_MM_dd(patients.getBirth())); | |
| 989 | + map.put("age",DateUtil.getAge(patients.getBirth())); | |
| 990 | + map.put("phone",patients.getPhone()); | |
| 991 | + map.put("fmWeek",patients.getFmWeek()); | |
| 992 | + map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); | |
| 993 | + map.put("mremark",patients.getMremark()); | |
| 994 | + map.put("oRiskFactor",patients.getoRiskFactor()); | |
| 995 | + map.put("riskScore",patients.getRiskScore()); | |
| 996 | + /* 复查信息 */ | |
| 997 | + map.put("checkTime",DateUtil.getyyyy_MM_dd(data.getCheckTime())); | |
| 998 | + map.put("day",data.getDay()); | |
| 999 | + map.put("day",data.getDay()); | |
| 1000 | + String prodDoctor = ""; | |
| 1001 | + | |
| 1002 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getProdDoctor())){ | |
| 1003 | + Users users = usersService.getUsers(Integer.parseInt(data.getProdDoctor())); | |
| 1004 | + if (users!=null && users.getYn()==YnEnums.YES.getId()){ | |
| 1005 | + prodDoctor = users.getName(); | |
| 1006 | + } | |
| 1007 | + } | |
| 1008 | + map.put("prodDoctor", prodDoctor); | |
| 1009 | + String hospitalId = ""; | |
| 1010 | + | |
| 1011 | + if (StringUtils.isNotEmpty(data.getHospitalId())){ | |
| 1012 | + Organization organization = organizationService.getOrganization(Integer.parseInt(data.getHospitalId())); | |
| 1013 | + if (organization!=null && organization.getYn()==YnEnums.YES.getId()){ | |
| 1014 | + hospitalId = organization.getName(); | |
| 1015 | + } | |
| 1016 | + } | |
| 1017 | + | |
| 1018 | + map.put("hospitalId", hospitalId); | |
| 1019 | + | |
| 1020 | + String deliverDoctor = ""; | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + return br; | |
| 1024 | + } | |
| 1025 | + | |
| 914 | 1026 | |
| 915 | 1027 | |
| 916 | 1028 | } |