Commit bc453eaff1e5e71da69c2cdf04d4e610616c0a76
1 parent
ddf437b899
Exists in
master
and in
6 other branches
产筛统计报表
Showing 8 changed files with 205 additions and 10 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/DiagnosisService.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/SieveService.java
- platform-dal/src/main/java/com/lyms/platform/query/DiagnosisQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/SieveQuery.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/rcfy/RcGlxtService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SieveController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SieveFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/CqSieveQueryRequest.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/DiagnosisService.java
View file @
bc453ea
... | ... | @@ -30,6 +30,11 @@ |
30 | 30 | return diagnosisDao.queryDiagnosis(query.addOrder(Sort.Direction.DESC, "created")); |
31 | 31 | } |
32 | 32 | |
33 | + public int queryDiagnosisCount(DiagnosisQuery diagnosisQuery){ | |
34 | + MongoQuery query = diagnosisQuery.convertToQuery(); | |
35 | + return diagnosisDao.queryDiagnosisCount(query); | |
36 | + } | |
37 | + | |
33 | 38 | public DiagnosisModel findOneDiagnosisById(String id){ |
34 | 39 | return diagnosisDao.findOneDiagnosisById(id); |
35 | 40 | } |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/SieveService.java
View file @
bc453ea
... | ... | @@ -78,6 +78,10 @@ |
78 | 78 | return iSieveDao.queryList(mongoQuery.addOrder(Sort.Direction.DESC, "modified")); |
79 | 79 | } |
80 | 80 | |
81 | + public int queryListCount(SieveQuery sieveQuery) { | |
82 | + return (int) iSieveDao.count(sieveQuery.convertToQuery()); | |
83 | + } | |
84 | + | |
81 | 85 | public SieveModel findOneById(String id) { |
82 | 86 | return iSieveDao.findOneById(id); |
83 | 87 | } |
platform-dal/src/main/java/com/lyms/platform/query/DiagnosisQuery.java
View file @
bc453ea
... | ... | @@ -25,6 +25,7 @@ |
25 | 25 | private String queryNo;//查询号 |
26 | 26 | private String order;//排序字段 |
27 | 27 | private String hospitalId;//医院ID |
28 | + private List<String> hospitalIds;//医院ID | |
28 | 29 | private String cardNo;//身份证 |
29 | 30 | private String vcCardNo;//就诊卡号 |
30 | 31 | private String diaResult;//诊断结果 |
... | ... | @@ -41,6 +42,14 @@ |
41 | 42 | private String collectHospitalId;//申请医院 |
42 | 43 | private List<String> parentIdList;//孕妇ID集合 |
43 | 44 | |
45 | + public List<String> getHospitalIds() { | |
46 | + return hospitalIds; | |
47 | + } | |
48 | + | |
49 | + public void setHospitalIds(List<String> hospitalIds) { | |
50 | + this.hospitalIds = hospitalIds; | |
51 | + } | |
52 | + | |
44 | 53 | public List<String> getParentIdList() { |
45 | 54 | return parentIdList; |
46 | 55 | } |
... | ... | @@ -229,6 +238,9 @@ |
229 | 238 | MongoCondition condition = MongoCondition.newInstance(); |
230 | 239 | if(null != id){ |
231 | 240 | condition = condition.and("id", id, MongoOper.IS); |
241 | + } | |
242 | + if(null != hospitalIds && hospitalIds.size() > 0){ | |
243 | + condition = condition.and("hospitalId", hospitalIds, MongoOper.IS); | |
232 | 244 | } |
233 | 245 | if(null != parentId){ |
234 | 246 | condition = condition.and("parentId", parentId, MongoOper.IS); |
platform-dal/src/main/java/com/lyms/platform/query/SieveQuery.java
View file @
bc453ea
... | ... | @@ -20,6 +20,7 @@ |
20 | 20 | |
21 | 21 | private String id; |
22 | 22 | private String hospitalId; |
23 | + private List<String> hospitalIds; | |
23 | 24 | //患者id |
24 | 25 | private String parentId; |
25 | 26 | //姓名 |
... | ... | @@ -242,6 +243,14 @@ |
242 | 243 | this.lastMensesStart = lastMensesStart; |
243 | 244 | } |
244 | 245 | |
246 | + public List<String> getHospitalIds() { | |
247 | + return hospitalIds; | |
248 | + } | |
249 | + | |
250 | + public void setHospitalIds(List<String> hospitalIds) { | |
251 | + this.hospitalIds = hospitalIds; | |
252 | + } | |
253 | + | |
245 | 254 | @Override |
246 | 255 | public MongoQuery convertToQuery() { |
247 | 256 | MongoCondition condition = MongoCondition.newInstance(); |
... | ... | @@ -256,6 +265,10 @@ |
256 | 265 | } |
257 | 266 | if (null != hospitalId) { |
258 | 267 | condition = condition.and("hospitalId", hospitalId, MongoOper.IS); |
268 | + } | |
269 | + | |
270 | + if (null != hospitalIds && hospitalIds.size() > 0) { | |
271 | + condition = condition.and("hospitalId", hospitalIds, MongoOper.IN); | |
259 | 272 | } |
260 | 273 | |
261 | 274 | if (null != sieveHospitalId) { |
platform-operate-api/src/main/java/com/lyms/hospitalapi/rcfy/RcGlxtService.java
View file @
bc453ea
... | ... | @@ -236,7 +236,7 @@ |
236 | 236 | result+= model.getHivktSelect().equals("1") ? "(初诊结果)" : "(已确诊)"; |
237 | 237 | } |
238 | 238 | ps.setString(10, result); |
239 | - ps.setString(11, CommonsHelper.getHospitalName(model.getHospitalId(), organizationService)); | |
239 | + ps.setString(11, hospitalsMap.get(model.getHospitalId())); | |
240 | 240 | ps.setString(12, StringUtils.isNum(model.getProdDoctor()) ? CommonsHelper.getUserName(model.getProdDoctor(), usersService) : model.getProdDoctor()); |
241 | 241 | ps.setString(13, CommonsHelper.getUserName(model.getOperator()+"", usersService)); |
242 | 242 | ps.setTimestamp(14, new Timestamp(model.getCreated().getTime())); |
... | ... | @@ -612,7 +612,7 @@ |
612 | 612 | ps.setString(13, null); |
613 | 613 | ps.setString(14, highScoreResult.gethighRiskStr()); |
614 | 614 | ps.setString(15, null); |
615 | - ps.setString(16, null); | |
615 | + ps.setString(16, CommonsHelper.getHospitalName(patients.getHospitalId(), organizationService)); | |
616 | 616 | ps.setString(17, null); |
617 | 617 | ps.setString(18, null); |
618 | 618 | ps.setString(19, null); |
... | ... | @@ -733,7 +733,7 @@ |
733 | 733 | ps.setString(5, StringUtils.isNum(model.getOperatorId()) ? CommonsHelper.getUserName(model.getOperatorId(), usersService) : model.getOperatorId()); |
734 | 734 | |
735 | 735 | |
736 | - ps.setString(6, CommonsHelper.getHospitalName(model.getHospitalId(), organizationService)); | |
736 | + ps.setString(6, hospitalsMap.get(model.getHospitalId())); | |
737 | 737 | ps.setString(7,resident.getUsername()); |
738 | 738 | ps.setTimestamp(8, new Timestamp(model.getDrawTime().getTime())); |
739 | 739 | ps.setString(9, StringUtils.isNum(model.getOperatorId()) ? CommonsHelper.getUserName(model.getOperatorId(), usersService) : model.getOperatorId()); |
... | ... | @@ -972,8 +972,8 @@ |
972 | 972 | //孕妇分娩信息 |
973 | 973 | String fmInfoSql = "insert into NEW_BORN_INFO(ID,PUERPERANT_ID,PUERPERANT_NAME,PUERPERANT_ID_CARD,CHILD_NAME,GENDER,BIRTH_TIME,BIRTH_HEIGHT," + |
974 | 974 | "BIRTH_GEST_WEEKS,BIRTH_WEIGHT,APGAR_SCORE,WEAKNESS,HOSPITAL,MIDWIFE_DOCTOR,PREGNANT_ADDRESS," + |
975 | - "CREATE_TIME,UPDATE_TIME) " + | |
976 | - " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; | |
975 | + "CREATE_TIME,UPDATE_TIME,SIGN_ORG_NAME) " + | |
976 | + " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; | |
977 | 977 | ps = conn.prepareStatement(fmInfoSql); |
978 | 978 | ps.setString(1,baby.getId() == null ? StringUtils.uuid() : baby.getId()); |
979 | 979 | ps.setString(2,model.getId()); |
... | ... | @@ -1002,7 +1002,7 @@ |
1002 | 1002 | } |
1003 | 1003 | ps.setString(11,p1Score == null ? null : p1Score); |
1004 | 1004 | ps.setString(12,null);//缺陷 |
1005 | - ps.setString(13, CommonsHelper.getHospitalName(model.getFmHospital(), organizationService)); | |
1005 | + ps.setString(13, hospitalsMap.get(model.getFmHospital())); | |
1006 | 1006 | ps.setString(14, CommonsHelper.getUserName(model.getDeliverDoctor(), usersService)); |
1007 | 1007 | String postAddress = CommonsHelper.getResidence(patients.getProvincePostRestId(), patients.getCityPostRestId(), |
1008 | 1008 | patients.getAreaPostRestId(), patients.getStreetPostRestId(), patients.getAddressPostRest(), basicConfigService); |
... | ... | @@ -1010,6 +1010,7 @@ |
1010 | 1010 | |
1011 | 1011 | ps.setTimestamp(16, new Timestamp(model.getCreated().getTime())); |
1012 | 1012 | ps.setTimestamp(17, new Timestamp(model.getModified().getTime())); |
1013 | + ps.setString(18, CommonsHelper.getHospitalName(model.getFmHospital(), organizationService)); | |
1013 | 1014 | |
1014 | 1015 | int saveRcNewBabyInfoCount = ps.executeUpdate(); |
1015 | 1016 | System.out.println("saveRcNewBabyInfo="+saveRcNewBabyInfoCount); |
... | ... | @@ -1138,7 +1139,7 @@ |
1138 | 1139 | |
1139 | 1140 | |
1140 | 1141 | ps.setString(11, StringUtils.isNum(model.getDeliverDoctor()) ? CommonsHelper.getUserName(model.getDeliverDoctor(), usersService) : model.getDeliverDoctor()); |
1141 | - ps.setString(12, CommonsHelper.getHospitalName(model.getFmHospital(), organizationService)); | |
1142 | + ps.setString(12, hospitalsMap.get(model.getFmHospital())); | |
1142 | 1143 | ps.setString(13, CommonsHelper.getUserName(model.getDeliverDoctor(), usersService)); |
1143 | 1144 | |
1144 | 1145 | ps.setTimestamp(14, new Timestamp(model.getCreated().getTime())); |
... | ... | @@ -1183,8 +1184,8 @@ |
1183 | 1184 | "REGISTER_ADDRESS, REGISTER_PROVINCE,REGISTER_CITY,REGISTER_COUNTRY,REGISTER_TOWN,REGISTER_HOURCE_NO," + |
1184 | 1185 | "BIRTH_DATE,CONTACT_NAME,CONTACT_TEL_NO,HUSBAND_NAME,HUSBAND_ID_CARD,HUSBAND_TEL,HUSBAND_CERTIFICATE_TYPE," + |
1185 | 1186 | "HUSBAND_CERTIFICATE_NO,HUSBAND_RESIDENCE_ADDRESS,HUSBAND_COMPANY," + |
1186 | - "STATUS,DATA_FROM_HOSPITAL,CREATE_TIME,UPDATE_TIME,OPERATOR,OPERAT_TIME,HEALTH_RECORD,TELPHONE) " + | |
1187 | - " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; | |
1187 | + "STATUS,DATA_FROM_HOSPITAL,CREATE_TIME,UPDATE_TIME,OPERATOR,OPERAT_TIME,HEALTH_RECORD,TELPHONE,BELONG_HOSPITAL) " + | |
1188 | + " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; | |
1188 | 1189 | ps = conn.prepareStatement(baseInfoSql); |
1189 | 1190 | ps.setString(1,patients.getId()); |
1190 | 1191 | ps.setString(2,patients.getUsername()); |
... | ... | @@ -1301,7 +1302,7 @@ |
1301 | 1302 | } |
1302 | 1303 | |
1303 | 1304 | ps.setString(30, status); |
1304 | - ps.setString(31, CommonsHelper.getHospitalName(patients.getHospitalId(), organizationService)); | |
1305 | + ps.setString(31, hospitalsMap.get(patients.getHospitalId())); | |
1305 | 1306 | |
1306 | 1307 | ps.setTimestamp(32, new Timestamp(patients.getCreated().getTime())); |
1307 | 1308 | ps.setTimestamp(33, patients.getModified() == null ? new Timestamp(patients.getCreated().getTime()) : new Timestamp(patients.getModified().getTime())); |
... | ... | @@ -1309,6 +1310,7 @@ |
1309 | 1310 | ps.setTimestamp(35, new Timestamp(patients.getCreated().getTime())); |
1310 | 1311 | ps.setString(36, patients.getFileCode()); |
1311 | 1312 | ps.setString(37, patients.getPhone()); |
1313 | + ps.setString(38, hospitalsMap.get(patients.getHospitalId())); | |
1312 | 1314 | int saveCount = ps.executeUpdate(); |
1313 | 1315 | System.out.println("saveCount="+saveCount); |
1314 | 1316 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SieveController.java
View file @
bc453ea
... | ... | @@ -273,5 +273,21 @@ |
273 | 273 | public BaseResponse saveCqRemark(@RequestParam(required = true)String cqId,@RequestParam(required = false)String csRemarkTypeId,@RequestParam(required = false)String detail) { |
274 | 274 | return sieveFacade.saveCqRemark(cqId,csRemarkTypeId,detail); |
275 | 275 | } |
276 | + | |
277 | + | |
278 | + /** | |
279 | + * 区域产前诊断及新生儿疾病筛查统计报表 | |
280 | + * @param cqSieveQueryRequest | |
281 | + * @param request | |
282 | + * @param response | |
283 | + */ | |
284 | + @ResponseBody | |
285 | + @RequestMapping(value = "/queryCqsievesReport",method = RequestMethod.GET) | |
286 | + @TokenRequired | |
287 | + public BaseResponse queryCqsievesReport(@Valid CqSieveQueryRequest cqSieveQueryRequest,HttpServletRequest request,HttpServletResponse response){ | |
288 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
289 | + return sieveFacade.queryCqsievesReport(cqSieveQueryRequest, loginState.getId()); | |
290 | + } | |
291 | + | |
276 | 292 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SieveFacade.java
View file @
bc453ea
... | ... | @@ -1108,5 +1108,100 @@ |
1108 | 1108 | } |
1109 | 1109 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
1110 | 1110 | } |
1111 | + | |
1112 | + public BaseResponse queryCqsievesReport(CqSieveQueryRequest cqSieveQueryRequest, Integer userId) { | |
1113 | + //获取用户权限医院和筛选条件的交集 | |
1114 | + List<String> currentUserHospPermissions = areaCountFacade.getCurrentUserHospPermissions(userId, cqSieveQueryRequest.getProvinceId(), | |
1115 | + cqSieveQueryRequest.getCityId(), cqSieveQueryRequest.getAreaId()); | |
1116 | + | |
1117 | + | |
1118 | + BasicConfigQuery basicQuery = new BasicConfigQuery(); | |
1119 | + basicQuery.setYn(YnEnums.YES.getId()); | |
1120 | + basicQuery.setTypeId("b7ea005c-dfac-4c2a-bdae-25239b3f44fd"); | |
1121 | + | |
1122 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(cqSieveQueryRequest.getProvinceId())) { | |
1123 | + basicQuery.setParentId(cqSieveQueryRequest.getProvinceId()); | |
1124 | + } | |
1125 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(cqSieveQueryRequest.getCityId())) { | |
1126 | + basicQuery.setParentId(cqSieveQueryRequest.getCityId()); | |
1127 | + } | |
1128 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(cqSieveQueryRequest.getAreaId())) { | |
1129 | + basicQuery.setParentId(cqSieveQueryRequest.getAreaId()); | |
1130 | + } | |
1131 | + | |
1132 | + //x轴标题数据 | |
1133 | + List<String> xAxis = new ArrayList<>(); | |
1134 | + | |
1135 | + //获取地址列表 | |
1136 | + List<BasicConfig> configList = basicConfigService.queryBasicConfig(basicQuery); | |
1137 | + | |
1138 | + if (CollectionUtils.isNotEmpty(configList)) { | |
1139 | + for (BasicConfig addr : configList) { | |
1140 | + xAxis.add(addr.getName()); | |
1141 | + } | |
1142 | + } | |
1143 | + | |
1144 | + //分类标题 | |
1145 | + List<String> titleItems = new LinkedList<>(); | |
1146 | + titleItems.add("产筛人数"); | |
1147 | + titleItems.add("诊断人数"); | |
1148 | + | |
1149 | + //图标数据 | |
1150 | + List<Map<String, Object>> series = new LinkedList<>(); | |
1151 | + | |
1152 | + SieveQuery sieveQuery = new SieveQuery(); | |
1153 | + sieveQuery.setHospitalIds(currentUserHospPermissions); | |
1154 | + sieveQuery.setYn(YnEnums.YES.getId()); | |
1155 | + sieveQuery.setStatus(3); | |
1156 | + if (StringUtils.isNotEmpty(cqSieveQueryRequest.getTime())) { | |
1157 | + String[] dates = cqSieveQueryRequest.getTime().split(" - "); | |
1158 | + sieveQuery.setResultTimeStart(DateUtil.parseYMD(dates[0])); | |
1159 | + if (dates.length == 2) { | |
1160 | + sieveQuery.setResultTimeEnd(DateUtil.parseYMDHMS(dates[1] + " 23:59:59")); | |
1161 | + } | |
1162 | + } | |
1163 | + | |
1164 | + int sieveFinishCount = sieveService.queryListCount(sieveQuery); | |
1165 | + List<String> csItems = new ArrayList<>(); | |
1166 | + csItems.add(String.valueOf(sieveFinishCount)); | |
1167 | + Map<String, Object> map = new HashMap(); | |
1168 | + map.put("name", "产筛人数"); | |
1169 | + map.put("type", "bar"); | |
1170 | + map.put("data", csItems); | |
1171 | + | |
1172 | + | |
1173 | + DiagnosisQuery diagnosisQuery = new DiagnosisQuery(); | |
1174 | + diagnosisQuery.setHospitalIds(currentUserHospPermissions); | |
1175 | + | |
1176 | + if (StringUtils.isNotEmpty(cqSieveQueryRequest.getTime())) { | |
1177 | + String[] dates = cqSieveQueryRequest.getTime().split(" - "); | |
1178 | + sieveQuery.setResultTimeStart(DateUtil.parseYMD(dates[0])); | |
1179 | + if (dates.length == 2) { | |
1180 | + sieveQuery.setResultTimeEnd(DateUtil.parseYMDHMS(dates[1] + " 23:59:59")); | |
1181 | + } | |
1182 | + } | |
1183 | + | |
1184 | + int diagnosisCount = diagnosisService.queryDiagnosisCount(diagnosisQuery); | |
1185 | + List<String> dItems = new ArrayList<>(); | |
1186 | + csItems.add(String.valueOf(diagnosisCount)); | |
1187 | + Map<String, Object> dMap = new HashMap(); | |
1188 | + map.put("name", "产筛人数"); | |
1189 | + map.put("type", "bar"); | |
1190 | + map.put("data", dItems); | |
1191 | + series.add(dMap); | |
1192 | + | |
1193 | + Map<String, Object> datas = new HashMap<>(); | |
1194 | + datas.put("series", series); | |
1195 | + datas.put("xAxis", xAxis); | |
1196 | + datas.put("legend", titleItems); | |
1197 | + return new BaseObjectResponse() | |
1198 | + .setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(datas); | |
1199 | + } | |
1200 | + | |
1201 | + @Autowired | |
1202 | + private BasicConfigService basicConfigService; | |
1203 | + | |
1204 | + @Autowired | |
1205 | + private AreaCountFacade areaCountFacade; | |
1111 | 1206 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/CqSieveQueryRequest.java
View file @
bc453ea
... | ... | @@ -63,6 +63,54 @@ |
63 | 63 | //标本号 |
64 | 64 | private String number; |
65 | 65 | |
66 | + //省市区地址 | |
67 | + private String provinceId; | |
68 | + private String cityId; | |
69 | + private String areaId; | |
70 | + private String streetId; | |
71 | + | |
72 | + private String time; | |
73 | + | |
74 | + public String getProvinceId() { | |
75 | + return provinceId; | |
76 | + } | |
77 | + | |
78 | + public void setProvinceId(String provinceId) { | |
79 | + this.provinceId = provinceId; | |
80 | + } | |
81 | + | |
82 | + public String getTime() { | |
83 | + return time; | |
84 | + } | |
85 | + | |
86 | + public void setTime(String time) { | |
87 | + this.time = time; | |
88 | + } | |
89 | + | |
90 | + public String getStreetId() { | |
91 | + return streetId; | |
92 | + } | |
93 | + | |
94 | + public void setStreetId(String streetId) { | |
95 | + this.streetId = streetId; | |
96 | + } | |
97 | + | |
98 | + public String getAreaId() { | |
99 | + return areaId; | |
100 | + } | |
101 | + | |
102 | + public void setAreaId(String areaId) { | |
103 | + this.areaId = areaId; | |
104 | + } | |
105 | + | |
106 | + public String getCityId() { | |
107 | + return cityId; | |
108 | + } | |
109 | + | |
110 | + public void setCityId(String cityId) { | |
111 | + this.cityId = cityId; | |
112 | + } | |
113 | + | |
66 | 114 | public String getNumber() { |
67 | 115 | return number; |
68 | 116 | } |