|
@ -611,18 +611,6 @@ public class DoctorSchemeService {
|
|
patients = jdbcTemplate.query(patientsql, new BeanPropertyRowMapper(PatientVO.class));
|
|
patients = jdbcTemplate.query(patientsql, new BeanPropertyRowMapper(PatientVO.class));
|
|
|
|
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
JSONObject green = new JSONObject();//绿标
|
|
|
|
JSONObject yellow = new JSONObject();//黄标
|
|
|
|
JSONObject red = new JSONObject();//红标
|
|
|
|
JSONObject pressure_standard = new JSONObject();//血压预警
|
|
|
|
JSONObject sugar_standard = new JSONObject();//血糖预警
|
|
|
|
|
|
|
|
JSONObject pressure_count = new JSONObject();//血压体征总数
|
|
|
|
JSONObject pressure_unusual_ount = new JSONObject();//血压体征总数
|
|
|
|
JSONObject sugar_count = new JSONObject();//血糖体征总数
|
|
|
|
JSONObject sugar_unusual_count = new JSONObject();//血糖体征总数
|
|
|
|
|
|
|
|
int count = patients.size();
|
|
|
|
//绿标居民
|
|
//绿标居民
|
|
List<PatientVO> green_patients = new ArrayList<>();
|
|
List<PatientVO> green_patients = new ArrayList<>();
|
|
//黄标居民
|
|
//黄标居民
|
|
@ -652,12 +640,13 @@ public class DoctorSchemeService {
|
|
}
|
|
}
|
|
|
|
|
|
//获取预警居民CODES
|
|
//获取预警居民CODES
|
|
if (1 == getstands && (patient.getStandardStatus() != null && patient.getStandardStatus() == 1)) {
|
|
|
|
if (patient.getDisease() != null) {
|
|
|
|
|
|
if (1 == getstands && patient.getStandardStatus() != null && patient.getDisease() != null) {
|
|
|
|
if(patient.getStandardStatus()==1||patient.getStandardStatus()==3){
|
|
if ("1".equals(patient.getDisease())|| "3".equals(patient.getDisease()) || "1,2".equals(patient.getDisease()) || "2,1".equals(patient.getDisease())) {
|
|
if ("1".equals(patient.getDisease())|| "3".equals(patient.getDisease()) || "1,2".equals(patient.getDisease()) || "2,1".equals(patient.getDisease())) {
|
|
bloodpressure_patientcodes.add(patient.getCode());
|
|
bloodpressure_patientcodes.add(patient.getCode());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
if(patient.getStandardStatus()==2||patient.getStandardStatus()==3){
|
|
if ("2".equals(patient.getDisease())|| "3".equals(patient.getDisease()) || "1,2".equals(patient.getDisease()) || "2,1".equals(patient.getDisease())) {
|
|
if ("2".equals(patient.getDisease())|| "3".equals(patient.getDisease()) || "1,2".equals(patient.getDisease()) || "2,1".equals(patient.getDisease())) {
|
|
bloodsugar_patientcodes.add(patient.getCode());
|
|
bloodsugar_patientcodes.add(patient.getCode());
|
|
}
|
|
}
|
|
@ -679,7 +668,6 @@ public class DoctorSchemeService {
|
|
if (1 == gethealthindex) {
|
|
if (1 == gethealthindex) {
|
|
Date start = DateUtil.strToDate(startdate);
|
|
Date start = DateUtil.strToDate(startdate);
|
|
Date end = DateUtil.strToDate(enddate);
|
|
Date end = DateUtil.strToDate(enddate);
|
|
// List<DevicePatientHealthIndex> devicePatientHealthIndices = devicePatientHealthIndexDao.findByTeamcodeAndRecordDate(start,end,teamCode,doctorcode);
|
|
|
|
List<DevicePatientHealthIndex> devicePatientHealthIndices = devicePatientHealthIndexDao.findByDoctor(start, end, doctorcode);
|
|
List<DevicePatientHealthIndex> devicePatientHealthIndices = devicePatientHealthIndexDao.findByDoctor(start, end, doctorcode);
|
|
|
|
|
|
int sugar = 0;
|
|
int sugar = 0;
|
|
@ -2262,57 +2250,6 @@ public class DoctorSchemeService {
|
|
doctorSwitchDao.save(doctorSwitch);
|
|
doctorSwitchDao.save(doctorSwitch);
|
|
}
|
|
}
|
|
|
|
|
|
public JSONObject patientsByDoctorAndLabelCode(String labelCode, String doctorCode) {//1,2改变。
|
|
|
|
StringBuilder sqlLabelStr = new StringBuilder();
|
|
|
|
sqlLabelStr.append(" sp.label in ('").append(labelCode.replace(",", "','")).append("') ");
|
|
|
|
List<PatientVO> patients = new ArrayList<>();
|
|
|
|
String patientsql = "select * from (select p.code,p.standard_status,p.disease_condition,group_concat(DISTINCT sp.label order by sp.label asc ) as disease from wlyy_patient p " +
|
|
|
|
" LEFT JOIN wlyy_sign_family s on s.patient = p.code " +
|
|
|
|
" RIGHT JOIN wlyy_sign_patient_label_info sp on sp.patient = p.code and sp.label_type = 3 and " + sqlLabelStr.toString() + " and sp.status =1" +
|
|
|
|
" WHERE s.status > 0 and (s.doctor = '" + doctorCode + "' or s.doctor_health ='" + doctorCode + "') GROUP BY p.code " +
|
|
|
|
"order by sp.label asc)tmp where tmp.disease='" + labelCode + "'";
|
|
|
|
|
|
|
|
patients = jdbcTemplate.query(patientsql, new BeanPropertyRowMapper(PatientVO.class));
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
|
//绿标居民
|
|
|
|
List<PatientVO> green_patients = new ArrayList<>();
|
|
|
|
//黄标居民
|
|
|
|
List<PatientVO> yellow_patients = new ArrayList<>();
|
|
|
|
//红标居民
|
|
|
|
List<PatientVO> red_patients = new ArrayList<>();
|
|
|
|
if (!patients.isEmpty()) {
|
|
|
|
for (PatientVO patient : patients) {
|
|
|
|
//获取居民颜色标签
|
|
|
|
if (patient.getDiseaseCondition() != null) {
|
|
|
|
switch (patient.getDiseaseCondition()) {
|
|
|
|
case 0:
|
|
|
|
green_patients.add(patient);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
yellow_patients.add(patient);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
red_patients.add(patient);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
result.put("greencount", green_patients.size());
|
|
|
|
result.put("yellowcount", yellow_patients.size());
|
|
|
|
result.put("redcount", red_patients.size());
|
|
|
|
// 重点关注居民
|
|
|
|
List<TrackPatient> list = trackPatientDao.findByDoctorCodeAndDel(doctorCode, "1");
|
|
|
|
if (list != null && list.size() > 0) {
|
|
|
|
result.put("trackPatientCount", list.size());
|
|
|
|
} else {
|
|
|
|
result.put("trackPatientCount", 0);
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getCode() {
|
|
public String getCode() {
|
|
return UUID.randomUUID().toString().replaceAll("-", "");
|
|
return UUID.randomUUID().toString().replaceAll("-", "");
|
|
}
|
|
}
|
|
@ -2322,7 +2259,7 @@ public class DoctorSchemeService {
|
|
/**
|
|
/**
|
|
* 获取红黄绿标高血压糖尿病的指标人数
|
|
* 获取红黄绿标高血压糖尿病的指标人数
|
|
* disease 1高血压,2糖尿病,3高血压+糖尿病
|
|
* disease 1高血压,2糖尿病,3高血压+糖尿病
|
|
* 预警数量 a.standard_status='1'
|
|
|
|
|
|
* 预警数量 a.standard_status>1
|
|
*
|
|
*
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@ -2334,7 +2271,7 @@ public class DoctorSchemeService {
|
|
"INNER join wlyy_patient_label l on l.patient=a.id AND l.label_type='2' " +
|
|
"INNER join wlyy_patient_label l on l.patient=a.id AND l.label_type='2' " +
|
|
"left join wlyy_track_patient t on t.doctor_code='"+doctorId+"' and t.patient_code=a.id AND t.del='1' " +
|
|
"left join wlyy_track_patient t on t.doctor_code='"+doctorId+"' and t.patient_code=a.id AND t.del='1' " +
|
|
"WHERE 1=1\n" +
|
|
"WHERE 1=1\n" +
|
|
"AND a.standard_status='1'\n" +
|
|
|
|
|
|
"AND a.standard_status>0 " +
|
|
"and l.label_name='高血压' " +
|
|
"and l.label_name='高血压' " +
|
|
"AND b.doctor ='" + doctorId + "'";
|
|
"AND b.doctor ='" + doctorId + "'";
|
|
// 高血压
|
|
// 高血压
|
|
@ -2354,7 +2291,7 @@ public class DoctorSchemeService {
|
|
"INNER join wlyy_patient_label l on l.patient=a.id AND l.label_type='2' " +
|
|
"INNER join wlyy_patient_label l on l.patient=a.id AND l.label_type='2' " +
|
|
"left join wlyy_track_patient t on t.doctor_code='"+doctorId+"' and t.patient_code=a.id AND t.del='1' " +
|
|
"left join wlyy_track_patient t on t.doctor_code='"+doctorId+"' and t.patient_code=a.id AND t.del='1' " +
|
|
"WHERE 1=1\n" +
|
|
"WHERE 1=1\n" +
|
|
"AND a.standard_status='1'\n" +
|
|
|
|
|
|
"AND a.standard_status>0 " +
|
|
"and l.label_name='糖尿病' " +
|
|
"and l.label_name='糖尿病' " +
|
|
"AND b.doctor ='" + doctorId + "'";
|
|
"AND b.doctor ='" + doctorId + "'";
|
|
// 糖尿病
|
|
// 糖尿病
|