Commit eca83f86bb7048a5b62a192b877b2e07a8373263

Authored by liquanyu
1 parent 2c67310bbd

隆化中间库对接

Showing 2 changed files with 149 additions and 59 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/lhxfy/LhxfyZjkService.java View file @ eca83f8
... ... @@ -6,6 +6,7 @@
6 6 import com.lyms.platform.common.enums.SexEnum;
7 7 import com.lyms.platform.common.enums.YnEnums;
8 8 import com.lyms.platform.common.utils.DateUtil;
  9 +import com.lyms.platform.common.utils.ExceptionUtils;
9 10 import com.lyms.platform.common.utils.HttpClientUtil;
10 11 import com.lyms.platform.common.utils.JsonUtil;
11 12 import com.lyms.platform.operate.web.utils.FunvCommonUtil;
... ... @@ -68,6 +69,7 @@
68 69 syncMcWomanhealth42days(hospitalId, start, end);
69 70 syncMcWomanhealthPostpartum(hospitalId, start, end);
70 71 syncMcWomanhealthAntenatal(hospitalId, start, end);
  72 + syncEtycf(hospitalId);
71 73 }
72 74  
73 75 public void syncEtycf(String hospitalId)
74 76  
... ... @@ -95,11 +97,11 @@
95 97 patientsQuery.setHospitalId(hospitalId);
96 98  
97 99  
98   - Long ycfnum = mongoTemplate.count(patientsQuery.convertToQuery().convertToMongoQuery(), BabyModel.class);
  100 + Long ycfnum = mongoTemplate.count(patientsQuery.convertToQuery().convertToMongoQuery(), Patients.class);
99 101 jobModel.setYcfnum(String.valueOf(ycfnum));
100 102  
101 103 patientsQuery.setBuildDaysEnd((13) * 7 - 1);
102   - Long zynum = mongoTemplate.count(patientsQuery.convertToQuery().convertToMongoQuery(), BabyModel.class);
  104 + Long zynum = mongoTemplate.count(patientsQuery.convertToQuery().convertToMongoQuery(), Patients.class);
103 105 jobModel.setZynum(String.valueOf(zynum));
104 106  
105 107  
... ... @@ -132,6 +134,7 @@
132 134 trencyJobModel.setHappentime(DateUtil.getyyyy_MM_dd(new Date()));
133 135  
134 136 String json1 = JsonUtil.obj2Str(trencyJobModel);
  137 +
135 138 sendSyncData(json1,URL+"lhfy/saveTrency");
136 139 }
137 140  
138 141  
... ... @@ -144,10 +147,8 @@
144 147 }
145 148 query.setCheckDateStart(start);
146 149 query.setCheckDateEnd(end);
147   - System.out.println("syncBabyCheck query = "+query.convertToQuery());
148   -
149 150 List<BabyCheckModel> checkModels = babyCheckService.queryBabyCheckRecord(query);
150   - System.out.println(checkModels.size());
  151 + System.out.println("BabyCheckModel==="+checkModels.size());
151 152 List<McChildhealthChildren> childhealthChildrens = new ArrayList<>();
152 153 if (CollectionUtils.isNotEmpty(checkModels)) {
153 154 for (BabyCheckModel checkModel : checkModels) {
... ... @@ -311,7 +312,7 @@
311 312 criteria.and("checkTime").gte(start).lt(end);
312 313  
313 314 List<NewbornVisit> newbornVisits = mongoTemplate.find(new Query(criteria), NewbornVisit.class);
314   - System.out.println(newbornVisits.size());
  315 + System.out.println("NewbornVisit==="+newbornVisits.size());
315 316 List<McChildhealthNeonate> mcChildhealthNeonates = new ArrayList<>();
316 317 if (CollectionUtils.isNotEmpty(newbornVisits)) {
317 318 for (NewbornVisit visit : newbornVisits) {
... ... @@ -389,6 +390,7 @@
389 390 neonate.setSpine_desc_gb(visit.getSpine());
390 391 try{
391 392 neonate.setInput_organ(organizationService.getOrganizationName(visit.getHospitalId()));
  393 + neonate.setCreateorg(organizationService.getOrganizationName(visit.getHospitalId()));
392 394 neonate.setInput_man_gb(usersService.getUsers(Integer.parseInt(visit.getDoctor())).getName());
393 395 }catch (Exception e){}
394 396  
395 397  
396 398  
... ... @@ -408,10 +410,11 @@
408 410 }catch (Exception e){
409 411 neonate.setMidwifery_institutions_gb(babyModel.getDeliverOrg());
410 412 }
  413 + neonate.setRegister_status("0");
411 414  
412   -
413 415 mcChildhealthNeonates.add(neonate);
414 416 String json = JsonUtil.array2JsonString(mcChildhealthNeonates);
  417 + System.out.println(json);
415 418 sendSyncData(json,URL+"lhfy/saveMcChildhealthNeonate");
416 419 mcChildhealthNeonates.clear();
417 420 }
... ... @@ -424,7 +427,7 @@
424 427 Criteria criteria = Criteria.where("hospitalId").is(hospitalId).and("yn").ne("0");
425 428 criteria.and("checkTime").gte(start).lt(end);
426 429 List<PostReviewModel> postReviewModels = mongoTemplate.find(new Query(criteria), PostReviewModel.class);
427   - System.out.println(postReviewModels.size());
  430 + System.out.println("PostReviewModel==="+postReviewModels.size());
428 431 List<McWomanhealth42days> mcWomanhealth42days = new ArrayList<>();
429 432 if (CollectionUtils.isNotEmpty(postReviewModels)) {
430 433 for (PostReviewModel post : postReviewModels) {
... ... @@ -481,6 +484,7 @@
481 484 days.setUpdatetime(DateUtil.getyyyy_MM_dd(post.getModified()));
482 485 days.setHappentime(DateUtil.getyyyy_MM_dd(post.getCheckTime()));
483 486 days.setCreatetime(DateUtil.getyyyy_MM_dd(post.getCreated()));
  487 + days.setRegister_status("0");
484 488  
485 489 mcWomanhealth42days.add(days);
486 490 String json = JsonUtil.array2JsonString(mcWomanhealth42days);
... ... @@ -498,7 +502,7 @@
498 502 antExRecordQuery.setCheckTimeStart(start);
499 503 antExRecordQuery.setCheckTimeEnd(end);
500 504 List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery);
501   - System.out.println(antExRecordModelList.size());
  505 + System.out.println("AntExRecordModel=="+antExRecordModelList.size());
502 506 List<McWomanhealthAntenatal> mcWomanhealthAntenatals = new ArrayList<>();
503 507 if (CollectionUtils.isNotEmpty(antExRecordModelList)) {
504 508 for (AntExRecordModel antExRecordModel : antExRecordModelList) {
... ... @@ -517,10 +521,18 @@
517 521 antenatal.setHusband_name_gb(patients.getHusbandName());
518 522 antenatal.setHusband_tel_gb(patients.getHusbandPhone());
519 523 antenatal.setHusband_birthday_gb(DateUtil.getyyyy_MM_dd(patients.getHusbandBirth()));
520   - antenatal.setGravidity_gb(chuModel.getPregnancyTimes() == null ? null : String.valueOf(chuModel.getPregnancyTimes()));
521   - antenatal.setParity_gb(chuModel.getProdTime() == null ? null : String.valueOf(chuModel.getProdTime()));
522   - antenatal.setEutocia_gb(chuModel.getDelivery() == null ? null : String.valueOf(chuModel.getDelivery()));
523   - antenatal.setCesarean_gb(chuModel.getPlanedProd() == null ? null : String.valueOf(chuModel.getPlanedProd()));
  524 + try{
  525 + antenatal.setGravidity_gb(chuModel.getPregnancyTimes() == null ? null : String.valueOf(chuModel.getPregnancyTimes()));
  526 + antenatal.setParity_gb(chuModel.getProdTime() == null ? null : String.valueOf(chuModel.getProdTime()));
  527 + antenatal.setEutocia_gb(chuModel.getDelivery() == null ? null : String.valueOf(chuModel.getDelivery()));
  528 + antenatal.setCesarean_gb(chuModel.getPlanedProd() == null ? null : String.valueOf(chuModel.getPlanedProd()));
  529 + antenatal.setAbortion_gb(chuModel.getAbortion() == null ? null : String.valueOf(chuModel.getAbortion()));
  530 + antenatal.setDeath_no_gb(chuModel.getStillChan() == null ? null : String.valueOf(chuModel.getStillChan()));
  531 + antenatal.setStillbirth_gb(chuModel.getStillbirth() == null ? null : String.valueOf(chuModel.getStillbirth()));
  532 + antenatal.setNeonatus_death_gb(chuModel.getNeoDeath() == null ? null : String.valueOf(chuModel.getNeoDeath()));
  533 + antenatal.setDefects_no_gb(chuModel.getBirthDefect() == null ? null : String.valueOf(chuModel.getBirthDefect()));
  534 + }catch (Exception e) {}
  535 +
524 536 antenatal.setLast_menstrual_gb(DateUtil.getyyyy_MM_dd(patients.getLastMenses()));
525 537 //既往史
526 538 String pastHistory = "";
527 539  
528 540  
529 541  
530 542  
... ... @@ -544,49 +556,89 @@
544 556 }
545 557 antenatal.setPersonal_disease_his_other(personalHistory);
546 558  
547   - antenatal.setAbortion_gb(chuModel.getAbortion() == null ? null : String.valueOf(chuModel.getAbortion()));
548   - antenatal.setDeath_no_gb(chuModel.getStillChan() == null ? null : String.valueOf(chuModel.getStillChan()));
549   - antenatal.setStillbirth_gb(chuModel.getStillbirth() == null ? null : String.valueOf(chuModel.getStillbirth()));
550   - antenatal.setNeonatus_death_gb(chuModel.getNeoDeath() == null ? null : String.valueOf(chuModel.getNeoDeath()));
551   - antenatal.setDefects_no_gb(chuModel.getBirthDefect() == null ? null : String.valueOf(chuModel.getBirthDefect()));
552   - antenatal.setBody_height_gb(chuModel.getHeight());
553   - antenatal.setBody_weight_gb(chuModel.getWeight());
  559 + try{
  560 + antenatal.setBody_height_gb(String.valueOf(Integer.parseInt(chuModel.getHeight())));
  561 + }catch (Exception e){}
  562 + try{
  563 + antenatal.setBody_weight_gb(String.valueOf(Integer.parseInt(chuModel.getWeight())));
  564 + }catch (Exception e){}
554 565  
555 566 if(StringUtils.isNotEmpty(chuModel.getBp()))
556 567 {
557   - String ssy = "";
558   - String szy = "";
559   - Map <String, String> chBpMap = JsonUtil.getMap(chuModel.getBp());
560   - if (MapUtils.isNotEmpty(chBpMap)) {
561   - ssy = chBpMap.get("ssy");
562   - szy = chBpMap.get("szy");
563   - }
564   - antenatal.setSbp_gb(ssy);
565   - antenatal.setDbp_gb(szy);
  568 + try{
  569 + String ssy = "";
  570 + String szy = "";
  571 + Map <String, String> chBpMap = JsonUtil.getMap(chuModel.getBp());
  572 + if (MapUtils.isNotEmpty(chBpMap)) {
  573 + ssy = chBpMap.get("ssy");
  574 + szy = chBpMap.get("szy");
  575 + Integer.parseInt(ssy);
  576 + Integer.parseInt(szy);
  577 + antenatal.setSbp_gb(ssy);
  578 + antenatal.setDbp_gb(szy);
  579 + }
  580 + }catch (Exception e){}
566 581 }
567 582  
568 583  
569   - antenatal.setFundus_uterus_gb(chuModel.getGonggao());
570   - antenatal.setAbdomen_circumference_gb(chuModel.getFuwei());
571   - antenatal.setHaematoglobin_gb(chuModel.getXhdb());
572   - antenatal.setWbc_count_gb(chuModel.getBxbjs());
573   - antenatal.setBlood_platelet_gb(chuModel.getPlatelet());
574   - antenatal.setBlood_platelet_gb(chuModel.getPlatelet());
  584 + try{
  585 + antenatal.setFundus_uterus_gb(String.valueOf(Integer.parseInt(chuModel.getGonggao())));
  586 + }catch (Exception e){}
  587 +
  588 + try{
  589 + antenatal.setAbdomen_circumference_gb(String.valueOf(Integer.parseInt(chuModel.getFuwei())));
  590 + }catch (Exception e){}
  591 +
  592 + try{
  593 + antenatal.setHaematoglobin_gb(String.valueOf(Integer.parseInt(chuModel.getXhdb())));
  594 + }catch (Exception e){}
  595 + try{
  596 + antenatal.setWbc_count_gb(String.valueOf(Integer.parseInt(chuModel.getBxbjs())));
  597 + }catch (Exception e){}
  598 + try{
  599 + antenatal.setBlood_platelet_gb(String.valueOf(Integer.parseInt(chuModel.getPlatelet())));
  600 + }catch (Exception e){}
575 601 antenatal.setBlood_other(chuModel.getChgOther());
576   - antenatal.setUrine_protein_quantify_gb(chuModel.getNdb());
577   - antenatal.setUrine_glucose_quantify_gb(chuModel.getNt());
  602 +
  603 + try{
  604 + antenatal.setUrine_protein_quantify_gb(String.valueOf(Integer.parseInt(chuModel.getNdb())));
  605 + }catch (Exception e){}
  606 +
  607 + try{
  608 + antenatal.setUrine_glucose_quantify_gb(String.valueOf(Integer.parseInt(chuModel.getNt())));
  609 + }catch (Exception e){}
578 610 antenatal.setUrine_acetone_value_gb(chuModel.getUrineKetone());
579 611 antenatal.setUrine_occult_blood_gb(chuModel.getBld());
580 612 antenatal.setUrine_routine_other(chuModel.getNcgOther());
581 613 antenatal.setUrine_routine_other(chuModel.getNcgOther());
582   - antenatal.setGlu_gb(chuModel.getBloodSugar());
583   - antenatal.setAlt_gb(chuModel.getXqgbzam());
584   - antenatal.setAst_gb(chuModel.getXqgczam());
585   - antenatal.setAlb_gb(chuModel.getAlbumin());
586   - antenatal.setTotal_bilirubin_gb(chuModel.getTotalBilirubin());
587   - antenatal.setHemobilirubin_value_gb(chuModel.getJhBilirubin());
588   - antenatal.setHematuresis_gb(chuModel.getXnsd());
589   - antenatal.setCrea_gb(chuModel.getXqjq());
  614 + try{
  615 + antenatal.setGlu_gb(String.valueOf(Integer.parseInt(chuModel.getBloodSugar())));
  616 + }catch (Exception e){}
  617 + try{
  618 + antenatal.setAlt_gb(String.valueOf(Integer.parseInt(chuModel.getXqgbzam())));
  619 + }catch (Exception e){}
  620 + try{
  621 + antenatal.setAst_gb(String.valueOf(Integer.parseInt(chuModel.getXqgczam())));
  622 + }catch (Exception e){}
  623 + try{
  624 + antenatal.setAlb_gb(String.valueOf(Integer.parseInt(chuModel.getAlbumin())));
  625 + }catch (Exception e){}
  626 + try{
  627 + antenatal.setTotal_bilirubin_gb(String.valueOf(Integer.parseInt(chuModel.getTotalBilirubin())));
  628 + }catch (Exception e){}
  629 + try{
  630 + antenatal.setHemobilirubin_value_gb(String.valueOf(Integer.parseInt(chuModel.getJhBilirubin())));
  631 + }catch (Exception e){}
  632 +
  633 + try{
  634 + antenatal.setHematuresis_gb(String.valueOf(Integer.parseInt(chuModel.getXnsd())));
  635 + }catch (Exception e){}
  636 +
  637 + try{
  638 + antenatal.setCrea_gb(String.valueOf(Integer.parseInt(chuModel.getXqjq())));
  639 + }catch (Exception e){}
  640 +
  641 +
590 642 antenatal.setType_b_ultrasonic_gb(chuModel.getbChao());
591 643 antenatal.setMaternal_health_guide_gb(chuModel.getDirOpinion());
592 644 try{
... ... @@ -619,15 +671,18 @@
619 671  
620 672 if(StringUtils.isNotEmpty(examinationModel.getBp()))
621 673 {
622   - String ssy = "";
623   - String szy = "";
624   - Map <String, String> chBpMap = JsonUtil.getMap(chuModel.getBp());
625   - if (MapUtils.isNotEmpty(chBpMap)) {
626   - ssy = chBpMap.get("ssy");
627   - szy = chBpMap.get("szy");
628   - }
629   - antenatal.setSbp_gb(ssy);
630   - antenatal.setDbp_gb(szy);
  674 + try {
  675 +
  676 + Map <String, String> chBpMap = JsonUtil.getMap(examinationModel.getBp());
  677 + if (MapUtils.isNotEmpty(chBpMap)) {
  678 + String ssy = chBpMap.get("ssy");
  679 + String szy = chBpMap.get("szy");
  680 + Integer.parseInt(ssy);
  681 + Integer.parseInt(szy);
  682 + antenatal.setSbp_gb(ssy);
  683 + antenatal.setDbp_gb(szy);
  684 + }
  685 + }catch (Exception e){}
631 686 }
632 687  
633 688 antenatal.setPatients_report_gb(examinationModel.getChiefComplaint());
... ... @@ -646,6 +701,7 @@
646 701 }
647 702 }
648 703  
  704 + antenatal.setRegister_status("0");
649 705 mcWomanhealthAntenatals.add(antenatal);
650 706 String json = JsonUtil.array2JsonString(mcWomanhealthAntenatals);
651 707 sendSyncData(json,URL+"lhfy/saveMcWomanhealthAntenatal");
... ... @@ -673,7 +729,7 @@
673 729 Criteria criteria = Criteria.where("visitDoctor").in(uids);
674 730 criteria.and("createDate").gte(start).lt(end);
675 731 List<MatdeliverFollowModel> followModels = mongoTemplate.find(new Query(criteria), MatdeliverFollowModel.class);
676   - System.out.println(followModels.size());
  732 + System.out.println("MatdeliverFollowModel=="+followModels.size());
677 733 List<McWomanhealthPostpartum> mcWomanhealthPostpartums = new ArrayList<>();
678 734 if (CollectionUtils.isNotEmpty(followModels)) {
679 735 PatientsQuery query = new PatientsQuery();
... ... @@ -720,7 +776,7 @@
720 776 }
721 777 postpartum.setHealth_desc_gb(followModel.getFitnessDesc());
722 778 postpartum.setMaternal_psychology_gb(followModel.getMentalityDesc());
723   - postpartum.setBreast(followModel.getBreast() == null ? null : String.valueOf(followModel.getBp()));
  779 + postpartum.setBreast(followModel.getBreast() == null ? null : String.valueOf(followModel.getBreast()));
724 780 postpartum.setLyma_gb(followModel.getLochia() == null ? null : String.valueOf(followModel.getLochia()));
725 781  
726 782  
... ... @@ -735,7 +791,7 @@
735 791 postpartum.setUpdatetime(DateUtil.getyyyy_MM_dd(followModel.getUpdateDate()));
736 792 postpartum.setHappentime(DateUtil.getyyyy_MM_dd(followModel.getVisitDate()));
737 793 postpartum.setCreatetime(DateUtil.getyyyy_MM_dd(followModel.getCreateDate()));
738   -
  794 + postpartum.setRegister_status("0");
739 795 mcWomanhealthPostpartums.add(postpartum);
740 796 String json = JsonUtil.array2JsonString(mcWomanhealthPostpartums);
741 797 sendSyncData(json,URL+"lhfy/saveMcWomanhealthPostpartum");
... ... @@ -747,8 +803,13 @@
747 803  
748 804 public void sendSyncData(String json,String path)
749 805 {
750   - String result = HttpClientUtil.doPostSSL(path,json);
751   - System.out.println("path = "+ path+ " ,sendSyncData result = "+ result);
  806 +// String result = HttpClientUtil.doPostSSL(path,json);
  807 + System.out.println(json);
  808 +// if (!"success".equals(result))
  809 +// {
  810 +// ExceptionUtils.catchException("syncLhxfyzjk="+json);
  811 +// }
  812 +// System.out.println("path = "+ path+ " ,sendSyncData result = "+ result);
752 813 }
753 814 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java View file @ eca83f8
... ... @@ -5019,6 +5019,15 @@
5019 5019  
5020 5020  
5021 5021  
  5022 + @RequestMapping(value = "/syncEtycf", method = RequestMethod.GET)
  5023 + @ResponseBody
  5024 + public void syncEtycf(@RequestParam(required = false) String hospitalId
  5025 + ) {
  5026 +
  5027 + lhxfyZjkService.syncEtycf(hospitalId);
  5028 + }
  5029 +
  5030 +
5022 5031 @RequestMapping(value = "/syncMcChildhealthChildren", method = RequestMethod.GET)
5023 5032 @ResponseBody
5024 5033 public void syncMcChildhealthChildren(@RequestParam(required = false) String hospitalId,
... ... @@ -5071,6 +5080,26 @@
5071 5080 Date start1 = DateUtil.getDayFirstSecond(DateUtil.parseYMD(start));
5072 5081 Date end1 = DateUtil.getDayLastSecond(DateUtil.parseYMD(end));
5073 5082 lhxfyZjkService.syncMcWomanhealthAntenatal(hospitalId,start1,end1);
  5083 + }
  5084 +
  5085 + @RequestMapping(value = "/syncLhfyzjkAll", method = RequestMethod.GET)
  5086 + @ResponseBody
  5087 + public void syncLhfyzjkAll(@RequestParam(required = false) String hospitalId,
  5088 + @RequestParam(required = false) String startStr) {
  5089 + lhxfyZjkService.syncEtycf(hospitalId);
  5090 + Date start = DateUtil.parseYMDHMS(startStr);
  5091 + for (int i = 1 ; i <= 7 ; i++)
  5092 + {
  5093 + Date end = DateUtil.addYear(start,1);
  5094 + lhxfyZjkService.syncMcChildhealthChildren(hospitalId, start, end);
  5095 + lhxfyZjkService.syncChildhealthNeonate(hospitalId, start, end);
  5096 + lhxfyZjkService.syncMcWomanhealth42days(hospitalId, start, end);
  5097 + lhxfyZjkService.syncMcWomanhealthPostpartum(hospitalId, start, end);
  5098 + lhxfyZjkService.syncMcWomanhealthAntenatal(hospitalId, start, end);
  5099 + start = end;
  5100 + }
  5101 +
  5102 +
5074 5103 }
5075 5104 }