Commit d5cc23922e3dc0f64ce27b4833c8512d7c7cbb7c

Authored by liquanyu
1 parent c4cc3869a0

update code

Showing 3 changed files with 131 additions and 22 deletions

platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java View file @ d5cc239
... ... @@ -882,18 +882,22 @@
882 882 }
883 883  
884 884 public static void main(String[] arg) throws Exception {
885   - Date now = new Date();
886   - Date start = y_m_d_h_m_s.parse("2017-04-30 11:11:11");
887   - Date end = y_m_d_h_m_s.parse("2017-04-30 11:11:11");
888   - System.out.println(isBetween(now, start, end));
889   -
890   - System.out.println(org.apache.commons.lang3.time.DateUtils.addMonths(start ,1).toLocaleString());
891   - long startTime = 1483372800000l;
892   - long endTime = end.getTime();
893   - System.out.println();
894   -
895   - Date d2 = new Date();
896   - System.out.println(isLtOrEq(start, end));
  885 +// Date now = new Date();
  886 +// Date start = y_m_d_h_m_s.parse("2017-04-30 11:11:11");
  887 +// Date end = y_m_d_h_m_s.parse("2017-04-30 11:11:11");
  888 +// System.out.println(isBetween(now, start, end));
  889 +//
  890 +// System.out.println(org.apache.commons.lang3.time.DateUtils.addMonths(start ,1).toLocaleString());
  891 +// long startTime = 1483372800000l;
  892 +// long endTime = end.getTime();
  893 +// System.out.println();
  894 +//
  895 +// Date d2 = new Date();
  896 +// System.out.println(isLtOrEq(start, end));
  897 + String startDate = DateUtil.getyyyy_MM_dd(DateUtil.parseYMD("2017-06-01"))+" 00:00:00";
  898 + String endDate = DateUtil.getyyyy_MM_dd(DateUtil.addDay(DateUtil.parseYMD("2017-06-01"),2))+" 00:00:00";
  899 + System.out.println(startDate);
  900 + System.out.println(endDate);
897 901 }
898 902 }
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyHisService.java View file @ d5cc239
... ... @@ -12,6 +12,8 @@
12 12 import com.lyms.platform.common.utils.DateUtil;
13 13 import com.lyms.platform.common.utils.ExceptionUtils;
14 14 import com.lyms.platform.common.utils.JsonUtil;
  15 +import com.lyms.platform.permission.model.LisReportItemModel;
  16 +import com.lyms.platform.permission.model.LisReportModel;
15 17 import com.lyms.platform.pojo.*;
16 18 import com.lyms.platform.query.LisReportQuery;
17 19 import com.lyms.platform.query.PatientsQuery;
... ... @@ -663,6 +665,78 @@
663 665 DbUtils.closeQuietly(conn);
664 666 e.printStackTrace();
665 667 return result;
  668 + }
  669 + }
  670 + return result;
  671 + }
  672 +
  673 + public List<LisReportModel> queryQhdCheckLisInfo(String vcCardNo,String phone,String titles,String checkTime) {
  674 + System.out.println("checktime = " + checkTime);
  675 + String startDate = DateUtil.getyyyy_MM_dd(DateUtil.parseYMD(checkTime))+" 00:00:00";
  676 + String endDate = DateUtil.getyyyy_MM_dd(DateUtil.addDay(DateUtil.parseYMD(checkTime),2))+" 00:00:00";
  677 +
  678 + List<LisReportModel> result = new ArrayList<>();
  679 + Connection conn = ConnTools.makeLisConnection();
  680 + QueryRunner queryRunner = new QueryRunner(true);
  681 + if (StringUtils.isNotBlank(vcCardNo)) {
  682 +
  683 + try {
  684 + String sql = " SELECT shenqinghao as lisId, "
  685 + + " baogaoleibiemingcheng as title, "
  686 + + " '' as type, "
  687 + + " kahao as vcCardNo, "
  688 + + " huanzhexingming as name, "
  689 + + " zhuyuanhao as bhnum, "
  690 + + " nianling as age, "
  691 + + " xingbie as sex, "
  692 + + " shengqingshijian as applyTime, "
  693 + + " jianchashijian as checkTime, "
  694 + + " baogaofabushijian as publishTime, "
  695 + + " shenqingyishengmingcheng as applyDoctor, "
  696 + + " shenqingkeshimingcheng as applyDept, "
  697 + + " '' as checker, "
  698 + + " baogaofabushijian as modified, "
  699 + + " baogaofabushijian as created, "
  700 + + " phone as phone "
  701 + + " from valllist_ex_en where kahao = '"+vcCardNo+"' "
  702 + + " and baogaofabushijian >= CONVERT(DATETIME,'" + startDate +"', 120) "
  703 + + " and baogaofabushijian <= CONVERT(DATETIME,'" + endDate +"', 120) "
  704 + + " and baogaoleibiemingcheng in "+ titles + " order by baogaofabushijian desc ";
  705 + String subSql = " select "
  706 + + " sheqingdanhao as lisId, "
  707 + + " xiangmudaima as code, "
  708 + + " xiangmumingcheng as name, "
  709 + + " zifujieguo as charResult, "
  710 + + " shuzijieguo as numberResult, "
  711 + + " zifujieguo as result, "
  712 + + " shuzijieguo as resultFlag, "
  713 + + " cankaozhi as ref, "
  714 + + " jieguoleixing as resultType,"
  715 + + " danwei as unit, "
  716 + + " '216' as hospitalId "
  717 + + " from valresult_ex_en "
  718 + + " where sheqingdanhao ='";
  719 + System.out.println("lis sql = " + sql);
  720 + List<LisReportModel> lisReportList = queryRunner.query(conn, sql, new BeanListHandler<LisReportModel>(LisReportModel.class));
  721 + if (CollectionUtils.isNotEmpty(lisReportList)) {
  722 + for (LisReportModel lisReport : lisReportList) {
  723 + if (StringUtils.isNotBlank(lisReport.getLisId())) {
  724 + List<LisReportItemModel> lisReportItemList =
  725 + queryRunner.query(conn, subSql+lisReport.getLisId()+"'",
  726 + new BeanListHandler<LisReportItemModel>(LisReportItemModel.class));
  727 + if (CollectionUtils.isNotEmpty(lisReportItemList)) {
  728 + System.out.println("items = " + lisReportItemList.size());
  729 + lisReport.setItems(lisReportItemList);
  730 + }
  731 + }
  732 + }
  733 + return lisReportList;
  734 + }
  735 + } catch (SQLException e) {
  736 + e.printStackTrace();
  737 + return result;
  738 + }finally {
  739 + DbUtils.closeQuietly(conn);
666 740 }
667 741 }
668 742 return result;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java View file @ d5cc239
... ... @@ -5,6 +5,7 @@
5 5 import com.lyms.hospitalapi.pojo.CheckItemResponse;
6 6 import com.lyms.hospitalapi.pojo.CheckResponse;
7 7 import com.lyms.hospitalapi.pojo.CheckType;
  8 +import com.lyms.hospitalapi.qhdfy.QhdfyHisService;
8 9 import com.lyms.platform.biz.service.*;
9 10 import com.lyms.platform.common.constants.ErrorCodeConstants;
10 11 import com.lyms.platform.common.enums.*;
... ... @@ -57,6 +58,9 @@
57 58 @Qualifier("commonThreadPool")
58 59 private ThreadPoolTaskExecutor commonThreadPool;
59 60  
  61 + @Autowired
  62 + private QhdfyHisService qhdfyHisService;
  63 +
60 64 public static final String HIS_VERSION = PropertiesUtils.getPropertyValue("his_version");
61 65  
62 66 /**
... ... @@ -756,7 +760,15 @@
756 760 query.setTitles(titles);
757 761 query.setHospitalId(hospitalId);
758 762 query.setCheckTime(DateUtil.parseYMD(checkTime));
759   - List<LisReportModel> lises = queryCheckLis(vcCardNo,phone,query);
  763 + List<LisReportModel> lises = null;
  764 + if ("216".equals(hospitalId))
  765 + {
  766 + lises = qhdfyHisService.queryQhdCheckLisInfo(vcCardNo,phone,"('尿常规','[丙]血常规(24项)','血常规(24项)','血细胞分析(末梢)')", checkTime);
  767 + }
  768 + else
  769 + {
  770 + lises = queryCheckLis(vcCardNo,phone,query);
  771 + }
760 772  
761 773 if (CollectionUtils.isNotEmpty(lises))
762 774 {
763 775  
... ... @@ -771,12 +783,17 @@
771 783 map1.put("nt",""); //尿糖
772 784 map1.put("ntt",""); //尿酮体
773 785 map1.put("nqx",""); //尿潜血
774   - String itemJson = model.getItemJson();
775   - List<LisReportItemModel> items = JsonUtil.toList(itemJson,LisReportItemModel.class);
  786 +// String itemJson = model.getItemJson();
  787 +// List<LisReportItemModel> items = JsonUtil.toList(itemJson,LisReportItemModel.class)
  788 + List<LisReportItemModel> items = model.getItems();;
776 789 if (CollectionUtils.isNotEmpty(items))
777 790 {
778 791 for(LisReportItemModel item : items)
779 792 {
  793 + if (item == null)
  794 + {
  795 + continue;
  796 + }
780 797 if ("尿蛋白".equals(item.getName()))
781 798 {
782 799 map1.put("ndb",item.getCharResult() == null ? item.getNumberResult() : item.getCharResult());
783 800  
784 801  
785 802  
786 803  
787 804  
788 805  
789 806  
... ... @@ -794,32 +811,38 @@
794 811 map1.put("nqx",item.getCharResult() == null ? item.getNumberResult() : item.getCharResult());
795 812 }
796 813 }
  814 + map.put("ncg",map1);
797 815 }
798   - map.put("ncg",map1);
  816 +
799 817 }
800   - else if ("[丙]血常规(24项)".equals(model.getTitle()) || "血常规(24项)".equals(model.getTitle()))
  818 + else if ("[丙]血常规(24项)".equals(model.getTitle()) || "血常规(24项)".equals(model.getTitle()) || "血细胞分析(末梢)".equals(model.getTitle()))
801 819 {
802 820 Map<String,String> map1 = new HashMap<>();
803 821 map1.put("xhdb",""); //血红蛋白
804 822 map1.put("bxbjs","");//白细胞计数
805 823 map1.put("xxbjs",""); //血小板计数
806   - String itemJson = model.getItemJson();
807   - List<LisReportItemModel> items = JsonUtil.toList(itemJson,LisReportItemModel.class);
  824 +// String itemJson = model.getItemJson();
  825 +// List<LisReportItemModel> items = JsonUtil.toList(itemJson,LisReportItemModel.class);
  826 + List<LisReportItemModel> items = model.getItems();
808 827 if (CollectionUtils.isNotEmpty(items))
809 828 {
810 829 for(LisReportItemModel item : items)
811 830 {
  831 + if (item == null)
  832 + {
  833 + continue;
  834 + }
812 835 if ("血红蛋白".equals(item.getName()))
813 836 {
814   - map1.put("xhdb",item.getNumberResult());
  837 + map1.put("xhdb",StringUtils.isNotEmpty(item.getResult()) ? item.getResult() : item.getNumberResult());
815 838 }
816 839 else if ("白细胞计数".equals(item.getName()))
817 840 {
818   - map1.put("bxbjs",item.getNumberResult());
  841 + map1.put("bxbjs",StringUtils.isNotEmpty(item.getResult()) ? item.getResult() : item.getNumberResult());
819 842 }
820 843 else if ("血小板计数".equals(item.getName()) || "血小板".equals(item.getName()))
821 844 {
822   - map1.put("xxbjs",item.getNumberResult());
  845 + map1.put("xxbjs",StringUtils.isNotEmpty(item.getResult()) ? item.getResult() : item.getNumberResult());
823 846 }
824 847 }
825 848 }
... ... @@ -841,6 +864,10 @@
841 864 {
842 865 for(LisReportItemModel item : items)
843 866 {
  867 + if (item == null)
  868 + {
  869 + continue;
  870 + }
844 871 if ("尿蛋白".equals(item.getName()))
845 872 {
846 873 map1.put("ndb",item.getCharResult() == null ? item.getNumberResult() : item.getCharResult());
... ... @@ -874,6 +901,10 @@
874 901 {
875 902 for(LisReportItemModel item : items)
876 903 {
  904 + if (item == null)
  905 + {
  906 + continue;
  907 + }
877 908 if ("血红蛋白".equals(item.getName()))
878 909 {
879 910 map1.put("xhdb",item.getNumberResult());