Commit f170c676189d84605b50abfe794187201fedec3e

Authored by yangfei
1 parent a5810429e8

听力诊断模块

Showing 1 changed file with 320 additions and 314 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/EarController.java View file @ f170c67
... ... @@ -70,7 +70,7 @@
70 70 @RequestMapping(method = RequestMethod.GET, value = "/checkBabyFollowUp")
71 71 @ResponseBody
72 72 @TokenRequired
73   - public BaseResponse checkBabyFollowUp(String babyId, HttpServletRequest request){
  73 + public BaseResponse checkBabyFollowUp(String babyId, HttpServletRequest request) {
74 74  
75 75 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
76 76 if (loginState == null) {
... ... @@ -87,7 +87,7 @@
87 87 //当前登录人医院Id
88 88 String hospitalId = autoMatchFacade.getHospitalId(loginState.getId());
89 89 //获取机构内同一儿童babyIds
90   - List<String> babyIds = babyEarFacade.getBabyIdsByItemOrg(babyId,hospitalId);
  90 + List<String> babyIds = babyEarFacade.getBabyIdsByItemOrg(babyId, hospitalId);
91 91 query.setBabyIds((String[]) babyIds.toArray(new String[babyIds.size()]));
92 92 List<BabyPatientExtendEarFollowUp> followUpList = babyPatientExtendEarFollowUpService.queryBabyPatientExtendEarFollowUp(query);
93 93 //是否结案
94 94  
95 95  
96 96  
97 97  
98 98  
99 99  
100 100  
101 101  
102 102  
103 103  
104 104  
105 105  
106 106  
107 107  
108 108  
109 109  
110 110  
111 111  
112 112  
113 113  
114 114  
115 115  
116 116  
117 117  
118 118  
119 119  
120 120  
121 121  
122 122  
123 123  
124 124  
125 125  
126 126  
127 127  
128 128  
129 129  
130 130  
131 131  
132 132  
133 133  
134 134  
135 135  
136 136  
137 137  
138 138  
139 139  
... ... @@ -140,363 +140,369 @@
140 140 break;
141 141 }
142 142 }
143   - if (!isConfirm) {// //若没有听诊记录或所有听诊记录都未确诊。提示:该儿童还未听力确诊,不能进行随访。
144   - return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_POWER).setErrormsg("当前儿童听诊记录还未有确诊记录不能进行随访");
145   - }
146   - //根据条件查询基础配置信息表
147   - return initHearingDiagnose.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功");
  143 + if (!isConfirm) {// //若没有听诊记录或所有听诊记录都未确诊。提示:该儿童还未听力确诊,不能进行随访。
  144 + return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_POWER).setErrormsg("当前儿童听诊记录还未有确诊记录不能进行随访");
148 145 }
  146 + //根据条件查询基础配置信息表
  147 + return initHearingDiagnose.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功");
  148 + }
149 149  
150   - /**
151   - * 进入新增听筛初始化数据
152   - *
153   - * @return
154   - */
155   - @RequestMapping(method = RequestMethod.GET, value = "/initScreen")
156   - @ResponseBody
157   - @TokenRequired
158   - public BaseResponse initScreen () {
159   - //根据条件查询基础配置信息表
160   - InitScreen initScreen = new InitScreen();
161   - initScreen.setHighRiskConfirms(EnumUtil.toJson(HighRiskEnum.class));
162   - initScreen.setDeafEnumsResult(DeafEnums.getDeafEnums());
163   - return initScreen.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功");
  150 + /**
  151 + * 进入新增听筛初始化数据
  152 + *
  153 + * @return
  154 + */
  155 + @RequestMapping(method = RequestMethod.GET, value = "/initScreen")
  156 + @ResponseBody
  157 + @TokenRequired
  158 + public BaseResponse initScreen() {
  159 + //根据条件查询基础配置信息表
  160 + InitScreen initScreen = new InitScreen();
  161 + initScreen.setHighRiskConfirms(EnumUtil.toJson(HighRiskEnum.class));
  162 + initScreen.setDeafEnumsResult(DeafEnums.getDeafEnums());
  163 + return initScreen.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功");
  164 + }
  165 +
  166 + /**
  167 + * 检测儿童是否能够听筛
  168 + *
  169 + * @param babyId 儿童档案id
  170 + * @return
  171 + */
  172 + @RequestMapping(method = RequestMethod.GET, value = "/checkBabySrccen")
  173 + @ResponseBody
  174 + @TokenRequired
  175 + public BaseResponse checkBabySrccen(String babyId, HttpServletRequest request) {
  176 +
  177 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  178 + if (loginState == null) {
  179 + return new BaseResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("请重新登录");
164 180 }
165 181  
166   - /**
167   - * 检测儿童是否能够听筛
168   - *
169   - * @param babyId 儿童档案id
170   - * @return
171   - */
172   - @RequestMapping(method = RequestMethod.GET, value = "/checkBabySrccen")
173   - @ResponseBody
174   - @TokenRequired
175   - public BaseResponse checkBabySrccen (String babyId, HttpServletRequest request){
176 182  
177   - LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
178   - if (loginState == null) {
179   - return new BaseResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("请重新登录");
180   - }
  183 + if (StringUtils.isEmpty(babyId)) {//传入儿童档案id
  184 + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入儿童档案id");
  185 + }
  186 + //当前登录人医院Id
  187 + String hospitalId = autoMatchFacade.getHospitalId(loginState.getId());
181 188  
  189 + //查询儿童听力基础信息
  190 + //根据babyId查询是否存
  191 + BabyPatientExtendEarQuery earQuery = new BabyPatientExtendEarQuery();
182 192  
183   - if (StringUtils.isEmpty(babyId)) {//传入儿童档案id
184   - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入儿童档案id");
185   - }
186   - //当前登录人医院Id
187   - String hospitalId = autoMatchFacade.getHospitalId(loginState.getId());
  193 + List<String> babyIds = babyEarFacade.getBabyIdsByItemOrg(babyId, hospitalId);
  194 + earQuery.setBabyPatientIds((String[]) babyIds.toArray(new String[babyIds.size()]));
188 195  
189   - //查询儿童听力基础信息
190   - //根据babyId查询是否存
191   - BabyPatientExtendEarQuery earQuery = new BabyPatientExtendEarQuery();
  196 + //获取院内医院集合
  197 + List hospiIds = babyEarFacade.getOrgHospitalIds(hospitalId);
  198 + earQuery.setCreateHospitalIds((String[]) hospiIds.toArray(new String[hospiIds.size()]));
192 199  
193   - List<String> babyIds = babyEarFacade.getBabyIdsByItemOrg(babyId,hospitalId);
194   - earQuery.setBabyPatientIds((String[]) babyIds.toArray(new String[babyIds.size()]));
  200 + List<BabyPatientExtendEar> babyPatientExtendEars = babyPatientExtendEarService.queryBabyPatientExtendEar(earQuery);
  201 + //是否听力建档
  202 + if (CollectionUtils.isEmpty(babyPatientExtendEars)) {
  203 + return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_POWER).setErrormsg("当前儿童还未完善听力建档");
  204 + }
195 205  
196   - //获取院内医院集合
197   - List hospiIds = babyEarFacade.getOrgHospitalIds(hospitalId);
198   - earQuery.setCreateHospitalIds((String[]) hospiIds.toArray(new String[hospiIds.size()]));
  206 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功");
  207 + }
199 208  
200   - List<BabyPatientExtendEar> babyPatientExtendEars = babyPatientExtendEarService.queryBabyPatientExtendEar(earQuery);
201   - //是否听力建档
202   - if (CollectionUtils.isEmpty(babyPatientExtendEars)) {
203   - return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_POWER).setErrormsg("当前儿童还未完善听力建档");
204   - }
  209 + /**
  210 + * 进入新增随访记录页面前,验证及初始化数据
  211 + *
  212 + * @return
  213 + */
  214 + @RequestMapping(method = RequestMethod.GET, value = "/initFollowUp")
  215 + @ResponseBody
  216 + @TokenRequired
  217 + public BaseResponse initFollowUp() {
  218 + //根据条件查询基础配置信息表
  219 + InitFollowUp initHearingDiagnose = new InitFollowUp();
  220 + initHearingDiagnose.setConfirmResult(EnumUtil.toJson(ConfirmedEnums.class));
  221 + return initHearingDiagnose.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功");
  222 + }
205 223  
206   - return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功");
207   - }
  224 + /**
  225 + * 听力诊断列表管理初始化数据
  226 + *
  227 + * @return
  228 + */
  229 + @RequestMapping(method = RequestMethod.GET, value = "/initHearingDiagnoseListData")
  230 + @ResponseBody
  231 + @TokenRequired
  232 + public BaseResponse initHearingDiagnoseListData() {
  233 + InitHearingDiagnoseListData baseResponse = new InitHearingDiagnoseListData();
  234 + //状态
  235 + baseResponse.setStatus(EnumUtil.toJson(HdEnums.StatusEnums.class));
  236 + baseResponse.setSource(EnumUtil.toJson(HdEnums.SourceEnums.class));
  237 + baseResponse.setIsConfirm(EnumUtil.toJson(HdEnums.IsConfirmEnums.class));
  238 + baseResponse.setConfirmResult(EnumUtil.toJson(HdEnums.ConfirmResultEnums.class));
  239 + baseResponse.setConfirmLevel(EnumUtil.toJson(HdEnums.ConfirmLevelEnums.class));
  240 + return baseResponse;
  241 + }
208 242  
209   - /**
210   - * 进入新增随访记录页面前,验证及初始化数据
211   - *
212   - * @return
213   - */
214   - @RequestMapping(method = RequestMethod.GET, value = "/initFollowUp")
215   - @ResponseBody
216   - @TokenRequired
217   - public BaseResponse initFollowUp () {
218   - //根据条件查询基础配置信息表
219   - InitFollowUp initHearingDiagnose = new InitFollowUp();
220   - initHearingDiagnose.setConfirmResult(EnumUtil.toJson(ConfirmedEnums.class));
221   - return initHearingDiagnose.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功");
222   - }
  243 + /**
  244 + * 进入新增听力诊断页面前,验证及初始化数据
  245 + *
  246 + * @return
  247 + */
  248 + @RequestMapping(method = RequestMethod.GET, value = "/initHearingDiagnose")
  249 + @ResponseBody
  250 + public BaseResponse initHearingDiagnose(String babyId) {
  251 + //根据条件查询基础配置信息表
  252 + InitHearingDiagnose initHearingDiagnose = new InitHearingDiagnose();
  253 + initHearingDiagnose.setConfirmResult(EnumUtil.toJson(ConfirmedEnums.class));
  254 + initHearingDiagnose.setHearingDiagnosis(EnumUtil.toJson(HearingDiagnosisEnums.class));
  255 + initHearingDiagnose.setHighRiskConfirms(EnumUtil.toJson(HighRiskEnum.class));
  256 + initHearingDiagnose.setHandlingSuggestion(HdEnums.getHandlingSuggestionEnums());
223 257  
224   - /**
225   - * 听力诊断列表管理初始化数据
226   - *
227   - * @return
228   - */
229   - @RequestMapping(method = RequestMethod.GET, value = "/initHearingDiagnoseListData")
230   - @ResponseBody
231   - @TokenRequired
232   - public BaseResponse initHearingDiagnoseListData () {
233   - InitHearingDiagnoseListData baseResponse = new InitHearingDiagnoseListData();
234   - //状态
235   - baseResponse.setStatus(EnumUtil.toJson(HdEnums.StatusEnums.class));
236   - baseResponse.setSource(EnumUtil.toJson(HdEnums.SourceEnums.class));
237   - baseResponse.setIsConfirm(EnumUtil.toJson(HdEnums.IsConfirmEnums.class));
238   - baseResponse.setConfirmResult(EnumUtil.toJson(HdEnums.ConfirmResultEnums.class));
239   - baseResponse.setConfirmLevel(EnumUtil.toJson(HdEnums.ConfirmLevelEnums.class));
240   - return baseResponse;
  258 + //查询最后一次听诊时间
  259 + //查询听诊记录
  260 + BabyPatientExtendEarHearingDiagnoseQuery hdQuery = new BabyPatientExtendEarHearingDiagnoseQuery();
  261 + hdQuery.setBabyId(babyId);
  262 + hdQuery.setSort("diagnose_time");
  263 + List<BabyPatientExtendEarHearingDiagnose> hdList = hearingDiagnoseService.queryBabyPatientExtendEarHearingDiagnose(hdQuery);
  264 + if (CollectionUtils.isNotEmpty(hdList)) {
  265 + BabyPatientExtendEarHearingDiagnose ehd = hdList.get(hdList.size() - 1);
  266 + initHearingDiagnose.setDiagnoseTime(DateUtil.getyyyy_MM_dd(ehd.getDiagnoseTime()));
241 267 }
  268 + return initHearingDiagnose.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功");
  269 + }
242 270  
243   - /**
244   - * 进入新增听力诊断页面前,验证及初始化数据
245   - *
246   - * @return
247   - */
248   - @RequestMapping(method = RequestMethod.GET, value = "/initHearingDiagnose")
249   - @ResponseBody
250   - public BaseResponse initHearingDiagnose (String babyId){
251   - //根据条件查询基础配置信息表
252   - InitHearingDiagnose initHearingDiagnose = new InitHearingDiagnose();
253   - initHearingDiagnose.setConfirmResult(EnumUtil.toJson(ConfirmedEnums.class));
254   - initHearingDiagnose.setHearingDiagnosis(EnumUtil.toJson(HearingDiagnosisEnums.class));
255   - initHearingDiagnose.setHighRiskConfirms(EnumUtil.toJson(HighRiskEnum.class));
256   - initHearingDiagnose.setHandlingSuggestion(HdEnums.getHandlingSuggestionEnums());
  271 + /**
  272 + * 进入新增听力诊断页面前,验证及初始化数据
  273 + *
  274 + * @return
  275 + */
  276 + @RequestMapping(method = RequestMethod.GET, value = "/checkHearingDiagnose")
  277 + @ResponseBody
  278 + @TokenRequired
  279 + public BaseResponse checkHearingDiagnose(String babyId, HttpServletRequest request) {
257 280  
258   - //查询最后一次听诊时间
259   - //查询听诊记录
260   - BabyPatientExtendEarHearingDiagnoseQuery hdQuery = new BabyPatientExtendEarHearingDiagnoseQuery();
261   - hdQuery.setBabyId(babyId);
262   - hdQuery.setSort("diagnose_time");
263   - List<BabyPatientExtendEarHearingDiagnose> hdList = hearingDiagnoseService.queryBabyPatientExtendEarHearingDiagnose(hdQuery);
264   - if (CollectionUtils.isNotEmpty(hdList)) {
265   - BabyPatientExtendEarHearingDiagnose ehd = hdList.get(hdList.size() - 1);
266   - initHearingDiagnose.setDiagnoseTime(DateUtil.getyyyy_MM_dd(ehd.getDiagnoseTime()));
267   - }
268   - return initHearingDiagnose.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功");
  281 + //获取当前登录用户ID
  282 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  283 + if (loginState == null) {
  284 + return new BaseResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("请重新登录");
269 285 }
  286 + //当前登录人医院Id
  287 + String hospitalId = autoMatchFacade.getHospitalId(loginState.getId());
270 288  
271   - /**
272   - * 进入新增听力诊断页面前,验证及初始化数据
273   - *
274   - * @return
275   - */
276   - @RequestMapping(method = RequestMethod.GET, value = "/checkHearingDiagnose")
277   - @ResponseBody
278   - @TokenRequired
279   - public BaseResponse checkHearingDiagnose (String babyId, HttpServletRequest request){
  289 + if (StringUtils.isEmpty(babyId)) {//传入儿童档案id
  290 + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入儿童档案id");
  291 + }
280 292  
281   - //获取当前登录用户ID
282   - LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
283   - if (loginState == null) {
284   - return new BaseResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("请重新登录");
285   - }
286   - //当前登录人医院Id
287   - String hospitalId = autoMatchFacade.getHospitalId(loginState.getId());
  293 + BabyPatientExtendEarScreenQuery query = new BabyPatientExtendEarScreenQuery();
  294 + List<String> babyIds = babyEarFacade.getBabyIdsByItemOrg(babyId, hospitalId);
288 295  
289   - if (StringUtils.isEmpty(babyId)) {//传入儿童档案id
290   - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入儿童档案id");
  296 + query.setBabyIds((String[]) babyIds.toArray(new String[babyIds.size()]));
  297 + // d、本院:初筛未通过或复筛确诊
  298 + List<BabyPatientExtendEarScreen> screenList = screenService.queryBabyPatientExtendEarScreen(query);
  299 + if (screenList == null || screenList.size() == 0) {//没有听筛记录,查询转诊记录
  300 + //查询听力转诊申请 // e、外院:有申请记录则允许进行新增听力筛查
  301 + HighriskChangeHospitalQuery hcQuery = new HighriskChangeHospitalQuery();
  302 + hcQuery.setIntoOrgid(hospitalId);
  303 + hcQuery.setTargetId(babyId);
  304 + List<HighriskChangeHospital> hchList = highchangeService.queryHighriskChangeHospital(hcQuery);
  305 + if (hchList == null || hchList.size() == 0) {//没有找到听力转诊申请
  306 + return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_POWER).setErrormsg("当前儿童还未完成听力筛查,不能进行听诊");
291 307 }
292   -
293   - BabyPatientExtendEarScreenQuery query = new BabyPatientExtendEarScreenQuery();
294   - List<String> babyIds = babyEarFacade.getBabyIdsByItemOrg(babyId,hospitalId);
295   -
296   - query.setBabyIds((String[]) babyIds.toArray(new String[babyIds.size()]));
297   - // d、本院:初筛未通过或复筛确诊
298   - List<BabyPatientExtendEarScreen> screenList = screenService.queryBabyPatientExtendEarScreen(query);
299   - if (screenList == null || screenList.size() == 0) {//没有听筛记录,查询转诊记录
300   - //查询听力转诊申请 // e、外院:有申请记录则允许进行新增听力筛查
301   - HighriskChangeHospitalQuery hcQuery = new HighriskChangeHospitalQuery();
302   - hcQuery.setIntoOrgid(hospitalId);
303   - hcQuery.setTargetId(babyId);
304   - List<HighriskChangeHospital> hchList = highchangeService.queryHighriskChangeHospital(hcQuery);
305   - if (hchList == null || hchList.size() == 0) {//没有找到听力转诊申请
306   - return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_POWER).setErrormsg("当前儿童还未完成听力筛查,不能进行听诊");
  308 + } else {
  309 + boolean isResu = false;
  310 + for (BabyPatientExtendEarScreen scr : screenList) {
  311 + if (scr.getScrIspass() == 2 && scr.getScreenType() == 2) {//是复筛并且未通过
  312 + isResu = true;
  313 + break;
307 314 }
308   - } else {
309   - boolean isResu = false;
310   - for (BabyPatientExtendEarScreen scr : screenList) {
311   - if(scr.getScrIspass()==2&&scr.getScreenType()==2){//是复筛并且未通过
312   - isResu = true;
313   - break;
314   - }
315   - }
316   - if (!isResu) {
317   - return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_POWER).setErrormsg("当前儿童听筛已通过,不能进行听力诊断");
318   - }
319 315 }
  316 + if (!isResu) {
  317 + return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_POWER).setErrormsg("当前儿童听筛已通过,不能进行听力诊断");
  318 + }
  319 + }
320 320  
321   - //根据条件查询基础配置信息表
322   - InitHearingDiagnose initHearingDiagnose = new InitHearingDiagnose();
323   - // initHearingDiagnose.setConfirmResult(EnumUtil.toJson(ConfirmedEnums.class));
324   - //
325   - // initHearingDiagnose.setHearingDiagnosis(EnumUtil.toJson(HearingDiagnosisEnums.class));
326   - //
327   - // initHearingDiagnose.setHighRiskConfirms(EnumUtil.toJson(HighRiskEnum.class));
  321 + //根据条件查询基础配置信息表
  322 + InitHearingDiagnose initHearingDiagnose = new InitHearingDiagnose();
  323 + // initHearingDiagnose.setConfirmResult(EnumUtil.toJson(ConfirmedEnums.class));
  324 + //
  325 + // initHearingDiagnose.setHearingDiagnosis(EnumUtil.toJson(HearingDiagnosisEnums.class));
  326 + //
  327 + // initHearingDiagnose.setHighRiskConfirms(EnumUtil.toJson(HighRiskEnum.class));
328 328  
329   - return initHearingDiagnose.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功");
330   - }
  329 + return initHearingDiagnose.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功");
  330 + }
331 331  
332   - /**
333   - * 随访模块列表管理初始化数据
334   - *
335   - * @return
336   - */
337   - @RequestMapping(method = RequestMethod.GET, value = "/initHighrFollowUpData")
338   - @ResponseBody
339   - @TokenRequired
340   - public BaseResponse initHighrFollowUpData () {
341   - InitFollowUpListData initFollowUpListData = new InitFollowUpListData();
342   - //确诊结果
343   - initFollowUpListData.setConfirmResult(EnumUtil.toJson(ConfirmedEnums.class));
344   - //是否结案
345   - initFollowUpListData.setIsClose(EnumUtil.toJson(IsCloseEnums.class));
346   - //来源
347   - initFollowUpListData.setSource(EnumUtil.toJson(SourceEnums.class));
348   - //干预治疗
349   - initFollowUpListData.setTreatment(EnumUtil.toJson(TreatmentEnums.class));
350   - return initFollowUpListData.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功");
  332 + /**
  333 + * 随访模块列表管理初始化数据
  334 + *
  335 + * @return
  336 + */
  337 + @RequestMapping(method = RequestMethod.GET, value = "/initHighrFollowUpData")
  338 + @ResponseBody
  339 + @TokenRequired
  340 + public BaseResponse initHighrFollowUpData() {
  341 + InitFollowUpListData initFollowUpListData = new InitFollowUpListData();
  342 + //确诊结果
  343 + initFollowUpListData.setConfirmResult(EnumUtil.toJson(ConfirmedEnums.class));
  344 + //是否结案
  345 + initFollowUpListData.setIsClose(EnumUtil.toJson(IsCloseEnums.class));
  346 + //来源
  347 + initFollowUpListData.setSource(EnumUtil.toJson(SourceEnums.class));
  348 + //干预治疗
  349 + initFollowUpListData.setTreatment(EnumUtil.toJson(TreatmentEnums.class));
  350 + return initFollowUpListData.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功");
  351 + }
  352 +
  353 + /**
  354 + * 进入新增听力转诊页面前,验证及初始化数据
  355 + *
  356 + * @param babyId 儿童档案ID
  357 + * @return
  358 + */
  359 + @RequestMapping(method = RequestMethod.GET, value = "/initHighrChangeHosp")
  360 + @ResponseBody
  361 + @TokenRequired
  362 + public BaseResponse initHighrChangeHosp(String babyId, HttpServletRequest request) {
  363 + //根据babyId和当前医院id
  364 + //获取当前登录用户ID
  365 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  366 + if (loginState == null) {
  367 + return new BaseResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("请重新登录");
351 368 }
  369 + //医院id
  370 + String hospitalId = autoMatchFacade.getHospitalId(loginState.getId());
352 371  
353   - /**
354   - * 进入新增听力转诊页面前,验证及初始化数据
355   - *
356   - * @param babyId 儿童档案ID
357   - * @return
358   - */
359   - @RequestMapping(method = RequestMethod.GET, value = "/initHighrChangeHosp")
360   - @ResponseBody
361   - @TokenRequired
362   - public BaseResponse initHighrChangeHosp (String babyId, HttpServletRequest request){
363   - //根据babyId和当前医院id
364   - //获取当前登录用户ID
365   - LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
366   - if (loginState == null) {
367   - return new BaseResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("请重新登录");
  372 + //根据医院id和儿童档案id获取听力筛查记录,获取一次初筛记录和最后一次复筛记录,将初筛和复筛的检测结果显示到转诊申请页。
  373 + BabyPatientExtendEarScreenQuery query = new BabyPatientExtendEarScreenQuery();
  374 + query.setCheckHospitalId(hospitalId);
  375 + query.setBabyId(babyId);
  376 + query.setStatus(0);
  377 + query.setSort("create_date");
  378 + // d、本院:初筛未通过或复筛确诊
  379 + List<BabyPatientExtendEarScreen> screenList = screenService.queryBabyPatientExtendEarScreen(query);
  380 + if (screenList == null && screenList.size() == 0) {
  381 + return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_POWER).setErrormsg("该儿童还未听筛记录不能进行听力转诊");
  382 + }
  383 + //根据医院ID和babyid查询听筛初筛第一条记录和复筛最后一条记录进行并集。前端显示
  384 + Map<String, String> map = new HashMap<>();
  385 + //取第一条初筛记录结果
  386 + BabyPatientExtendEarScreen firstScreen = null;
  387 + //取复筛记录最后一条结果
  388 + BabyPatientExtendEarScreen endScreen = null;
  389 + for (BabyPatientExtendEarScreen es : screenList) {
  390 + if (firstScreen == null) {
  391 + if (es.getScreenType() == 1) {
  392 + firstScreen = es;
  393 + }
368 394 }
369   - //医院id
370   - String hospitalId = autoMatchFacade.getHospitalId(loginState.getId());
371   -
372   - //根据医院id和儿童档案id获取听力筛查记录,获取一次初筛记录和最后一次复筛记录,将初筛和复筛的检测结果显示到转诊申请页。
373   - BabyPatientExtendEarScreenQuery query = new BabyPatientExtendEarScreenQuery();
374   - query.setCheckHospitalId(hospitalId);
375   - query.setBabyId(babyId);
376   - query.setStatus(0);
377   - query.setSort("create_date");
378   - // d、本院:初筛未通过或复筛确诊
379   - List<BabyPatientExtendEarScreen> screenList = screenService.queryBabyPatientExtendEarScreen(query);
380   - if (screenList == null && screenList.size() == 0) {
381   - return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_POWER).setErrormsg("该儿童还未听筛记录不能进行听力转诊");
  395 + if (es.getScreenType() == 2) {
  396 + endScreen = es;
382 397 }
383   - //根据医院ID和babyid查询听筛初筛第一条记录和复筛最后一条记录进行并集。前端显示
384   - Map<String, String> map = new HashMap<>();
385   - //取第一条初筛记录结果
386   - BabyPatientExtendEarScreen firstScreen = screenList.get(0);
  398 + }
387 399  
388   - if (firstScreen.getOaeLeft() == null) {
389   - firstScreen.setOaeLeft(1);
  400 +
  401 + //初筛
  402 + if (firstScreen != null) {
  403 + //未通过
  404 + if (firstScreen.getScrIspass() == 2) {
  405 + map.put("firstResu", "未通过");
  406 + } else {
  407 + map.put("firstResu", "通过");
390 408 }
391   - if (firstScreen.getOaeRight() == null) {
392   - firstScreen.setOaeRight(1);
  409 + StringBuffer firstMethod = new StringBuffer("");
  410 + if (firstScreen.getOaeLeft() != null || firstScreen.getOaeRight() != null) {
  411 + firstMethod.append("OAE/");
393 412 }
394   - if (firstScreen.getAabrLeft() == null) {
395   - firstScreen.setAabrLeft(1);
  413 + if (firstScreen.getAabrLeft() != null || firstScreen.getAabrRight() != null) {
  414 + firstMethod.append("AABR/");
396 415 }
397   - if (firstScreen.getAabrRight() == null) {
398   - firstScreen.setAabrRight(1);
  416 +
  417 + if (firstScreen.getGjb2Del35() != null || firstScreen.getGjb2Del176() != null || firstScreen.getGjb2Del235() != null || firstScreen.getGjb2Del299() != null) {
  418 + firstMethod.append("GJB2/");
399 419 }
400   - //初筛未通过
401   - StringBuffer firstResu = new StringBuffer();
402   - if (firstScreen.getOaeLeft() == -1 || firstScreen.getOaeRight() == -1 || firstScreen.getAabrLeft() == -1 || firstScreen.getAabrRight() == -1) {//oae未通过
403   - firstResu.append("未通过(");
  420 + if (firstScreen.getGjb3Slc26a4538() != null) {
  421 + firstMethod.append("GJB3/");
404 422 }
405   - if ((firstScreen.getOaeLeft() == -1 || firstScreen.getAabrLeft() == -1) && (firstScreen.getOaeRight() == -1 || firstScreen.getAabrRight() == -1)) {//oae未通过
406   - firstResu.append("双耳");
407   - } else if (firstScreen.getOaeLeft() == -1 || firstScreen.getAabrLeft() == -1) {//oae未通过
408   - firstResu.append("左耳");
409   - } else if (firstScreen.getOaeRight() == -1 || firstScreen.getAabrRight() == -1) {//aabr未通过
410   - firstResu.append("右耳");
  423 + if (firstScreen.getGjb3Slc26a42168() != null || firstScreen.getGjb3Slc26a4Ivs7() != null) {
  424 + firstMethod.append("SLC26A4/");
411 425 }
412   - if (StringUtils.isNotEmpty(firstResu.toString())) {
413   - firstResu.append(")");
  426 + if (firstScreen.getRrna1494() != null || firstScreen.getRrna1555() != null) {
  427 + firstMethod.append("线粒体125rRNA/");
414 428 }
415   -
416   - map.put("firstResu", firstResu.toString());
417   - if ((firstScreen.getOaeLeft() == -1 || firstScreen.getOaeRight() == -1) && (firstScreen.getAabrLeft() == -1 || firstScreen.getAabrRight() == -1)) {
418   - map.put("firstMethod", "OAE/AABR");
419   - } else if (firstScreen.getOaeLeft() == -1 || firstScreen.getOaeRight() == -1) {
420   - map.put("firstMethod", "OAE");
421   - } else if (firstScreen.getAabrLeft() == -1 || firstScreen.getAabrRight() == -1) {
422   - map.put("firstMethod", "AABR");
  429 + String hfString = null;
  430 + if (firstMethod.toString().endsWith("/")) {
  431 + hfString = firstMethod.substring(0, firstMethod.length() - 1);
  432 + } else {
  433 + hfString = firstMethod.toString();
423 434 }
424 435 //初筛时间
425 436 map.put("firstTime", DateUtil.getyyyy_MM_dd(firstScreen.getScreenDate()));
  437 + map.put("firstMethod", hfString);
  438 + }
426 439  
427   - if (screenList.size() > 1) {
428   - //取复筛记录最后一条结果
429   - BabyPatientExtendEarScreen endScreen = screenList.get(screenList.size() - 1);
430   - //初筛未通过
431   - StringBuffer endResu = new StringBuffer();
432   - if ((endScreen.getOaeLeft() != null && endScreen.getOaeLeft() == -1) || (endScreen.getOaeRight() != null && endScreen.getOaeRight() == -1) || (endScreen.getAabrLeft() != null && endScreen.getAabrLeft() == -1) || (endScreen.getAabrRight() != null && endScreen.getAabrRight() == -1)) {//oae未通过
433   - endResu.append("未通过(");
434   - }
435   - if (((endScreen.getOaeLeft() != null && endScreen.getOaeLeft() == -1) || (endScreen.getAabrLeft() != null && endScreen.getAabrLeft() == -1)) && ((endScreen.getOaeRight() != null && endScreen.getOaeRight() == -1) || (endScreen.getAabrRight() != null && endScreen.getAabrRight() == -1))) {//oae未通过
436   - endResu.append("双耳");
  440 + //复筛
  441 + if (endScreen != null) {
  442 + //未通过
  443 + if (endScreen.getScrIspass() == 2) {
  444 + map.put("endResu", "未通过");
  445 + } else {
  446 + map.put("endResu", "通过");
  447 + }
  448 + StringBuffer endMethod = new StringBuffer("");
  449 + if (endScreen.getOaeLeft() != null || endScreen.getOaeRight() != null) {
  450 + endMethod.append("OAE/");
  451 + }
  452 + if (endScreen.getAabrLeft() != null || endScreen.getAabrRight() != null) {
  453 + endMethod.append("AABR/");
  454 + }
437 455  
438   - } else if ((endScreen.getOaeLeft() != null && endScreen.getOaeLeft() == -1) || (endScreen.getAabrLeft() != null && endScreen.getAabrLeft() == -1)) {//oae未通过
439   - endResu.append("左耳");
440   - } else if ((endScreen.getOaeRight() != null && endScreen.getOaeRight() == -1) || (endScreen.getAabrRight() != null && endScreen.getAabrRight() == -1)) {//aabr未通过
441   - endResu.append("右耳");
442   - }
443   - if (StringUtils.isNotEmpty(endResu.toString())) {
444   - endResu.append(")");
445   - }
446   -
447   - map.put("endResu", endResu.toString());
448   -
449   - if (endScreen.getOaeLeft() == null) {
450   - endScreen.setOaeLeft(1);
451   - }
452   - if (endScreen.getOaeRight() == null) {
453   - endScreen.setOaeRight(1);
454   - }
455   - if (endScreen.getAabrLeft() == null) {
456   - endScreen.setAabrLeft(1);
457   - }
458   - if (endScreen.getAabrRight() == null) {
459   - endScreen.setAabrRight(1);
460   - }
461   -
462   - if ((endScreen.getOaeLeft() == -1 || endScreen.getOaeRight() == -1) && (endScreen.getAabrLeft() == -1 || endScreen.getAabrRight() == -1)) {
463   - map.put("endMethod", "OAE/AABR");
464   - } else if (endScreen.getOaeLeft() == -1 || endScreen.getOaeRight() == -1) {
465   - map.put("endMethod", "OAE");
466   - } else if (endScreen.getAabrLeft() == -1 || endScreen.getAabrRight() == -1) {
467   - map.put("endMethod", "AABR");
468   - }
469   - //初筛时间
470   - map.put("endTime", DateUtil.getyyyy_MM_dd(endScreen.getScreenDate()));
  456 + if (endScreen.getGjb2Del35() != null || endScreen.getGjb2Del176() != null || endScreen.getGjb2Del235() != null || endScreen.getGjb2Del299() != null) {
  457 + endMethod.append("GJB2/");
471 458 }
472   - BaseResponse baseResp = new BaseResponse();
473   - baseResp.setObject(map);
474   - return baseResp.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功");
  459 + if (endScreen.getGjb3Slc26a4538() != null) {
  460 + endMethod.append("GJB3/");
  461 + }
  462 + if (endScreen.getGjb3Slc26a42168() != null || endScreen.getGjb3Slc26a4Ivs7() != null) {
  463 + endMethod.append("SLC26A4/");
  464 + }
  465 + if (endScreen.getRrna1494() != null || endScreen.getRrna1555() != null) {
  466 + endMethod.append("线粒体125rRNA/");
  467 + }
  468 + String hfString = null;
  469 + if (endMethod.toString().endsWith("/")) {
  470 + hfString = endMethod.substring(0, endMethod.length() - 1);
  471 + } else {
  472 + hfString = endMethod.toString();
  473 + }
  474 + //初筛时间
  475 + map.put("endTime", DateUtil.getyyyy_MM_dd(endScreen.getScreenDate()));
  476 + map.put("endMethod", hfString);
475 477 }
  478 + BaseResponse baseResp = new BaseResponse();
  479 + baseResp.setObject(map);
  480 + return baseResp.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功");
  481 + }
476 482  
477   - /**
478   - * 添加儿童建档
479   - *
480   - * @return
481   - */
482   - @RequestMapping(method = RequestMethod.POST)
483   - @ResponseBody
484   - @TokenRequired
485   - public BaseObjectResponse add (BabyPatientExtendEar ear, BabyPatientExtendEarBirth earBirth,
486   - BabyPatientExtendEarMother earMother, BabyPatientExtendEarFamily earFamily, HttpServletRequest request){
487   - return babyPatientExtendEarService.insert(ear, earBirth, earMother, earFamily, getUserId(request));
488   - }
  483 + /**
  484 + * 添加儿童建档
  485 + *
  486 + * @return
  487 + */
  488 + @RequestMapping(method = RequestMethod.POST)
  489 + @ResponseBody
  490 + @TokenRequired
  491 + public BaseObjectResponse add(BabyPatientExtendEar ear, BabyPatientExtendEarBirth earBirth,
  492 + BabyPatientExtendEarMother earMother, BabyPatientExtendEarFamily earFamily, HttpServletRequest request) {
  493 + return babyPatientExtendEarService.insert(ear, earBirth, earMother, earFamily, getUserId(request));
  494 + }
489 495  
490   - /**
491   - * 获取 添加儿童建档界面的 下拉列表数据
492   - *
493   - * @return
494   - */
495   - @RequestMapping(value = "/configs", method = RequestMethod.GET)
496   - @ResponseBody
497   - public BaseObjectResponse configs () {
498   - return babyPatientExtendEarService.getConfigs();
499   - }
500   -
  496 + /**
  497 + * 获取 添加儿童建档界面的 下拉列表数据
  498 + *
  499 + * @return
  500 + */
  501 + @RequestMapping(value = "/configs", method = RequestMethod.GET)
  502 + @ResponseBody
  503 + public BaseObjectResponse configs() {
  504 + return babyPatientExtendEarService.getConfigs();
501 505 }
  506 +
  507 +}