Commit d696ccab25d75f87ab811de271d343cc48b57a76

Authored by yangfei
1 parent 7e991afdce

听力诊断模块

Showing 4 changed files with 82 additions and 22 deletions

platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarFollowUp.xml View file @ d696cca
... ... @@ -192,7 +192,7 @@
192 192 and mark_time = #{markTime,jdbcType=TIMESTAMP}
193 193 </if>
194 194 <if test="markResult != null and markResult != ''">
195   - and mark_result = #{markResult,jdbcType=VARCHAR}
  195 + and mark_result like concat("%",#{markResult},"%")
196 196 </if>
197 197 <if test="markDetail != null and markDetail != ''">
198 198 and mark_detail = #{markDetail,jdbcType=VARCHAR}
... ... @@ -309,6 +309,7 @@
309 309 </foreach>
310 310 </if>
311 311 and ifdel = 0
  312 + order by follow_time
312 313 </where>
313 314 </select>
314 315 </mapper>
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FollowUpController.java View file @ d696cca
... ... @@ -61,7 +61,7 @@
61 61 private BabyPatientExtendEarBabyService earBabyService;
62 62  
63 63 /**
64   - * 根据babyId获取随访记录
  64 + * 根据babyId获取随访列表
65 65 *
66 66 * @param babyId 随访记录id
67 67 * @return
... ... @@ -108,7 +108,7 @@
108 108 }
109 109  
110 110 /**
111   - * 编辑:获取随访记录详情
  111 + * 获取随访记录详情
112 112 *
113 113 * @param fuId 随访记录id
114 114 * @return
... ... @@ -205,6 +205,9 @@
205 205  
206 206 if(followUp.getNextTime()!=null){
207 207 fuResult.setNextTime(DateUtil.getyyyy_MM_dd(followUp.getNextTime()));
  208 + //根据babyId查询档案信息
  209 + BabyModel babyModel = babyService.getOneBabyById(followUp.getBabyId());
  210 + fuResult.setNextTimeMouseAge(DateUtil.getBabyMonthAge(babyModel.getBirth(), followUp.getNextTime()));
208 211 }
209 212 if(followUp.getIfclose()!=null){
210 213 fuResult.setIfclose(followUp.getIfclose());
... ... @@ -275,7 +278,7 @@
275 278  
276 279 //确诊结果
277 280 if (fur.getMarkResult() != null) {
278   - query.setMarkResult(String.valueOf(fur.getMarkResult()));
  281 + query.setMarkResult(","+fur.getMarkResult()+",");
279 282 }
280 283  
281 284 //医院ID 集合。本院、外院、全部...
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HearDiagnManageController.java View file @ d696cca
... ... @@ -334,27 +334,48 @@
334 334 if (hdReq.getConfirmEndTime() != null) {//确诊结束时间
335 335 query.setConfirmEndTime(hdReq.getConfirmEndTime());
336 336 }
  337 +
  338 + BabyPatientExtendEarBabyQuery babyQuery = new BabyPatientExtendEarBabyQuery();
  339 + babyQuery.setQueryNo(hdReq.getKeyWord());
  340 + babyQuery.setBirthStart(hdReq.getBirthStartTime());
  341 + babyQuery.setBirthEnd(hdReq.getBirthEndTime());
  342 + babyQuery.setHospitalId(hospitalId);
  343 + List<BabyPatientExtendEarBaby> models = earBabyService.queryBabyPatientExtendEarBaby(babyQuery);
  344 +
  345 + List<String> babyIds = new ArrayList<>();
  346 + if (CollectionUtils.isEmpty(models) && (StringUtils.isNotEmpty(hdReq.getKeyWord()) || hdReq.getBirthStartTime() != null || hdReq.getBirthEndTime() != null)) {
  347 + return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  348 + }
  349 +
  350 + if (CollectionUtils.isNotEmpty(models)) {
  351 + for (BabyPatientExtendEarBaby pa : models) {
  352 + babyIds.add(pa.getBabyPatientId());
  353 + }
  354 + query.setBabyIds(babyIds.toArray(new String[babyIds.size()]));
  355 + }
  356 +
  357 +
337 358 //设置确诊
338 359 query.setIsconfirm(1);
339 360 query.setIfdel(0);
340   - if (hdReq.getConfirmDegree() != null) {//模糊查询确诊结果
  361 + if (hdReq.getConfirmResult() != null) {//模糊查询确诊结果
341 362 List<String> cfList = new ArrayList<>();
342   - if (hdReq.getConfirmDegree() == 1) {//轻度
  363 + if (hdReq.getConfirmResult() == 1) {//轻度
343 364 cfList.add(",1,");
344 365 cfList.add(",2,");
345 366 cfList.add(",3,");
346   - } else if (hdReq.getConfirmDegree() == 2) {//中度
  367 + } else if (hdReq.getConfirmResult() == 2) {//中度
347 368 cfList.add(",4,");
348 369 cfList.add(",5,");
349 370 cfList.add(",6,");
350   - } else if (hdReq.getConfirmDegree() == 3) {//重度
  371 + } else if (hdReq.getConfirmResult() == 3) {//重度
351 372 cfList.add(",7,");
352 373 cfList.add(",8,");
353 374 cfList.add(",9,");
354 375 cfList.add(",10,");
355 376 cfList.add(",11,");
356 377 cfList.add(",12,");
357   - } else if (hdReq.getConfirmDegree() == 4) {//极重度
  378 + } else if (hdReq.getConfirmResult() == 4) {//极重度
358 379 cfList.add(",13,");
359 380 cfList.add(",14,");
360 381 cfList.add(",15,");
361 382  
362 383  
... ... @@ -459,19 +480,21 @@
459 480 if (loginState == null) {
460 481 return new BaseResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("请重新登录");
461 482 }
462   -//当前登录人医院Id
  483 + //当前登录人医院Id
463 484 String hospitalId = autoMatchFacade.getHospitalId(loginState.getId());
464 485  
465 486 List<String> babyIds = new ArrayList<>();
466 487  
467 488 BabyPatientExtendEarScreenQuery screenQuery = new BabyPatientExtendEarScreenQuery();
  489 +
468 490 BabyPatientExtendEarBabyQuery babyQuery = new BabyPatientExtendEarBabyQuery();
469 491 babyQuery.setQueryNo(model.getKeyWord());
470 492 babyQuery.setBirthStart(model.getBirthStartTime());
471 493 babyQuery.setBirthEnd(model.getBirthEndTime());
472 494 babyQuery.setHospitalId(hospitalId);
473 495 List<BabyPatientExtendEarBaby> models = earBabyService.queryBabyPatientExtendEarBaby(babyQuery);
474   - if (CollectionUtils.isEmpty(models) && (StringUtils.isNotEmpty(model.getKeyWord()) || model.getBirthStartTime() == null || model.getBirthEndTime() == null)) {
  496 +
  497 + if (CollectionUtils.isEmpty(models) && (StringUtils.isNotEmpty(model.getKeyWord()) || model.getBirthStartTime() != null || model.getBirthEndTime() != null)) {
475 498 return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
476 499 }
477 500  
... ... @@ -482,7 +505,6 @@
482 505 screenQuery.setBabyIds(babyIds.toArray(new String[babyIds.size()]));
483 506 }
484 507  
485   -
486 508 //听筛开始时间
487 509 if (model.getSecrStartTime() != null) {
488 510 screenQuery.setScreenStartDate(model.getSecrStartTime());
489 511  
490 512  
491 513  
492 514  
493 515  
... ... @@ -890,26 +912,24 @@
890 912 babyQuery.setBirthStart(end);
891 913 }
892 914  
  915 +
893 916 babyQuery.setHospitalId(hospitalId);
894 917 babyQuery.setNoEnable("0");
895   - List<BabyPatientExtendEarBaby> babyModels = earBabyService.queryBabyPatientExtendEarBaby(babyQuery);
896 918  
897 919 List<String> babyIds = new ArrayList<>();
898 920  
899   - for (BabyPatientExtendEarBaby babyModel : babyModels) {
900   - babyIds.add(babyModel.getBabyPatientId());
  921 + //如果查询号不为空,根据查询号查询儿童档案表,获取儿童档案Id
  922 + if (StringUtils.isNotEmpty(model.getKeyWord())) {//关键字:姓名、联系方式、就诊卡 查询babyId
  923 + babyQuery.setQueryNo(model.getKeyWord());
  924 + babyQuery.setHospitalId(hospitalId);
901 925 }
902 926  
  927 + List<BabyPatientExtendEarBaby> babyModels = earBabyService.queryBabyPatientExtendEarBaby(babyQuery);
903 928  
904   -//根据儿童条件查询如果为空
905   - if (CollectionUtils.isEmpty(babyIds) && (model.getMonthAgeStart() != null || model.getMonthAgeEnd() != null || StringUtils.isNotEmpty(model.getKeyWord()) || model.getBirthStartTime() != null || model.getBirthEndTime() != null)) {
906   - BaseListResponse result = new BaseListResponse();
907   - result.setData(new ArrayList());
908   - result.setErrorcode(0);
909   - return result;
  929 + for (BabyPatientExtendEarBaby babyModel : babyModels) {
  930 + babyIds.add(babyModel.getBabyPatientId());
910 931 }
911 932  
912   -
913 933 //查询儿童听筛记录
914 934 BabyPatientExtendEarScreenQuery screenQuery = new BabyPatientExtendEarScreenQuery();
915 935 //检测医生ID
... ... @@ -918,6 +938,14 @@
918 938 }
919 939 screenQuery.setCheckHospitalId(hospitalId);
920 940  
  941 + //根据儿童条件查询如果为空
  942 + if (CollectionUtils.isEmpty(babyIds) && (model.getMonthAgeStart() != null || model.getMonthAgeEnd() != null || StringUtils.isNotEmpty(model.getKeyWord()) || model.getBirthStartTime() != null || model.getBirthEndTime() != null)) {
  943 + BaseListResponse result = new BaseListResponse();
  944 + result.setData(new ArrayList());
  945 + result.setErrorcode(0);
  946 + return result;
  947 + }
  948 +
921 949 //查询全部数据
922 950 List<BabyPatientExtendEarScreen> earScreens = screenService.queryBabyPatientExtendEarScreen(screenQuery);
923 951 Map<String, BabyPatientExtendEarScreen> screenMap = new HashMap<>();
924 952  
... ... @@ -927,7 +955,16 @@
927 955 }
928 956 }
929 957  
  958 + //听筛医生不为空
  959 + if (CollectionUtils.isEmpty(earScreens)&&model.getDiagnDoctorId() != null) {
  960 + BaseListResponse result = new BaseListResponse();
  961 + result.setData(new ArrayList());
  962 + result.setErrorcode(0);
  963 + return result;
  964 + }
930 965  
  966 +
  967 +
931 968 //要返回的数据
932 969 List<HearDiagnManageListResult> hdmResult = new ArrayList<>();
933 970 if (CollectionUtils.isNotEmpty(babyModels)) {
... ... @@ -942,6 +979,13 @@
942 979 hdm.setBirthday(com.lyms.platform.common.utils.StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(ear.getBirth())));
943 980 hdm.setSex(com.lyms.platform.common.utils.StringUtils.emptyDeal(SexEnum.getTextById(ear.getSex())));
944 981 BabyPatientExtendEarScreen es = screenMap.get(ear.getBabyPatientId());
  982 +
  983 + if(es==null){
  984 + if (model.getDiagnDoctorId() != null) {//筛查医生查询条件不为空,没找到则跳过
  985 + continue;
  986 + }
  987 + }
  988 +
945 989 if (es != null) {
946 990 hdm.setId(es.getId());
947 991 String docotorId = es.getCheckDoctorId();
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/FollowUpOneResult.java View file @ d696cca
... ... @@ -120,6 +120,18 @@
120 120 * 当前月龄
121 121 */
122 122 private String cMonthAge;
  123 + /**
  124 + * 下次随访月龄
  125 + */
  126 + private String nextTimeMouseAge;
  127 +
  128 + public String getNextTimeMouseAge() {
  129 + return nextTimeMouseAge;
  130 + }
  131 +
  132 + public void setNextTimeMouseAge(String nextTimeMouseAge) {
  133 + this.nextTimeMouseAge = nextTimeMouseAge;
  134 + }
123 135  
124 136 public String getVerdict() {
125 137 return verdict;