Commit 4eebc26fe0d496671f693a9b2c554c20162cbd45

Authored by yangfei
1 parent 2fb3365d61

儿童管理列表按高危查询

Showing 1 changed file with 326 additions and 188 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SieveFacade.java View file @ 4eebc26
... ... @@ -2,7 +2,6 @@
2 2  
3 3 import com.lyms.platform.biz.service.*;
4 4 import com.lyms.platform.common.constants.ErrorCodeConstants;
5   -import com.lyms.platform.common.dao.operator.MongoQuery;
6 5 import com.lyms.platform.common.enums.OptActionEnums;
7 6 import com.lyms.platform.common.enums.SieveEnums;
8 7 import com.lyms.platform.common.enums.TrackDownDateEnums;
9 8  
... ... @@ -22,11 +21,11 @@
22 21 import com.lyms.platform.operate.web.utils.CommonsHelper;
23 22 import com.lyms.platform.operate.web.worker.SieveWorker;
24 23 import com.lyms.platform.permission.model.Organization;
25   -import com.lyms.platform.permission.model.Users;
26 24 import com.lyms.platform.permission.service.OrganizationService;
27 25 import com.lyms.platform.permission.service.UsersService;
28 26 import com.lyms.platform.pojo.*;
29 27 import com.lyms.platform.query.*;
  28 +import net.sf.json.JSONObject;
30 29 import org.apache.commons.collections.CollectionUtils;
31 30 import org.apache.commons.lang.StringUtils;
32 31 import org.apache.commons.lang.math.NumberUtils;
... ... @@ -84,7 +83,6 @@
84 83 private AntenatalExaminationFacade antenatalExaminationFacade;
85 84  
86 85 /**
87   - *
88 86 * 增加一条产筛结果记录
89 87 *
90 88 * @param sieveAddRequest
91 89  
... ... @@ -146,9 +144,9 @@
146 144 if (CollectionUtils.isNotEmpty(records)) {
147 145 TrackDownRecord track = records.get(0);
148 146 trackDownRecord.setId(track.getId());
149   - if (track.getTrackType()== TrackDownDateEnums.C.getId()) {
  147 + if (track.getTrackType() == TrackDownDateEnums.C.getId()) {
150 148 trackDownRecord.setTrackType(TrackDownDateEnums.I.getId());
151   - }else if(track.getTrackType()== TrackDownDateEnums.H.getId()){
  149 + } else if (track.getTrackType() == TrackDownDateEnums.H.getId()) {
152 150 trackDownRecord.setTrackType(TrackDownDateEnums.E.getId());
153 151 }
154 152 }
... ... @@ -247,8 +245,7 @@
247 245 }
248 246  
249 247  
250   - public String getSieveStatus(String patientId,String hospitalId)
251   - {
  248 + public String getSieveStatus(String patientId, String hospitalId) {
252 249  
253 250 String siveStatus = "";
254 251 SieveQuery sieveQuery = new SieveQuery();
255 252  
256 253  
257 254  
258 255  
259 256  
260 257  
261 258  
262 259  
263 260  
264 261  
265 262  
266 263  
267 264  
268 265  
269 266  
... ... @@ -257,73 +254,58 @@
257 254 sieveQuery.setParentId(patientId);
258 255 //查询产筛list
259 256 List<SieveModel> list = sieveService.queryList1(sieveQuery, "order");
260   - if (CollectionUtils.isNotEmpty(list))
261   - {
  257 + if (CollectionUtils.isNotEmpty(list)) {
262 258 SieveModel model = list.get(0);
263   - if (model.getZtfx() == null)
264   - {
  259 + if (model.getZtfx() == null) {
265 260 SieveApplyOrderQuery sieveApplyOrderQuery1 = new SieveApplyOrderQuery();
266 261 sieveApplyOrderQuery1.setParentId(patientId);
267 262 sieveApplyOrderQuery1.setHospitalId(hospitalId);
268 263 sieveApplyOrderQuery1.setYn(YnEnums.YES.getId());
269 264 List<SieveApplyOrderModel> list1 = applyOrderService.querySieveApplyOrderWithQuery(sieveApplyOrderQuery1);
270   - if (CollectionUtils.isEmpty(list1))
271   - {
  265 + if (CollectionUtils.isEmpty(list1)) {
272 266 siveStatus = "未产筛";
273   - }
274   - else
275   - {
  267 + } else {
276 268 siveStatus = "已申请";
277 269 }
278   - }
279   - else
280   - {
  270 + } else {
281 271 siveStatus = SieveEnums.getTitle(model.getZtfx());
282 272 }
283   - }
284   - else
285   - {
  273 + } else {
286 274 SieveApplyOrderQuery sieveApplyOrderQuery1 = new SieveApplyOrderQuery();
287 275 sieveApplyOrderQuery1.setParentId(patientId);
288 276 sieveApplyOrderQuery1.setHospitalId(hospitalId);
289 277 sieveApplyOrderQuery1.setYn(YnEnums.YES.getId());
290 278 List<SieveApplyOrderModel> list1 = applyOrderService.querySieveApplyOrderWithQuery(sieveApplyOrderQuery1);
291   - if (CollectionUtils.isEmpty(list1))
292   - {
  279 + if (CollectionUtils.isEmpty(list1)) {
293 280 siveStatus = "未产筛";
294   - }
295   - else
296   - {
  281 + } else {
297 282 SieveResultQuery sieveResultQuery = new SieveResultQuery();
298 283 sieveResultQuery.setParentId(patientId);
299 284 sieveResultQuery.setYn(YnEnums.YES.getId());
300 285 List<SieveResultModel> resultModels = sieveService.queryListSieveResult(sieveResultQuery);
301   - if (CollectionUtils.isNotEmpty(resultModels))
302   - {
  286 + if (CollectionUtils.isNotEmpty(resultModels)) {
303 287  
304 288 SieveResultModel resultModel = resultModels.get(0);
305 289  
306   - List<Integer> slist =new ArrayList<>();
  290 + List<Integer> slist = new ArrayList<>();
307 291  
308   - if(StringUtils.isNotEmpty(resultModel.getTszhz())){
  292 + if (StringUtils.isNotEmpty(resultModel.getTszhz())) {
309 293 slist.add(Integer.valueOf(resultModel.getTszhz()));
310 294 }
311   - if(StringUtils.isNotEmpty(resultModel.getSjgjx())){
  295 + if (StringUtils.isNotEmpty(resultModel.getSjgjx())) {
312 296 slist.add(Integer.valueOf(resultModel.getSjgjx()));
313 297 }
314   - if(StringUtils.isNotEmpty(resultModel.getSbst())){
  298 + if (StringUtils.isNotEmpty(resultModel.getSbst())) {
315 299 slist.add(Integer.valueOf(resultModel.getSbst()));
316 300 }
317   - if(StringUtils.isNotEmpty(resultModel.getDzhpx())){
  301 + if (StringUtils.isNotEmpty(resultModel.getDzhpx())) {
318 302 slist.add(Integer.valueOf(resultModel.getDzhpx()));
319 303 }
320   - if(StringUtils.isNotEmpty(resultModel.getStzhz13())){
  304 + if (StringUtils.isNotEmpty(resultModel.getStzhz13())) {
321 305 slist.add(Integer.valueOf(resultModel.getStzhz13()));
322 306 }
323 307 siveStatus = SieveEnums.getTitle(Collections.max(slist));
324   - }
325   - else
326   - {
  308 + } else {
327 309 siveStatus = "已申请";
328 310 }
329 311 }
... ... @@ -339,7 +321,7 @@
339 321 * @param cqSieveQueryRequest
340 322 * @return
341 323 */
342   - public BaseResponse queryList(CqSieveQueryRequest cqSieveQueryRequest, Integer userId, String needPage,boolean isSieveLagManage) {
  324 + public BaseResponse queryList(CqSieveQueryRequest cqSieveQueryRequest, Integer userId, String needPage, boolean isSieveLagManage) {
343 325  
344 326 SieveQuery sieveQuery = new SieveQuery();
345 327 sieveQuery.setQueryNo(cqSieveQueryRequest.getQueryNo());
346 328  
... ... @@ -398,13 +380,10 @@
398 380 sieveQuery.setNeed(needPage);
399 381 String hospitalId = autoMatchFacade.getHospitalId(userId);
400 382  
401   - if(isSieveLagManage)
402   - {
  383 + if (isSieveLagManage) {
403 384 sieveQuery.setApplyHospitalId(hospitalId);
404 385 sieveQuery.setSieveHospitalId(hospitalId);
405   - }
406   - else
407   - {
  386 + } else {
408 387 sieveQuery.setHospitalId(hospitalId);
409 388 }
410 389  
... ... @@ -420,7 +399,7 @@
420 399 if (end > list.size()) {
421 400 end = list.size();
422 401 }
423   - listFuture.add(commonThreadPool.submit(new SieveWorker(hospitalId, list.subList(i, end), antenatalExaminationService, patientsService,applyOrderService,organizationService)));
  402 + listFuture.add(commonThreadPool.submit(new SieveWorker(hospitalId, list.subList(i, end), antenatalExaminationService, patientsService, applyOrderService, organizationService)));
424 403 }
425 404 for (Future f : listFuture) {
426 405 try {
... ... @@ -435,7 +414,7 @@
435 414 public void exportCqsieves(CqSieveQueryRequest cqSieveQueryRequest, Integer id, HttpServletResponse response) {
436 415 try {
437 416  
438   - BaseListResponse listResponse = (BaseListResponse) queryList(cqSieveQueryRequest, id, null,false);
  417 + BaseListResponse listResponse = (BaseListResponse) queryList(cqSieveQueryRequest, id, null, false);
439 418  
440 419 List<SieveListResult> list = listResponse.getData();
441 420 List<Map<String, Object>> datas = new ArrayList<>();
442 421  
443 422  
444 423  
445 424  
446 425  
... ... @@ -541,36 +520,31 @@
541 520 }
542 521  
543 522 /**
544   - * 添加查询前 查询孕妇基本信息 如果孕妇没有在本院建档就添加隐藏档案
  523 + * 添加查询前 查询孕妇基本信息 如果孕妇没有在本院建档就添加隐藏档案
  524 + *
545 525 * @param cardNo
546 526 * @param userId
547 527 * @return
548 528 */
549   - public BaseResponse querySievePatientInfo(String cardNo,String vcCardNo, Integer userId) {
  529 + public BaseResponse querySievePatientInfo(String cardNo, String vcCardNo, Integer userId) {
550 530  
551 531 String hospitalId = autoMatchFacade.getHospitalId(userId);
552 532  
553 533 PatientsQuery patientsQuery = new PatientsQuery();
554 534 patientsQuery.setHospitalId(hospitalId);
555 535 patientsQuery.setYn(YnEnums.YES.getId());
556   - if (StringUtils.isNotEmpty(cardNo))
557   - {
  536 + if (StringUtils.isNotEmpty(cardNo)) {
558 537 patientsQuery.setPhoneOrCert(cardNo);
559   - }
560   - else if (StringUtils.isNotEmpty(vcCardNo))
561   - {
  538 + } else if (StringUtils.isNotEmpty(vcCardNo)) {
562 539 patientsQuery.setVcCardNo(vcCardNo);
563 540 }
564 541  
565 542  
566 543 List<Patients> localPatients = patientsService.queryPatient(patientsQuery);
567 544 Patients pat = null;
568   - if (CollectionUtils.isNotEmpty(localPatients))
569   - {
  545 + if (CollectionUtils.isNotEmpty(localPatients)) {
570 546 pat = localPatients.get(0);
571   - }
572   - else
573   - {
  547 + } else {
574 548 patientsQuery.setHospitalId(null);
575 549 List<Patients> areaPatients = patientsService.queryPatient(patientsQuery);
576 550 if (CollectionUtils.isNotEmpty(areaPatients)) {
... ... @@ -580,9 +554,7 @@
580 554 String id = antenatalExaminationFacade.handHideBuild(pat.getPid(), pat.getId(), userId, 1);
581 555  
582 556 pat = patientsService.findOnePatientById(id);
583   - }
584   - else
585   - {
  557 + } else {
586 558 return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("没有档案,请建档后申请产筛");
587 559 }
588 560 }
... ... @@ -601,8 +573,7 @@
601 573 antExChuQuery.setYn(YnEnums.YES.getId());
602 574  
603 575 List<AntExChuModel> list = antenatalExaminationService.queryAntExChu(antExChuQuery);
604   - if (CollectionUtils.isNotEmpty(list))
605   - {
  576 + if (CollectionUtils.isNotEmpty(list)) {
606 577 AntExChuModel chuModel = list.get(0);
607 578 patientBaseResult.setWeight(chuModel.getYqWeight());
608 579 }
609 580  
... ... @@ -610,9 +581,9 @@
610 581 return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(patientBaseResult);
611 582 }
612 583  
613   - public BaseResponse getSieveApplyInfo(String parentId, Integer userId,Integer type) {
  584 + public BaseResponse getSieveApplyInfo(String parentId, Integer userId, Integer type) {
614 585  
615   - Map<String,Object> map = new HashMap<>();
  586 + Map<String, Object> map = new HashMap<>();
616 587 String hospitalId = autoMatchFacade.getHospitalId(userId);
617 588  
618 589 PatientsQuery patientsQuery = new PatientsQuery();
619 590  
... ... @@ -622,12 +593,9 @@
622 593  
623 594 List<Patients> localPatients = patientsService.queryPatient(patientsQuery);
624 595 Patients pat = null;
625   - if (CollectionUtils.isNotEmpty(localPatients))
626   - {
  596 + if (CollectionUtils.isNotEmpty(localPatients)) {
627 597 pat = localPatients.get(0);
628   - }
629   - else
630   - {
  598 + } else {
631 599 patientsQuery.setHospitalId(null);
632 600 List<Patients> areaPatients = patientsService.queryPatient(patientsQuery);
633 601 if (CollectionUtils.isNotEmpty(areaPatients)) {
... ... @@ -637,9 +605,7 @@
637 605 String id = antenatalExaminationFacade.handHideBuild(pat.getPid(), pat.getId(), userId, 1);
638 606  
639 607 pat = patientsService.findOnePatientById(id);
640   - }
641   - else
642   - {
  608 + } else {
643 609 return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("没有档案,请建档后申请产筛");
644 610 }
645 611 }
646 612  
647 613  
648 614  
649 615  
650 616  
651 617  
652 618  
653 619  
654 620  
655 621  
656 622  
657 623  
658 624  
659 625  
660 626  
661 627  
662 628  
... ... @@ -660,95 +626,89 @@
660 626 sieveApplyOrderQuery1.setHospitalId(hospitalId);
661 627 sieveApplyOrderQuery1.setYn(YnEnums.YES.getId());
662 628  
663   - if (type == 4)
664   - {
  629 + if (type == 4) {
665 630  
666   - Map<String,Object> sieveResultEditInfo = new HashMap<>();
  631 + Map<String, Object> sieveResultEditInfo = new HashMap<>();
667 632 SieveResultQuery sieveResultQuery = new SieveResultQuery();
668 633 sieveResultQuery.setParentId(parentId);
669 634 sieveResultQuery.setYn(YnEnums.YES.getId());
670 635 List<SieveResultModel> list = sieveService.queryListSieveResult(sieveResultQuery);
671   - if (CollectionUtils.isNotEmpty(list))
672   - {
  636 + if (CollectionUtils.isNotEmpty(list)) {
673 637 SieveResultModel model = list.get(0);
674   - sieveResultEditInfo.put("id",model.getId());
675   - sieveResultEditInfo.put("hcg",model.getHcg() != null ? model.getHcg() : "");
676   - sieveResultEditInfo.put("hcgMom",model.getHcgMom() != null ? model.getHcgMom() : "");
677   - sieveResultEditInfo.put("hafp",model.getHafp() != null ? model.getHafp() : "");
678   - sieveResultEditInfo.put("hafpMom",model.getHafpMom() != null ? model.getHafpMom() : "");
  638 + sieveResultEditInfo.put("id", model.getId());
  639 + sieveResultEditInfo.put("hcg", model.getHcg() != null ? model.getHcg() : "");
  640 + sieveResultEditInfo.put("hcgMom", model.getHcgMom() != null ? model.getHcgMom() : "");
  641 + sieveResultEditInfo.put("hafp", model.getHafp() != null ? model.getHafp() : "");
  642 + sieveResultEditInfo.put("hafpMom", model.getHafpMom() != null ? model.getHafpMom() : "");
679 643 sieveResultEditInfo.put("examineId", model.getExamineId());
680   - sieveResultEditInfo.put("checkerId",model.getCheckerId());
681   - sieveResultEditInfo.put("resultTime",DateUtil.getyyyy_MM_dd(model.getResultTime()));
  644 + sieveResultEditInfo.put("checkerId", model.getCheckerId());
  645 + sieveResultEditInfo.put("resultTime", DateUtil.getyyyy_MM_dd(model.getResultTime()));
682 646  
683   - sieveResultEditInfo.put("tszhz",model.getTszhz());
684   - sieveResultEditInfo.put("sbst",model.getSbst());
685   - sieveResultEditInfo.put("stzhz13",model.getStzhz13());
686   - sieveResultEditInfo.put("sjgjx",model.getSjgjx());
  647 + sieveResultEditInfo.put("tszhz", model.getTszhz());
  648 + sieveResultEditInfo.put("sbst", model.getSbst());
  649 + sieveResultEditInfo.put("stzhz13", model.getStzhz13());
  650 + sieveResultEditInfo.put("sjgjx", model.getSjgjx());
687 651  
688 652  
689   - sieveResultEditInfo.put("tszhzValue",model.getTszhzValue());
690   - sieveResultEditInfo.put("sbstValue",model.getSbstValue());
691   - sieveResultEditInfo.put("stzhz13Value",model.getStzhz13Value());
692   - sieveResultEditInfo.put("sjgjxValue",model.getSjgjxValue());
693   - sieveResultEditInfo.put("publishName",model.getPublishName());
  653 + sieveResultEditInfo.put("tszhzValue", model.getTszhzValue());
  654 + sieveResultEditInfo.put("sbstValue", model.getSbstValue());
  655 + sieveResultEditInfo.put("stzhz13Value", model.getStzhz13Value());
  656 + sieveResultEditInfo.put("sjgjxValue", model.getSjgjxValue());
  657 + sieveResultEditInfo.put("publishName", model.getPublishName());
694 658 }
695   - map.put("sieveResultEditInfo",sieveResultEditInfo);
696   - }
697   - else
698   - {
  659 + map.put("sieveResultEditInfo", sieveResultEditInfo);
  660 + } else {
699 661 List<SieveApplyOrderModel> sieveApplyOrderModels = applyOrderService.querySieveApplyOrderWithQuery(sieveApplyOrderQuery1);
700   - if (CollectionUtils.isNotEmpty(sieveApplyOrderModels))
701   - {
702   - Map<String,Object> result = new HashMap<>();
  662 + if (CollectionUtils.isNotEmpty(sieveApplyOrderModels)) {
  663 + Map<String, Object> result = new HashMap<>();
703 664  
704   - Map<String,Object> viewInfo = new HashMap<>();
  665 + Map<String, Object> viewInfo = new HashMap<>();
705 666 SieveApplyOrderModel sieveApply = sieveApplyOrderModels.get(0);
706 667  
707   - result.put("id",sieveApply.getId());
708   - result.put("parentId",sieveApply.getParentId());
  668 + result.put("id", sieveApply.getId());
  669 + result.put("parentId", sieveApply.getParentId());
709 670  
710   - result.put("check",sieveApply.getCheckItem());
711   - result.put("guide",sieveApply.getGuide());
712   - result.put("checkDate",sieveApply.getCheckDate());
713   - result.put("applyDoctor",sieveApply.getApplyDoctor());
714   - result.put("hospitalId",sieveApply.getHospitalId());
715   - result.put("applyTime",DateUtil.getyyyy_MM_dd(sieveApply.getApplyTime()));
716   - result.put("birth",DateUtil.getyyyy_MM_dd(sieveApply.getBirth()));
717   - result.put("weight",sieveApply.getWeight());
718   - result.put("lastMenses",DateUtil.getyyyy_MM_dd(sieveApply.getLastMenses()));
719   - result.put("number",sieveApply.getNumber());
720   - result.put("collectionDoctorId",sieveApply.getCollectionDoctorId());
721   - result.put("collectionDate",DateUtil.getyyyy_MM_dd(sieveApply.getCollectionDate()));
722   - result.put("crl",sieveApply.getCrl());
723   - result.put("bpd",sieveApply.getBpd());
724   - result.put("bcCheckDate",DateUtil.getyyyy_MM_dd(sieveApply.getBcCheckDate()));
725   - result.put("historyBirth",sieveApply.getHistoryBirth());
726   - result.put("pastHistory",sieveApply.getPastHistory());
727   - result.put("sieveHospitalId",sieveApply.getSieveHospitalId());
728   - result.put("sendDoctor",sieveApply.getSendDoctor());
729   - result.put("sendTime",DateUtil.getyyyy_MM_dd(sieveApply.getSendTime()));
730   - result.put("age",DateUtil.getAge(sieveApply.getBirth(), sieveApply.getCreated()));
731   - result.put("mensesDay",sieveApply.getMensesDay());
732   - result.put("mensesWeek",sieveApply.getMensesWeek());
733   - result.put("experimentNum","");
  671 + result.put("check", sieveApply.getCheckItem());
  672 + result.put("guide", sieveApply.getGuide());
  673 + result.put("checkDate", sieveApply.getCheckDate());
  674 + result.put("applyDoctor", sieveApply.getApplyDoctor());
  675 + result.put("hospitalId", sieveApply.getHospitalId());
  676 + result.put("applyTime", DateUtil.getyyyy_MM_dd(sieveApply.getApplyTime()));
  677 + result.put("birth", DateUtil.getyyyy_MM_dd(sieveApply.getBirth()));
  678 + result.put("weight", sieveApply.getWeight());
  679 + result.put("lastMenses", DateUtil.getyyyy_MM_dd(sieveApply.getLastMenses()));
  680 + result.put("number", sieveApply.getNumber());
  681 + result.put("collectionDoctorId", sieveApply.getCollectionDoctorId());
  682 + result.put("collectionDate", DateUtil.getyyyy_MM_dd(sieveApply.getCollectionDate()));
  683 + result.put("crl", sieveApply.getCrl());
  684 + result.put("bpd", sieveApply.getBpd());
  685 + result.put("bcCheckDate", DateUtil.getyyyy_MM_dd(sieveApply.getBcCheckDate()));
  686 + result.put("historyBirth", sieveApply.getHistoryBirth());
  687 + result.put("pastHistory", sieveApply.getPastHistory());
  688 + result.put("sieveHospitalId", sieveApply.getSieveHospitalId());
  689 + result.put("sendDoctor", sieveApply.getSendDoctor());
  690 + result.put("sendTime", DateUtil.getyyyy_MM_dd(sieveApply.getSendTime()));
  691 + result.put("age", DateUtil.getAge(sieveApply.getBirth(), sieveApply.getCreated()));
  692 + result.put("mensesDay", sieveApply.getMensesDay());
  693 + result.put("mensesWeek", sieveApply.getMensesWeek());
  694 + result.put("experimentNum", "");
734 695  
735   - map.put("sieveApplyInfo",result);
  696 + map.put("sieveApplyInfo", result);
736 697  
737   - if (type == 1 || type == 3)
738   - {
739   - String applyDoctorName = CommonsHelper.getUserName(sieveApply.getApplyDoctor(),usersService);
740   - viewInfo.put("applyDoctorName",applyDoctorName);
  698 + if (type == 1 || type == 3) {
  699 + String applyDoctorName = CommonsHelper.getUserName(sieveApply.getApplyDoctor(), usersService);
  700 + viewInfo.put("applyDoctorName", applyDoctorName);
741 701  
742   - String collectionDoctorName = CommonsHelper.getUserName(sieveApply.getCollectionDoctorId(),usersService);
743   - viewInfo.put("collectionDoctorName",collectionDoctorName);
  702 + String collectionDoctorName = CommonsHelper.getUserName(sieveApply.getCollectionDoctorId(), usersService);
  703 + viewInfo.put("collectionDoctorName", collectionDoctorName);
744 704  
745   - String sendDoctorName = CommonsHelper.getUserName(sieveApply.getSendDoctor(),usersService);
746   - viewInfo.put("sendDoctorName",sendDoctorName);
  705 + String sendDoctorName = CommonsHelper.getUserName(sieveApply.getSendDoctor(), usersService);
  706 + viewInfo.put("sendDoctorName", sendDoctorName);
747 707  
748   - String applyHospitalName = CommonsHelper.getHospitalName(sieveApply.getSieveHospitalId(),organizationService);
  708 + String applyHospitalName = CommonsHelper.getHospitalName(sieveApply.getSieveHospitalId(), organizationService);
749 709 viewInfo.put("applyHospitalName", applyHospitalName);
750 710  
751   - String currentHospitalName = CommonsHelper.getHospitalName(sieveApply.getHospitalId(),organizationService);
  711 + String currentHospitalName = CommonsHelper.getHospitalName(sieveApply.getHospitalId(), organizationService);
752 712 viewInfo.put("currentHospitalName", currentHospitalName);
753 713  
754 714 String isTire = "";
755 715  
756 716  
757 717  
758 718  
759 719  
760 720  
761 721  
762 722  
763 723  
764 724  
765 725  
766 726  
767 727  
768 728  
769 729  
770 730  
771 731  
772 732  
773 733  
... ... @@ -757,82 +717,74 @@
757 717 antExChuQuery1.setParentId(parentId);
758 718 antExChuQuery1.setYn(YnEnums.YES.getId());
759 719 List<AntExChuModel> data1 = antenatalExaminationService.queryAntExChu(antExChuQuery1);
760   - if (CollectionUtils.isNotEmpty(data1))
761   - {
  720 + if (CollectionUtils.isNotEmpty(data1)) {
762 721 AntExChuModel chuModel = data1.get(0);
763   - if (StringUtils.isNotEmpty(chuModel.getTireNumber()))
764   - {
765   - isTire = Integer.parseInt(chuModel.getTireNumber()) > 1 ? "是":"否";
  722 + if (StringUtils.isNotEmpty(chuModel.getTireNumber())) {
  723 + isTire = Integer.parseInt(chuModel.getTireNumber()) > 1 ? "是" : "否";
766 724 tireNumber = chuModel.getTireNumber();
767 725 }
768 726 }
769 727 map.put("isTire", isTire);
770   - map.put("tireNumber",tireNumber);
771   - map.put("viewInfo",viewInfo);
  728 + map.put("tireNumber", tireNumber);
  729 + map.put("viewInfo", viewInfo);
772 730  
773   - if (type == 3)
774   - {
775   - Map<String,Object> sieveResultInfo = new HashMap<>();
  731 + if (type == 3) {
  732 + Map<String, Object> sieveResultInfo = new HashMap<>();
776 733  
777 734 SieveResultQuery sieveResultQuery = new SieveResultQuery();
778 735 sieveResultQuery.setParentId(parentId);
779 736 sieveResultQuery.setYn(YnEnums.YES.getId());
780 737 List<SieveResultModel> list = sieveService.queryListSieveResult(sieveResultQuery);
781   - if (CollectionUtils.isNotEmpty(list))
782   - {
  738 + if (CollectionUtils.isNotEmpty(list)) {
783 739 SieveResultModel sieveResultModel = list.get(0);
784   - sieveResultInfo.put("hcg",sieveResultModel.getHcg() != null ? sieveResultModel.getHcg()+"ng/ml" : "");
785   - sieveResultInfo.put("hcgMom",sieveResultModel.getHcgMom() != null ? sieveResultModel.getHcgMom() : "");
786   - sieveResultInfo.put("hafp",sieveResultModel.getHafp() != null ? sieveResultModel.getHafp()+"U/ml" : "");
787   - sieveResultInfo.put("hafpMom",sieveResultModel.getHafpMom() != null ? sieveResultModel.getHafpMom() : "");
  740 + sieveResultInfo.put("hcg", sieveResultModel.getHcg() != null ? sieveResultModel.getHcg() + "ng/ml" : "");
  741 + sieveResultInfo.put("hcgMom", sieveResultModel.getHcgMom() != null ? sieveResultModel.getHcgMom() : "");
  742 + sieveResultInfo.put("hafp", sieveResultModel.getHafp() != null ? sieveResultModel.getHafp() + "U/ml" : "");
  743 + sieveResultInfo.put("hafpMom", sieveResultModel.getHafpMom() != null ? sieveResultModel.getHafpMom() : "");
788 744 sieveResultInfo.put("examineName", CommonsHelper.getUserName(sieveResultModel.getExamineId(), usersService));
789   - sieveResultInfo.put("checkerName",CommonsHelper.getUserName(sieveResultModel.getCheckerId(), usersService));
790   - sieveResultInfo.put("reportTime",DateUtil.getyyyy_MM_dd(sieveResultModel.getResultTime()));
  745 + sieveResultInfo.put("checkerName", CommonsHelper.getUserName(sieveResultModel.getCheckerId(), usersService));
  746 + sieveResultInfo.put("reportTime", DateUtil.getyyyy_MM_dd(sieveResultModel.getResultTime()));
791 747  
792 748 String tszhzValue = "";
793   - if (StringUtils.isNotEmpty(sieveResultModel.getTszhz()) && sieveResultModel.getTszhzValue() != null && sieveResultModel.getTszhzValue().size() > 0)
794   - {
  749 + if (StringUtils.isNotEmpty(sieveResultModel.getTszhz()) && sieveResultModel.getTszhzValue() != null && sieveResultModel.getTszhzValue().size() > 0) {
795 750  
796 751 String valueOne = sieveResultModel.getTszhzValue().get("valueOne");
797 752 String valueTwo = sieveResultModel.getTszhzValue().get("valueTwo");
798   - tszhzValue = valueOne + "/"+valueTwo+("0".equals(sieveResultModel.getTszhz()) ? "低风险" : "1".equals(sieveResultModel.getTszhz()) ? "临界值" : "高风险");
  753 + tszhzValue = valueOne + "/" + valueTwo + ("0".equals(sieveResultModel.getTszhz()) ? "低风险" : "1".equals(sieveResultModel.getTszhz()) ? "临界值" : "高风险");
799 754 }
800   - sieveResultInfo.put("tszhz",tszhzValue);
  755 + sieveResultInfo.put("tszhz", tszhzValue);
801 756  
802 757  
803 758 String sbst = "";
804   - if (StringUtils.isNotEmpty(sieveResultModel.getSbst()) && sieveResultModel.getSbstValue() != null && sieveResultModel.getSbstValue().size() > 0)
805   - {
  759 + if (StringUtils.isNotEmpty(sieveResultModel.getSbst()) && sieveResultModel.getSbstValue() != null && sieveResultModel.getSbstValue().size() > 0) {
806 760  
807 761 String valueOne = sieveResultModel.getSbstValue().get("valueOne");
808 762 String valueTwo = sieveResultModel.getSbstValue().get("valueTwo");
809   - sbst = valueOne + "/"+valueTwo+("0".equals(sieveResultModel.getSbst()) ? "低风险" : "1".equals(sieveResultModel.getSbst()) ? "临界值" : "高风险");
  763 + sbst = valueOne + "/" + valueTwo + ("0".equals(sieveResultModel.getSbst()) ? "低风险" : "1".equals(sieveResultModel.getSbst()) ? "临界值" : "高风险");
810 764 }
811   - sieveResultInfo.put("sbst",sbst);
  765 + sieveResultInfo.put("sbst", sbst);
812 766  
813 767  
814   - String sjgjx = "";
815   - if (StringUtils.isNotEmpty(sieveResultModel.getSjgjx()) && sieveResultModel.getSjgjxValue() != null && sieveResultModel.getSjgjxValue().size() > 0)
816   - {
  768 + String sjgjx = "";
  769 + if (StringUtils.isNotEmpty(sieveResultModel.getSjgjx()) && sieveResultModel.getSjgjxValue() != null && sieveResultModel.getSjgjxValue().size() > 0) {
817 770  
818 771 String valueOne = sieveResultModel.getSjgjxValue().get("valueOne");
819 772 String valueTwo = sieveResultModel.getSjgjxValue().get("valueTwo");
820   - sjgjx = valueOne + "/"+valueTwo+("0".equals(sieveResultModel.getSjgjx()) ? "低风险" : "1".equals(sieveResultModel.getSjgjx()) ? "临界值" : "高风险");
  773 + sjgjx = valueOne + "/" + valueTwo + ("0".equals(sieveResultModel.getSjgjx()) ? "低风险" : "1".equals(sieveResultModel.getSjgjx()) ? "临界值" : "高风险");
821 774 }
822   - sieveResultInfo.put("sjgjx",sjgjx);
  775 + sieveResultInfo.put("sjgjx", sjgjx);
823 776  
824   - String stzhz13 = "";
825   - if (StringUtils.isNotEmpty(sieveResultModel.getStzhz13()) && sieveResultModel.getStzhz13Value() != null && sieveResultModel.getStzhz13Value().size() > 0)
826   - {
  777 + String stzhz13 = "";
  778 + if (StringUtils.isNotEmpty(sieveResultModel.getStzhz13()) && sieveResultModel.getStzhz13Value() != null && sieveResultModel.getStzhz13Value().size() > 0) {
827 779 String valueOne = sieveResultModel.getStzhz13Value().get("valueOne");
828 780 String valueTwo = sieveResultModel.getStzhz13Value().get("valueTwo");
829   - stzhz13 = valueOne + "/"+valueTwo+("0".equals(sieveResultModel.getStzhz13()) ? "低风险" : "1".equals(sieveResultModel.getStzhz13()) ? "临界值" : "高风险");
  781 + stzhz13 = valueOne + "/" + valueTwo + ("0".equals(sieveResultModel.getStzhz13()) ? "低风险" : "1".equals(sieveResultModel.getStzhz13()) ? "临界值" : "高风险");
830 782 }
831   - sieveResultInfo.put("stzhz13",stzhz13);
  783 + sieveResultInfo.put("stzhz13", stzhz13);
832 784  
833 785  
834 786 }
835   - map.put("sieveResultInfo",sieveResultInfo);
  787 + map.put("sieveResultInfo", sieveResultInfo);
836 788 }
837 789 }
838 790 }
839 791  
840 792  
... ... @@ -841,20 +793,206 @@
841 793 return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(map);
842 794 }
843 795  
  796 + /**
  797 + * 查询产筛申请信息和结果信息
  798 + *
  799 + * @return
  800 + */
  801 + public Map<String, Object> xcxSieveApplyInfo(String formDataStr) {
  802 +
  803 + JSONObject jsonObject = JsonUtil.getObj(formDataStr);
  804 + String parentId = jsonObject.getString("parentId");
  805 + int type = jsonObject.getInt("type");
  806 +
  807 + Map<String, Object> map = new HashMap<>();
  808 +
  809 + Patients pat = patientsService.findOnePatientById(parentId);
  810 + HighScoreResult highScoreResult = antenatalExaminationFacade.findLastRisk(pat.getPid(), false);
  811 + PatientBaseResult patientBaseResult = new PatientBaseResult();
  812 + if (null != pat) {
  813 + patientBaseResult.convert(pat);
  814 + }
  815 + patientBaseResult.setRiskFactor(highScoreResult.getHighRisk());
  816 + patientBaseResult.setRiskScore(highScoreResult.getScoreStr());
  817 +
  818 + map.put("patientInfo", patientBaseResult);
  819 + SieveApplyOrderQuery sieveApplyOrderQuery1 = new SieveApplyOrderQuery();
  820 + sieveApplyOrderQuery1.setParentId(parentId);
  821 + sieveApplyOrderQuery1.setYn(YnEnums.YES.getId());
  822 +
  823 + if (type == 2) {//查看报告
  824 + Map<String, Object> sieveResultEditInfo = new HashMap<>();
  825 + SieveResultQuery sieveResultQuery = new SieveResultQuery();
  826 + sieveResultQuery.setParentId(parentId);
  827 + sieveResultQuery.setYn(YnEnums.YES.getId());
  828 + List<SieveResultModel> list = sieveService.queryListSieveResult(sieveResultQuery);
  829 + if (CollectionUtils.isNotEmpty(list)) {
  830 + SieveResultModel model = list.get(0);
  831 + sieveResultEditInfo.put("id", model.getId());
  832 + sieveResultEditInfo.put("hcg", model.getHcg() != null ? model.getHcg() : "");
  833 + sieveResultEditInfo.put("hcgMom", model.getHcgMom() != null ? model.getHcgMom() : "");
  834 + sieveResultEditInfo.put("hafp", model.getHafp() != null ? model.getHafp() : "");
  835 + sieveResultEditInfo.put("hafpMom", model.getHafpMom() != null ? model.getHafpMom() : "");
  836 + sieveResultEditInfo.put("examineId", model.getExamineId());
  837 + sieveResultEditInfo.put("checkerId", model.getCheckerId());
  838 + sieveResultEditInfo.put("resultTime", DateUtil.getyyyy_MM_dd(model.getResultTime()));
  839 +
  840 + sieveResultEditInfo.put("tszhz", model.getTszhz());
  841 + sieveResultEditInfo.put("sbst", model.getSbst());
  842 + sieveResultEditInfo.put("stzhz13", model.getStzhz13());
  843 + sieveResultEditInfo.put("sjgjx", model.getSjgjx());
  844 +
  845 +
  846 + sieveResultEditInfo.put("tszhzValue", model.getTszhzValue());
  847 + sieveResultEditInfo.put("sbstValue", model.getSbstValue());
  848 + sieveResultEditInfo.put("stzhz13Value", model.getStzhz13Value());
  849 + sieveResultEditInfo.put("sjgjxValue", model.getSjgjxValue());
  850 + sieveResultEditInfo.put("publishName", model.getPublishName());
  851 + }
  852 + map.put("sieveResultEditInfo", sieveResultEditInfo);
  853 + } else {//查看申请单
  854 + List<SieveApplyOrderModel> sieveApplyOrderModels = applyOrderService.querySieveApplyOrderWithQuery(sieveApplyOrderQuery1);
  855 + if (CollectionUtils.isNotEmpty(sieveApplyOrderModels)) {
  856 + Map<String, Object> result = new HashMap<>();
  857 +
  858 + Map<String, Object> viewInfo = new HashMap<>();
  859 + SieveApplyOrderModel sieveApply = sieveApplyOrderModels.get(0);
  860 +
  861 + result.put("id", sieveApply.getId());
  862 + result.put("parentId", sieveApply.getParentId());
  863 +
  864 + result.put("check", sieveApply.getCheckItem());
  865 + result.put("guide", sieveApply.getGuide());
  866 + result.put("checkDate", sieveApply.getCheckDate());
  867 + result.put("applyDoctor", sieveApply.getApplyDoctor());
  868 + result.put("hospitalId", sieveApply.getHospitalId());
  869 + result.put("applyTime", DateUtil.getyyyy_MM_dd(sieveApply.getApplyTime()));
  870 + result.put("birth", DateUtil.getyyyy_MM_dd(sieveApply.getBirth()));
  871 + result.put("weight", sieveApply.getWeight());
  872 + result.put("lastMenses", DateUtil.getyyyy_MM_dd(sieveApply.getLastMenses()));
  873 + result.put("number", sieveApply.getNumber());
  874 + result.put("collectionDoctorId", sieveApply.getCollectionDoctorId());
  875 + result.put("collectionDate", DateUtil.getyyyy_MM_dd(sieveApply.getCollectionDate()));
  876 + result.put("crl", sieveApply.getCrl());
  877 + result.put("bpd", sieveApply.getBpd());
  878 + result.put("bcCheckDate", DateUtil.getyyyy_MM_dd(sieveApply.getBcCheckDate()));
  879 + result.put("historyBirth", sieveApply.getHistoryBirth());
  880 + result.put("pastHistory", sieveApply.getPastHistory());
  881 + result.put("sieveHospitalId", sieveApply.getSieveHospitalId());
  882 + result.put("sendDoctor", sieveApply.getSendDoctor());
  883 + result.put("sendTime", DateUtil.getyyyy_MM_dd(sieveApply.getSendTime()));
  884 + result.put("age", DateUtil.getAge(sieveApply.getBirth(), sieveApply.getCreated()));
  885 + result.put("mensesDay", sieveApply.getMensesDay());
  886 + result.put("mensesWeek", sieveApply.getMensesWeek());
  887 + result.put("experimentNum", "");
  888 +
  889 + map.put("sieveApplyInfo", result);
  890 +
  891 + if (type == 1) {
  892 + String applyDoctorName = CommonsHelper.getUserName(sieveApply.getApplyDoctor(), usersService);
  893 + viewInfo.put("applyDoctorName", applyDoctorName);
  894 +
  895 + String collectionDoctorName = CommonsHelper.getUserName(sieveApply.getCollectionDoctorId(), usersService);
  896 + viewInfo.put("collectionDoctorName", collectionDoctorName);
  897 +
  898 + String sendDoctorName = CommonsHelper.getUserName(sieveApply.getSendDoctor(), usersService);
  899 + viewInfo.put("sendDoctorName", sendDoctorName);
  900 +
  901 + String applyHospitalName = CommonsHelper.getHospitalName(sieveApply.getSieveHospitalId(), organizationService);
  902 + viewInfo.put("applyHospitalName", applyHospitalName);
  903 +
  904 + String currentHospitalName = CommonsHelper.getHospitalName(sieveApply.getHospitalId(), organizationService);
  905 + viewInfo.put("currentHospitalName", currentHospitalName);
  906 +
  907 + String isTire = "";
  908 + String tireNumber = "";
  909 + AntExChuQuery antExChuQuery1 = new AntExChuQuery();
  910 + antExChuQuery1.setParentId(parentId);
  911 + antExChuQuery1.setYn(YnEnums.YES.getId());
  912 + List<AntExChuModel> data1 = antenatalExaminationService.queryAntExChu(antExChuQuery1);
  913 + if (CollectionUtils.isNotEmpty(data1)) {
  914 + AntExChuModel chuModel = data1.get(0);
  915 + if (StringUtils.isNotEmpty(chuModel.getTireNumber())) {
  916 + isTire = Integer.parseInt(chuModel.getTireNumber()) > 1 ? "是" : "否";
  917 + tireNumber = chuModel.getTireNumber();
  918 + }
  919 + }
  920 + map.put("isTire", isTire);
  921 + map.put("tireNumber", tireNumber);
  922 + map.put("viewInfo", viewInfo);
  923 +
  924 + Map<String, Object> sieveResultInfo = new HashMap<>();
  925 +
  926 + SieveResultQuery sieveResultQuery = new SieveResultQuery();
  927 + sieveResultQuery.setParentId(parentId);
  928 + sieveResultQuery.setYn(YnEnums.YES.getId());
  929 + List<SieveResultModel> list = sieveService.queryListSieveResult(sieveResultQuery);
  930 + if (CollectionUtils.isNotEmpty(list)) {
  931 + SieveResultModel sieveResultModel = list.get(0);
  932 + sieveResultInfo.put("hcg", sieveResultModel.getHcg() != null ? sieveResultModel.getHcg() + "ng/ml" : "");
  933 + sieveResultInfo.put("hcgMom", sieveResultModel.getHcgMom() != null ? sieveResultModel.getHcgMom() : "");
  934 + sieveResultInfo.put("hafp", sieveResultModel.getHafp() != null ? sieveResultModel.getHafp() + "U/ml" : "");
  935 + sieveResultInfo.put("hafpMom", sieveResultModel.getHafpMom() != null ? sieveResultModel.getHafpMom() : "");
  936 + sieveResultInfo.put("examineName", CommonsHelper.getUserName(sieveResultModel.getExamineId(), usersService));
  937 + sieveResultInfo.put("checkerName", CommonsHelper.getUserName(sieveResultModel.getCheckerId(), usersService));
  938 + sieveResultInfo.put("reportTime", DateUtil.getyyyy_MM_dd(sieveResultModel.getResultTime()));
  939 +
  940 + String tszhzValue = "";
  941 + if (StringUtils.isNotEmpty(sieveResultModel.getTszhz()) && sieveResultModel.getTszhzValue() != null && sieveResultModel.getTszhzValue().size() > 0) {
  942 +
  943 + String valueOne = sieveResultModel.getTszhzValue().get("valueOne");
  944 + String valueTwo = sieveResultModel.getTszhzValue().get("valueTwo");
  945 + tszhzValue = valueOne + "/" + valueTwo + ("0".equals(sieveResultModel.getTszhz()) ? "低风险" : "1".equals(sieveResultModel.getTszhz()) ? "临界值" : "高风险");
  946 + }
  947 + sieveResultInfo.put("tszhz", tszhzValue);
  948 +
  949 +
  950 + String sbst = "";
  951 + if (StringUtils.isNotEmpty(sieveResultModel.getSbst()) && sieveResultModel.getSbstValue() != null && sieveResultModel.getSbstValue().size() > 0) {
  952 +
  953 + String valueOne = sieveResultModel.getSbstValue().get("valueOne");
  954 + String valueTwo = sieveResultModel.getSbstValue().get("valueTwo");
  955 + sbst = valueOne + "/" + valueTwo + ("0".equals(sieveResultModel.getSbst()) ? "低风险" : "1".equals(sieveResultModel.getSbst()) ? "临界值" : "高风险");
  956 + }
  957 + sieveResultInfo.put("sbst", sbst);
  958 +
  959 +
  960 + String sjgjx = "";
  961 + if (StringUtils.isNotEmpty(sieveResultModel.getSjgjx()) && sieveResultModel.getSjgjxValue() != null && sieveResultModel.getSjgjxValue().size() > 0) {
  962 +
  963 + String valueOne = sieveResultModel.getSjgjxValue().get("valueOne");
  964 + String valueTwo = sieveResultModel.getSjgjxValue().get("valueTwo");
  965 + sjgjx = valueOne + "/" + valueTwo + ("0".equals(sieveResultModel.getSjgjx()) ? "低风险" : "1".equals(sieveResultModel.getSjgjx()) ? "临界值" : "高风险");
  966 + }
  967 + sieveResultInfo.put("sjgjx", sjgjx);
  968 +
  969 + String stzhz13 = "";
  970 + if (StringUtils.isNotEmpty(sieveResultModel.getStzhz13()) && sieveResultModel.getStzhz13Value() != null && sieveResultModel.getStzhz13Value().size() > 0) {
  971 + String valueOne = sieveResultModel.getStzhz13Value().get("valueOne");
  972 + String valueTwo = sieveResultModel.getStzhz13Value().get("valueTwo");
  973 + stzhz13 = valueOne + "/" + valueTwo + ("0".equals(sieveResultModel.getStzhz13()) ? "低风险" : "1".equals(sieveResultModel.getStzhz13()) ? "临界值" : "高风险");
  974 + }
  975 + sieveResultInfo.put("stzhz13", stzhz13);
  976 + }
  977 + map.put("sieveResultInfo", sieveResultInfo);
  978 + }
  979 + }
  980 + }
  981 +
  982 + return map;
  983 + }
  984 +
844 985 public BaseResponse reviceSieve(List<String> parentIds, Integer userId) {
845 986 String hospitalId = autoMatchFacade.getHospitalId(userId);
846   - if (CollectionUtils.isNotEmpty(parentIds))
847   - {
  987 + if (CollectionUtils.isNotEmpty(parentIds)) {
848 988 SieveQuery query = new SieveQuery();
849 989 query.setParentIds(parentIds);
850 990 query.setYn(YnEnums.YES.getId());
851 991 query.setApplyHospitalId(hospitalId);
852 992 List<SieveModel> list = sieveService.queryList(query);
853 993  
854   - if (CollectionUtils.isNotEmpty(list))
855   - {
856   - for (SieveModel sieve : list)
857   - {
  994 + if (CollectionUtils.isNotEmpty(list)) {
  995 + for (SieveModel sieve : list) {
858 996 sieve.setReviceStatus(2);
859 997 sieveService.updateOneChanQianDiaSieve(sieve);
860 998 }