Commit 0754295c0e031a544a4516564ff21178d69d6cf8
1 parent
ddc0ede908
Exists in
master
and in
6 other branches
产检医生统计
Showing 1 changed file with 41 additions and 4 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HearingDiagnoseController.java
View file @
0754295
... | ... | @@ -20,6 +20,7 @@ |
20 | 20 | import com.lyms.platform.permission.model.*; |
21 | 21 | import com.lyms.platform.permission.service.*; |
22 | 22 | import com.lyms.platform.pojo.BabyModel; |
23 | +import org.apache.commons.collections.CollectionUtils; | |
23 | 24 | import org.apache.commons.lang.StringUtils; |
24 | 25 | import org.springframework.beans.factory.annotation.Autowired; |
25 | 26 | import org.springframework.stereotype.Controller; |
... | ... | @@ -58,6 +59,42 @@ |
58 | 59 | private UsersService usersService; |
59 | 60 | |
60 | 61 | /** |
62 | + * 根据儿童id获取最后一次确诊结果 | |
63 | + * | |
64 | + * @param babyId | |
65 | + * @return | |
66 | + */ | |
67 | + @RequestMapping(method = RequestMethod.GET, value = "/queryLastHearingDiagnose") | |
68 | + @ResponseBody | |
69 | + public BaseResponse queryLastHearingDiagnose(String babyId) { | |
70 | + BaseResponse response = new BaseResponse(); | |
71 | + BabyPatientExtendEarHearingDiagnoseQuery query = new BabyPatientExtendEarHearingDiagnoseQuery(); | |
72 | + query.setBabyId(babyId); | |
73 | + query.setSort("confirm_time"); | |
74 | + | |
75 | + List<BabyPatientExtendEarHearingDiagnose> babyPatientExtendEarHearingDiagnoses = hearingDiagnoseService.queryBabyPatientExtendEarHearingDiagnose(query); | |
76 | + Map<String, String> result = new HashMap<>(); | |
77 | + result.put("confirmResultStr", ""); | |
78 | + result.put("confirmResult", ""); | |
79 | + | |
80 | + if (CollectionUtils.isNotEmpty(babyPatientExtendEarHearingDiagnoses)) { | |
81 | + BabyPatientExtendEarHearingDiagnose extendEarHearingDiagnose = babyPatientExtendEarHearingDiagnoses.get(0); | |
82 | + StringBuffer hfBuff = new StringBuffer(); | |
83 | + String[] highFactors = extendEarHearingDiagnose.getConfirmResult().split(","); | |
84 | + for (String hf : highFactors) { | |
85 | + if (StringUtils.isNotEmpty(hf)) { | |
86 | + String name = ConfirmedEnums.getTitle(Integer.parseInt(hf)); | |
87 | + hfBuff.append(name + "、"); | |
88 | + } | |
89 | + } | |
90 | + result.put("confirmResultStr", hfBuff.toString()); | |
91 | + result.put("confirmResult", extendEarHearingDiagnose.getConfirmResult()); | |
92 | + } | |
93 | + response.setObject(result); | |
94 | + return response; | |
95 | + } | |
96 | + | |
97 | + /** | |
61 | 98 | * 根据id获取听力诊断记录信息 |
62 | 99 | * |
63 | 100 | * @param hdId 听力诊断记录id |
... | ... | @@ -67,7 +104,7 @@ |
67 | 104 | @ResponseBody |
68 | 105 | public BaseResponse queryHearingDiagnoseOne(String hdId) { |
69 | 106 | BabyPatientExtendEarHearingDiagnose behd = hearingDiagnoseService.getBabyPatientExtendEarHearingDiagnose(hdId); |
70 | - if (hdId == null) { | |
107 | + if (behd == null) { | |
71 | 108 | return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("没有找到对应的数据"); |
72 | 109 | } |
73 | 110 | |
... | ... | @@ -80,7 +117,7 @@ |
80 | 117 | behd.setHospitalName(hospitalName); |
81 | 118 | } |
82 | 119 | } |
83 | - if(behd.getDiagnNextTime()!=null){ | |
120 | + if (behd.getDiagnNextTime() != null) { | |
84 | 121 | behd.setDiagnNextTimeStr(DateUtil.getyyyy_MM_dd(behd.getDiagnNextTime())); |
85 | 122 | } |
86 | 123 | if (StringUtils.isNotEmpty(behd.getDiagnDoctorId())) {//查询医生名称 |
... | ... | @@ -90,8 +127,8 @@ |
90 | 127 | } |
91 | 128 | } |
92 | 129 | |
93 | - if(behd.getIsconfirm()!=null){ | |
94 | - behd.setIsconfirmStr(behd.getIsconfirm()==1?"是":"否"); | |
130 | + if (behd.getIsconfirm() != null) { | |
131 | + behd.setIsconfirmStr(behd.getIsconfirm() == 1 ? "是" : "否"); | |
95 | 132 | } |
96 | 133 | |
97 | 134 | if (behd.getConfirmTime() != null) {//计算儿童月龄 |