|
@ -3,6 +3,8 @@ package com.yihu.jw.care.service.statistics;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yihu.jw.care.dao.device.PatientDeviceDao;
|
|
|
import com.yihu.jw.care.util.CommonUtil;
|
|
|
import com.yihu.jw.care.util.ConstantUtil;
|
|
|
import com.yihu.jw.care.vo.NumVo;
|
|
|
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
|
|
@ -11,22 +13,31 @@ import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
|
|
|
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
|
|
|
import com.yihu.jw.entity.base.login.BaseLoginLogDO;
|
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
|
import com.yihu.jw.entity.care.device.DevicePatientDevice;
|
|
|
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
|
|
|
import com.yihu.jw.es.util.ElasticsearchUtil;
|
|
|
import com.yihu.jw.es.util.SaveModel;
|
|
|
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
|
|
|
import com.yihu.jw.im.util.ImUtil;
|
|
|
import com.yihu.jw.message.dao.MessageDao;
|
|
|
import com.yihu.jw.org.dao.BaseOrgDao;
|
|
|
import com.yihu.jw.patient.dao.BasePatientDao;
|
|
|
import com.yihu.jw.restmodel.web.PageEnvelop;
|
|
|
import com.yihu.jw.util.common.IdCardUtil;
|
|
|
import com.yihu.jw.util.date.DateUtil;
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.persistence.criteria.CriteriaBuilder;
|
|
|
import java.awt.print.Pageable;
|
|
|
import java.text.DecimalFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
@ -56,6 +67,12 @@ public class StatisticsService {
|
|
|
private StatisticsUtilService statisticsUtilService;
|
|
|
@Autowired
|
|
|
private BasePatientDao patientDao;
|
|
|
@Autowired
|
|
|
private CommonUtil commonUtil;
|
|
|
@Autowired
|
|
|
private SystemMessageDao messageDao;
|
|
|
@Autowired
|
|
|
private PatientDeviceDao patientDeviceDao;
|
|
|
|
|
|
private static final String defalutArea = "330100";
|
|
|
|
|
@ -454,8 +471,8 @@ public class StatisticsService {
|
|
|
}
|
|
|
|
|
|
|
|
|
String sql1 = "SELECT COUNT(*) c,IFNULL(on_line,0) online from base_patient a WHERE archive_type = 1" +
|
|
|
" and del='1' "+oldFilter+" GROUP BY on_line";
|
|
|
String sql1 = "SELECT COUNT(*) c,case 1 WHEN openid is not null then 1 WHEN a.on_line = '1' then 1 ELSE 0 end as online from base_patient a WHERE archive_type = 1" +
|
|
|
" and del='1' "+oldFilter+" GROUP BY online";
|
|
|
List<Map<String,Object>> list1 = jdbcTemplate.queryForList(sql1);
|
|
|
for(Map<String,Object> map:list1){
|
|
|
Integer num = Integer.valueOf(map.get("c").toString());
|
|
@ -528,14 +545,21 @@ public class StatisticsService {
|
|
|
public JSONObject statisticsTotalAmount( String endDate, String area, int level, String index, String type) throws Exception {
|
|
|
JSONObject res = new JSONObject();
|
|
|
String[] indexes = index.split(",");
|
|
|
String areaLevel = null;
|
|
|
for(String ind:indexes){
|
|
|
//总量
|
|
|
SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, ind, SaveModel.timeLevel_DDL);
|
|
|
if (ind.equals("41")||ind.equals("46")){//指标统计最小单位
|
|
|
areaLevel="4";
|
|
|
}
|
|
|
if (ind.equals("45")){
|
|
|
areaLevel="2";
|
|
|
}
|
|
|
SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, ind, SaveModel.timeLevel_DDL,areaLevel);
|
|
|
res.put("index_"+ind+"_total",saveModel.getResult2().longValue());
|
|
|
if(StringUtils.isNotBlank(type)){
|
|
|
//周/月 增量
|
|
|
String start = statisticsUtilService.calStart(endDate,type);
|
|
|
SaveModel saveModelAdd = elasticsearchUtil.findOneDateQuotaLevel0(start, endDate, area, level, ind, SaveModel.timeLevel_ZL);
|
|
|
SaveModel saveModelAdd = elasticsearchUtil.findOneDateQuotaLevel0(start, endDate, area, level, ind, SaveModel.timeLevel_ZL,areaLevel);
|
|
|
|
|
|
res.put("index_"+ind+"_add",saveModelAdd.getResult2().longValue());
|
|
|
}
|
|
@ -647,7 +671,6 @@ public class StatisticsService {
|
|
|
*/
|
|
|
public JSONObject patientAnalysis(String endDate, String area, int level,String index) throws Exception{
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
|
|
String areaLevel = "6";
|
|
|
if("42".equals(index)){
|
|
|
areaLevel = "4";
|
|
@ -667,26 +690,7 @@ public class StatisticsService {
|
|
|
}else{
|
|
|
//老人
|
|
|
//能力评估 从签约时服务标签取
|
|
|
JSONArray levelArray = new JSONArray();
|
|
|
String sql = " select dict.dict_code,dict_value,count(DISTINCT lab.patient) total from wlyy_hospital_sys_dict dict \n" +
|
|
|
"LEFT JOIN wlyy_patient_label lab on dict.dict_code = lab.label_code AND lab.label_type='1' " +
|
|
|
"where dict.dict_name='service_type' and dict.dict_code is not null and dict_code<>5 \n" +
|
|
|
" GROUP BY dict.dict_code; ";
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
|
|
|
String older = " select count(DISTINCT patient) from wlyy_patient_label where label_type='1' ";
|
|
|
Integer count = jdbcTemplate.queryForObject(older,Integer.class);
|
|
|
|
|
|
for(Map<String,Object> map:list){
|
|
|
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());
|
|
|
levelArray.add(json);
|
|
|
}
|
|
|
res.put("levelList",levelArray);
|
|
|
res.put("levelList",capacityAssessment(null,null,null));
|
|
|
|
|
|
//年龄分布 50
|
|
|
// ageList = elasticsearchUtil.findDateAllQuotaLevel1(endDate, endDate, area, level, "50", SaveModel.timeLevel_DDL,null,null,"2");
|
|
@ -704,17 +708,47 @@ public class StatisticsService {
|
|
|
ageArray.add(json);
|
|
|
}
|
|
|
res.put("ageList",ageArray);
|
|
|
}
|
|
|
|
|
|
//性别
|
|
|
List<SaveModel> sexList = elasticsearchUtil.findDateAllQuotaLevel2(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL,null,null,areaLevel);
|
|
|
//居住小区分布
|
|
|
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"));
|
|
|
orgCodes = orgCodes.replaceAll(",","','");
|
|
|
filter = " not in ('"+orgCodes+"')";
|
|
|
}
|
|
|
String sql = "select count(id) total,residential_area residentialArea from base_patient where del=1 and id "+filter+" and archive_type=1 " +
|
|
|
"GROUP BY residential_area ORDER BY total desc";
|
|
|
List<Map<String,Object>> result = jdbcTemplate.queryForList(sql);
|
|
|
Iterator<Map<String, Object>> iterator = result.iterator();
|
|
|
Map<String, Object> tmp = new HashMap<>();
|
|
|
while (iterator.hasNext()){
|
|
|
tmp = iterator.next();
|
|
|
if (null==tmp.get("residentialArea")){
|
|
|
iterator.remove();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
result.add(tmp);
|
|
|
res.put("residentialArea",result);
|
|
|
}
|
|
|
//性别分析
|
|
|
String archiType="";
|
|
|
if("42".equals(index)){
|
|
|
archiType="2";
|
|
|
}
|
|
|
if("37".equals(index)){
|
|
|
archiType="1";
|
|
|
}
|
|
|
List<SaveModel> sexList = elasticsearchUtil.findDateQuotaLevel2ByKeyGroup(endDate, endDate,defalutArea, level, "51",SaveModel.timeLevel_DDL,null,archiType,null,null,"2","1");
|
|
|
JSONArray sexArray = new JSONArray();
|
|
|
for(int i=0;i<sexList.size();i++){
|
|
|
SaveModel saveModel = sexList.get(i);
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("num",saveModel.getResult2().longValue());
|
|
|
json.put("code",saveModel.getSlaveKey2());
|
|
|
json.put("name",saveModel.getSlaveKey2Name());
|
|
|
json.put("code",saveModel.getSlaveKey1());
|
|
|
json.put("name",saveModel.getSlaveKey1Name());
|
|
|
sexArray.add(json);
|
|
|
}
|
|
|
res.put("sexList",sexArray);
|
|
@ -778,16 +812,24 @@ public class StatisticsService {
|
|
|
/**
|
|
|
* 能力评估评估类型
|
|
|
*/
|
|
|
public JSONArray capacityAssessment(String endDate, String area, int level) throws Exception{
|
|
|
public JSONArray capacityAssessment(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"));
|
|
|
orgCodes = orgCodes.replaceAll(",","','");
|
|
|
filter = " not in ('"+orgCodes+"')";
|
|
|
}
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
String sql = " select dict.dict_code,dict_value,count(DISTINCT lab.patient) total from wlyy_hospital_sys_dict dict \n" +
|
|
|
"LEFT JOIN wlyy_patient_label lab on dict.dict_code = lab.label_code AND lab.label_type='1' " +
|
|
|
"where dict.dict_name='service_type' and dict.dict_code is not null and dict_code<>5 \n" +
|
|
|
"where dict.dict_name='service_type' and lab.patient "+filter+" and dict.dict_code is not null and dict_code<>5 \n" +
|
|
|
" GROUP BY dict.dict_code; ";
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
|
|
|
String older = " select count(DISTINCT patient) from wlyy_patient_label where label_type='1' ";
|
|
|
String older = " select count(DISTINCT patient) from wlyy_patient_label where label_type='1' and patient "+filter;
|
|
|
Integer count = jdbcTemplate.queryForObject(older,Integer.class);
|
|
|
|
|
|
for(Map<String,Object> map:list){
|
|
@ -956,6 +998,196 @@ public class StatisticsService {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 管理端首页老人接入情况
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONObject olderBindingDeviceStatus(String area){
|
|
|
JSONObject result = new JSONObject();
|
|
|
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"));
|
|
|
orgCodes = orgCodes.replaceAll(",","','");
|
|
|
filter = " not in ('"+orgCodes+"')";
|
|
|
}
|
|
|
String sql =" select count(id) from base_patient where del=1 and id "+filter;
|
|
|
Integer olderCount = jdbcTemplate.queryForObject(sql,Integer.class);
|
|
|
|
|
|
sql = " select count(DISTINCT pd.id) from base_patient p INNER JOIN wlyy_patient_device pd on p.id = pd.user and pd.del=0 where p.del=1 and p.id "+filter;
|
|
|
Integer bindingCount = jdbcTemplate.queryForObject(sql,Integer.class);
|
|
|
result.put("olderCount",olderCount);
|
|
|
result.put("bindingCount",bindingCount);
|
|
|
result.put("range",commonUtil.getRange(bindingCount,olderCount));
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 管理端安防监护新增分析
|
|
|
*/
|
|
|
public JSONObject statisticsSecurityOlder( String endDate, String area, int level, String type) throws Exception {
|
|
|
JSONObject res = new JSONObject();
|
|
|
String areaLevel = "4";
|
|
|
areaLevel="4";
|
|
|
SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, "46", SaveModel.timeLevel_DDL,areaLevel);
|
|
|
res.put("index_"+46+"_total",saveModel.getResult2().longValue());
|
|
|
if(StringUtils.isNotBlank(type)){
|
|
|
//周/月 增量
|
|
|
String start = statisticsUtilService.calStart(endDate,type);
|
|
|
SaveModel saveModelAdd = elasticsearchUtil.findOneDateQuotaLevel0(start, endDate, area, level, "46", SaveModel.timeLevel_ZL,areaLevel);
|
|
|
res.put("index_"+46+"_add",saveModelAdd.getResult2().longValue());
|
|
|
}
|
|
|
String sql = "SELECT dict_code code from wlyy_hospital_sys_dict WHERE dict_name = 'security_server_dict'";//46指标一级纬度
|
|
|
List<String> dictCodes = jdbcTemplate.queryForList(sql,String.class);
|
|
|
JSONArray addDetail = new JSONArray();
|
|
|
for (String dictCode:dictCodes){
|
|
|
if(StringUtils.isNotBlank(type)){
|
|
|
//周/月 增量
|
|
|
String start = statisticsUtilService.calStart(endDate,type);
|
|
|
SaveModel saveModelAdd = elasticsearchUtil.findOneDateQuotaLevel1(start,endDate, area,level, "46", SaveModel.timeLevel_ZL, dictCode,areaLevel);
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("num",saveModelAdd.getResult2().longValue());
|
|
|
json.put("code",saveModelAdd.getSlaveKey1());
|
|
|
json.put("name",saveModelAdd.getSlaveKey1Name());
|
|
|
addDetail.add(json);
|
|
|
}
|
|
|
}
|
|
|
res.put("index_add_detail",addDetail);
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
public JSONObject deviceGrantAndService(){
|
|
|
JSONObject result = new JSONObject();
|
|
|
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"));
|
|
|
orgCodes = orgCodes.replaceAll(",","','");
|
|
|
filter = " not in ('"+orgCodes+"')";
|
|
|
}
|
|
|
String sql =" select count(DISTINCT device_code) from wlyy_devices ";
|
|
|
Integer deviceTotal = jdbcTemplate.queryForObject(sql,Integer.class);
|
|
|
|
|
|
sql = " select count(DISTINCT wd.device_code) from wlyy_devices wd INNER JOIN wlyy_patient_device pd " +
|
|
|
" ON pd.device_sn = wd.device_code AND pd.del=0 and pd.user "+filter;
|
|
|
Integer bindingCount = jdbcTemplate.queryForObject(sql,Integer.class);
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("deviceTotal",deviceTotal);
|
|
|
jsonObject.put("bindingCount",bindingCount);
|
|
|
jsonObject.put("range",commonUtil.getRange(bindingCount,deviceTotal));
|
|
|
result.put("deviceGrant",jsonObject);
|
|
|
sql =" SELECT sde.`value`,COUNT(d.id) count,GROUP_CONCAT(DISTINCT d.category_code SEPARATOR ',') AS category_code," +
|
|
|
" GROUP_CONCAT(DISTINCT d.model SEPARATOR ',') AS model FROM base_system_dict_entry sde LEFT JOIN dm_device d " +
|
|
|
" ON FIND_IN_SET(sde.`code`,d.service_topic) WHERE sde.remark = 'security' GROUP BY sde.`value` ";
|
|
|
List<Map<String,Object>> deviceService = jdbcTemplate.queryForList(sql);
|
|
|
result.put("deviceService",deviceService);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
public Page<SystemMessageDO> getAllDeviceLostMessage(String area,Integer page,Integer size){
|
|
|
PageRequest pageRequest = new PageRequest(page - 1, size);
|
|
|
Page<SystemMessageDO> systemMessageDOS = messageDao.getByType("43",pageRequest);
|
|
|
return systemMessageDOS;
|
|
|
}
|
|
|
|
|
|
public JSONObject deviceUsingInfo(String area){
|
|
|
JSONObject result = new JSONObject();
|
|
|
String sql = "SELECT COUNT(DISTINCT device_sn) FROM wlyy_patient_device WHERE del = 0";
|
|
|
Integer use = jdbcTemplate.queryForObject(sql,Integer.class);
|
|
|
sql = "SELECT COUNT(DISTINCT device_code) FROM wlyy_devices ";
|
|
|
Integer total = jdbcTemplate.queryForObject(sql,Integer.class);
|
|
|
result.put("use",use);//使用中
|
|
|
result.put("putOnFile",total);//采购
|
|
|
result.put("stock",total-use);//库存
|
|
|
|
|
|
sql = "SELECT DISTINCT count(wd.device_code) FROM wlyy_devices wd INNER JOIN wlyy_patient_device pd on " +
|
|
|
"wd.device_code =pd.device_sn WHERE contact_status = 0";//contact_status = 0 失联
|
|
|
Integer lost = jdbcTemplate.queryForObject(sql,Integer.class);
|
|
|
//物联率 失联率
|
|
|
result.put("deviceAll",total);//物联率分母总数 设备总数(包括库存)
|
|
|
result.put("lost",lost);//失联数
|
|
|
result.put("notLost",use);//物联数 被人绑定了就是物联
|
|
|
result.put("notLost",use);//失联数分母总数 发出的设备数
|
|
|
result.put("iotRange",commonUtil.getRange(use,total));
|
|
|
result.put("LostRange",commonUtil.getRange(lost,use));
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
public PageEnvelop getSecurityOrderList(String area,String status, String svrDesc,String topicItem, Integer page, Integer pageSize){
|
|
|
JSONArray result = new JSONArray();
|
|
|
|
|
|
String sqlCount = "select count(ord.id) from base_security_monitoring_order ord INNER JOIN base_patient p on p.id = ord.patient " +
|
|
|
"where 1=1 ";
|
|
|
String fliter = " ";
|
|
|
String sql = " select p.id patientCode,p.name,p.sex,p.photo,p.idcard,ord.id orderId,ord.number,ord.serve_desc,ord.create_time,ord.`status`,ord.doctor," +
|
|
|
"ord.doctor_name,ord.update_user,ord.update_user_name,ord.patient_phone,ord.conclusion_status from base_security_monitoring_order ord INNER JOIN base_patient p on p.id = ord.patient " +
|
|
|
"where 1=1 ";
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(status)){
|
|
|
fliter+=" and ord.status='"+Integer.parseInt(status)+"' ";
|
|
|
}
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(svrDesc)){
|
|
|
fliter+=" and ord.serve_desc='"+svrDesc+"' ";
|
|
|
}
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(topicItem)){
|
|
|
fliter+=" and ord.topic_item='"+topicItem+"' ";
|
|
|
}
|
|
|
Long count = jdbcTemplate.queryForObject(sqlCount+fliter,Long.class);
|
|
|
fliter+=" order by ord.create_time desc limit " + (page*pageSize) + "," + pageSize;
|
|
|
List<Map<String,Object>> sqlResult = jdbcTemplate.queryForList(sql+fliter);
|
|
|
|
|
|
for (Map<String,Object>one:sqlResult){
|
|
|
JSONObject tmp = new JSONObject();
|
|
|
tmp.put("patientCode",one.get("patientCode"));
|
|
|
tmp.put("patientName",one.get("name"));
|
|
|
tmp.put("sex",one.get("sex"));
|
|
|
tmp.put("photo",one.get("photo"));
|
|
|
tmp.put("idcard",one.get("idcard"));
|
|
|
tmp.put("number",one.get("number"));
|
|
|
tmp.put("id",one.get("orderId"));
|
|
|
tmp.put("serveDesc",one.get("serve_desc"));
|
|
|
Date date = (Date)one.get("create_time");
|
|
|
tmp.put("createTime", DateUtil.dateToStrLong(date));
|
|
|
tmp.put("status",one.get("status"));
|
|
|
tmp.put("doctor",one.get("doctor"));
|
|
|
tmp.put("doctorName",one.get("doctor_name"));
|
|
|
tmp.put("patientPhone",one.get("patient_phone"));
|
|
|
tmp.put("conclusionStatus",one.get("conclusion_status"));
|
|
|
Integer conclusionStatus = Integer.valueOf(one.get("conclusion_status")==null?"0":(one.get("conclusion_status")+""));
|
|
|
String conclusionStatusName = "";
|
|
|
switch (conclusionStatus){
|
|
|
case 1:conclusionStatusName="待补录";break;
|
|
|
case 2:conclusionStatusName="已登记";break;
|
|
|
}
|
|
|
tmp.put("conclusionStatusName",conclusionStatusName);
|
|
|
Integer statustemp = Integer.valueOf(one.get("status")+"");
|
|
|
if (-2==statustemp||-1==statustemp){
|
|
|
tmp.put("doctor",one.get("update_user"));
|
|
|
tmp.put("doctorName",one.get("update_user_name"));
|
|
|
}
|
|
|
String statusName = "";
|
|
|
switch (statustemp){
|
|
|
case -2:statusName="误警报";break;
|
|
|
case -1:statusName="已取消";break;
|
|
|
case 0:statusName="已完成";break;
|
|
|
case 1:statusName="预警中";break;
|
|
|
}
|
|
|
tmp.put("statusName",statusName);
|
|
|
Integer age = IdCardUtil.getAgeForIdcard(tmp.getString("idcard"));
|
|
|
tmp.put("age",age);
|
|
|
//患者设备
|
|
|
List<DevicePatientDevice> devices = patientDeviceDao.findAllByUser(tmp.get("patientCode").toString());
|
|
|
if (devices.size()>0){
|
|
|
tmp.put("deviceFlag","1");
|
|
|
}
|
|
|
else {
|
|
|
tmp.put("deviceFlag","0");
|
|
|
}
|
|
|
result.add(tmp);
|
|
|
}
|
|
|
return PageEnvelop.getSuccessListWithPage("success",result,page,pageSize,count);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 计算开始时间
|