Commit 84107c1379f3f63f99246199a4be4eeb9db06d5e
1 parent
2abe0c9a84
Exists in
master
and in
1 other branch
区域儿童信息
Showing 8 changed files with 779 additions and 25 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarBaby.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarBabyQuery.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/HighriskChangeHospitalQuery.java
- platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarBaby.xml
- platform-biz-service/src/main/resources/mainOrm/master/HighriskChangeHospital.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HearingDiagnoseController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HighriskChangeHospitalController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/HearingDiagnoseRequest.java
platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarBaby.java
View file @
84107c1
... | ... | @@ -23,6 +23,16 @@ |
23 | 23 | private String babyEarId; |
24 | 24 | private String personId; |
25 | 25 | |
26 | + private String[] babyPatientIds; | |
27 | + | |
28 | + public String[] getBabyPatientIds() { | |
29 | + return babyPatientIds; | |
30 | + } | |
31 | + | |
32 | + public void setBabyPatientIds(String[] babyPatientIds) { | |
33 | + this.babyPatientIds = babyPatientIds; | |
34 | + } | |
35 | + | |
26 | 36 | public String getPersonId() { |
27 | 37 | return personId; |
28 | 38 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarBabyQuery.java
View file @
84107c1
... | ... | @@ -28,6 +28,8 @@ |
28 | 28 | private Integer yn; |
29 | 29 | private Date buildDate; |
30 | 30 | private String babyPatientId; |
31 | + private String[] babyPatientIds; | |
32 | + | |
31 | 33 | private String babyEarId; |
32 | 34 | //儿童姓名、母亲证件号、母亲联系方式 |
33 | 35 | private String queryNo; |
... | ... | @@ -40,6 +42,14 @@ |
40 | 42 | * 生日 |
41 | 43 | */ |
42 | 44 | private Date birthEnd; |
45 | + | |
46 | + public String[] getBabyPatientIds() { | |
47 | + return babyPatientIds; | |
48 | + } | |
49 | + | |
50 | + public void setBabyPatientIds(String[] babyPatientIds) { | |
51 | + this.babyPatientIds = babyPatientIds; | |
52 | + } | |
43 | 53 | |
44 | 54 | public String[] getHospitalIds() { |
45 | 55 | return hospitalIds; |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/HighriskChangeHospitalQuery.java
View file @
84107c1
... | ... | @@ -6,7 +6,6 @@ |
6 | 6 | import java.util.Date; |
7 | 7 | |
8 | 8 | |
9 | - | |
10 | 9 | public class HighriskChangeHospitalQuery extends BaseQuery { |
11 | 10 | /** |
12 | 11 | * ID(转诊) |
13 | 12 | |
... | ... | @@ -32,7 +31,18 @@ |
32 | 31 | * 转入医院ID |
33 | 32 | */ |
34 | 33 | private String intoOrgid; |
34 | + | |
35 | + | |
35 | 36 | /** |
37 | + * 转出医院ID | |
38 | + */ | |
39 | + private String[] outOrgidArry; | |
40 | + /** | |
41 | + * 转入医院ID | |
42 | + */ | |
43 | + private String[] intoOrgidArry; | |
44 | + | |
45 | + /** | |
36 | 46 | * 病情描述 |
37 | 47 | */ |
38 | 48 | private String description; |
... | ... | @@ -91,6 +101,136 @@ |
91 | 101 | private String pid; |
92 | 102 | //听诊儿童档案集合 |
93 | 103 | private String[] babyIds; |
104 | + // | |
105 | + private String[] hospitalIds; | |
106 | + | |
107 | + // | |
108 | + private String[] babyPatientId; | |
109 | + | |
110 | + | |
111 | + //省 | |
112 | + private String provinceId; | |
113 | + //城市id | |
114 | + private String cityId; | |
115 | + //县id | |
116 | + private String areaId; | |
117 | + //镇id | |
118 | + private String streetId; | |
119 | + //详细地址 | |
120 | + private String address; | |
121 | + | |
122 | + //省市区查询机构 | |
123 | + private String orgProvinceId; | |
124 | + //城市id | |
125 | + private String orgCityId; | |
126 | + //县id | |
127 | + private String orgAreaId; | |
128 | + //医院id | |
129 | + private String hospitalId; | |
130 | + | |
131 | + public String[] getOutOrgidArry() { | |
132 | + return outOrgidArry; | |
133 | + } | |
134 | + | |
135 | + public String[] getBabyPatientId() { | |
136 | + return babyPatientId; | |
137 | + } | |
138 | + | |
139 | + public void setBabyPatientId(String[] babyPatientId) { | |
140 | + this.babyPatientId = babyPatientId; | |
141 | + } | |
142 | + | |
143 | + public void setOutOrgidArry(String[] outOrgidArry) { | |
144 | + this.outOrgidArry = outOrgidArry; | |
145 | + } | |
146 | + | |
147 | + public String[] getIntoOrgidArry() { | |
148 | + return intoOrgidArry; | |
149 | + } | |
150 | + | |
151 | + public void setIntoOrgidArry(String[] intoOrgidArry) { | |
152 | + this.intoOrgidArry = intoOrgidArry; | |
153 | + } | |
154 | + | |
155 | + public String getProvinceId() { | |
156 | + return provinceId; | |
157 | + } | |
158 | + | |
159 | + public void setProvinceId(String provinceId) { | |
160 | + this.provinceId = provinceId; | |
161 | + } | |
162 | + | |
163 | + public String getCityId() { | |
164 | + return cityId; | |
165 | + } | |
166 | + | |
167 | + public void setCityId(String cityId) { | |
168 | + this.cityId = cityId; | |
169 | + } | |
170 | + | |
171 | + public String getAreaId() { | |
172 | + return areaId; | |
173 | + } | |
174 | + | |
175 | + public void setAreaId(String areaId) { | |
176 | + this.areaId = areaId; | |
177 | + } | |
178 | + | |
179 | + public String getStreetId() { | |
180 | + return streetId; | |
181 | + } | |
182 | + | |
183 | + public void setStreetId(String streetId) { | |
184 | + this.streetId = streetId; | |
185 | + } | |
186 | + | |
187 | + public String getAddress() { | |
188 | + return address; | |
189 | + } | |
190 | + | |
191 | + public void setAddress(String address) { | |
192 | + this.address = address; | |
193 | + } | |
194 | + | |
195 | + public String getOrgProvinceId() { | |
196 | + return orgProvinceId; | |
197 | + } | |
198 | + | |
199 | + public void setOrgProvinceId(String orgProvinceId) { | |
200 | + this.orgProvinceId = orgProvinceId; | |
201 | + } | |
202 | + | |
203 | + public String getOrgCityId() { | |
204 | + return orgCityId; | |
205 | + } | |
206 | + | |
207 | + public void setOrgCityId(String orgCityId) { | |
208 | + this.orgCityId = orgCityId; | |
209 | + } | |
210 | + | |
211 | + public String getOrgAreaId() { | |
212 | + return orgAreaId; | |
213 | + } | |
214 | + | |
215 | + public void setOrgAreaId(String orgAreaId) { | |
216 | + this.orgAreaId = orgAreaId; | |
217 | + } | |
218 | + | |
219 | + public String getHospitalId() { | |
220 | + return hospitalId; | |
221 | + } | |
222 | + | |
223 | + public void setHospitalId(String hospitalId) { | |
224 | + this.hospitalId = hospitalId; | |
225 | + } | |
226 | + | |
227 | + public String[] getHospitalIds() { | |
228 | + return hospitalIds; | |
229 | + } | |
230 | + | |
231 | + public void setHospitalIds(String[] hospitalIds) { | |
232 | + this.hospitalIds = hospitalIds; | |
233 | + } | |
94 | 234 | |
95 | 235 | public String getPid() { |
96 | 236 | return pid; |
platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarBaby.xml
View file @
84107c1
... | ... | @@ -216,6 +216,15 @@ |
216 | 216 | <if test="babyPatientId != null and babyPatientId != ''"> |
217 | 217 | and baby_patient_id = #{babyPatientId,jdbcType=VARCHAR} |
218 | 218 | </if> |
219 | + | |
220 | + <if test="babyPatientIds != null"> | |
221 | + and baby_patient_id in | |
222 | + <foreach item="item" index="index" collection="babyPatientIds" open="(" separator="," close=")"> | |
223 | + #{item} | |
224 | + </foreach> | |
225 | + </if> | |
226 | + | |
227 | + | |
219 | 228 | <if test="babyEarId != null and babyEarId != ''"> |
220 | 229 | and baby_ear_id = #{babyEarId,jdbcType=VARCHAR} |
221 | 230 | </if> |
platform-biz-service/src/main/resources/mainOrm/master/HighriskChangeHospital.xml
View file @
84107c1
... | ... | @@ -120,7 +120,27 @@ |
120 | 120 | </foreach> |
121 | 121 | ) |
122 | 122 | </if> |
123 | - | |
123 | + <if test="hospitalIds!=null"> | |
124 | + and INTO_ORGID in ( | |
125 | + <foreach item="item" collection="hospitalIds" separator=","> | |
126 | + #{item} | |
127 | + </foreach> | |
128 | + ) | |
129 | + </if> | |
130 | + <if test="intoOrgidArry!=null"> | |
131 | + and INTO_ORGID in ( | |
132 | + <foreach item="item" collection="intoOrgidArry" separator=","> | |
133 | + #{item} | |
134 | + </foreach> | |
135 | + ) | |
136 | + </if> | |
137 | + <if test="outOrgidArry!=null"> | |
138 | + and OUT_ORGID in ( | |
139 | + <foreach item="item" collection="outOrgidArry" separator=","> | |
140 | + #{item} | |
141 | + </foreach> | |
142 | + ) | |
143 | + </if> | |
124 | 144 | <if test="targetId != null and targetId != ''"> |
125 | 145 | and TARGET_ID = #{targetId,jdbcType=VARCHAR} |
126 | 146 | </if> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HearingDiagnoseController.java
View file @
84107c1
... | ... | @@ -12,6 +12,7 @@ |
12 | 12 | import com.lyms.platform.common.result.BaseListResponse; |
13 | 13 | import com.lyms.platform.common.result.BaseResponse; |
14 | 14 | import com.lyms.platform.common.utils.DateUtil; |
15 | +import com.lyms.platform.operate.web.facade.AreaCountFacade; | |
15 | 16 | import com.lyms.platform.operate.web.facade.AutoMatchFacade; |
16 | 17 | import com.lyms.platform.operate.web.facade.BabyEarFacade; |
17 | 18 | import com.lyms.platform.operate.web.facade.OperateLogFacade; |
... | ... | @@ -21,6 +22,7 @@ |
21 | 22 | import com.lyms.platform.permission.model.*; |
22 | 23 | import com.lyms.platform.permission.service.*; |
23 | 24 | import com.lyms.platform.pojo.BabyModel; |
25 | +import com.lyms.platform.query.BabyModelQuery; | |
24 | 26 | import org.apache.commons.collections.CollectionUtils; |
25 | 27 | import org.apache.commons.lang.StringUtils; |
26 | 28 | import org.springframework.beans.factory.annotation.Autowired; |
... | ... | @@ -69,6 +71,10 @@ |
69 | 71 | @Autowired |
70 | 72 | private OperateLogFacade operateLogFacade; |
71 | 73 | |
74 | + | |
75 | + @Autowired | |
76 | + private AreaCountFacade areaCountFacade; | |
77 | + | |
72 | 78 | /** |
73 | 79 | * 根据儿童id获取最后一次确诊结果 |
74 | 80 | * |
... | ... | @@ -286,7 +292,7 @@ |
286 | 292 | |
287 | 293 | BabyPatientExtendEarHearingDiagnoseQuery query = new BabyPatientExtendEarHearingDiagnoseQuery(); |
288 | 294 | |
289 | - List<String> babyIds = babyEarFacade.getBabyIdsByItemOrg(babyId,hospitalId); | |
295 | + List<String> babyIds = babyEarFacade.getBabyIdsByItemOrg(babyId, hospitalId); | |
290 | 296 | query.setBabyIds((String[]) babyIds.toArray(new String[babyIds.size()])); |
291 | 297 | query.setIfdel(0); |
292 | 298 | //查询听力转诊申请 // e、外院:有申请记录则允许进行新增听力筛查 |
293 | 299 | |
... | ... | @@ -359,9 +365,9 @@ |
359 | 365 | } |
360 | 366 | BabyPatientExtendEarBabyQuery babyQuery = new BabyPatientExtendEarBabyQuery(); |
361 | 367 | babyQuery.setHospitalId(hospitalId); |
362 | - babyQuery.setEnables(new String[]{"0","1","2"}); | |
368 | + babyQuery.setEnables(new String[]{"0", "1", "2"}); | |
363 | 369 | List<BabyPatientExtendEarBaby> earBabies = earBabyService.queryBabyPatientExtendEarBaby(babyQuery); |
364 | - for (BabyPatientExtendEarBaby eb:earBabies){ | |
370 | + for (BabyPatientExtendEarBaby eb : earBabies) { | |
365 | 371 | pids.add(eb.getPersonId()); |
366 | 372 | } |
367 | 373 | } else if (hdReq.getSource() == 1) {//1.本院 |
368 | 374 | |
... | ... | @@ -369,14 +375,13 @@ |
369 | 375 | babyQuery.setHospitalId(hospitalId); |
370 | 376 | babyQuery.setIsEnable("1"); |
371 | 377 | List<BabyPatientExtendEarBaby> earBabies = earBabyService.queryBabyPatientExtendEarBaby(babyQuery); |
372 | - for (BabyPatientExtendEarBaby eb:earBabies){ | |
378 | + for (BabyPatientExtendEarBaby eb : earBabies) { | |
373 | 379 | pids.add(eb.getPersonId()); |
374 | 380 | } |
375 | 381 | } |
376 | 382 | } |
377 | 383 | |
378 | 384 | |
379 | - | |
380 | 385 | BabyPatientExtendEarHearingDiagnoseQuery query = new BabyPatientExtendEarHearingDiagnoseQuery(); |
381 | 386 | |
382 | 387 | |
383 | 388 | |
... | ... | @@ -403,10 +408,10 @@ |
403 | 408 | //是否需要查询听筛数据 |
404 | 409 | boolean isHdScr = true; |
405 | 410 | |
406 | - if(CollectionUtils.isNotEmpty(pids)){ | |
411 | + if (CollectionUtils.isNotEmpty(pids)) { | |
407 | 412 | query.setPids((String[]) pids.toArray(new String[pids.size()])); |
408 | 413 | } |
409 | - if(CollectionUtils.isEmpty(pids)&&hdReq.getSource()!=null){ | |
414 | + if (CollectionUtils.isEmpty(pids) && hdReq.getSource() != null) { | |
410 | 415 | return new FrontEndResult().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("没有找到数据"); |
411 | 416 | } |
412 | 417 | |
... | ... | @@ -517,7 +522,7 @@ |
517 | 522 | List<HearingDiagnoseListResult> hdrList = new ArrayList<>(); |
518 | 523 | List<String> babyIds = new ArrayList<>(); |
519 | 524 | //需要查询听筛数据 |
520 | - if(isHdScr){ | |
525 | + if (isHdScr) { | |
521 | 526 | // scrQuery.setCreateHospitalId(hospitalId); |
522 | 527 | scrQuery.setCheckHospitalId(hospitalId); |
523 | 528 | //本院听筛数据 复筛未通过-待诊断 |
524 | 529 | |
525 | 530 | |
... | ... | @@ -668,19 +673,19 @@ |
668 | 673 | } |
669 | 674 | result.setData(resList); |
670 | 675 | pageInfo.setCount(confiList.size()); |
671 | - } else if(hdReq.getConfirmDegree()!=null){ | |
676 | + } else if (hdReq.getConfirmDegree() != null) { | |
672 | 677 | for (int i = (hdReq.getPage() - 1) * hdReq.getLimit(); i < hdrList.size() && i < hdReq.getPage() * hdReq.getLimit(); i++) { |
673 | 678 | resList.add(confiList.get(i)); |
674 | 679 | } |
675 | 680 | result.setData(resList); |
676 | 681 | pageInfo.setCount(confiList.size()); |
677 | - }else if(StringUtils.isNotEmpty(hdReq.getDiagnDoctorId())){ | |
678 | - for (int i = (hdReq.getPage() - 1) * hdReq.getLimit();i < hdrList.size() && i < hdReq.getPage() * hdReq.getLimit(); i++) { | |
682 | + } else if (StringUtils.isNotEmpty(hdReq.getDiagnDoctorId())) { | |
683 | + for (int i = (hdReq.getPage() - 1) * hdReq.getLimit(); i < hdrList.size() && i < hdReq.getPage() * hdReq.getLimit(); i++) { | |
679 | 684 | resList.add(confiList.get(i)); |
680 | 685 | } |
681 | 686 | result.setData(resList); |
682 | 687 | pageInfo.setCount(confiList.size()); |
683 | - }else { | |
688 | + } else { | |
684 | 689 | for (int i = (hdReq.getPage() - 1) * hdReq.getLimit(); i < hdrList.size() && i < hdReq.getPage() * hdReq.getLimit(); i++) { |
685 | 690 | resList.add(hdrList.get(i)); |
686 | 691 | } |
687 | 692 | |
688 | 693 | |
... | ... | @@ -774,16 +779,15 @@ |
774 | 779 | obj.setModifyId(String.valueOf(loginState.getId())); |
775 | 780 | obj.setModifyTime(new Date()); |
776 | 781 | //确诊 加入确诊时间 |
777 | - if(obj.getIsconfirm()==1){ | |
782 | + if (obj.getIsconfirm() == 1) { | |
778 | 783 | obj.setConfirmTime(new Date()); |
779 | 784 | } |
780 | 785 | |
781 | - BabyPatientExtendEarHearingDiagnose before = hearingDiagnoseService.getBabyPatientExtendEarHearingDiagnose(obj.getId()); | |
786 | + BabyPatientExtendEarHearingDiagnose before = hearingDiagnoseService.getBabyPatientExtendEarHearingDiagnose(obj.getId()); | |
782 | 787 | hearingDiagnoseService.updateBabyPatientExtendEarHearingDiagnose(obj); |
783 | - BabyPatientExtendEarHearingDiagnose after = hearingDiagnoseService.getBabyPatientExtendEarHearingDiagnose(obj.getId()); | |
784 | - if (before != null && after != null) | |
785 | - { | |
786 | - operateLogFacade.addModifyOptLog(loginState.getId(), Integer.valueOf(hospitalId), before,after, OptActionEnums.UPDATE.getId(), "修改听力诊断"); | |
788 | + BabyPatientExtendEarHearingDiagnose after = hearingDiagnoseService.getBabyPatientExtendEarHearingDiagnose(obj.getId()); | |
789 | + if (before != null && after != null) { | |
790 | + operateLogFacade.addModifyOptLog(loginState.getId(), Integer.valueOf(hospitalId), before, after, OptActionEnums.UPDATE.getId(), "修改听力诊断"); | |
787 | 791 | } |
788 | 792 | |
789 | 793 | BaseResponse response = new BaseResponse(); |
... | ... | @@ -821,7 +825,7 @@ |
821 | 825 | //医院id |
822 | 826 | String hospitalId = autoMatchFacade.getHospitalId(loginState.getId()); |
823 | 827 | //确诊 加入确诊时间未诊断时间 |
824 | - if(obj.getIsconfirm()==1){ | |
828 | + if (obj.getIsconfirm() == 1) { | |
825 | 829 | obj.setConfirmTime(obj.getDiagnoseTime()); |
826 | 830 | } |
827 | 831 | String pid = babyModel.getPid(); |
828 | 832 | |
829 | 833 | |
... | ... | @@ -851,17 +855,407 @@ |
851 | 855 | hch.setReceiveDoctorid(String.valueOf(loginState.getId())); |
852 | 856 | highchangeService.updateHighriskChangeHospital(hch); |
853 | 857 | //调用儿童档案接口,将隐藏档案设置为显示 |
854 | - babyEarFacade.showBabyEar(obj.getBabyId(),hospitalId); | |
858 | + babyEarFacade.showBabyEar(obj.getBabyId(), hospitalId); | |
855 | 859 | } |
856 | 860 | } |
857 | 861 | //听力筛查-当某个儿童在同一院组内某家医院完成了的听筛建档后去院组内其他医院做了听筛、听诊或随访,应该要在对应的医院下创建一个隐藏档案 |
858 | 862 | //建立隐藏档案 |
859 | - babyEarFacade.addhideBabyEar(obj.getBabyId(), hospitalId,"2"); | |
863 | + babyEarFacade.addhideBabyEar(obj.getBabyId(), hospitalId, "2"); | |
860 | 864 | |
861 | 865 | BaseResponse result = new BaseResponse(); |
862 | 866 | result.setErrorcode(ErrorCodeConstants.SUCCESS); |
863 | 867 | result.setErrormsg("新增成功"); |
864 | 868 | result.setObject(obj.getId()); |
869 | + return result; | |
870 | + } | |
871 | + | |
872 | + @RequestMapping(method = RequestMethod.GET, value = "/queryHearingDiagnoseRegionList") | |
873 | + @ResponseBody | |
874 | + @TokenRequired | |
875 | + public BaseResponse queryHearingDiagnoseRegionList(HearingDiagnoseRequest hdReq, HttpServletRequest request) { | |
876 | + //获取当前登录用户ID | |
877 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
878 | + if (loginState == null) { | |
879 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("请重新登录"); | |
880 | + } | |
881 | + //获取当前用户能看到的那些医院 | |
882 | + List<String> hospitalIds = new ArrayList<>(); | |
883 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(hdReq.getHospitalId())) { | |
884 | + hospitalIds.add(hdReq.getHospitalId()); | |
885 | + } else { | |
886 | + //获取用户拥有的权限医院和条件筛选的医院交集 | |
887 | + hospitalIds = areaCountFacade.getCurrentUserHospPermissions(loginState.getId(), hdReq.getOrgProvinceId(), hdReq.getOrgCityId(), hdReq.getAreaId()); | |
888 | + } | |
889 | + //当前登录人医院Id | |
890 | + // String hospitalId = autoMatchFacade.getHospitalId(loginState.getId()); | |
891 | + String[] hospitalIdArry = new String[hospitalIds.size()]; | |
892 | + | |
893 | + | |
894 | + BabyModelQuery modelQuery = new BabyModelQuery(); | |
895 | + modelQuery.setProvinceId(hdReq.getProvinceId()); | |
896 | + modelQuery.setCityId(hdReq.getCityId()); | |
897 | + modelQuery.setAreaId(hdReq.getAreaId()); | |
898 | + modelQuery.setStreetId(hdReq.getStreetId()); | |
899 | + modelQuery.setAreaId(hdReq.getAreaId()); | |
900 | + List<BabyModel> babyModels = babyService.queryBabyWithQuery(modelQuery); | |
901 | + List<String> list = new ArrayList<>(); | |
902 | + if (CollectionUtils.isNotEmpty(babyModels)) { | |
903 | + for (BabyModel babyModel : babyModels) { | |
904 | + list.add(babyModel.getId()); | |
905 | + } | |
906 | + } | |
907 | + | |
908 | + List<String> pids = new ArrayList<>(); | |
909 | + if (hdReq.getSource() != null) { | |
910 | + if (hdReq.getSource() == 2) {//2.外院 | |
911 | + //转诊过来的医院id | |
912 | + HighriskChangeHospitalQuery hchQuery = new HighriskChangeHospitalQuery(); | |
913 | + hchQuery.setTargetType(2);//儿童 | |
914 | + hchQuery.setChangeType(1);//听力转诊 | |
915 | + hchQuery.setStatus(2);//已接受 | |
916 | + hchQuery.setHospitalIds(hospitalIds.toArray(hospitalIdArry)); | |
917 | + List<HighriskChangeHospital> hchList = highchangeService.queryHighriskChangeHospital(hchQuery); | |
918 | + if (hchList != null && hchList.size() > 0) { | |
919 | + for (HighriskChangeHospital hch : hchList) {//如果存在则修改转诊记录状态为接收 | |
920 | + pids.add(hch.getPid()); | |
921 | + } | |
922 | + } | |
923 | + BabyPatientExtendEarBabyQuery babyQuery = new BabyPatientExtendEarBabyQuery(); | |
924 | + babyQuery.setHospitalIds(hospitalIds.toArray(hospitalIdArry)); | |
925 | + babyQuery.setEnables(new String[]{"0", "1", "2"}); | |
926 | + List<BabyPatientExtendEarBaby> earBabies = earBabyService.queryBabyPatientExtendEarBaby(babyQuery); | |
927 | + for (BabyPatientExtendEarBaby eb : earBabies) { | |
928 | + pids.add(eb.getPersonId()); | |
929 | + } | |
930 | + } else if (hdReq.getSource() == 1) {//1.本院 | |
931 | + BabyPatientExtendEarBabyQuery babyQuery = new BabyPatientExtendEarBabyQuery(); | |
932 | + babyQuery.setHospitalIds(hospitalIds.toArray(hospitalIdArry)); | |
933 | + babyQuery.setIsEnable("1"); | |
934 | + babyQuery.setBabyPatientIds(list.toArray(new String[list.size()])); | |
935 | + | |
936 | + | |
937 | + List<BabyPatientExtendEarBaby> earBabies = earBabyService.queryBabyPatientExtendEarBaby(babyQuery); | |
938 | + for (BabyPatientExtendEarBaby eb : earBabies) { | |
939 | + pids.add(eb.getPersonId()); | |
940 | + } | |
941 | + } | |
942 | + } | |
943 | + | |
944 | + | |
945 | + BabyPatientExtendEarHearingDiagnoseQuery query = new BabyPatientExtendEarHearingDiagnoseQuery(); | |
946 | + | |
947 | + | |
948 | + BabyPatientExtendEarScreenQuery scrQuery = new BabyPatientExtendEarScreenQuery(); | |
949 | + //如果查询号不为空,根据查询号查询儿童档案表,获取儿童档案Id | |
950 | + if (StringUtils.isNotEmpty(hdReq.getKeyWord())) {//关键字:姓名、联系方式、就诊卡 查询babyId | |
951 | + BabyPatientExtendEarBabyQuery babyQuery = new BabyPatientExtendEarBabyQuery(); | |
952 | + babyQuery.setQueryNo(hdReq.getKeyWord()); | |
953 | + babyQuery.setHospitalIds(hospitalIds.toArray(hospitalIdArry)); | |
954 | + List<BabyPatientExtendEarBaby> models = earBabyService.queryBabyPatientExtendEarBaby(babyQuery); | |
955 | + if (CollectionUtils.isNotEmpty(models)) { | |
956 | + List<String> babyIds = new ArrayList<>(); | |
957 | + for (BabyPatientExtendEarBaby babyModel : models) { | |
958 | + babyIds.add(babyModel.getBabyPatientId()); | |
959 | + } | |
960 | + scrQuery.setBabyIds(babyIds.toArray(new String[babyIds.size()])); | |
961 | + query.setBabyIds(babyIds.toArray(new String[babyIds.size()])); | |
962 | + } else { | |
963 | + return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("没有找到数据"); | |
964 | + } | |
965 | + } | |
966 | + | |
967 | + | |
968 | + //是否需要查询听筛数据 | |
969 | + boolean isHdScr = true; | |
970 | + | |
971 | + if (CollectionUtils.isNotEmpty(pids)) { | |
972 | + query.setPids((String[]) pids.toArray(new String[pids.size()])); | |
973 | + } | |
974 | + if (CollectionUtils.isEmpty(pids) && hdReq.getSource() != null) { | |
975 | + return new FrontEndResult().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("没有找到数据"); | |
976 | + } | |
977 | + | |
978 | + if (hdReq.getDiagnoseStartTime() != null) {//诊断开始时间 | |
979 | + query.setDiagnoseStartTime(hdReq.getDiagnoseStartTime()); | |
980 | + isHdScr = false; | |
981 | + } | |
982 | + | |
983 | + if (hdReq.getDiagnoseEndTime() != null) {//诊断结束时间 | |
984 | + query.setDiagnoseEndTime(hdReq.getDiagnoseEndTime()); | |
985 | + isHdScr = false; | |
986 | + } | |
987 | + | |
988 | + if (hdReq.getDiagnDoctorId() != null) {//诊断医生 | |
989 | + query.setDiagnDoctorId(hdReq.getDiagnDoctorId()); | |
990 | + isHdScr = false; | |
991 | + } | |
992 | + | |
993 | + | |
994 | + if (hdReq.getDiagnNextStartTime() != null) {//预约下次开始诊断时间 | |
995 | + query.setDiagnNextStartTime(hdReq.getDiagnNextStartTime()); | |
996 | + isHdScr = false; | |
997 | + } | |
998 | + | |
999 | + if (hdReq.getDiagnNextEndTime() != null) {//预约下次结束诊断时间 | |
1000 | + query.setDiagnNextEndTime(hdReq.getDiagnNextEndTime()); | |
1001 | + isHdScr = false; | |
1002 | + } | |
1003 | + | |
1004 | + if (hdReq.getIsconfirm() != null) {//是否确诊 0-未确诊 1-确诊 | |
1005 | + query.setIsconfirm(hdReq.getIsconfirm()); | |
1006 | + isHdScr = false; | |
1007 | + } | |
1008 | + if (hdReq.getConfirmDegree() != null) {//查询确诊程度 | |
1009 | + isHdScr = false; | |
1010 | + List<String> cfList = new ArrayList<>(); | |
1011 | + if (hdReq.getConfirmDegree() == 1) {//轻度 | |
1012 | + cfList.add(",1,"); | |
1013 | + cfList.add(",2,"); | |
1014 | + cfList.add(",3,"); | |
1015 | + } else if (hdReq.getConfirmDegree() == 2) {//中度 | |
1016 | + cfList.add(",4,"); | |
1017 | + cfList.add(",5,"); | |
1018 | + cfList.add(",6,"); | |
1019 | + } else if (hdReq.getConfirmDegree() == 3) {//中重度和重度 | |
1020 | + cfList.add(",7,"); | |
1021 | + cfList.add(",8,"); | |
1022 | + cfList.add(",9,"); | |
1023 | + cfList.add(",10,"); | |
1024 | + cfList.add(",11,"); | |
1025 | + cfList.add(",12,"); | |
1026 | + } else if (hdReq.getConfirmDegree() == 4) {//极重度 | |
1027 | + cfList.add(",13,"); | |
1028 | + cfList.add(",14,"); | |
1029 | + cfList.add(",15,"); | |
1030 | + } | |
1031 | + query.setConfirmResults(cfList.toArray(new String[cfList.size()])); | |
1032 | + } | |
1033 | + | |
1034 | + if (hdReq.getConfirmResult() != null) {//确诊程度 | |
1035 | + isHdScr = false; | |
1036 | + List<String> cfList = new ArrayList<>(); | |
1037 | + if (hdReq.getConfirmResult() == 1) {//轻度 | |
1038 | + cfList.add(",1,"); | |
1039 | + cfList.add(",2,"); | |
1040 | + cfList.add(",3,"); | |
1041 | + } else if (hdReq.getConfirmResult() == 2) {//中度 | |
1042 | + cfList.add(",4,"); | |
1043 | + cfList.add(",5,"); | |
1044 | + cfList.add(",6,"); | |
1045 | + } else if (hdReq.getConfirmResult() == 3) {//中重度和重度 | |
1046 | + cfList.add(",7,"); | |
1047 | + cfList.add(",8,"); | |
1048 | + cfList.add(",9,"); | |
1049 | + cfList.add(",10,"); | |
1050 | + cfList.add(",11,"); | |
1051 | + cfList.add(",12,"); | |
1052 | + } else if (hdReq.getConfirmResult() == 4) {//极重度 | |
1053 | + cfList.add(",13,"); | |
1054 | + cfList.add(",14,"); | |
1055 | + cfList.add(",15,"); | |
1056 | + } | |
1057 | + query.setConfirmResults(cfList.toArray(new String[cfList.size()])); | |
1058 | + } | |
1059 | + | |
1060 | + | |
1061 | + if (hdReq.getConfirmStartTime() != null) {//确诊开始时间 | |
1062 | + isHdScr = false; | |
1063 | + query.setConfirmStartTime(hdReq.getConfirmStartTime()); | |
1064 | + } | |
1065 | + | |
1066 | + if (hdReq.getConfirmEndTime() != null) {//确诊结束时间 | |
1067 | + isHdScr = false; | |
1068 | + query.setConfirmEndTime(hdReq.getConfirmEndTime()); | |
1069 | + } | |
1070 | + | |
1071 | + query.setCheckHospitalIds(hospitalIds.toArray(hospitalIdArry)); | |
1072 | + query.setSort("diagnose_time desc"); | |
1073 | + | |
1074 | + //已经诊断的数据 | |
1075 | + List<BabyPatientExtendEarHearingDiagnose> hearingDiagnoseList = hearingDiagnoseService.getHdAndScreen(query); | |
1076 | + | |
1077 | + //待诊断 | |
1078 | + List<HearingDiagnoseListResult> waitConfiList = new ArrayList<>(); | |
1079 | + //已诊断 | |
1080 | + List<HearingDiagnoseListResult> confiList = new ArrayList<>(); | |
1081 | + //全部 | |
1082 | + List<HearingDiagnoseListResult> hdrList = new ArrayList<>(); | |
1083 | + List<String> babyIds = new ArrayList<>(); | |
1084 | + //需要查询听筛数据 | |
1085 | + if (isHdScr) { | |
1086 | + // scrQuery.setCreateHospitalId(hospitalId); | |
1087 | + scrQuery.setCheckHospitalIds(hospitalIds.toArray(hospitalIdArry)); | |
1088 | + //本院听筛数据 复筛未通过-待诊断 | |
1089 | + babyIds = screenService.queryScrBabyIds(scrQuery); | |
1090 | + } | |
1091 | + | |
1092 | + //添加已经诊断的数据 | |
1093 | + for (BabyPatientExtendEarHearingDiagnose hd : hearingDiagnoseList) { | |
1094 | + //删除总数据 | |
1095 | + babyIds.remove(hd.getBabyId()); | |
1096 | + HearingDiagnoseListResult hea = new HearingDiagnoseListResult(); | |
1097 | + BabyModel babyModel = babyService.getOneBabyById(hd.getBabyId()); | |
1098 | + if (babyModel != null) { | |
1099 | + hea.setBabyName(babyModel.getName()); | |
1100 | + hea.setBabyId(hd.getBabyId()); | |
1101 | + hea.setMommyName(com.lyms.platform.common.utils.StringUtils.emptyDeal(babyModel.getMname())); | |
1102 | + hea.setMommnyPhone(com.lyms.platform.common.utils.StringUtils.emptyDeal(babyModel.getMphone())); | |
1103 | + hea.setMommnyEncryptPhone(com.lyms.platform.common.utils.StringUtils.encryPhone(babyModel.getMphone())); | |
1104 | + hea.setMonthAge(DateUtil.getBabyMonthAge(babyModel.getBirth(), hd.getDiagnoseTime())); | |
1105 | + hea.setBirthday(com.lyms.platform.common.utils.StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(babyModel.getBirth()))); | |
1106 | + hea.setSex(com.lyms.platform.common.utils.StringUtils.emptyDeal(SexEnum.getTextById(babyModel.getSex()))); | |
1107 | + } | |
1108 | + hea.setIsconfirm(hd.getIsconfirm() == null ? "未确诊" : hd.getIsconfirm() == 0 ? "未确诊" : "已确诊"); | |
1109 | + hea.setId(hd.getId()); | |
1110 | + hea.setDiagnoseTime(DateUtil.getyyyy_MM_dd(hd.getDiagnoseTime())); | |
1111 | + String docotorId = hd.getDiagnDoctorId(); | |
1112 | + Users users = usersService.getUsers(Integer.parseInt(docotorId == null ? "0" : docotorId)); | |
1113 | + if (users != null) { | |
1114 | + hea.setDoctorName(users.getName() == null ? "-" : users.getName()); | |
1115 | + } | |
1116 | + hea.setHdTime(com.lyms.platform.common.utils.StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(hd.getDiagnoseTime()))); | |
1117 | + //听力高危因数 | |
1118 | + if (hd.getHighFactor() != null) { | |
1119 | + String hf[] = hd.getHighFactor().split(","); | |
1120 | + StringBuffer hrSb = new StringBuffer(); | |
1121 | + for (int b = 0; b < hf.length; b++) { | |
1122 | + if (StringUtils.isNotEmpty(hf[b])) { | |
1123 | + Map<Integer, String> map = new HashMap<>(); | |
1124 | + String title = HighRiskEnum.getTitle(Integer.parseInt(hf[b])); | |
1125 | + map.put(Integer.parseInt(hf[b]), title); | |
1126 | + hrSb.append(title + "、"); | |
1127 | + } | |
1128 | + } | |
1129 | + String hfString = null; | |
1130 | + if (hrSb.toString().endsWith("、")) { | |
1131 | + hfString = hrSb.substring(0, hrSb.length() - 1); | |
1132 | + } else { | |
1133 | + hfString = hrSb.toString(); | |
1134 | + } | |
1135 | + hea.setHighRiskEnums(hfString); | |
1136 | + } | |
1137 | + //确诊结果 | |
1138 | + if (hd.getConfirmResult() != null) { | |
1139 | + String cr[] = hd.getConfirmResult().split(","); | |
1140 | + StringBuffer hdSb = new StringBuffer(); | |
1141 | + for (int b = 0; b < cr.length; b++) { | |
1142 | + if (StringUtils.isNotEmpty(cr[b])) { | |
1143 | + Map<Integer, String> map = new HashMap<>(); | |
1144 | + String title = ConfirmedEnums.getTitle(Integer.parseInt(cr[b])); | |
1145 | + map.put(Integer.parseInt(cr[b]), title); | |
1146 | + hdSb.append(title + "、"); | |
1147 | + } | |
1148 | + } | |
1149 | + String hfString = null; | |
1150 | + if (hdSb.toString().endsWith("、")) { | |
1151 | + hfString = hdSb.substring(0, hdSb.length() - 1); | |
1152 | + } else { | |
1153 | + hfString = hdSb.toString(); | |
1154 | + } | |
1155 | + hea.setConfirmResult(hfString); | |
1156 | + } | |
1157 | + | |
1158 | + //诊断结果 | |
1159 | + if (hd.getDiagnResult() != null) { | |
1160 | + String cr[] = hd.getDiagnResult().split(","); | |
1161 | + StringBuffer hdSb = new StringBuffer(); | |
1162 | + for (int b = 0; b < cr.length; b++) { | |
1163 | + if (StringUtils.isNotEmpty(cr[b])) { | |
1164 | + Map<Integer, String> map = new HashMap<>(); | |
1165 | + String title = HearingDiagnosisEnums.getTitle(Integer.parseInt(cr[b])); | |
1166 | + map.put(Integer.parseInt(cr[b]), title); | |
1167 | + hdSb.append(title + "、"); | |
1168 | + } | |
1169 | + } | |
1170 | + String hfString = null; | |
1171 | + if (hdSb.toString().endsWith("、")) { | |
1172 | + hfString = hdSb.substring(0, hdSb.length() - 1); | |
1173 | + } else { | |
1174 | + hfString = hdSb.toString(); | |
1175 | + } | |
1176 | + hea.setDiagnResult(hfString); | |
1177 | + } | |
1178 | + //已诊断 | |
1179 | + confiList.add(hea); | |
1180 | + //全部 | |
1181 | + hdrList.add(hea); | |
1182 | + } | |
1183 | + | |
1184 | + | |
1185 | + Collections.sort(hearingDiagnoseList); | |
1186 | + for (int i = 0; i < babyIds.size(); i++) { | |
1187 | + HearingDiagnoseListResult hea = new HearingDiagnoseListResult(); | |
1188 | + BabyModel babyModel = babyService.getOneBabyById(babyIds.get(i)); | |
1189 | + if (babyModel != null) { | |
1190 | + hea.setBabyName(babyModel.getName()); | |
1191 | + hea.setBabyId(babyIds.get(i)); | |
1192 | + hea.setMommyName(com.lyms.platform.common.utils.StringUtils.emptyDeal(babyModel.getMname())); | |
1193 | + hea.setMommnyPhone(com.lyms.platform.common.utils.StringUtils.emptyDeal(babyModel.getMphone())); | |
1194 | + hea.setMommnyEncryptPhone(com.lyms.platform.common.utils.StringUtils.encryPhone(babyModel.getMphone())); | |
1195 | + hea.setMonthAge(DateUtil.getBabyMonthAge(babyModel.getBirth(), new Date())); | |
1196 | + hea.setBirthday(com.lyms.platform.common.utils.StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(babyModel.getBirth()))); | |
1197 | + hea.setSex(com.lyms.platform.common.utils.StringUtils.emptyDeal(SexEnum.getTextById(babyModel.getSex()))); | |
1198 | + } | |
1199 | + hea.setDiagnResult("待诊断"); | |
1200 | + //全部 | |
1201 | + hdrList.add(hea); | |
1202 | + //待诊断 | |
1203 | + waitConfiList.add(hea); | |
1204 | + } | |
1205 | + | |
1206 | + BaseListResponse result = new BaseListResponse(); | |
1207 | + PageInfo pageInfo = new PageInfo(); | |
1208 | + List<HearingDiagnoseListResult> resList = new ArrayList<>(); | |
1209 | + if (hdReq.getEnalble() != null) { | |
1210 | + if (hdReq.getEnalble() == 1) { | |
1211 | + for (int i = (hdReq.getPage() - 1) * hdReq.getLimit(); i < hdrList.size() && i < hdReq.getPage() * hdReq.getLimit(); i++) { | |
1212 | + resList.add(confiList.get(i)); | |
1213 | + } | |
1214 | + result.setData(resList); | |
1215 | + pageInfo.setCount(confiList.size()); | |
1216 | + } else if (hdReq.getEnalble() == 2) { | |
1217 | + for (int i = (hdReq.getPage() - 1) * hdReq.getLimit(); i < hdrList.size() && i < hdReq.getPage() * hdReq.getLimit(); i++) { | |
1218 | + resList.add(waitConfiList.get(i)); | |
1219 | + } | |
1220 | + pageInfo.setCount(waitConfiList.size()); | |
1221 | + result.setData(resList); | |
1222 | + } else if (hdReq.getEnalble() == 3) { | |
1223 | + for (int i = (hdReq.getPage() - 1) * hdReq.getLimit(); i < hdrList.size() && i < hdReq.getPage() * hdReq.getLimit(); i++) { | |
1224 | + resList.add(hdrList.get(i)); | |
1225 | + } | |
1226 | + pageInfo.setCount(hdrList.size()); | |
1227 | + result.setData(resList); | |
1228 | + } | |
1229 | + } else if (hdReq.getIsconfirm() != null) { | |
1230 | + for (int i = (hdReq.getPage() - 1) * hdReq.getLimit(); i < hdrList.size() && i < hdReq.getPage() * hdReq.getLimit(); i++) { | |
1231 | + resList.add(confiList.get(i)); | |
1232 | + } | |
1233 | + result.setData(resList); | |
1234 | + pageInfo.setCount(confiList.size()); | |
1235 | + } else if (hdReq.getConfirmDegree() != null) { | |
1236 | + for (int i = (hdReq.getPage() - 1) * hdReq.getLimit(); i < hdrList.size() && i < hdReq.getPage() * hdReq.getLimit(); i++) { | |
1237 | + resList.add(confiList.get(i)); | |
1238 | + } | |
1239 | + result.setData(resList); | |
1240 | + pageInfo.setCount(confiList.size()); | |
1241 | + } else if (StringUtils.isNotEmpty(hdReq.getDiagnDoctorId())) { | |
1242 | + for (int i = (hdReq.getPage() - 1) * hdReq.getLimit(); i < hdrList.size() && i < hdReq.getPage() * hdReq.getLimit(); i++) { | |
1243 | + resList.add(confiList.get(i)); | |
1244 | + } | |
1245 | + result.setData(resList); | |
1246 | + pageInfo.setCount(confiList.size()); | |
1247 | + } else { | |
1248 | + for (int i = (hdReq.getPage() - 1) * hdReq.getLimit(); i < hdrList.size() && i < hdReq.getPage() * hdReq.getLimit(); i++) { | |
1249 | + resList.add(hdrList.get(i)); | |
1250 | + } | |
1251 | + pageInfo.setCount(hdrList.size()); | |
1252 | + result.setData(resList); | |
1253 | + } | |
1254 | + | |
1255 | + pageInfo.setLimit(hdReq.getLimit()); | |
1256 | + pageInfo.setPage(hdReq.getPage()); | |
1257 | + result.setPageInfo(pageInfo); | |
1258 | + result.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功"); | |
865 | 1259 | return result; |
866 | 1260 | } |
867 | 1261 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HighriskChangeHospitalController.java
View file @
84107c1
... | ... | @@ -10,6 +10,7 @@ |
10 | 10 | import com.lyms.platform.common.enums.SexEnum; |
11 | 11 | import com.lyms.platform.common.result.BaseResponse; |
12 | 12 | import com.lyms.platform.common.utils.DateUtil; |
13 | +import com.lyms.platform.operate.web.facade.AreaCountFacade; | |
13 | 14 | import com.lyms.platform.operate.web.facade.AutoMatchFacade; |
14 | 15 | import com.lyms.platform.operate.web.facade.BabyEarFacade; |
15 | 16 | import com.lyms.platform.operate.web.facade.OperateLogFacade; |
... | ... | @@ -20,6 +21,7 @@ |
20 | 21 | import com.lyms.platform.permission.model.*; |
21 | 22 | import com.lyms.platform.permission.service.*; |
22 | 23 | import com.lyms.platform.pojo.BabyModel; |
24 | +import com.lyms.platform.query.BabyModelQuery; | |
23 | 25 | import org.apache.commons.collections.CollectionUtils; |
24 | 26 | import org.apache.commons.lang.StringUtils; |
25 | 27 | import org.springframework.beans.factory.annotation.Autowired; |
... | ... | @@ -66,6 +68,9 @@ |
66 | 68 | @Autowired |
67 | 69 | private OperateLogFacade operateLogFacade; |
68 | 70 | |
71 | + @Autowired | |
72 | + private AreaCountFacade areaCountFacade; | |
73 | + | |
69 | 74 | /** |
70 | 75 | * 导出听力转诊列表 |
71 | 76 | * |
... | ... | @@ -332,7 +337,7 @@ |
332 | 337 | } else { |
333 | 338 | return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入查询类型"); |
334 | 339 | } |
335 | - query.setOffset((query.getPage()-1)*query.getLimit()); | |
340 | + query.setOffset((query.getPage() - 1) * query.getLimit()); | |
336 | 341 | query.setNeed("1"); |
337 | 342 | query.setSort("CREATE_TIME desc"); |
338 | 343 | |
... | ... | @@ -604,6 +609,80 @@ |
604 | 609 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
605 | 610 | } |
606 | 611 | |
612 | + @RequestMapping(method = RequestMethod.GET, value = "/queryHighriskChangeHospitalRegionList") | |
613 | + @ResponseBody | |
614 | + @TokenRequired | |
615 | + public BaseResponse queryHighriskChangeHospitaRegionlList(HighriskChangeHospitalQuery query, Integer type, HttpServletRequest request) { | |
616 | + //获取当前登录用户ID | |
617 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
618 | + if (loginState == null) { | |
619 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("请重新登录"); | |
620 | + } | |
621 | + //医院id | |
622 | + // String hospitalId = autoMatchFacade.getHospitalId(loginState.getId()); | |
623 | + //获取当前用户能看到的那些医院 | |
624 | + List<String> hospitalIds = new ArrayList<>(); | |
625 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(query.getHospitalId())) { | |
626 | + hospitalIds.add(query.getHospitalId()); | |
627 | + } else { | |
628 | + //获取用户拥有的权限医院和条件筛选的医院交集 | |
629 | + hospitalIds = areaCountFacade.getCurrentUserHospPermissions(loginState.getId(), query.getOrgProvinceId(), query.getOrgCityId(), query.getAreaId()); | |
630 | + } | |
631 | + String[] hospitalIdArry = new String[hospitalIds.size()]; | |
632 | + | |
633 | + //查询省市区 | |
634 | + BabyModelQuery modelQuery = new BabyModelQuery(); | |
635 | + modelQuery.setProvinceId(query.getProvinceId()); | |
636 | + modelQuery.setCityId(query.getCityId()); | |
637 | + modelQuery.setAreaId(query.getAreaId()); | |
638 | + modelQuery.setStreetId(query.getStreetId()); | |
639 | + modelQuery.setAreaId(query.getAreaId()); | |
640 | + List<BabyModel> babyModels = babyService.queryBabyWithQuery(modelQuery); | |
641 | + List<String> list = new ArrayList<>(); | |
642 | + if (CollectionUtils.isNotEmpty(babyModels)) { | |
643 | + for (BabyModel babyModel : babyModels) { | |
644 | + list.add(babyModel.getId()); | |
645 | + } | |
646 | + } | |
647 | + | |
648 | + if (type != null && type == 1) {//转出 | |
649 | + query.setOutOrgidArry(hospitalIds.toArray(hospitalIdArry)); | |
650 | + } else if (type != null && type == 0) {//转入儿童 | |
651 | + query.setIntoOrgidArry(hospitalIds.toArray(hospitalIdArry)); | |
652 | + } else { | |
653 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入查询类型"); | |
654 | + } | |
655 | + query.setOffset((query.getPage() - 1) * query.getLimit()); | |
656 | + query.setNeed("1"); | |
657 | + query.setSort("CREATE_TIME desc"); | |
658 | + | |
659 | + //如果查询号不为空,根据查询号查询儿童档案表,获取儿童档案Id | |
660 | + //关键字:姓名、联系方式、就诊卡 查询babyId | |
661 | + BabyPatientExtendEarBabyQuery babyQuery = new BabyPatientExtendEarBabyQuery(); | |
662 | + babyQuery.setQueryNo(query.getQueryNo()); | |
663 | + if (type != null && type == 1) {//转出 | |
664 | + babyQuery.setHospitalIds(hospitalIds.toArray(hospitalIdArry)); | |
665 | + } | |
666 | + babyQuery.setBabyPatientIds(list.toArray(new String[babyModels.size()])); | |
667 | + List<BabyPatientExtendEarBaby> models = earBabyService.queryBabyPatientExtendEarBaby(babyQuery); | |
668 | + //查询建档记录 | |
669 | + if (CollectionUtils.isNotEmpty(models)) { | |
670 | + List<String> babyIds = new ArrayList<>(); | |
671 | + for (BabyPatientExtendEarBaby babyModel : models) { | |
672 | + babyIds.add(babyModel.getBabyPatientId()); | |
673 | + } | |
674 | + query.setBabyIds(babyIds.toArray(new String[babyIds.size()])); | |
675 | + } else { | |
676 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("没有找到数据"); | |
677 | + } | |
678 | + | |
679 | + | |
680 | + //医院id | |
681 | + List<HighriskChangeHospital> hchList = highriskChangeHospitalService.queryHighriskChangeHospital(query); | |
682 | + | |
683 | + List<HighriskChangeHospitalListResult> results = disposeHighriskChange(hchList, type); | |
684 | + return FrontEndResult.ini().setData(results).setPageInfo(query.getPageInfo()).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功"); | |
685 | + } | |
607 | 686 | |
608 | 687 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/HearingDiagnoseRequest.java
View file @
84107c1
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 | * @createTime 2017年05月15日 10时10分 |
8 | 8 | * @discription |
9 | 9 | */ |
10 | -public class HearingDiagnoseRequest extends BasePageQueryRequest{ | |
10 | +public class HearingDiagnoseRequest extends BasePageQueryRequest { | |
11 | 11 | /** |
12 | 12 | * 诊断开始时间 |
13 | 13 | */ |
14 | 14 | |
15 | 15 | |
... | ... | @@ -62,8 +62,99 @@ |
62 | 62 | */ |
63 | 63 | private Date confirmEndTime; |
64 | 64 | |
65 | + //省 | |
66 | + private String provinceId; | |
67 | + //城市id | |
68 | + private String cityId; | |
69 | + //县id | |
70 | + private String areaId; | |
71 | + //镇id | |
72 | + private String streetId; | |
73 | + //详细地址 | |
74 | + private String address; | |
65 | 75 | |
76 | + //省市区查询机构 | |
77 | + private String orgProvinceId; | |
78 | + //城市id | |
79 | + private String orgCityId; | |
80 | + //县id | |
81 | + private String orgAreaId; | |
82 | + //医院id | |
83 | + private String hospitalId; | |
66 | 84 | |
85 | + | |
86 | + public String getProvinceId() { | |
87 | + return provinceId; | |
88 | + } | |
89 | + | |
90 | + public void setProvinceId(String provinceId) { | |
91 | + this.provinceId = provinceId; | |
92 | + } | |
93 | + | |
94 | + public String getCityId() { | |
95 | + return cityId; | |
96 | + } | |
97 | + | |
98 | + public void setCityId(String cityId) { | |
99 | + this.cityId = cityId; | |
100 | + } | |
101 | + | |
102 | + public String getAreaId() { | |
103 | + return areaId; | |
104 | + } | |
105 | + | |
106 | + public void setAreaId(String areaId) { | |
107 | + this.areaId = areaId; | |
108 | + } | |
109 | + | |
110 | + public String getStreetId() { | |
111 | + return streetId; | |
112 | + } | |
113 | + | |
114 | + public void setStreetId(String streetId) { | |
115 | + this.streetId = streetId; | |
116 | + } | |
117 | + | |
118 | + public String getAddress() { | |
119 | + return address; | |
120 | + } | |
121 | + | |
122 | + public void setAddress(String address) { | |
123 | + this.address = address; | |
124 | + } | |
125 | + | |
126 | + public String getOrgProvinceId() { | |
127 | + return orgProvinceId; | |
128 | + } | |
129 | + | |
130 | + public void setOrgProvinceId(String orgProvinceId) { | |
131 | + this.orgProvinceId = orgProvinceId; | |
132 | + } | |
133 | + | |
134 | + public String getOrgCityId() { | |
135 | + return orgCityId; | |
136 | + } | |
137 | + | |
138 | + public void setOrgCityId(String orgCityId) { | |
139 | + this.orgCityId = orgCityId; | |
140 | + } | |
141 | + | |
142 | + public String getOrgAreaId() { | |
143 | + return orgAreaId; | |
144 | + } | |
145 | + | |
146 | + public void setOrgAreaId(String orgAreaId) { | |
147 | + this.orgAreaId = orgAreaId; | |
148 | + } | |
149 | + | |
150 | + public String getHospitalId() { | |
151 | + return hospitalId; | |
152 | + } | |
153 | + | |
154 | + public void setHospitalId(String hospitalId) { | |
155 | + this.hospitalId = hospitalId; | |
156 | + } | |
157 | + | |
67 | 158 | public String getDiagnDoctorId() { |
68 | 159 | return diagnDoctorId; |
69 | 160 | } |
... | ... | @@ -156,6 +247,7 @@ |
156 | 247 | public Date getDiagnNextStartTime() { |
157 | 248 | return diagnNextStartTime; |
158 | 249 | } |
250 | + | |
159 | 251 | public void setDiagnNextStartTime(Date diagnNextStartTime) { |
160 | 252 | this.diagnNextStartTime = diagnNextStartTime; |
161 | 253 | } |