Commit 90ed7701d2b80015a59f7e2c1e71d1899cd8d6ed
1 parent
69fafdb939
Exists in
master
and in
6 other branches
听力诊断模块
Showing 1 changed file with 81 additions and 15 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HearDiagnManageController.java
View file @
90ed770
| ... | ... | @@ -84,7 +84,7 @@ |
| 84 | 84 | //当前登录人医院Id |
| 85 | 85 | String hospitalId = autoMatchFacade.getHospitalId(loginState.getId()); |
| 86 | 86 | //获取机构内同一儿童babyIds |
| 87 | - List<String> babyIds = earFacade.getBabyIdsByItemOrg(babyId,hospitalId); | |
| 87 | + List<String> babyIds = earFacade.getBabyIdsByItemOrg(babyId, hospitalId); | |
| 88 | 88 | |
| 89 | 89 | |
| 90 | 90 | //儿童听筛记录 |
| ... | ... | @@ -162,7 +162,7 @@ |
| 162 | 162 | //获取当前登录用户ID |
| 163 | 163 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 164 | 164 | if (loginState == null) { |
| 165 | - return ; | |
| 165 | + return; | |
| 166 | 166 | } |
| 167 | 167 | //当前登录人医院Id |
| 168 | 168 | String hospitalId = autoMatchFacade.getHospitalId(loginState.getId()); |
| ... | ... | @@ -198,7 +198,7 @@ |
| 198 | 198 | |
| 199 | 199 | List<String> babyIds = new ArrayList<>(); |
| 200 | 200 | if (CollectionUtils.isEmpty(models) && (StringUtils.isNotEmpty(hdReq.getKeyWord()) || hdReq.getBirthStartTime() != null || hdReq.getBirthEndTime() != null)) { |
| 201 | - return ; | |
| 201 | + return; | |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | if (CollectionUtils.isNotEmpty(models)) { |
| ... | ... | @@ -529,7 +529,6 @@ |
| 529 | 529 | |
| 530 | 530 | List<String> babyIds = new ArrayList<>(); |
| 531 | 531 | |
| 532 | - | |
| 533 | 532 | BabyPatientExtendEarBabyQuery babyQuery = new BabyPatientExtendEarBabyQuery(); |
| 534 | 533 | babyQuery.setQueryNo(model.getKeyWord()); |
| 535 | 534 | babyQuery.setBirthStart(model.getBirthStartTime()); |
| 536 | 535 | |
| ... | ... | @@ -603,13 +602,32 @@ |
| 603 | 602 | hdm.setBirthday(com.lyms.platform.common.utils.StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(babyModel.getBirth()))); |
| 604 | 603 | hdm.setSex(com.lyms.platform.common.utils.StringUtils.emptyDeal(SexEnum.getTextById(babyModel.getSex()))); |
| 605 | 604 | } |
| 605 | + | |
| 606 | + if (StringUtils.isNotEmpty(es.getHighRiskCause())) { | |
| 607 | + StringBuffer hfBuff = new StringBuffer(); | |
| 608 | + String[] highFactors = es.getHighRiskCause().split(","); | |
| 609 | + for (String hf : highFactors) { | |
| 610 | + if (StringUtils.isNotEmpty(hf)) { | |
| 611 | + String name = HighRiskEnum.getTitle(Integer.parseInt(hf)); | |
| 612 | + hfBuff.append(name + "、"); | |
| 613 | + } | |
| 614 | + } | |
| 615 | + String hfString = null; | |
| 616 | + if (hfBuff.toString().endsWith("、")) { | |
| 617 | + hfString = hfBuff.substring(0, hfBuff.length() - 1); | |
| 618 | + } else { | |
| 619 | + hfString = hfBuff.toString(); | |
| 620 | + } | |
| 621 | + hdm.setHighRiskEnums(hfString); | |
| 622 | + } | |
| 623 | + | |
| 606 | 624 | String babyId = es.getBabyId(); |
| 607 | 625 | BabyPatientExtendEarHearingDiagnoseQuery hdQuery = new BabyPatientExtendEarHearingDiagnoseQuery(); |
| 608 | 626 | hdQuery.setBabyId(babyId); |
| 609 | 627 | //根据babyId查询听力诊断,如果有数据则已诊断 |
| 610 | 628 | int count = hearingDiagnoseService.queryBabyPatientExtendEarHearingDiagnoseCount(hdQuery); |
| 611 | - hdm.setSecrType(es.getScreenType()==1?"初筛":"复筛"); | |
| 612 | - hdm.setSecrResult(es.getScrIspass()==1?"通过":"未通过"); | |
| 629 | + hdm.setSecrType(es.getScreenType() == 1 ? "初筛" : "复筛"); | |
| 630 | + hdm.setSecrResult(es.getScrIspass() == 1 ? "通过" : "未通过"); | |
| 613 | 631 | if (count > 0) {//儿童在医院里做过听力诊断记录,标记为已诊断 |
| 614 | 632 | hdm.setStatus("已诊断"); |
| 615 | 633 | alrScreens.add(hdm); |
| ... | ... | @@ -752,6 +770,23 @@ |
| 752 | 770 | hdm.setBirthday(com.lyms.platform.common.utils.StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(babyModel.getBirth()))); |
| 753 | 771 | hdm.setSex(com.lyms.platform.common.utils.StringUtils.emptyDeal(SexEnum.getTextById(babyModel.getSex()))); |
| 754 | 772 | } |
| 773 | + if (StringUtils.isNotEmpty(es.getHighRiskCause())) { | |
| 774 | + StringBuffer hfBuff = new StringBuffer(); | |
| 775 | + String[] highFactors = es.getHighRiskCause().split(","); | |
| 776 | + for (String hf : highFactors) { | |
| 777 | + if (StringUtils.isNotEmpty(hf)) { | |
| 778 | + String name = HighRiskEnum.getTitle(Integer.parseInt(hf)); | |
| 779 | + hfBuff.append(name + "、"); | |
| 780 | + } | |
| 781 | + } | |
| 782 | + String hfString = null; | |
| 783 | + if (hfBuff.toString().endsWith("、")) { | |
| 784 | + hfString = hfBuff.substring(0, hfBuff.length() - 1); | |
| 785 | + } else { | |
| 786 | + hfString = hfBuff.toString(); | |
| 787 | + } | |
| 788 | + hdm.setHighRiskEnums(hfString); | |
| 789 | + } | |
| 755 | 790 | String babyId = es.getBabyId(); |
| 756 | 791 | BabyPatientExtendEarHearingDiagnoseQuery hdQuery = new BabyPatientExtendEarHearingDiagnoseQuery(); |
| 757 | 792 | hdQuery.setBabyId(babyId); |
| ... | ... | @@ -930,7 +965,7 @@ |
| 930 | 965 | |
| 931 | 966 | //根据儿童条件查询如果为空 |
| 932 | 967 | if (CollectionUtils.isEmpty(babyIds) && (model.getMonthAgeStart() != null || model.getMonthAgeEnd() != null || StringUtils.isNotEmpty(model.getKeyWord()) || model.getBirthStartTime() != null || model.getBirthEndTime() != null)) { |
| 933 | - return ; | |
| 968 | + return; | |
| 934 | 969 | } |
| 935 | 970 | |
| 936 | 971 | //查询全部数据 |
| 937 | 972 | |
| ... | ... | @@ -943,12 +978,11 @@ |
| 943 | 978 | } |
| 944 | 979 | |
| 945 | 980 | //听筛医生不为空 |
| 946 | - if (CollectionUtils.isEmpty(earScreens)&&model.getDiagnDoctorId() != null) { | |
| 981 | + if (CollectionUtils.isEmpty(earScreens) && model.getDiagnDoctorId() != null) { | |
| 947 | 982 | return; |
| 948 | 983 | } |
| 949 | 984 | |
| 950 | 985 | |
| 951 | - | |
| 952 | 986 | //要返回的数据 |
| 953 | 987 | List<HearDiagnManageListResult> hdmResult = new ArrayList<>(); |
| 954 | 988 | if (CollectionUtils.isNotEmpty(babyModels)) { |
| 955 | 989 | |
| 956 | 990 | |
| ... | ... | @@ -964,13 +998,30 @@ |
| 964 | 998 | hdm.setSex(com.lyms.platform.common.utils.StringUtils.emptyDeal(SexEnum.getTextById(ear.getSex()))); |
| 965 | 999 | BabyPatientExtendEarScreen es = screenMap.get(ear.getBabyPatientId()); |
| 966 | 1000 | |
| 967 | - if(es==null){ | |
| 1001 | + if (es == null) { | |
| 968 | 1002 | if (model.getDiagnDoctorId() != null) {//筛查医生查询条件不为空,没找到则跳过 |
| 969 | 1003 | continue; |
| 970 | 1004 | } |
| 971 | 1005 | } |
| 972 | - | |
| 973 | 1006 | if (es != null) { |
| 1007 | + if (StringUtils.isNotEmpty(es.getHighRiskCause())) { | |
| 1008 | + StringBuffer hfBuff = new StringBuffer(); | |
| 1009 | + String[] highFactors = es.getHighRiskCause().split(","); | |
| 1010 | + for (String hf : highFactors) { | |
| 1011 | + if (StringUtils.isNotEmpty(hf)) { | |
| 1012 | + String name = HighRiskEnum.getTitle(Integer.parseInt(hf)); | |
| 1013 | + hfBuff.append(name + "、"); | |
| 1014 | + } | |
| 1015 | + } | |
| 1016 | + String hfString = null; | |
| 1017 | + if (hfBuff.toString().endsWith("、")) { | |
| 1018 | + hfString = hfBuff.substring(0, hfBuff.length() - 1); | |
| 1019 | + } else { | |
| 1020 | + hfString = hfBuff.toString(); | |
| 1021 | + } | |
| 1022 | + hdm.setHighRiskEnums(hfString); | |
| 1023 | + } | |
| 1024 | + | |
| 974 | 1025 | hdm.setId(es.getId()); |
| 975 | 1026 | String docotorId = es.getCheckDoctorId(); |
| 976 | 1027 | Users users = usersService.getUsers(Integer.parseInt(docotorId == null ? "0" : docotorId)); |
| ... | ... | @@ -1137,7 +1188,7 @@ |
| 1137 | 1188 | } |
| 1138 | 1189 | |
| 1139 | 1190 | //听筛医生不为空 |
| 1140 | - if (CollectionUtils.isEmpty(earScreens)&&model.getDiagnDoctorId() != null) { | |
| 1191 | + if (CollectionUtils.isEmpty(earScreens) && model.getDiagnDoctorId() != null) { | |
| 1141 | 1192 | BaseListResponse result = new BaseListResponse(); |
| 1142 | 1193 | result.setData(new ArrayList()); |
| 1143 | 1194 | result.setErrorcode(0); |
| ... | ... | @@ -1145,7 +1196,6 @@ |
| 1145 | 1196 | } |
| 1146 | 1197 | |
| 1147 | 1198 | |
| 1148 | - | |
| 1149 | 1199 | //要返回的数据 |
| 1150 | 1200 | List<HearDiagnManageListResult> hdmResult = new ArrayList<>(); |
| 1151 | 1201 | if (CollectionUtils.isNotEmpty(babyModels)) { |
| 1152 | 1202 | |
| ... | ... | @@ -1161,12 +1211,11 @@ |
| 1161 | 1211 | hdm.setSex(com.lyms.platform.common.utils.StringUtils.emptyDeal(SexEnum.getTextById(ear.getSex()))); |
| 1162 | 1212 | BabyPatientExtendEarScreen es = screenMap.get(ear.getBabyPatientId()); |
| 1163 | 1213 | |
| 1164 | - if(es==null){ | |
| 1214 | + if (es == null) { | |
| 1165 | 1215 | if (model.getDiagnDoctorId() != null) {//筛查医生查询条件不为空,没找到则跳过 |
| 1166 | 1216 | continue; |
| 1167 | 1217 | } |
| 1168 | 1218 | } |
| 1169 | - | |
| 1170 | 1219 | if (es != null) { |
| 1171 | 1220 | hdm.setId(es.getId()); |
| 1172 | 1221 | String docotorId = es.getCheckDoctorId(); |
| ... | ... | @@ -1175,6 +1224,23 @@ |
| 1175 | 1224 | hdm.setDoctorName(users.getName() == null ? "-" : users.getName()); |
| 1176 | 1225 | } |
| 1177 | 1226 | hdm.setSecrTime(DateUtil.getyyyy_MM_dd(es.getScreenDate())); |
| 1227 | + if (StringUtils.isNotEmpty(es.getHighRiskCause())) { | |
| 1228 | + StringBuffer hfBuff = new StringBuffer(); | |
| 1229 | + String[] highFactors = es.getHighRiskCause().split(","); | |
| 1230 | + for (String hf : highFactors) { | |
| 1231 | + if (StringUtils.isNotEmpty(hf)) { | |
| 1232 | + String name = HighRiskEnum.getTitle(Integer.parseInt(hf)); | |
| 1233 | + hfBuff.append(name + "、"); | |
| 1234 | + } | |
| 1235 | + } | |
| 1236 | + String hfString = null; | |
| 1237 | + if (hfBuff.toString().endsWith("、")) { | |
| 1238 | + hfString = hfBuff.substring(0, hfBuff.length() - 1); | |
| 1239 | + } else { | |
| 1240 | + hfString = hfBuff.toString(); | |
| 1241 | + } | |
| 1242 | + hdm.setHighRiskEnums(hfString); | |
| 1243 | + } | |
| 1178 | 1244 | } |
| 1179 | 1245 | hdmResult.add(hdm); |
| 1180 | 1246 | } |