Commit b8c82f59a96ac04be981696c77e019b433349696
1 parent
0525b9faf2
Exists in
master
and in
6 other branches
儿童出院总结
Showing 3 changed files with 71 additions and 61 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/pojo/BabyDischargeDiagnosisModel.java
View file @
b8c82f5
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 | private String blh; |
8 | 8 | |
9 | 9 | //出院日期 |
10 | - private Date cyrq; | |
10 | + private String cyrq; | |
11 | 11 | |
12 | 12 | //姓名 |
13 | 13 | private String hzxm; |
14 | 14 | |
15 | 15 | |
... | ... | @@ -29,14 +29,22 @@ |
29 | 29 | this.blh = blh; |
30 | 30 | } |
31 | 31 | |
32 | - public Date getCyrq() { | |
32 | + public String getCyrq() { | |
33 | 33 | return cyrq; |
34 | 34 | } |
35 | 35 | |
36 | - public void setCyrq(Date cyrq) { | |
36 | + public void setCyrq(String cyrq) { | |
37 | 37 | this.cyrq = cyrq; |
38 | 38 | } |
39 | 39 | |
40 | + public String getBirth() { | |
41 | + return birth; | |
42 | + } | |
43 | + | |
44 | + public void setBirth(String birth) { | |
45 | + this.birth = birth; | |
46 | + } | |
47 | + | |
40 | 48 | public String getHzxm() { |
41 | 49 | return hzxm; |
42 | 50 | } |
... | ... | @@ -53,13 +61,6 @@ |
53 | 61 | this.sex = sex; |
54 | 62 | } |
55 | 63 | |
56 | - public String getBirth() { | |
57 | - return birth; | |
58 | - } | |
59 | - | |
60 | - public void setBirth(String birth) { | |
61 | - this.birth = birth; | |
62 | - } | |
63 | 64 | |
64 | 65 | public String getCyzdmc() { |
65 | 66 | return cyzdmc; |
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyHisService.java
View file @
b8c82f5
... | ... | @@ -6,9 +6,12 @@ |
6 | 6 | import com.lyms.platform.biz.param.AssayConfigQuery; |
7 | 7 | import com.lyms.platform.biz.param.ReferConfigQuery; |
8 | 8 | import com.lyms.platform.biz.service.*; |
9 | +import com.lyms.platform.common.base.PageInfo; | |
10 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
9 | 11 | import com.lyms.platform.common.dao.operator.MongoCondition; |
10 | 12 | import com.lyms.platform.common.dao.operator.MongoOper; |
11 | 13 | import com.lyms.platform.common.enums.YnEnums; |
14 | +import com.lyms.platform.common.result.BaseListResponse; | |
12 | 15 | import com.lyms.platform.common.utils.DateUtil; |
13 | 16 | import com.lyms.platform.common.utils.ExceptionUtils; |
14 | 17 | import com.lyms.platform.common.utils.JsonUtil; |
15 | 18 | |
... | ... | @@ -861,13 +864,15 @@ |
861 | 864 | return map; |
862 | 865 | } |
863 | 866 | |
864 | - public List<Map<String, Object>> getBabyDiacrisis(String startDischargeDate, String endDischargeDate, | |
865 | - String startBirthDate, String endBirthDate, | |
866 | - String hospitalizationNo, String babyName, | |
867 | - String finalDiagnosis, Integer page, Integer limit) { | |
867 | + public BaseListResponse getBabyDiacrisis(String startDischargeDate, String endDischargeDate, | |
868 | + String startBirthDate, String endBirthDate, | |
869 | + String hospitalizationNo, String babyName, | |
870 | + String finalDiagnosis, Integer page, Integer limit) { | |
868 | 871 | List<Map<String, Object>> result = new ArrayList<>(); |
869 | - String startDate = startDischargeDate + " 00:00:00"; | |
870 | - String endDate = endDischargeDate + " 00:00:00"; | |
872 | + String startDate = startDischargeDate + "00:00:00"; | |
873 | + String endDate = endDischargeDate + "00:00:00"; | |
874 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); | |
875 | + PageInfo pageInfo = new PageInfo(); | |
871 | 876 | int startPage = 1; |
872 | 877 | int endlimit = 10; |
873 | 878 | if (null != page && null != limit) { |
874 | 879 | |
875 | 880 | |
876 | 881 | |
877 | 882 | |
878 | 883 | |
879 | 884 | |
880 | 885 | |
... | ... | @@ -914,53 +919,63 @@ |
914 | 919 | } |
915 | 920 | sql = hospitalizationNoSql + babyNameSql + finalDiagnosisSql + dischargeDateSql + birthDateSql; |
916 | 921 | } |
917 | - System.out.println("select * from (select top 99999999 ROW_NUMBER() OVER(ORDER BY lrrq DESC ) " + | |
922 | + String sqls = "select * from (select top 99999999 ROW_NUMBER() OVER(ORDER BY lrrq DESC ) " + | |
918 | 923 | "AS ROWID,blh,cyrq,hzxm,sex,birth,cyzdmc from VW_LYMS_XSE_BRSYK where cyrq is not null " + sql + ") " + |
919 | - "AS TEMP where ROWID BETWEEN " + startPage + " and " + endlimit + " order by ROWID Asc"); | |
924 | + "AS TEMP where ROWID BETWEEN " + startPage + " and " + endlimit + " order by ROWID Asc"; | |
920 | 925 | |
921 | - | |
922 | - /*Map<String, Object> map = new HashMap<>(); | |
923 | - map.put("dischargeDate", "20190524"); | |
924 | - map.put("babyName", "陈晨"); | |
925 | - map.put("sex", "女"); | |
926 | - map.put("birth", "20190404"); | |
927 | - map.put("monthAge", "2月2天"); | |
928 | - map.put("hospitalizationNo", "123456"); | |
929 | - map.put("dischargeDiagnosis", "新生儿肺炎"); | |
930 | - result.add(map);*/ | |
931 | - | |
932 | -// List<BabyDischargeDiagnosisModel> list = queryRunner.query(conn, "select * from (select top 99999999 ROW_NUMBER() OVER(ORDER BY lrrq DESC ) " + | |
933 | -// "AS ROWID,blh,cyrq,hzxm,sex,birth,cyzdmc from VW_LYMS_XSE_BRSYK where cyrq is not null " + sql + ") " + | |
934 | -// "AS TEMP where ROWID BETWEEN " + startPage + " and " + endlimit + " order by ROWID Asc", new BeanListHandler<BabyDischargeDiagnosisModel>(BabyDischargeDiagnosisModel.class)); | |
935 | -// if (list.size() > 0) { | |
936 | -// for (BabyDischargeDiagnosisModel info : list) { | |
937 | -// Map<String, Object> map = new HashMap<>(); | |
938 | -// map.put("dischargeDate", DateUtil.getyyyy_MM_dd(info.getCyrq())); | |
939 | -// map.put("babyName", info.getHzxm()); | |
940 | -// map.put("sex", info.getSex()); | |
941 | -// map.put("birth", info.getBirth()); | |
942 | -// map.put("monthAge", ""); | |
943 | -// map.put("hospitalizationNo", info.getBlh()); | |
944 | -// map.put("dischargeDiagnosis", info.getCyzdmc()); | |
945 | -// result.add(map); | |
946 | -// } | |
947 | -// } | |
948 | -// long end1 = System.currentTimeMillis(); | |
949 | -// System.out.println("times4 = " + (end1 - end)); | |
950 | -// DbUtils.closeQuietly(conn); | |
951 | - } catch ( | |
952 | - Exception e) { | |
926 | + String count = "select top 99999999 ROW_NUMBER() OVER(ORDER BY lrrq DESC ) " + | |
927 | + "AS ROWID,blh,cyrq,hzxm,sex,birth,cyzdmc from VW_LYMS_XSE_BRSYK where cyrq is not null" + sql + " "; | |
928 | + List<BabyDischargeDiagnosisModel> counts = queryRunner.query(conn, count, new BeanListHandler<BabyDischargeDiagnosisModel>(BabyDischargeDiagnosisModel.class)); | |
929 | + pageInfo.setCount(counts.size()); | |
930 | + List<BabyDischargeDiagnosisModel> list = queryRunner.query(conn, sqls, new BeanListHandler<BabyDischargeDiagnosisModel>(BabyDischargeDiagnosisModel.class)); | |
931 | + if (list.size() > 0) { | |
932 | + for (BabyDischargeDiagnosisModel info : list) { | |
933 | + Map<String, Object> map = new HashMap<>(); | |
934 | + try { | |
935 | + if (StringUtils.isNotEmpty(info.getCyrq())) { | |
936 | + Date date = sdf.parse(info.getCyrq()); | |
937 | + map.put("dischargeDate", DateUtil.getyyyy_MM_dd(date)); | |
938 | + } | |
939 | + } catch (Exception e) { | |
940 | + map.put("dischargeDate", ""); | |
941 | + } | |
942 | + try { | |
943 | + if (StringUtils.isNotEmpty(info.getBirth())) { | |
944 | + Date date = sdf.parse(info.getBirth()); | |
945 | + map.put("birth", DateUtil.getyyyy_MM_dd(date)); | |
946 | + map.put("monthAge", DateUtil.getBabyMonthAge(date, new Date())); | |
947 | + } | |
948 | + } catch (Exception e) { | |
949 | + map.put("birth", ""); | |
950 | + } | |
951 | + map.put("babyName", info.getHzxm()); | |
952 | + map.put("sex", info.getSex()); | |
953 | + map.put("hospitalizationNo", info.getBlh()); | |
954 | + map.put("dischargeDiagnosis", info.getCyzdmc()); | |
955 | + result.add(map); | |
956 | + } | |
957 | + } | |
958 | + long end1 = System.currentTimeMillis(); | |
959 | + System.out.println("times4 = " + (end1 - end)); | |
953 | 960 | DbUtils.closeQuietly(conn); |
961 | + } catch (SQLException e) { | |
962 | + DbUtils.closeQuietly(conn); | |
954 | 963 | ExceptionUtils.catchException(e, "qhd his exception "); |
955 | 964 | e.printStackTrace(); |
956 | 965 | |
957 | 966 | } |
958 | - return result; | |
959 | - } | |
960 | 967 | |
961 | - public static void main(String[] args) { | |
968 | + BaseListResponse objectResponse = new BaseListResponse(); | |
969 | + pageInfo.setPage(page); | |
970 | + pageInfo.setLimit(limit); | |
971 | + objectResponse.setPageInfo(pageInfo); | |
972 | + objectResponse.setData(result); | |
973 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
974 | + objectResponse.setErrormsg("成功"); | |
962 | 975 | |
976 | + return objectResponse; | |
963 | 977 | } |
978 | + | |
964 | 979 | |
965 | 980 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
b8c82f5
... | ... | @@ -4037,13 +4037,7 @@ |
4037 | 4037 | String hospitalizationNo, String babyName, |
4038 | 4038 | String finalDiagnosis, Integer page, Integer limit) { |
4039 | 4039 | |
4040 | - List list = qhdfyHisService.getBabyDiacrisis(startDischargeDate, endDischargeDate, startBirthDate, endBirthDate, hospitalizationNo, babyName, finalDiagnosis, page, limit); | |
4041 | - BaseListResponse objectResponse = new BaseListResponse(); | |
4042 | - //objectResponse.setPageInfo(); | |
4043 | - objectResponse.setData(list); | |
4044 | - objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
4045 | - objectResponse.setErrormsg("成功"); | |
4046 | - return objectResponse; | |
4040 | + return qhdfyHisService.getBabyDiacrisis(startDischargeDate, endDischargeDate, startBirthDate, endBirthDate, hospitalizationNo, babyName, finalDiagnosis, page, limit); | |
4047 | 4041 | |
4048 | 4042 | } |
4049 | 4043 |