|
@ -3,6 +3,7 @@ package com.yihu.jw.hospital.module.common.service;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.yihu.jw.wlyy.service.WlyyBusinessService;
|
|
import com.yihu.jw.wlyy.service.WlyyBusinessService;
|
|
|
|
import com.yihu.jw.wlyy.wlyyhttp.WlyyHttpService;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
@ -22,12 +23,14 @@ public class StatisticsService {
|
|
private JdbcTemplate jdbcTemplate;
|
|
private JdbcTemplate jdbcTemplate;
|
|
@Autowired
|
|
@Autowired
|
|
private WlyyBusinessService wlyyBusinessService;
|
|
private WlyyBusinessService wlyyBusinessService;
|
|
|
|
@Autowired
|
|
|
|
private WlyyHttpService wlyyHttpService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 医共体分析-头部
|
|
* 医共体分析-头部
|
|
* 1、【新签约人数】= 查询时间范围内,同安区新签约、续签的家签患者人数; i健康
|
|
* 1、【新签约人数】= 查询时间范围内,同安区新签约、续签的家签患者人数; i健康
|
|
* 2、【签约患者数】= 时间范围内,同安区的家签患者总数; i健康
|
|
* 2、【签约患者数】= 时间范围内,同安区的家签患者总数; i健康
|
|
* 3、【共管患者数】 = 时间范围内,签约三院专科团队的家签患者数+与三院医生产生业务交集的家签患者数;【共同管率】 = 共管患者数/签约患者数 X 100%;
|
|
|
|
|
|
* 3、【共管患者数】 = 时间范围内,签约三院专科团队的家签患者数+与三院医生产生业务交集的家签患者数;【共同管率】 = 共管患者数/签约患者数 X 100%;问诊、转诊、康复下转、社区邀请、社区协诊
|
|
* 4、【家签门诊数】= 时间范围内,同安区的家签居民通过i健康进行预约线下门诊的次数; i健康
|
|
* 4、【家签门诊数】= 时间范围内,同安区的家签居民通过i健康进行预约线下门诊的次数; i健康
|
|
* 5、【本院门诊数】= 时间范围内,同安区的家签居民通过i健康预约本院就诊的次数; i健康
|
|
* 5、【本院门诊数】= 时间范围内,同安区的家签居民通过i健康预约本院就诊的次数; i健康
|
|
* 6、【外院门诊数】= 时间范围内,同安区的家签居民通过i健康预约其他医院就诊的次数;i健康
|
|
* 6、【外院门诊数】= 时间范围内,同安区的家签居民通过i健康预约其他医院就诊的次数;i健康
|
|
@ -38,7 +41,8 @@ public class StatisticsService {
|
|
* 11、【家签问诊数】= 时间范围内,同安区的家签居民在三院进行图文咨询、图文复诊、视频咨询、视频复诊、社区协诊的次数;=3_1
|
|
* 11、【家签问诊数】= 时间范围内,同安区的家签居民在三院进行图文咨询、图文复诊、视频咨询、视频复诊、社区协诊的次数;=3_1
|
|
* 12、【普患问诊数】= 时间范围内,普通患者三院进行图文咨询、图文复诊、视频咨询、视频复诊、社区协诊的次数;
|
|
* 12、【普患问诊数】= 时间范围内,普通患者三院进行图文咨询、图文复诊、视频咨询、视频复诊、社区协诊的次数;
|
|
*/
|
|
*/
|
|
public void medicalCommunityTop(String startDate,String endDate){
|
|
|
|
|
|
public JSONObject medicalCommunityTop(String startDate,String endDate){
|
|
|
|
JSONObject json = new JSONObject();
|
|
String sql3 = "SELECT COUNT(DISTINCT s.id) from base_team_relation r,wlyy_sign s WHERE r.admin_team_id=s.admin_team_id and s.status>0 ";
|
|
String sql3 = "SELECT COUNT(DISTINCT s.id) from base_team_relation r,wlyy_sign s WHERE r.admin_team_id=s.admin_team_id and s.status>0 ";
|
|
String sql3_1 = "SELECT COUNT(DISTINCT s.id) from wlyy_outpatient r,wlyy_sign s WHERE r.patient=s.patient and s.status>0 ";
|
|
String sql3_1 = "SELECT COUNT(DISTINCT s.id) from wlyy_outpatient r,wlyy_sign s WHERE r.patient=s.patient and s.status>0 ";
|
|
String sql8 = "select count(s.id) from wlyy_patient_rehabilitation_plan s ";
|
|
String sql8 = "select count(s.id) from wlyy_patient_rehabilitation_plan s ";
|
|
@ -49,17 +53,66 @@ public class StatisticsService {
|
|
sql3_1 += " and r.create_time>'"+startDate+"' ";
|
|
sql3_1 += " and r.create_time>'"+startDate+"' ";
|
|
sql8 += " and s.create_time>'"+startDate+"' ";
|
|
sql8 += " and s.create_time>'"+startDate+"' ";
|
|
sql10 += " and s.create_time>'"+startDate+"' ";
|
|
sql10 += " and s.create_time>'"+startDate+"' ";
|
|
|
|
|
|
|
|
}else {
|
|
|
|
startDate = "";
|
|
}
|
|
}
|
|
if(StringUtils.isNotBlank(endDate)){
|
|
if(StringUtils.isNotBlank(endDate)){
|
|
sql3 += " and r.create_time<='"+endDate+" 23:59:59' ";
|
|
sql3 += " and r.create_time<='"+endDate+" 23:59:59' ";
|
|
sql3_1 += " and r.create_time<='"+endDate+" 23:59:59' ";
|
|
sql3_1 += " and r.create_time<='"+endDate+" 23:59:59' ";
|
|
sql8 += " and s.create_time<='"+endDate+" 23:59:59' ";
|
|
sql8 += " and s.create_time<='"+endDate+" 23:59:59' ";
|
|
sql10 += " and s.create_time<='"+endDate+" 23:59:59' ";
|
|
sql10 += " and s.create_time<='"+endDate+" 23:59:59' ";
|
|
|
|
|
|
|
|
}else {
|
|
|
|
endDate = "";
|
|
|
|
}
|
|
|
|
int teamSignNum = jdbcTemplate.queryForObject(sql3,Integer.class);
|
|
|
|
int signOutpatientNum = jdbcTemplate.queryForObject(sql3_1,Integer.class);
|
|
|
|
int rehabilitationThirdNum = jdbcTemplate.queryForObject(sql8,Integer.class);
|
|
|
|
int outpatientNum = jdbcTemplate.queryForObject(sql10,Integer.class);
|
|
|
|
int signAdd = 0;
|
|
|
|
int signNum = 0;
|
|
|
|
int num3 = 0;
|
|
|
|
int rehabilitationOtherNum = 0;
|
|
|
|
int bookNum = 0;
|
|
|
|
int bookThird = 0;
|
|
|
|
int bootOther = 0;
|
|
|
|
try {
|
|
|
|
String param = "?startDate="+startDate+"&endDate="+endDate;
|
|
|
|
JSONObject re = wlyyHttpService.sendWlyyMesGet("commonGet", "medicalCommunityTop" + param);
|
|
|
|
if(re!=null&&re.getInteger("status")==200){
|
|
|
|
JSONObject data = re.getJSONObject("data");
|
|
|
|
signAdd = data.getInteger("signAdd");
|
|
|
|
signNum = data.getInteger("signNum");
|
|
|
|
num3 = data.getInteger("num3");
|
|
|
|
rehabilitationOtherNum = data.getInteger("rehabilitationOtherNum");
|
|
|
|
bookNum = data.getInteger("bookNum");
|
|
|
|
bookThird = data.getInteger("bookThird");
|
|
|
|
bootOther = data.getInteger("bootOther");
|
|
|
|
}
|
|
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
int coMum = teamSignNum +num3+signOutpatientNum;
|
|
|
|
if(coMum>signNum){
|
|
|
|
signNum = coMum;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
json.put("signAdd",signAdd);//新签约人数
|
|
|
|
json.put("signNum",signNum);//签约患者数
|
|
|
|
json.put("coMum",coMum);//共管患者数
|
|
|
|
json.put("coRate",getRange(coMum,signNum));//共同管率
|
|
|
|
json.put("bookNum",bookNum);//家签门诊数
|
|
|
|
json.put("bookThird",bookThird);//本院门诊数
|
|
|
|
json.put("bootOther",bootOther);//外院门诊数
|
|
|
|
|
|
|
|
int rehabilitationNum = rehabilitationOtherNum + rehabilitationThirdNum;
|
|
|
|
json.put("rehabilitationNum",rehabilitationNum);//康复下转数
|
|
|
|
json.put("rehabilitationThirdNum",rehabilitationThirdNum);//本院管理数
|
|
|
|
json.put("rehabilitationOtherNum",rehabilitationOtherNum);//社区管理数
|
|
|
|
json.put("outpatientNum",outpatientNum);//在线问诊数
|
|
|
|
json.put("signOutpatientNum",signOutpatientNum);//家签问诊数
|
|
|
|
int otherOutpatientNum = outpatientNum = signOutpatientNum;
|
|
|
|
json.put("otherOutpatientNum",otherOutpatientNum);//普患问诊数
|
|
|
|
return json;
|
|
}
|
|
}
|
|
|
|
|
|
//服务情况明细
|
|
//服务情况明细
|