Commit a5c617a8ad2b8f4e92eed2de8885cfcb1e8f630b
1 parent
9aed5fff1a
Exists in
master
and in
6 other branches
update
Showing 4 changed files with 638 additions and 56 deletions
- platform-dal/src/main/java/com/lyms/platform/pojo/BabyEyeCheck.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyEyeCheckController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/BabyEyeCheckService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java
platform-dal/src/main/java/com/lyms/platform/pojo/BabyEyeCheck.java
View file @
a5c617a
... | ... | @@ -21,22 +21,32 @@ |
21 | 21 | * @Author: 武涛涛 |
22 | 22 | * @Date: 2020/7/20 9:27 |
23 | 23 | */ |
24 | + //类型 默认是旧版本,1新版本20200720 | |
25 | + private String edition; | |
24 | 26 | // 眼外观 1通过 2不通过 |
25 | 27 | private String eyeAppearance; |
28 | + private String eyeAppearanceOther; | |
26 | 29 | //红光反射,以前数据有相同的 |
27 | 30 | private String redReflexQhd; |
31 | + private String redReflexQhdOther; | |
28 | 32 | //瞬目反射 |
29 | 33 | private String blinkReflex; |
34 | + private String blinkReflexOther; | |
30 | 35 | //红球试验 |
31 | 36 | private String redBallTest; |
37 | + private String redBallTestOther; | |
32 | 38 | //视物行为观察 |
33 | 39 | private String behaviorObservation; |
40 | + private String behaviorObservationOther; | |
34 | 41 | //屈光筛查 |
35 | 42 | private String refractiveScreening; |
43 | + private String refractiveScreeningOther; | |
36 | 44 | //眼位检查 |
37 | 45 | private String eyePositionExamination; |
46 | + private String eyePositionExaminationOther; | |
38 | 47 | //眼球运动 |
39 | 48 | private String eyeMovement; |
49 | + private String eyeMovementOther; | |
40 | 50 | //戴镜类型 1框架眼镜 2隐形眼镜 3角膜塑形镜 4不戴镜 |
41 | 51 | private String typeOfWearingGlasses; |
42 | 52 | /*远视力检查结果*/ |
... | ... | @@ -70,6 +80,8 @@ |
70 | 80 | * 其他检查(选填)对应老数据的,其他 |
71 | 81 | */ |
72 | 82 | private String other; |
83 | + //秦皇岛处理医生自定义处理意见 | |
84 | + private List<String> handleOpinionsIdList; | |
73 | 85 | |
74 | 86 | /* end 秦皇岛新增的眼保健字段 */ |
75 | 87 | |
... | ... | @@ -201,11 +213,6 @@ |
201 | 213 | */ |
202 | 214 | private String handleOpinionsId; |
203 | 215 | |
204 | - /* | |
205 | - 秦皇岛处理意见定制 | |
206 | - */ | |
207 | - private List<String> handleOpinionsIdList; | |
208 | - | |
209 | 216 | /** |
210 | 217 | * 指导意见 |
211 | 218 | */ |
... | ... | @@ -996,6 +1003,246 @@ |
996 | 1003 | |
997 | 1004 | public void setNextCheckMonthId(String nextCheckMonthId) { |
998 | 1005 | this.nextCheckMonthId = nextCheckMonthId; |
1006 | + } | |
1007 | + | |
1008 | + public String getEyeAppearance() { | |
1009 | + return eyeAppearance; | |
1010 | + } | |
1011 | + | |
1012 | + public void setEyeAppearance(String eyeAppearance) { | |
1013 | + this.eyeAppearance = eyeAppearance; | |
1014 | + } | |
1015 | + | |
1016 | + public String getRedReflexQhd() { | |
1017 | + return redReflexQhd; | |
1018 | + } | |
1019 | + | |
1020 | + public void setRedReflexQhd(String redReflexQhd) { | |
1021 | + this.redReflexQhd = redReflexQhd; | |
1022 | + } | |
1023 | + | |
1024 | + public String getBlinkReflex() { | |
1025 | + return blinkReflex; | |
1026 | + } | |
1027 | + | |
1028 | + public void setBlinkReflex(String blinkReflex) { | |
1029 | + this.blinkReflex = blinkReflex; | |
1030 | + } | |
1031 | + | |
1032 | + public String getRedBallTest() { | |
1033 | + return redBallTest; | |
1034 | + } | |
1035 | + | |
1036 | + public void setRedBallTest(String redBallTest) { | |
1037 | + this.redBallTest = redBallTest; | |
1038 | + } | |
1039 | + | |
1040 | + public String getBehaviorObservation() { | |
1041 | + return behaviorObservation; | |
1042 | + } | |
1043 | + | |
1044 | + public void setBehaviorObservation(String behaviorObservation) { | |
1045 | + this.behaviorObservation = behaviorObservation; | |
1046 | + } | |
1047 | + | |
1048 | + public String getRefractiveScreening() { | |
1049 | + return refractiveScreening; | |
1050 | + } | |
1051 | + | |
1052 | + public void setRefractiveScreening(String refractiveScreening) { | |
1053 | + this.refractiveScreening = refractiveScreening; | |
1054 | + } | |
1055 | + | |
1056 | + public String getEyePositionExamination() { | |
1057 | + return eyePositionExamination; | |
1058 | + } | |
1059 | + | |
1060 | + public void setEyePositionExamination(String eyePositionExamination) { | |
1061 | + this.eyePositionExamination = eyePositionExamination; | |
1062 | + } | |
1063 | + | |
1064 | + public String getEyeMovement() { | |
1065 | + return eyeMovement; | |
1066 | + } | |
1067 | + | |
1068 | + public void setEyeMovement(String eyeMovement) { | |
1069 | + this.eyeMovement = eyeMovement; | |
1070 | + } | |
1071 | + | |
1072 | + public String getTypeOfWearingGlasses() { | |
1073 | + return typeOfWearingGlasses; | |
1074 | + } | |
1075 | + | |
1076 | + public void setTypeOfWearingGlasses(String typeOfWearingGlasses) { | |
1077 | + this.typeOfWearingGlasses = typeOfWearingGlasses; | |
1078 | + } | |
1079 | + | |
1080 | + public String getRightEyeVision() { | |
1081 | + return rightEyeVision; | |
1082 | + } | |
1083 | + | |
1084 | + public void setRightEyeVision(String rightEyeVision) { | |
1085 | + this.rightEyeVision = rightEyeVision; | |
1086 | + } | |
1087 | + | |
1088 | + public String getRightVision() { | |
1089 | + return rightVision; | |
1090 | + } | |
1091 | + | |
1092 | + public void setRightVision(String rightVision) { | |
1093 | + this.rightVision = rightVision; | |
1094 | + } | |
1095 | + | |
1096 | + public String getLeftEyeVision() { | |
1097 | + return leftEyeVision; | |
1098 | + } | |
1099 | + | |
1100 | + public void setLeftEyeVision(String leftEyeVision) { | |
1101 | + this.leftEyeVision = leftEyeVision; | |
1102 | + } | |
1103 | + | |
1104 | + public String getLeftVision() { | |
1105 | + return leftVision; | |
1106 | + } | |
1107 | + | |
1108 | + public void setLeftVision(String leftVision) { | |
1109 | + this.leftVision = leftVision; | |
1110 | + } | |
1111 | + | |
1112 | + public String getDoctorName() { | |
1113 | + return doctorName; | |
1114 | + } | |
1115 | + | |
1116 | + public void setDoctorName(String doctorName) { | |
1117 | + this.doctorName = doctorName; | |
1118 | + } | |
1119 | + | |
1120 | + public String getRightQJ() { | |
1121 | + return rightQJ; | |
1122 | + } | |
1123 | + | |
1124 | + public void setRightQJ(String rightQJ) { | |
1125 | + this.rightQJ = rightQJ; | |
1126 | + } | |
1127 | + | |
1128 | + public String getRightQZ() { | |
1129 | + return rightQZ; | |
1130 | + } | |
1131 | + | |
1132 | + public void setRightQZ(String rightQZ) { | |
1133 | + this.rightQZ = rightQZ; | |
1134 | + } | |
1135 | + | |
1136 | + public String getRightZW() { | |
1137 | + return rightZW; | |
1138 | + } | |
1139 | + | |
1140 | + public void setRightZW(String rightZW) { | |
1141 | + this.rightZW = rightZW; | |
1142 | + } | |
1143 | + | |
1144 | + public String getLeftQJ() { | |
1145 | + return leftQJ; | |
1146 | + } | |
1147 | + | |
1148 | + public void setLeftQJ(String leftQJ) { | |
1149 | + this.leftQJ = leftQJ; | |
1150 | + } | |
1151 | + | |
1152 | + public String getLeftQZ() { | |
1153 | + return leftQZ; | |
1154 | + } | |
1155 | + | |
1156 | + public void setLeftQZ(String leftQZ) { | |
1157 | + this.leftQZ = leftQZ; | |
1158 | + } | |
1159 | + | |
1160 | + public String getLeftZW() { | |
1161 | + return leftZW; | |
1162 | + } | |
1163 | + | |
1164 | + public void setLeftZW(String leftZW) { | |
1165 | + this.leftZW = leftZW; | |
1166 | + } | |
1167 | + | |
1168 | + public String getOtherContent() { | |
1169 | + return otherContent; | |
1170 | + } | |
1171 | + | |
1172 | + public void setOtherContent(String otherContent) { | |
1173 | + this.otherContent = otherContent; | |
1174 | + } | |
1175 | + | |
1176 | + public String getEdition() { | |
1177 | + return edition; | |
1178 | + } | |
1179 | + | |
1180 | + public void setEdition(String edition) { | |
1181 | + this.edition = edition; | |
1182 | + } | |
1183 | + | |
1184 | + public String getEyeAppearanceOther() { | |
1185 | + return eyeAppearanceOther; | |
1186 | + } | |
1187 | + | |
1188 | + public void setEyeAppearanceOther(String eyeAppearanceOther) { | |
1189 | + this.eyeAppearanceOther = eyeAppearanceOther; | |
1190 | + } | |
1191 | + | |
1192 | + public String getRedReflexQhdOther() { | |
1193 | + return redReflexQhdOther; | |
1194 | + } | |
1195 | + | |
1196 | + public void setRedReflexQhdOther(String redReflexQhdOther) { | |
1197 | + this.redReflexQhdOther = redReflexQhdOther; | |
1198 | + } | |
1199 | + | |
1200 | + public String getBlinkReflexOther() { | |
1201 | + return blinkReflexOther; | |
1202 | + } | |
1203 | + | |
1204 | + public void setBlinkReflexOther(String blinkReflexOther) { | |
1205 | + this.blinkReflexOther = blinkReflexOther; | |
1206 | + } | |
1207 | + | |
1208 | + public String getRedBallTestOther() { | |
1209 | + return redBallTestOther; | |
1210 | + } | |
1211 | + | |
1212 | + public void setRedBallTestOther(String redBallTestOther) { | |
1213 | + this.redBallTestOther = redBallTestOther; | |
1214 | + } | |
1215 | + | |
1216 | + public String getBehaviorObservationOther() { | |
1217 | + return behaviorObservationOther; | |
1218 | + } | |
1219 | + | |
1220 | + public void setBehaviorObservationOther(String behaviorObservationOther) { | |
1221 | + this.behaviorObservationOther = behaviorObservationOther; | |
1222 | + } | |
1223 | + | |
1224 | + public String getRefractiveScreeningOther() { | |
1225 | + return refractiveScreeningOther; | |
1226 | + } | |
1227 | + | |
1228 | + public void setRefractiveScreeningOther(String refractiveScreeningOther) { | |
1229 | + this.refractiveScreeningOther = refractiveScreeningOther; | |
1230 | + } | |
1231 | + | |
1232 | + public String getEyePositionExaminationOther() { | |
1233 | + return eyePositionExaminationOther; | |
1234 | + } | |
1235 | + | |
1236 | + public void setEyePositionExaminationOther(String eyePositionExaminationOther) { | |
1237 | + this.eyePositionExaminationOther = eyePositionExaminationOther; | |
1238 | + } | |
1239 | + | |
1240 | + public String getEyeMovementOther() { | |
1241 | + return eyeMovementOther; | |
1242 | + } | |
1243 | + | |
1244 | + public void setEyeMovementOther(String eyeMovementOther) { | |
1245 | + this.eyeMovementOther = eyeMovementOther; | |
999 | 1246 | } |
1000 | 1247 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyEyeCheckController.java
View file @
a5c617a
... | ... | @@ -3,6 +3,7 @@ |
3 | 3 | import com.lyms.platform.common.annotation.TokenRequired; |
4 | 4 | import com.lyms.platform.common.base.BaseController; |
5 | 5 | import com.lyms.platform.common.result.BaseResponse; |
6 | +import com.lyms.platform.common.utils.StringUtils; | |
6 | 7 | import com.lyms.platform.operate.web.service.BabyEyeCheckService; |
7 | 8 | import com.lyms.platform.pojo.BabyEyeCheck; |
8 | 9 | import com.lyms.platform.pojo.BabyEyePatient; |
... | ... | @@ -33,7 +34,12 @@ |
33 | 34 | @RequestMapping(method = RequestMethod.POST) |
34 | 35 | @TokenRequired |
35 | 36 | public BaseResponse addOrUpdate(@RequestBody BabyEyeCheck babyEyeCheck, HttpServletRequest request) { |
36 | - return babyEyeCheckService.addOrUpdate(getUserId(request), babyEyeCheck); | |
37 | + if(StringUtils.isNotEmpty(babyEyeCheck.getEdition()) && "1".equals(babyEyeCheck.getEdition())){ | |
38 | + //秦皇岛眼保健 | |
39 | + return babyEyeCheckService.addOrUpdateQhd(getUserId(request), babyEyeCheck); | |
40 | + }else { | |
41 | + return babyEyeCheckService.addOrUpdate(getUserId(request), babyEyeCheck); | |
42 | + } | |
37 | 43 | } |
38 | 44 | |
39 | 45 | @ResponseBody |
... | ... | @@ -42,7 +48,12 @@ |
42 | 48 | public BaseResponse query(@PathVariable String id, HttpServletRequest request) { |
43 | 49 | return babyEyeCheckService.query(getUserId(request), id); |
44 | 50 | } |
45 | - | |
51 | + @ResponseBody | |
52 | + @TokenRequired | |
53 | + @RequestMapping(value = "/queryQhd/{id}", method = RequestMethod.GET) | |
54 | + public BaseResponse queryQhd(@PathVariable String id, HttpServletRequest request) { | |
55 | + return babyEyeCheckService.queryQhd(getUserId(request), id); | |
56 | + } | |
46 | 57 | /** |
47 | 58 | * 保存之后查看的数据 |
48 | 59 | * |
49 | 60 | |
50 | 61 | |
... | ... | @@ -55,12 +66,32 @@ |
55 | 66 | public BaseResponse info(@PathVariable String id) { |
56 | 67 | return babyEyeCheckService.info(id); |
57 | 68 | } |
69 | + /** | |
70 | + * 秦皇岛(定制)保存之后查看的数据 | |
71 | + * | |
72 | + * @param id | |
73 | + * @Author: 武涛涛 | |
74 | + * @Date: 2020/7/20 13:37 | |
75 | + */ | |
76 | + @ResponseBody | |
77 | + @TokenRequired | |
78 | + @RequestMapping(value = "/infoQhd/{id}", method = RequestMethod.GET) | |
79 | + public BaseResponse infoQhd(@PathVariable String id) { | |
80 | + return babyEyeCheckService.infoQhd(id); | |
81 | + } | |
58 | 82 | |
83 | + | |
59 | 84 | @ResponseBody |
60 | 85 | @TokenRequired |
61 | 86 | @RequestMapping(value = "/{id}", method = RequestMethod.GET) |
62 | 87 | public BaseResponse edit(@PathVariable String id) { |
63 | 88 | return babyEyeCheckService.edit(id); |
89 | + } | |
90 | + @ResponseBody | |
91 | + @TokenRequired | |
92 | + @RequestMapping(value = "/editQhd/{id}", method = RequestMethod.GET) | |
93 | + public BaseResponse editQhd(@PathVariable String id) { | |
94 | + return babyEyeCheckService.editQhd(id); | |
64 | 95 | } |
65 | 96 | |
66 | 97 | @ResponseBody |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/BabyEyeCheckService.java
View file @
a5c617a
... | ... | @@ -14,16 +14,20 @@ |
14 | 14 | BaseObjectResponse init(); |
15 | 15 | |
16 | 16 | BaseResponse addOrUpdate(Integer userId, BabyEyeCheck babyEyeCheck); |
17 | + BaseResponse addOrUpdateQhd(Integer userId, BabyEyeCheck babyEyeCheck); | |
17 | 18 | |
18 | 19 | BaseResponse info(String id); |
20 | + BaseResponse infoQhd(String id); | |
19 | 21 | |
20 | 22 | BaseResponse edit(String id); |
23 | + BaseResponse editQhd(String id); | |
21 | 24 | |
22 | 25 | BaseResponse delete(String id, Integer userId); |
23 | 26 | |
24 | 27 | BaseResponse list(Integer userId, Date startDate, Date endDate, String doctor, String key, Integer currentMonthStart, Integer currentMonthEnd, String chechMonth, boolean positive, String positiveIds, Integer page, Integer limit, Date bookStartDate, Date bookEndDate, String apparatusPositive, String doctorPositive, String yin); |
25 | 28 | |
26 | 29 | BaseResponse query(Integer userId, String babyId); |
30 | + BaseResponse queryQhd(Integer userId, String babyId); | |
27 | 31 | |
28 | 32 | BaseResponse listInit(Integer userId); |
29 | 33 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java
View file @
a5c617a
... | ... | @@ -82,7 +82,7 @@ |
82 | 82 | List<Map<String, Object>> highRiskQhd = EnumUtil.toJson(HandleOpinionsQhdEnums.class); /** 眼保健高危因素 */ |
83 | 83 | List<Map<String, Object>> handleOpinions = EnumUtil.toJson(HandleOpinionsEnums.class); /** 处理意见 */ |
84 | 84 | List<Map<String, Object>> eyePosition = EnumUtil.toJson(EyePositionEnums.class); /** 处理意见 */ |
85 | - return RespBuilder.buildSuccess("eyePosition", eyePosition, "addSubtract", addSubtract, "checkMonth", checkMonth,"checkMonthQhdEnums", checkMonthQhdEnums, "highRisk", highRisk, "highRiskQhd", highRiskQhd,"handleOpinions", handleOpinions); | |
85 | + return RespBuilder.buildSuccess("eyePosition", eyePosition, "addSubtract", addSubtract, "checkMonth", checkMonth, "checkMonthQhdEnums", checkMonthQhdEnums, "highRisk", highRisk, "highRiskQhd", highRiskQhd, "handleOpinions", handleOpinions); | |
86 | 86 | } |
87 | 87 | |
88 | 88 | @Override |
89 | 89 | |
90 | 90 | |
91 | 91 | |
92 | 92 | |
... | ... | @@ -96,25 +96,22 @@ |
96 | 96 | || "yang".equals(babyEyeCheck.getConjunctiva()) || "yang".equals(babyEyeCheck.getCorneal()) || "yang".equals(babyEyeCheck.getLacrimalApparatus()) |
97 | 97 | || "yang".equals(babyEyeCheck.getNystagmus()) || "yang".equals(babyEyeCheck.getExtEyelook()) |
98 | 98 | || "ruoyang".equals(babyEyeCheck.getRedRightReflex()) || "ruoyang".equals(babyEyeCheck.getRedLeftReflex()) |
99 | - || "ruoyang".equals(babyEyeCheck.getRedReflex()) | |
100 | - || "yang".equals(babyEyeCheck.getRefraction2()) | |
99 | + || "ruoyang".equals(babyEyeCheck.getRedReflex()) | |
100 | + || "yang".equals(babyEyeCheck.getRefraction2()) | |
101 | 101 | |
102 | 102 | |
103 | - ) { | |
103 | + ) { | |
104 | 104 | //器械判定阳性 |
105 | 105 | babyEyeCheck.setApparatus("2"); |
106 | - } | |
107 | - else | |
108 | - { | |
106 | + } else { | |
109 | 107 | babyEyeCheck.setApparatus("1"); |
110 | 108 | } |
111 | 109 | if ("yang".equals(babyEyeCheck.getEyePositionId2()) || "yang".equals(babyEyeCheck.getRedLeft2()) || "yang".equals(babyEyeCheck.getVision2()) |
112 | 110 | || "yang".equals(babyEyeCheck.getY2()) || "yang".equals(babyEyeCheck.getRedLeft2()) |
113 | - ) { | |
111 | + ) { | |
114 | 112 | //医生判定阳性 |
115 | 113 | babyEyeCheck.setDoctorJudgement("2"); |
116 | - } | |
117 | - else { | |
114 | + } else { | |
118 | 115 | babyEyeCheck.setDoctorJudgement("1"); |
119 | 116 | } |
120 | 117 | |
... | ... | @@ -124,7 +121,6 @@ |
124 | 121 | } |
125 | 122 | |
126 | 123 | |
127 | - | |
128 | 124 | babyEyeCheck.setCreated(new Date()); |
129 | 125 | babyEyeCheck.setYn("1"); |
130 | 126 | babyEyeCheck.setOperaterId(userId + ""); |
131 | 127 | |
132 | 128 | |
133 | 129 | |
134 | 130 | |
... | ... | @@ -187,25 +183,95 @@ |
187 | 183 | |
188 | 184 | } |
189 | 185 | |
190 | - if (CollectionUtils.isNotEmpty(babyEyeCheck.getDelFiles())) | |
191 | - { | |
186 | + if (CollectionUtils.isNotEmpty(babyEyeCheck.getDelFiles())) { | |
192 | 187 | deleteImg(babyEyeCheck); |
193 | 188 | } |
194 | 189 | FilePathModel filePath = babyEyeCheck.getFilePath(); |
195 | 190 | if (filePath != null && filePath.getId() == null) { |
196 | 191 | filePath.setBabyEyeId(babyEyeCheck.getId()); |
197 | 192 | yunBookbuildingService.addFilePath(filePath); |
198 | - } | |
199 | - else if (filePath != null) | |
200 | - { | |
193 | + } else if (filePath != null) { | |
201 | 194 | yunBookbuildingService.updateFilePath(filePath); |
202 | 195 | } |
203 | 196 | |
204 | 197 | return RespBuilder.buildSuccess(babyEyeCheck.getId()); |
205 | 198 | } |
206 | 199 | |
200 | + @Override | |
201 | + public BaseResponse addOrUpdateQhd(Integer userId, BabyEyeCheck babyEyeCheck) { | |
202 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
207 | 203 | |
204 | + //添加眼保健 | |
205 | + if (StringUtils.isEmpty(babyEyeCheck.getId())) { | |
206 | + if (!mongoUtil.buildArchive(userId, babyEyeCheck.getBabyId())) { | |
207 | + return RespBuilder.buildSuccess(ResponseCode.NEED_BUILD); | |
208 | + } | |
208 | 209 | |
210 | + babyEyeCheck.setCreated(new Date()); | |
211 | + babyEyeCheck.setYn("1"); | |
212 | + babyEyeCheck.setOperaterId(userId + ""); | |
213 | + babyEyeCheck.setHospitalId(autoMatchFacade.getHospitalId(userId)); | |
214 | + BabyModel babyModel = mongoTemplate.findById(babyEyeCheck.getBabyId(), BabyModel.class); | |
215 | + if (babyModel != null) { | |
216 | + babyEyeCheck.setPid(babyModel.getPid()); | |
217 | + babyEyeCheck.setBirth(babyModel.getBirth()); | |
218 | + } | |
219 | + syncData("ADD", babyEyeCheck, ""); | |
220 | + mongoTemplate.save(babyEyeCheck); | |
221 | + | |
222 | + // 添加追访眼保检查 | |
223 | + Date nextCheckTime = babyEyeCheck.getNextCheckTime(); | |
224 | + if (null != nextCheckTime) { | |
225 | + babyAfterVisitService.addOrUpdateAfterVisitData(babyEyeCheck, TYPE_EYE_CHECK, STATUS_TYPE_NO); | |
226 | + } else { | |
227 | + babyAfterVisitService.addOrUpdateAfterVisitData(babyEyeCheck, TYPE_EYE_CHECK, STATUS_TYPE_NULL); | |
228 | + } | |
229 | + BabyModel model = new BabyModel(); | |
230 | + model.setId(babyEyeCheck.getBabyId()); | |
231 | + babyAfterVisitService.addOrUpdateAfterVisitData(model, TYPE_STATISTICS, STATUS_TYPE_EYE_CHECK); | |
232 | + //新增的操作日志记录 | |
233 | + operateLogFacade.addAddOptLog(userId, Integer.valueOf(hospitalId), babyEyeCheck, OptActionEnums.ADD.getId(), "添加儿童眼保检查"); | |
234 | + | |
235 | + } | |
236 | + //更新眼保健 | |
237 | + else { | |
238 | + babyEyeCheck.setOperaterId(userId.toString()); | |
239 | + List<BabyEyeCheck> before = mongoTemplate.find(Query.query(Criteria.where("id").is(babyEyeCheck.getId())), BabyEyeCheck.class); | |
240 | + | |
241 | + Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(babyEyeCheck)); | |
242 | + mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(babyEyeCheck.getId())), update, BabyEyeCheck.class); | |
243 | + syncData("UPDATE", babyEyeCheck, babyEyeCheck.getId()); | |
244 | + | |
245 | + //添加修改的操作日志记录 | |
246 | + List<BabyEyeCheck> after = mongoTemplate.find(Query.query(Criteria.where("id").is(babyEyeCheck.getId())), BabyEyeCheck.class); | |
247 | + if (CollectionUtils.isNotEmpty(before) && CollectionUtils.isNotEmpty(after)) { | |
248 | + operateLogFacade.addModifyOptLog(userId, Integer.valueOf(hospitalId), before.get(0), after.get(0), OptActionEnums.UPDATE.getId(), "修改儿童眼保检查"); | |
249 | + } | |
250 | + // 添加追访眼保检查 | |
251 | + Date nextCheckTime = babyEyeCheck.getNextCheckTime(); | |
252 | + if (null != nextCheckTime) { | |
253 | + babyAfterVisitService.addOrUpdateAfterVisitData(babyEyeCheck, TYPE_EYE_CHECK, STATUS_TYPE_NO); | |
254 | + } else { | |
255 | + babyAfterVisitService.addOrUpdateAfterVisitData(babyEyeCheck, TYPE_EYE_CHECK, STATUS_TYPE_NULL); | |
256 | + } | |
257 | + | |
258 | + } | |
259 | + | |
260 | + if (CollectionUtils.isNotEmpty(babyEyeCheck.getDelFiles())) { | |
261 | + deleteImg(babyEyeCheck); | |
262 | + } | |
263 | + FilePathModel filePath = babyEyeCheck.getFilePath(); | |
264 | + if (filePath != null && filePath.getId() == null) { | |
265 | + filePath.setBabyEyeId(babyEyeCheck.getId()); | |
266 | + yunBookbuildingService.addFilePath(filePath); | |
267 | + } else if (filePath != null) { | |
268 | + yunBookbuildingService.updateFilePath(filePath); | |
269 | + } | |
270 | + | |
271 | + return RespBuilder.buildSuccess(babyEyeCheck.getId()); | |
272 | + } | |
273 | + | |
274 | + | |
209 | 275 | public void deleteImg(BabyEyeCheck babyEyeCheck) { |
210 | 276 | List<String> files = new ArrayList<>(); |
211 | 277 | List<String> delFiles = babyEyeCheck.getDelFiles(); |
... | ... | @@ -239,7 +305,6 @@ |
239 | 305 | map.put("doctor", couponMapper.getUserName(doctor)); |
240 | 306 | } |
241 | 307 | map.put("handleOpinionsId", HandleOpinionsEnums.getName(babyEyeCheck.getHandleOpinionsId())); |
242 | - map.put("handleOpinionsIdList", babyEyeCheck.getHandleOpinionsIdList());//秦皇岛眼保健新增的,保存是id,返回也是id | |
243 | 308 | List<String> riskFactorNames = EyeHighRiskEnums.getName(babyEyeCheck.getRiskFactorId()); |
244 | 309 | if (CollectionUtils.isNotEmpty(riskFactorNames)) { |
245 | 310 | for (int i = 0; i < riskFactorNames.size(); i++) { |
246 | 311 | |
... | ... | @@ -330,13 +395,13 @@ |
330 | 395 | map.put("y2", "yang".equals(babyEyeCheck.getY2()) ? "医生判定阳性" : ""); |
331 | 396 | map.put("refraction2", "yang".equals(babyEyeCheck.getRefraction2()) ? "医生判定阳性" : ""); |
332 | 397 | |
333 | - map.put("visionJudgment1", babyEyeCheck.getVisionJudgment1() == null ? "" : babyEyeCheck.getVisionJudgment1() == 0 ? "" : "标准对视远视力表"); | |
334 | - map.put("visionJudgment2", babyEyeCheck.getVisionJudgment2() == null ? "" : babyEyeCheck.getVisionJudgment2() == 0 ? "" : "儿童对数视力表"); | |
335 | - map.put("visionJudgment3", babyEyeCheck.getVisionJudgment3() == null ? "" : babyEyeCheck.getVisionJudgment3() == 0 ? "" : "欠合作"); | |
398 | + map.put("visionJudgment1", babyEyeCheck.getVisionJudgment1() == null ? "" : babyEyeCheck.getVisionJudgment1() == 0 ? "" : "标准对视远视力表"); | |
399 | + map.put("visionJudgment2", babyEyeCheck.getVisionJudgment2() == null ? "" : babyEyeCheck.getVisionJudgment2() == 0 ? "" : "儿童对数视力表"); | |
400 | + map.put("visionJudgment3", babyEyeCheck.getVisionJudgment3() == null ? "" : babyEyeCheck.getVisionJudgment3() == 0 ? "" : "欠合作"); | |
336 | 401 | |
337 | 402 | map.put("prismLeft", babyEyeCheck.getPrismLeft()); |
338 | 403 | map.put("prismRight", babyEyeCheck.getPrismRight()); |
339 | - map.put("cooperation", !StringUtils.isNotEmpty(babyEyeCheck.getCooperation()) ? "" : "0".equals(babyEyeCheck.getCooperation()) ? "欠合作" : "不合作"); | |
404 | + map.put("cooperation", !StringUtils.isNotEmpty(babyEyeCheck.getCooperation()) ? "" : "0".equals(babyEyeCheck.getCooperation()) ? "欠合作" : "不合作"); | |
340 | 405 | |
341 | 406 | FilePathModel filePath = yunBookbuildingService.findFilePathByBabyId(babyEyeCheck.getId()); |
342 | 407 | map.put("filePath", filePath); |
343 | 408 | |
... | ... | @@ -344,7 +409,184 @@ |
344 | 409 | CollectionUtils.removeNullValue(map); |
345 | 410 | return RespBuilder.buildSuccess(map); |
346 | 411 | } |
412 | + /** | |
413 | + * 秦皇岛(定制)保存之后查看的数据 | |
414 | + * | |
415 | + * @param id | |
416 | + * @Author: 武涛涛 | |
417 | + * @Date: 2020/7/20 13:39 | |
418 | + */ | |
419 | + @Override | |
420 | + public BaseResponse infoQhd(String id) { | |
421 | + BabyEyeCheck babyEyeCheck = mongoTemplate.findById(id, BabyEyeCheck.class); | |
422 | + if (babyEyeCheck == null) { | |
423 | + return RespBuilder.buildSuccess(); | |
424 | + } | |
425 | + Map<String, Object> map = ReflectionUtils.beanToMap(babyEyeCheck); | |
426 | + map.put("eyeMovementsId", "xz".equals(babyEyeCheck.getEyeMovementsId()) ? "限制" : "xt".equals(babyEyeCheck.getEyeMovementsId()) ? "协调" : "qhz".equals(babyEyeCheck.getEyeMovementsId()) ? "欠合作" : ""); | |
427 | + map.put("nystagmus", parseYinYang(babyEyeCheck.getNystagmus())); | |
428 | + map.put("checkTime", DateUtil.getYyyyMmDd(babyEyeCheck.getCheckTime())); | |
429 | + map.put("nextCheckTime", DateUtil.getYyyyMmDd(babyEyeCheck.getNextCheckTime())); | |
430 | + String doctor = babyEyeCheck.getDoctor(); | |
431 | + if (StringUtils.isNotEmpty(doctor)) { | |
432 | + map.put("doctor", couponMapper.getUserName(doctor)); | |
433 | + } | |
434 | + map.put("handleOpinionsId", HandleOpinionsEnums.getName(babyEyeCheck.getHandleOpinionsId())); | |
435 | + /** | |
436 | + * start 秦皇岛眼保健新增的 | |
437 | + * @Author: 武涛涛 | |
438 | + * @Date: 2020/7/20 13:40 | |
439 | + */ | |
440 | + map.put("handleOpinionsIdList", babyEyeCheck.getHandleOpinionsIdList());//医生自定义处理意见 id | |
441 | + map.put("handleOpinionsId", babyEyeCheck.getHandleOpinionsId());//处理意见 id | |
442 | + map.put("eyeAppearance", babyEyeCheck.getEyeAppearance());//眼外观 1通过 2不通过 | |
443 | + map.put("redReflexQhd", babyEyeCheck.getRedReflexQhd());//红光反射 | |
444 | + map.put("redReflexQhdOther", babyEyeCheck.getRedReflexQhdOther()); | |
445 | + map.put("blinkReflex", babyEyeCheck.getBlinkReflex()); //瞬目反射 | |
446 | + map.put("blinkReflexOther", babyEyeCheck.getBlinkReflexOther()); | |
447 | + map.put("redBallTest", babyEyeCheck.getRedBallTest()); //红球试验 | |
448 | + map.put("redBallTestOther", babyEyeCheck.getRedBallTestOther()); | |
449 | + map.put("behaviorObservation", babyEyeCheck.getBehaviorObservation());//视物行为观察 | |
450 | + map.put("behaviorObservationOther", babyEyeCheck.getBehaviorObservationOther()); | |
451 | + map.put("refractiveScreening", babyEyeCheck.getRefractiveScreening());//屈光筛查 | |
452 | + map.put("refractiveScreeningOther", babyEyeCheck.getRefractiveScreeningOther()); | |
453 | + map.put("eyePositionExamination", babyEyeCheck.getEyePositionExamination()); //眼位检查 | |
454 | + map.put("eyePositionExaminationOther", babyEyeCheck.getEyePositionExaminationOther()); | |
455 | + map.put("eyeMovement", babyEyeCheck.getEyeMovement()); //眼球运动 | |
456 | + map.put("eyeMovementOther", babyEyeCheck.getEyeMovementOther()); | |
457 | + map.put("typeOfWearingGlasses", babyEyeCheck.getTypeOfWearingGlasses());//戴镜类型 1框架眼镜 2隐形眼镜 3角膜塑形镜 4不戴镜 | |
458 | + map.put("rightEyeVision", babyEyeCheck.getRightEyeVision()); //右眼:裸眼视力 | |
459 | + map.put("rightVision", babyEyeCheck.getRightVision());//右眼:戴镜视力 | |
460 | + map.put("leftEyeVision", babyEyeCheck.getLeftEyeVision());//左眼:裸眼视力 | |
461 | + map.put("leftVision", babyEyeCheck.getLeftVision());//左眼:戴镜视力 | |
462 | + String doctorName = babyEyeCheck.getDoctorName(); | |
463 | + if (StringUtils.isNotEmpty(doctorName)) { | |
464 | + map.put("doctorName", couponMapper.getUserName(doctorName));//医生签名 | |
465 | + } | |
466 | + map.put("rightQJ", babyEyeCheck.getRightQJ());//右眼:球镜 | |
467 | + map.put("rightQZ", babyEyeCheck.getRightQZ());//右眼:柱镜 | |
468 | + map.put("rightZW", babyEyeCheck.getRightZW());//右眼:轴位 | |
469 | + map.put("leftQJ", babyEyeCheck.getLeftQJ());//左眼:球镜 | |
470 | + map.put("leftQZ", babyEyeCheck.getLeftQZ());//左眼:柱镜 | |
471 | + map.put("leftZW", babyEyeCheck.getLeftZW());//左眼:轴位 | |
472 | + map.put("otherContent", babyEyeCheck.getOtherContent());// //其他需要注明的问题: | |
473 | + /* end 秦皇岛眼保健新增的*/ | |
347 | 474 | |
475 | + List<String> riskFactorNames = EyeHighRiskEnums.getName(babyEyeCheck.getRiskFactorId()); | |
476 | + if (CollectionUtils.isNotEmpty(riskFactorNames)) { | |
477 | + for (int i = 0; i < riskFactorNames.size(); i++) { | |
478 | + if ("其他".equals(riskFactorNames.get(i))) { | |
479 | + riskFactorNames.set(i, "其他:" + (babyEyeCheck.getRiskFactorIdOther() == null ? "" : map.get("riskFactorIdOther").toString())); | |
480 | + } | |
481 | + } | |
482 | + } | |
483 | + | |
484 | + StringBuilder refractometer = new StringBuilder(); | |
485 | + if (StringUtils.isNotEmpty(babyEyeCheck.getR1())) { | |
486 | + refractometer.append("R:S( ").append(babyEyeCheck.getR1()).append(" )"); | |
487 | + } | |
488 | + if (StringUtils.isNotEmpty(babyEyeCheck.getR2())) { | |
489 | + if (refractometer.length() != 0) { | |
490 | + refractometer.append(" "); | |
491 | + } | |
492 | + refractometer.append("R:DC( ").append(babyEyeCheck.getR2()).append(" ) D"); | |
493 | + } | |
494 | + boolean flag = false; | |
495 | + if (StringUtils.isNotEmpty(babyEyeCheck.getL1())) { | |
496 | + if (refractometer.length() != 0) { | |
497 | + refractometer.append(", "); | |
498 | + flag = true; | |
499 | + } | |
500 | + refractometer.append("L:S( ").append(babyEyeCheck.getL1()).append(" ) "); | |
501 | + } | |
502 | + if (StringUtils.isNotEmpty(babyEyeCheck.getL2())) { | |
503 | + if (!flag) { | |
504 | + if (StringUtils.isNotEmpty(babyEyeCheck.getR1()) || StringUtils.isNotEmpty(babyEyeCheck.getR2())) { | |
505 | + refractometer.append(", "); | |
506 | + } | |
507 | + } | |
508 | + refractometer.append("L:DC( ").append(babyEyeCheck.getL2()).append(" ) D"); | |
509 | + } | |
510 | + map.put("refractometer", refractometer.toString()); | |
511 | + | |
512 | + StringBuilder refraction = new StringBuilder(); | |
513 | + if (StringUtils.isNotEmpty(babyEyeCheck.getRefractionR1())) { | |
514 | + refraction.append("R:S( ").append(babyEyeCheck.getRefractionR1()).append(" )"); | |
515 | + } | |
516 | + if (StringUtils.isNotEmpty(babyEyeCheck.getRefractionR2())) { | |
517 | + if (refraction.length() != 0) { | |
518 | + refraction.append(" "); | |
519 | + } | |
520 | + refraction.append("R:DC( ").append(babyEyeCheck.getRefractionR2()).append(" ) D"); | |
521 | + } | |
522 | + boolean flag2 = false; | |
523 | + if (StringUtils.isNotEmpty(babyEyeCheck.getRefractionL1())) { | |
524 | + if (refraction.length() != 0) { | |
525 | + refraction.append(", "); | |
526 | + flag2 = true; | |
527 | + } | |
528 | + refraction.append("L:S( ").append(babyEyeCheck.getRefractionL1()).append(" ) "); | |
529 | + } | |
530 | + if (StringUtils.isNotEmpty(babyEyeCheck.getRefractionL2())) { | |
531 | + if (!flag2) { | |
532 | + if (StringUtils.isNotEmpty(babyEyeCheck.getRefractionR1()) || StringUtils.isNotEmpty(babyEyeCheck.getRefractionR2())) { | |
533 | + refraction.append(", "); | |
534 | + } | |
535 | + } | |
536 | + refraction.append("L:DC( ").append(babyEyeCheck.getRefractionL2()).append(" ) D"); | |
537 | + } | |
538 | + map.put("refraction", refraction.toString()); | |
539 | + | |
540 | + map.put("riskFactorId", riskFactorNames); | |
541 | + //处理老数据 | |
542 | + if("0".equals(babyEyeCheck.getCheckMonthId())){ | |
543 | + babyEyeCheck.setCheckMonthId("1"); | |
544 | + }else if("9".equals(babyEyeCheck.getCheckMonthId())){ | |
545 | + babyEyeCheck.setCheckMonthId("12"); | |
546 | + }else if("18".equals(babyEyeCheck.getCheckMonthId())){ | |
547 | + babyEyeCheck.setCheckMonthId("24"); | |
548 | + } | |
549 | + map.put("checkMonthId", CheckMonthQhdEnums.getName(babyEyeCheck.getCheckMonthId())); | |
550 | + | |
551 | + | |
552 | + map.put("checkMonth", babyEyeCheck.getCheckMonthId()); | |
553 | + map.put("nextCheckMonthId", babyEyeCheck.getNextCheckMonthId()); | |
554 | + map.put("extRightEyelook", parseYinYang(babyEyeCheck.getExtRightEyelook(), babyEyeCheck.getExtRightEyelookOther())); | |
555 | + map.put("extEyelook", parseYinYang(babyEyeCheck.getExtEyelook(), babyEyeCheck.getExtEyelookOther())); | |
556 | + map.put("extLeftEyelook", parseYinYang(babyEyeCheck.getExtLeftEyelook(), babyEyeCheck.getExtLeftEyelookOther())); | |
557 | + map.put("blinkRightReflex", parseYinYang(babyEyeCheck.getBlinkRightReflex())); | |
558 | + map.put("blinkLefttReflex", parseYinYang(babyEyeCheck.getBlinkLefttReflex())); | |
559 | + map.put("pupillaryRightReflex", parseYinYang(babyEyeCheck.getPupillaryRightReflex())); | |
560 | + map.put("pupillaryLeftReflex", parseYinYang(babyEyeCheck.getPupillaryLeftReflex())); | |
561 | + map.put("redRightReflex", parseYinYang(babyEyeCheck.getRedRightReflex())); | |
562 | + map.put("eyePositionId", (StringUtils.isNotEmpty(EyePositionEnums.getName(babyEyeCheck.getEyePositionId())) ? EyePositionEnums.getName(babyEyeCheck.getEyePositionId()) : "") + (StringUtils.isNotEmpty(babyEyeCheck.getEyePositionOther()) ? ":" + babyEyeCheck.getEyePositionOther() : "")); | |
563 | + map.put("redLeftReflex", parseYinYang(babyEyeCheck.getRedLeftReflex())); | |
564 | + map.put("redReflex", parseYinYang(babyEyeCheck.getRedReflex(), babyEyeCheck.getRedReflexOther())); | |
565 | + map.put("conjunctiva", parseYinYang(babyEyeCheck.getConjunctiva(), babyEyeCheck.getConjunctivaOther())); | |
566 | + map.put("corneal", parseYinYang(babyEyeCheck.getCorneal(), babyEyeCheck.getCornealOther())); | |
567 | + map.put("lacrimalApparatus", parseYinYang(babyEyeCheck.getLacrimalApparatus(), babyEyeCheck.getLacrimalApparatusOther())); | |
568 | + //一下都是医生选定阳性 | |
569 | + map.put("eyePosition2", "yang".equals(babyEyeCheck.getEyePositionId2()) ? "医生判定阳性" : ""); | |
570 | + map.put("redLeft2", "yang".equals(babyEyeCheck.getRedLeft2()) ? "医生判定阳性" : ""); | |
571 | + map.put("vision2", "yang".equals(babyEyeCheck.getVision2()) ? "医生判定阳性" : ""); | |
572 | + map.put("y2", "yang".equals(babyEyeCheck.getY2()) ? "医生判定阳性" : ""); | |
573 | + map.put("refraction2", "yang".equals(babyEyeCheck.getRefraction2()) ? "医生判定阳性" : ""); | |
574 | + | |
575 | + map.put("visionJudgment1", babyEyeCheck.getVisionJudgment1() == null ? "" : babyEyeCheck.getVisionJudgment1() == 0 ? "" : "标准对视远视力表"); | |
576 | + map.put("visionJudgment2", babyEyeCheck.getVisionJudgment2() == null ? "" : babyEyeCheck.getVisionJudgment2() == 0 ? "" : "儿童对数视力表"); | |
577 | + map.put("visionJudgment3", babyEyeCheck.getVisionJudgment3() == null ? "" : babyEyeCheck.getVisionJudgment3() == 0 ? "" : "欠合作"); | |
578 | + | |
579 | + map.put("prismLeft", babyEyeCheck.getPrismLeft()); | |
580 | + map.put("prismRight", babyEyeCheck.getPrismRight()); | |
581 | + map.put("cooperation", !StringUtils.isNotEmpty(babyEyeCheck.getCooperation()) ? "" : "0".equals(babyEyeCheck.getCooperation()) ? "欠合作" : "不合作"); | |
582 | + | |
583 | + FilePathModel filePath = yunBookbuildingService.findFilePathByBabyId(babyEyeCheck.getId()); | |
584 | + map.put("filePath", filePath); | |
585 | + // | |
586 | + CollectionUtils.removeNullValue(map); | |
587 | + return RespBuilder.buildSuccess(map); | |
588 | + } | |
589 | + | |
348 | 590 | private String parseYinYang(String s) { |
349 | 591 | return parseYinYang(s, null); |
350 | 592 | } |
... | ... | @@ -356,9 +598,7 @@ |
356 | 598 | return "- (" + other + ")"; |
357 | 599 | } else if ("yang".equals(s)) { |
358 | 600 | return "+ (" + other + ")"; |
359 | - } | |
360 | - else if ("ruoyang".equals(s)) | |
361 | - { | |
601 | + } else if ("ruoyang".equals(s)) { | |
362 | 602 | return "稍减弱"; |
363 | 603 | } |
364 | 604 | } else { |
... | ... | @@ -366,9 +606,7 @@ |
366 | 606 | return "-"; |
367 | 607 | } else if ("yang".equals(s)) { |
368 | 608 | return "+"; |
369 | - } | |
370 | - else if ("ruoyang".equals(s)) | |
371 | - { | |
609 | + } else if ("ruoyang".equals(s)) { | |
372 | 610 | return "稍减弱"; |
373 | 611 | } |
374 | 612 | } |
375 | 613 | |
... | ... | @@ -403,7 +641,42 @@ |
403 | 641 | } |
404 | 642 | return RespBuilder.buildSuccess(map); |
405 | 643 | } |
644 | + @Override | |
645 | + public BaseResponse editQhd(String id) { | |
646 | + BabyEyeCheck babyEyeCheck = mongoTemplate.findById(id, BabyEyeCheck.class); | |
647 | + Map<String, Object> map = ReflectionUtils.beanToMap(babyEyeCheck); | |
648 | + map.put("checkTime", DateUtil.getYyyyMmDd(babyEyeCheck.getCheckTime())); | |
649 | + if (StringUtils.isNotEmpty(babyEyeCheck.getCheckMonthId())) { | |
650 | + //处理老数据 | |
651 | + if("0".equals(babyEyeCheck.getCheckMonthId())){ | |
652 | + babyEyeCheck.setCheckMonthId("1"); | |
653 | + }else if("9".equals(babyEyeCheck.getCheckMonthId())){ | |
654 | + babyEyeCheck.setCheckMonthId("12"); | |
655 | + }else if("18".equals(babyEyeCheck.getCheckMonthId())){ | |
656 | + babyEyeCheck.setCheckMonthId("24"); | |
657 | + } | |
658 | + map.put("checkMonthId", babyEyeCheck.getCheckMonthId() + ""); | |
659 | + } | |
406 | 660 | |
661 | + FilePathModel filePath = yunBookbuildingService.findFilePathByBabyId(babyEyeCheck.getId()); | |
662 | + map.put("filePath", filePath); | |
663 | + | |
664 | + map.put("nextCheckTime", DateUtil.getYyyyMmDd(babyEyeCheck.getNextCheckTime())); | |
665 | + if (babyEyeCheck.getRiskFactorId() != null) { | |
666 | + List<String> riskFactorId = babyEyeCheck.getRiskFactorId(); | |
667 | + List<Map<String, Object>> rest = new ArrayList<>(); | |
668 | + for (String s : riskFactorId) { | |
669 | + EyeHighRiskEnums eyeHighRiskEnums = EyeHighRiskEnums.get(Integer.parseInt(s)); | |
670 | + Map<String, Object> tempMap = new HashedMap(); | |
671 | + tempMap.put("id", eyeHighRiskEnums.getId() + ""); | |
672 | + tempMap.put("name", eyeHighRiskEnums.getName()); | |
673 | + rest.add(tempMap); | |
674 | + } | |
675 | + map.put("riskFactorId", rest); | |
676 | + } | |
677 | + return RespBuilder.buildSuccess(map); | |
678 | + } | |
679 | + | |
407 | 680 | @Override |
408 | 681 | public BaseResponse delete(String id, Integer userId) { |
409 | 682 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
410 | 683 | |
411 | 684 | |
412 | 685 | |
... | ... | @@ -466,16 +739,16 @@ |
466 | 739 | query.addCriteria(new Criteria().orOperator(Criteria.where("apparatus").is("2"), Criteria.where("doctorJudgement").is("2"))); |
467 | 740 | System.out.println(query.toString()); |
468 | 741 | |
469 | - int count = (int)mongoTemplate.count(query, BabyEyeCheck.class); | |
742 | + int count = (int) mongoTemplate.count(query, BabyEyeCheck.class); | |
470 | 743 | |
471 | - BaseQuery param = new BaseQuery(); | |
744 | + BaseQuery param = new BaseQuery(); | |
472 | 745 | param.setPage(page); |
473 | 746 | param.setLimit(limit); |
474 | - param.mysqlBuild( count); | |
747 | + param.mysqlBuild(count); | |
475 | 748 | query.skip(param.getOffset()).limit(param.getLimit()); |
476 | 749 | |
477 | 750 | List<BabyEyeCheck> babyEyeChecks = mongoTemplate.find(query, BabyEyeCheck.class); |
478 | - // doFilter(babyEyeChecks); | |
751 | + // doFilter(babyEyeChecks); | |
479 | 752 | |
480 | 753 | if (StringUtils.isNotEmpty(positiveIds)) { |
481 | 754 | List<String> ids = CollectionUtils.asList(positiveIds, String.class); |
... | ... | @@ -485,7 +758,7 @@ |
485 | 758 | } |
486 | 759 | //Integer count = babyEyeChecks.size(); |
487 | 760 | |
488 | - // List<BabyEyeCheck> datas = CollectionUtils.getPageIds(babyEyeChecks, page, limit); | |
761 | + // List<BabyEyeCheck> datas = CollectionUtils.getPageIds(babyEyeChecks, page, limit); | |
489 | 762 | List<Map<String, Object>> maps = setDatas(babyEyeChecks); |
490 | 763 | return RespBuilder.buildSuccess(new PageResult(count, page, limit, maps)); |
491 | 764 | } |
492 | 765 | |
493 | 766 | |
494 | 767 | |
495 | 768 | |
... | ... | @@ -594,27 +867,21 @@ |
594 | 867 | positive.append("手持眼光仪(医生判定阳性)"); |
595 | 868 | } |
596 | 869 | if ("yang".equals(babyEyeCheck.getRefraction2())) { |
597 | - if ("197".equals(babyEyeCheck.getHospitalId())) | |
598 | - { | |
870 | + if ("197".equals(babyEyeCheck.getHospitalId())) { | |
599 | 871 | positive.append("屈光不正"); |
600 | - } | |
601 | - else | |
602 | - { | |
872 | + } else { | |
603 | 873 | positive.append("屈光(医生判定阳性)"); |
604 | 874 | } |
605 | 875 | |
606 | 876 | } |
607 | 877 | |
608 | - if ("ruoyang".equals(babyEyeCheck.getRedRightReflex())) | |
609 | - { | |
878 | + if ("ruoyang".equals(babyEyeCheck.getRedRightReflex())) { | |
610 | 879 | positive.append("瞳孔红光反射(右)(稍减弱)"); |
611 | 880 | } |
612 | - if ("ruoyang".equals(babyEyeCheck.getRedLeftReflex())) | |
613 | - { | |
881 | + if ("ruoyang".equals(babyEyeCheck.getRedLeftReflex())) { | |
614 | 882 | positive.append("瞳孔红光反射(左)(稍减弱)"); |
615 | 883 | } |
616 | - if ("ruoyang".equals(babyEyeCheck.getRedReflex())) | |
617 | - { | |
884 | + if ("ruoyang".equals(babyEyeCheck.getRedReflex())) { | |
618 | 885 | positive.append("红光反射(稍减弱)"); |
619 | 886 | } |
620 | 887 | |
621 | 888 | |
... | ... | @@ -720,7 +987,44 @@ |
720 | 987 | } |
721 | 988 | return RespBuilder.buildSuccess(rest); |
722 | 989 | } |
990 | + @Override | |
991 | + public BaseResponse queryQhd(Integer userId, String babyId) { | |
992 | + List<String> hospitalIds = organizationGroupsFacade.findGroupHospital(userId, false); | |
993 | + if (CollectionUtils.isEmpty(hospitalIds)) { | |
994 | + return RespBuilder.buildSuccess(); | |
995 | + } | |
996 | + List<BabyEyeCheck> babyEyeChecks = mongoTemplate.find(Query.query(Criteria.where("babyId").is(babyId).and("hospitalId").in(hospitalIds).and("yn").ne("0")) | |
997 | + .with(new Sort(Sort.Direction.ASC, "checkTime")), BabyEyeCheck.class); | |
998 | + List<Map<String, Object>> rest = new ArrayList<>(); | |
999 | + for (BabyEyeCheck babyEyeCheck : babyEyeChecks) { | |
1000 | + Map<String, Object> temp = new HashMap<>(); | |
1001 | + temp.put("id", babyEyeCheck.getId()); | |
1002 | + temp.put("hospitalId", babyEyeCheck.getHospitalId()); | |
1003 | + temp.put("pid", babyEyeCheck.getPid()); | |
723 | 1004 | |
1005 | + //处理老数据 | |
1006 | + if("0".equals(babyEyeCheck.getCheckMonthId())){ | |
1007 | + babyEyeCheck.setCheckMonthId("1"); | |
1008 | + }else if("9".equals(babyEyeCheck.getCheckMonthId())){ | |
1009 | + babyEyeCheck.setCheckMonthId("12"); | |
1010 | + }else if("18".equals(babyEyeCheck.getCheckMonthId())){ | |
1011 | + babyEyeCheck.setCheckMonthId("24"); | |
1012 | + } | |
1013 | + temp.put("checkMonth", CheckMonthQhdEnums.getName(babyEyeCheck.getCheckMonthId())); | |
1014 | + BabyModel babyModel = mongoTemplate.findById(babyEyeCheck.getBabyId(), BabyModel.class); | |
1015 | + if (babyModel != null) { | |
1016 | + temp.put("name", babyModel.getName()); | |
1017 | + if (babyModel.getSex() != null) { | |
1018 | + temp.put("sex", SexEnum.getTextById(babyModel.getSex())); | |
1019 | + } | |
1020 | + } | |
1021 | + temp.put("checkTime", babyEyeCheck.getCheckTime() == null ? null : DateUtil.getYyyyMmDd(babyEyeCheck.getCheckTime())); | |
1022 | + CollectionUtils.removeNullValue(temp); | |
1023 | + rest.add(temp); | |
1024 | + } | |
1025 | + return RespBuilder.buildSuccess(rest); | |
1026 | + } | |
1027 | + | |
724 | 1028 | @Override |
725 | 1029 | public BaseResponse listInit(Integer userId) { |
726 | 1030 | |
... | ... | @@ -729,8 +1033,7 @@ |
729 | 1033 | List<Map<String, Object>> currentMonth = EnumUtil.toJson(CheckMonthEnums2.class); /** 检查月龄 */ |
730 | 1034 | List<Map<String, Object>> positive = new ArrayList<>(); /** 阳性项目 */ |
731 | 1035 | |
732 | - if ("197".equals(hospitalId)) | |
733 | - { | |
1036 | + if ("197".equals(hospitalId)) { | |
734 | 1037 | |
735 | 1038 | Map<String, Object> extRightEyelookMap = new HashMap<>(); |
736 | 1039 | extRightEyelookMap.put("id", "extRightEyelook"); |
... | ... | @@ -814,9 +1117,7 @@ |
814 | 1117 | vision2Map.put("id", "vision2"); |
815 | 1118 | vision2Map.put("name", "视力(医生判定阳性)"); |
816 | 1119 | positive.add(vision2Map); |
817 | - } | |
818 | - else | |
819 | - { | |
1120 | + } else { | |
820 | 1121 | Map<String, Object> extEyelookMap = new HashMap<>(); |
821 | 1122 | extEyelookMap.put("id", "extEyelook"); |
822 | 1123 | extEyelookMap.put("name", "外眼观察"); |
... | ... | @@ -913,7 +1214,6 @@ |
913 | 1214 | refraction2Map.put("name", "屈光(医生判定阳性)"); |
914 | 1215 | positive.add(refraction2Map); |
915 | 1216 | } |
916 | - | |
917 | 1217 | |
918 | 1218 | |
919 | 1219 | return RespBuilder.buildSuccess("checkMonth", checkMonth, "positive", positive, "currentMonth", currentMonth); |