|
@ -307,8 +307,10 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
" t1.doctor = ? " +
|
|
" t1.doctor = ? " +
|
|
" OR t1.doctor_health = ? " +
|
|
" OR t1.doctor_health = ? " +
|
|
" ) " +
|
|
" ) " +
|
|
" AND t1. STATUS > 0 " +
|
|
|
|
" AND t1.admin_team_code = ?" ;
|
|
|
|
|
|
" AND t1. STATUS > 0 AND t1.admin_team_code = ?";
|
|
|
|
if(isSlowDisease){
|
|
|
|
sql = sql + " AND p.diease >0 " ;
|
|
|
|
}
|
|
if(StringUtils.isNotBlank(diseaseCondition)){
|
|
if(StringUtils.isNotBlank(diseaseCondition)){
|
|
sql = sql + " AND p.disease_condition ="+diseaseCondition;
|
|
sql = sql + " AND p.disease_condition ="+diseaseCondition;
|
|
}
|
|
}
|
|
@ -356,14 +358,13 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
signList = jdbcTemplate.queryForList(sql, args);
|
|
signList = jdbcTemplate.queryForList(sql, args);
|
|
|
|
|
|
//查询患者设备绑定情况
|
|
//查询患者设备绑定情况
|
|
String _pdsql = "select user,floor(sum(category_code)) deviceType FROM wlyy_patient_device GROUP BY user";
|
|
|
|
|
|
String _pdsql = "select user,sum(category_code) deviceType FROM wlyy_patient_device GROUP BY user";
|
|
List<Map<String,Object>> patientCodeDeviceTypes = jdbcTemplate.queryForList(_pdsql);
|
|
List<Map<String,Object>> patientCodeDeviceTypes = jdbcTemplate.queryForList(_pdsql);
|
|
|
|
|
|
if(!patientCodeDeviceTypes.isEmpty()){
|
|
if(!patientCodeDeviceTypes.isEmpty()){
|
|
for (Map<String,Object> patientCodeDeviceType : patientCodeDeviceTypes) {
|
|
for (Map<String,Object> patientCodeDeviceType : patientCodeDeviceTypes) {
|
|
String user = String.valueOf(patientCodeDeviceType.get("user"));
|
|
String user = String.valueOf(patientCodeDeviceType.get("user"));
|
|
String sum = String.valueOf(patientCodeDeviceType.get("deviceType"));
|
|
String sum = String.valueOf(patientCodeDeviceType.get("deviceType"));
|
|
System.out.println(user+sum);
|
|
|
|
patientDeviceTypeMap.put(user,sum);
|
|
patientDeviceTypeMap.put(user,sum);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@ -481,9 +482,9 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
//预警状态
|
|
//预警状态
|
|
json.put("standardStatus",p.getStandardStatus());
|
|
json.put("standardStatus",p.getStandardStatus());
|
|
//设备状态:0未绑定,1血糖仪,2血压仪,3血糖仪+血压仪
|
|
//设备状态:0未绑定,1血糖仪,2血压仪,3血糖仪+血压仪
|
|
Integer deviceType = 0;
|
|
|
|
|
|
String deviceType = "";
|
|
if(!patientDeviceTypeMap.isEmpty() && patientDeviceTypeMap.keySet().contains(p.getCode())){
|
|
if(!patientDeviceTypeMap.isEmpty() && patientDeviceTypeMap.keySet().contains(p.getCode())){
|
|
deviceType = (Integer) patientDeviceTypeMap.get(p.getCode());
|
|
|
|
|
|
deviceType = (String) patientDeviceTypeMap.get(p.getCode());
|
|
}
|
|
}
|
|
json.put("deviceType",deviceType);
|
|
json.put("deviceType",deviceType);
|
|
|
|
|
|
@ -530,20 +531,18 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
|
|
|
|
//判断预警状态
|
|
//判断预警状态
|
|
if(standardStatus1 == standardStatus2){
|
|
if(standardStatus1 == standardStatus2){
|
|
//判断病种种类
|
|
|
|
if(disease1 == disease2){
|
|
|
|
//判断颜色标签
|
|
|
|
if(diseaseCondition1 == diseaseCondition2){
|
|
|
|
|
|
//判断颜色标签
|
|
|
|
if(diseaseCondition1 == diseaseCondition2){
|
|
|
|
//判断病种种类
|
|
|
|
if(disease1 == disease2){
|
|
//判断微信绑定情况
|
|
//判断微信绑定情况
|
|
re = openid1.compareTo(openid2);
|
|
re = openid1.compareTo(openid2);
|
|
}else{
|
|
}else{
|
|
re = diseaseCondition1 - diseaseCondition2;
|
|
|
|
|
|
re = disease2 - disease1;
|
|
}
|
|
}
|
|
|
|
|
|
}else{
|
|
}else{
|
|
re = disease1 - disease2;
|
|
|
|
|
|
re = diseaseCondition2 - diseaseCondition1;
|
|
}
|
|
}
|
|
|
|
|
|
}else{
|
|
}else{
|
|
re = standardStatus1 - standardStatus2;
|
|
re = standardStatus1 - standardStatus2;
|
|
}
|
|
}
|
|
@ -3583,7 +3582,7 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
* @return
|
|
* @return
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
public JSONArray getPatientByTeamCodeExitDoctor(long teamCode, String labelCode, String labelType, int page, int pagesize, boolean sortByStandardStatus, String diseaseCondition) throws Exception {
|
|
|
|
|
|
public JSONArray getPatientByTeamCodeExitDoctor(long teamCode, String labelCode, String labelType, int page, int pagesize, boolean isSlowDisease, String diseaseCondition) throws Exception {
|
|
|
|
|
|
Map<String, JSONObject> result = new TreeMap<>();
|
|
Map<String, JSONObject> result = new TreeMap<>();
|
|
List<Map<String, Object>> signList = new ArrayList<>();
|
|
List<Map<String, Object>> signList = new ArrayList<>();
|
|
@ -3643,6 +3642,9 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
}else{
|
|
}else{
|
|
args = new Object[]{teamCode};
|
|
args = new Object[]{teamCode};
|
|
}
|
|
}
|
|
|
|
if(isSlowDisease){
|
|
|
|
sql = sql + " AND p.disease >0 ";
|
|
|
|
}
|
|
sql = sql +
|
|
sql = sql +
|
|
" ) f " +
|
|
" ) f " +
|
|
"WHERE " +
|
|
"WHERE " +
|
|
@ -3706,7 +3708,6 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
for (Map<String,Object> patientCodeDeviceType : patientCodeDeviceTypes) {
|
|
for (Map<String,Object> patientCodeDeviceType : patientCodeDeviceTypes) {
|
|
String user = String.valueOf(patientCodeDeviceType.get("user"));
|
|
String user = String.valueOf(patientCodeDeviceType.get("user"));
|
|
String sum = String.valueOf(patientCodeDeviceType.get("deviceType"));
|
|
String sum = String.valueOf(patientCodeDeviceType.get("deviceType"));
|
|
System.out.println(user+sum);
|
|
|
|
patientDeviceTypeMap.put(user,sum);
|
|
patientDeviceTypeMap.put(user,sum);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@ -3825,9 +3826,9 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
//预警状态
|
|
//预警状态
|
|
json.put("standardStatus",p.getStandardStatus());
|
|
json.put("standardStatus",p.getStandardStatus());
|
|
//设备状态:0未绑定,1血糖仪,2血压仪,3血糖仪+血压仪
|
|
//设备状态:0未绑定,1血糖仪,2血压仪,3血糖仪+血压仪
|
|
Integer deviceType = 0;
|
|
|
|
|
|
String deviceType = "";
|
|
if(!patientDeviceTypeMap.isEmpty() && patientDeviceTypeMap.keySet().contains(p.getCode())){
|
|
if(!patientDeviceTypeMap.isEmpty() && patientDeviceTypeMap.keySet().contains(p.getCode())){
|
|
deviceType = (Integer) patientDeviceTypeMap.get(p.getCode());
|
|
|
|
|
|
deviceType = (String) patientDeviceTypeMap.get(p.getCode());
|
|
}
|
|
}
|
|
json.put("deviceType",deviceType);
|
|
json.put("deviceType",deviceType);
|
|
|
|
|
|
@ -3875,18 +3876,19 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
|
|
|
|
//判断预警状态
|
|
//判断预警状态
|
|
if(standardStatus1 == standardStatus2){
|
|
if(standardStatus1 == standardStatus2){
|
|
//判断病种种类
|
|
|
|
if(disease1 == disease2){
|
|
|
|
//判断颜色标签
|
|
|
|
if(diseaseCondition1 == diseaseCondition2){
|
|
|
|
|
|
//判断颜色标签
|
|
|
|
if(diseaseCondition1 == diseaseCondition2){
|
|
|
|
//判断病种种类
|
|
|
|
if(disease1 == disease2){
|
|
//判断微信绑定情况
|
|
//判断微信绑定情况
|
|
re = openid1.compareTo(openid2);
|
|
re = openid1.compareTo(openid2);
|
|
}else{
|
|
}else{
|
|
re = diseaseCondition1 - diseaseCondition2;
|
|
|
|
|
|
re = disease2 - disease1;
|
|
}
|
|
}
|
|
|
|
|
|
}else{
|
|
}else{
|
|
re = disease1 - disease2;
|
|
|
|
|
|
re = diseaseCondition2 - diseaseCondition1;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}else{
|
|
}else{
|
|
@ -4094,10 +4096,11 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
" (t1.doctor = ? or t1.doctor_health = ?) " +
|
|
" (t1.doctor = ? or t1.doctor_health = ?) " +
|
|
" AND t1.status > 0 " +
|
|
" AND t1.status > 0 " +
|
|
" AND t2.status = 1) " +
|
|
" AND t2.status = 1) " +
|
|
(StringUtils.isNotEmpty(labelCode) ? " AND t2.label = ? " : " AND (t2.label = 4 or t2.label = 5 )") +
|
|
|
|
|
|
(StringUtils.isNotEmpty(labelCode) ? " AND t2.label = ? " : "") +
|
|
(StringUtils.isNotEmpty(labelType) ? " AND t2.label_type = ? " : "") +
|
|
(StringUtils.isNotEmpty(labelType) ? " AND t2.label_type = ? " : "") +
|
|
(teamCode > 0 ? (" AND admin_team_code = " + teamCode) : "")+
|
|
(teamCode > 0 ? (" AND admin_team_code = " + teamCode) : "")+
|
|
(StringUtils.isNotEmpty(diseaseCondition) ? " AND t3.diseaseCondition = ? " : "");
|
|
(StringUtils.isNotEmpty(diseaseCondition) ? " AND t3.diseaseCondition = ? " : "");
|
|
|
|
sql = sql + " AND t3.disease > 0 AND t3.status > 0 ";
|
|
|
|
|
|
if (matcher.find()) {
|
|
if (matcher.find()) {
|
|
sql = sql + " AND (t1.idcard like ?) ";
|
|
sql = sql + " AND (t1.idcard like ?) ";
|
|
@ -4130,11 +4133,11 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
sql = sql + " order by t3.diseaseCondition,t3.disease,t3.diseaseCondition,t3.openid desc limit " + page + "," + pagesize;
|
|
|
|
|
|
sql = sql + " order by t3.standard_status,t3.disease_condition,t3.disease,t3.openid desc limit " + page + "," + pagesize;
|
|
signList = jdbcTemplate.queryForList(sql, argsnew);
|
|
signList = jdbcTemplate.queryForList(sql, argsnew);
|
|
}else{
|
|
}else{
|
|
|
|
|
|
sql = sql + " order by t3.diseaseCondition,t3.disease,t3.diseaseCondition,t3.openid desc limit " + page + "," + pagesize;
|
|
|
|
|
|
sql = sql + " order by t3.standard_status,t3.disease_condition,t3.disease,t3.openid desc limit " + page + "," + pagesize;
|
|
signList = jdbcTemplate.queryForList(sql, args);
|
|
signList = jdbcTemplate.queryForList(sql, args);
|
|
}
|
|
}
|
|
|
|
|
|
@ -4146,7 +4149,6 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
for (Map<String,Object> patientCodeDeviceType : patientCodeDeviceTypes) {
|
|
for (Map<String,Object> patientCodeDeviceType : patientCodeDeviceTypes) {
|
|
String user = String.valueOf(patientCodeDeviceType.get("user"));
|
|
String user = String.valueOf(patientCodeDeviceType.get("user"));
|
|
String sum = String.valueOf(patientCodeDeviceType.get("deviceType"));
|
|
String sum = String.valueOf(patientCodeDeviceType.get("deviceType"));
|
|
System.out.println(user+sum);
|
|
|
|
patientDeviceTypeMap.put(user,sum);
|
|
patientDeviceTypeMap.put(user,sum);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@ -4287,9 +4289,9 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
//预警状态
|
|
//预警状态
|
|
json.put("standardStatus",p.getStandardStatus());
|
|
json.put("standardStatus",p.getStandardStatus());
|
|
//设备状态:0未绑定,1血糖仪,2血压仪,3血糖仪+血压仪
|
|
//设备状态:0未绑定,1血糖仪,2血压仪,3血糖仪+血压仪
|
|
Integer deviceType = 0;
|
|
|
|
|
|
String deviceType = "";
|
|
if(!patientDeviceTypeMap.isEmpty() && patientDeviceTypeMap.keySet().contains(p.getCode())){
|
|
if(!patientDeviceTypeMap.isEmpty() && patientDeviceTypeMap.keySet().contains(p.getCode())){
|
|
deviceType = (Integer) patientDeviceTypeMap.get(p.getCode());
|
|
|
|
|
|
deviceType = (String) patientDeviceTypeMap.get(p.getCode());
|
|
}
|
|
}
|
|
json.put("deviceType",deviceType);
|
|
json.put("deviceType",deviceType);
|
|
|
|
|
|
@ -4339,17 +4341,16 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_sign_family t1 " +
|
|
" wlyy_sign_family t1 " +
|
|
" JOIN wlyy_patiend t2 ON t1.patient = t2.code " +
|
|
" JOIN wlyy_patiend t2 ON t1.patient = t2.code " +
|
|
(isIdcard ? ",wlyy_patient p " : "") +
|
|
|
|
" WHERE " +
|
|
" WHERE " +
|
|
(isIdcard ? " t1.patient = p.code and " : "") +
|
|
|
|
|
|
(isIdcard ? " t1.patient = t2.code and " : "") +
|
|
" t1.status > 0 " +
|
|
" t1.status > 0 " +
|
|
" AND t1.admin_team_code = ? " +
|
|
" AND t1.admin_team_code = ? " +
|
|
" AND" +
|
|
" AND" +
|
|
(isIdcard ? " p.idcard like ? " : " t1.name like ? ");
|
|
|
|
|
|
(isIdcard ? " t2.idcard like ? " : " t1.name like ? ");
|
|
|
|
|
|
sqlTemp = sqlTemp + " AND p.disease_condition = "+diseaseCondition;
|
|
|
|
|
|
sqlTemp = sqlTemp + " AND t2.disease_condition = "+diseaseCondition+" AND t2.diease >0 AND t2.status >0 ";
|
|
|
|
|
|
String sql = sqlTemp + " order by t2.diseaseCondition,t2.disease,t2,diseaseCondition,t2.openid desc limit " + page + "," + pagesize;
|
|
|
|
|
|
String sql = sqlTemp + " order by t2.standard_status,t2.disease_condition,t2.disease,t2.openid desc limit " + page + "," + pagesize;
|
|
signList = jdbcTemplate.queryForList(sql, args);
|
|
signList = jdbcTemplate.queryForList(sql, args);
|
|
|
|
|
|
//查询患者设备绑定情况
|
|
//查询患者设备绑定情况
|
|
@ -4360,7 +4361,6 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
for (Map<String,Object> patientCodeDeviceType : patientCodeDeviceTypes) {
|
|
for (Map<String,Object> patientCodeDeviceType : patientCodeDeviceTypes) {
|
|
String user = String.valueOf(patientCodeDeviceType.get("user"));
|
|
String user = String.valueOf(patientCodeDeviceType.get("user"));
|
|
String sum = String.valueOf(patientCodeDeviceType.get("deviceType"));
|
|
String sum = String.valueOf(patientCodeDeviceType.get("deviceType"));
|
|
System.out.println(user+sum);
|
|
|
|
patientDeviceTypeMap.put(user,sum);
|
|
patientDeviceTypeMap.put(user,sum);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@ -4485,9 +4485,9 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
//预警状态
|
|
//预警状态
|
|
json.put("standardStatus",p.getStandardStatus());
|
|
json.put("standardStatus",p.getStandardStatus());
|
|
//设备状态:0未绑定,1血糖仪,2血压仪,3血糖仪+血压仪
|
|
//设备状态:0未绑定,1血糖仪,2血压仪,3血糖仪+血压仪
|
|
Integer deviceType = 0;
|
|
|
|
|
|
String deviceType = "";
|
|
if(!patientDeviceTypeMap.isEmpty() && patientDeviceTypeMap.keySet().contains(p.getCode())){
|
|
if(!patientDeviceTypeMap.isEmpty() && patientDeviceTypeMap.keySet().contains(p.getCode())){
|
|
deviceType = (Integer) patientDeviceTypeMap.get(p.getCode());
|
|
|
|
|
|
deviceType = (String) patientDeviceTypeMap.get(p.getCode());
|
|
}
|
|
}
|
|
json.put("deviceType",deviceType);
|
|
json.put("deviceType",deviceType);
|
|
|
|
|