|
@ -1006,10 +1006,7 @@ public class StatisticsService {
|
|
|
arrTmp.put("patientLabelList", labelArr);
|
|
|
res.put("patientLabelStatistic", arrTmp);
|
|
|
|
|
|
//能力评估 从签约时服务标签取
|
|
|
res.put("levelList", capacityAssessment(null, null, null));
|
|
|
|
|
|
//居民健康标签
|
|
|
//居民类型标签
|
|
|
list = elasticsearchUtil.findDateAllQuotaLevel1(endDate, endDate, area, level, "56", SaveModel.timeLevel_DDL, null, null, "2");
|
|
|
labelArr = new JSONArray();
|
|
|
total = 0l;
|
|
@ -1033,8 +1030,6 @@ public class StatisticsService {
|
|
|
arrTmp.put("patientLabelList", labelArr);
|
|
|
res.put("olderLabelStatistic", arrTmp);
|
|
|
|
|
|
|
|
|
|
|
|
//年龄分布 50
|
|
|
// ageList = elasticsearchUtil.findDateAllQuotaLevel1(endDate, endDate, area, level, "50", SaveModel.timeLevel_DDL,null,null,"2");
|
|
|
List<SaveModel> ageList = elasticsearchUtil.findDateAllQuotaLevel1(endDate, endDate, area, level, "50", SaveModel.timeLevel_DDL, null, null, "2");
|
|
@ -1834,7 +1829,7 @@ public class StatisticsService {
|
|
|
} else {
|
|
|
//老人
|
|
|
//能力评估 从签约时服务标签取
|
|
|
res.put("levelList", cloudCareForTheElderly(null, null, null));
|
|
|
res.put("levelList", cloudCareForTheElderly(endDate, area, level));
|
|
|
|
|
|
//居民健康标签
|
|
|
List<SaveModel> list = elasticsearchUtil.findDateAllQuotaLevel1(endDate, endDate, area, level, "47", SaveModel.timeLevel_DDL, null, null, "2");
|
|
@ -1926,36 +1921,20 @@ public class StatisticsService {
|
|
|
|
|
|
/*大屏 老人云照护 评估*/
|
|
|
public JSONArray cloudCareForTheElderly(String endDate, String area, Integer level) throws Exception {
|
|
|
//评估类型
|
|
|
String filter = "";
|
|
|
String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_child' or dict_name = 'jkzl_older' ";
|
|
|
List<Map<String, Object>> listtmp = jdbcTemplate.queryForList(sqltmp);
|
|
|
if (listtmp.size() > 0) {
|
|
|
String orgCodes = String.valueOf(listtmp.get(0).get("orgCodes"));
|
|
|
if (StringUtils.isNotBlank(orgCodes)) {
|
|
|
orgCodes = orgCodes.replaceAll(",", "','");
|
|
|
filter = " and lab.patient not in ('" + orgCodes + "')";
|
|
|
}
|
|
|
}
|
|
|
//居民类型标签
|
|
|
List<SaveModel> list = elasticsearchUtil.findDateAllQuotaLevel1(endDate, endDate, area, level, "56", SaveModel.timeLevel_DDL, null, null, "2");
|
|
|
SaveModel saveModel3 = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, "56", SaveModel.timeLevel_DDL);
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
String sql = " select dict.dict_code,dict_value,count(DISTINCT A.patient) total from wlyy_hospital_sys_dict dict \n" +
|
|
|
" LEFT JOIN (select distinct lab.patient,lab.label_code from wlyy_patient_label lab INNER JOIN base_patient p on p.id = lab.patient AND lab.label_type='3' " +
|
|
|
filter + " \n" +
|
|
|
")A on dict.dict_code = A.label_code " +
|
|
|
"where dict.dict_name='older_label' and dict.dict_code is not null and dict_code <= 7 \n" +
|
|
|
" GROUP BY dict.dict_code; ";
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
|
|
|
String older = " select count(distinct lab.patient) from wlyy_patient_label lab INNER JOIN base_patient p on p.id = lab.patient AND lab.label_type='1' " + filter;
|
|
|
Integer count = jdbcTemplate.queryForObject(older, Integer.class);
|
|
|
|
|
|
for (Map<String, Object> map : list) {
|
|
|
Long total = saveModel3.getResult1().longValue();
|
|
|
DecimalFormat df = new DecimalFormat("0.00");
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
SaveModel saveModel = list.get(i);
|
|
|
JSONObject json = new JSONObject();
|
|
|
DecimalFormat df = new DecimalFormat("0.00");
|
|
|
json.put("rate", df.format((Integer.parseInt(map.get("total").toString()) * 1.00) / count * 100));
|
|
|
json.put("num", map.get("total"));
|
|
|
json.put("code", map.get("dict_code").toString());
|
|
|
json.put("name", map.get("dict_value").toString());
|
|
|
json.put("num", saveModel.getResult2().longValue());
|
|
|
json.put("code", saveModel.getSlaveKey1());
|
|
|
json.put("name", saveModel.getSlaveKey1Name());
|
|
|
json.put("rate", df.format((saveModel.getResult2().longValue() * 1.00) / total * 100));
|
|
|
total += saveModel.getResult2().longValue();
|
|
|
jsonArray.add(json);
|
|
|
}
|
|
|
return jsonArray;
|