|
@ -410,7 +410,7 @@ public class RehabilitationInfoService {
|
|
|
// "f.czrq,f.doctor_name doctorName,f.doctor_health_name doctorHealthName,f.hospital_name hospitalName,f.admin_team_code teamCode " +
|
|
|
// " from wlyy_patient_discharge d,wlyy_patient p,wlyy_sign_family f\n" +
|
|
|
// "where 1=1 " + filterSql + " and ( ISNULL(d.type) or d.type=2) AND p. CODE = d.patient AND d.patient=f.patient AND f.`status`=1 AND f.sign_year='" + DateUtil.getSignYear() + "' AND d.patient NOT IN \n" +
|
|
|
// "( SELECT i.patient FROM wlyy_specialist.wlyy_patient_rehabilitation_plan i,wlyy_patient p WHERE i.create_user = '" + doctorCode + "' \n" +
|
|
|
// "( SELECT i.patient FROM wlyy_patient_rehabilitation_plan i,wlyy_patient p WHERE i.create_user = '" + doctorCode + "' \n" +
|
|
|
// "AND i. STATUS != 0 AND p. CODE = i.patient GROUP BY i.patient ORDER BY i.create_time desc)GROUP BY d.patient ORDER BY d.create_time DESC ";
|
|
|
|
|
|
String sql = "SELECT \n" +
|
|
@ -455,7 +455,7 @@ public class RehabilitationInfoService {
|
|
|
// " from wlyy_patient p,wlyy_patient_discharge d " +
|
|
|
// " left JOIN wlyy_sign_family f on d.patient=f.patient AND f.`status`=1 AND f.sign_year='" + DateUtil.getSignYear() + "'" +
|
|
|
// "where 1=1 " + filterSql + " and ( ISNULL(d.type) or d.type=2) AND p. CODE = d.patient AND d.patient NOT IN \n" +
|
|
|
// "( SELECT DISTINCT i.patient FROM wlyy_specialist.wlyy_patient_rehabilitation_plan i,wlyy_patient p WHERE i.create_user = '" + doctorCode + "' \n" +
|
|
|
// "( SELECT DISTINCT i.patient FROM wlyy_patient_rehabilitation_plan i,wlyy_patient p WHERE i.create_user = '" + doctorCode + "' \n" +
|
|
|
// "AND i. STATUS != 0 AND p. CODE = i.patient )GROUP BY d.patient ORDER BY d.create_time DESC ";
|
|
|
|
|
|
String sql = "SELECT '' id, p.idcard,p.id 'patient',p.`name` patientName,p.sex,d.age,p.address,\n" +
|
|
@ -485,8 +485,8 @@ public class RehabilitationInfoService {
|
|
|
// " i. STATUS, p. NAME patientName, p.address, CONCAT(s.doctor_name,'(全科医生)' ) AS doctorName, \n" +
|
|
|
// "IFNULL(CONCAT(s.doctor_health_name,'(健管师)'), s.doctor_health_name ) doctorHealthName, s.hospital_name hospitalName, \n" +
|
|
|
// "s.admin_team_code teamCode ,pr.is_manage isManage \n" +
|
|
|
// "FROM wlyy_specialist.wlyy_patient_rehabilitation_plan i, wlyy_sign_family s, wlyy_patient p ,\n" +
|
|
|
// "wlyy_specialist.wlyy_specialist_patient_relation pr \n" +
|
|
|
// "FROM wlyy_patient_rehabilitation_plan i, wlyy_sign_family s, wlyy_patient p ,\n" +
|
|
|
// "wlyy_specialist_patient_relation pr \n" +
|
|
|
// "WHERE i.create_user = '" + doctorCode + "' AND i.status != 0 AND i.patient = s.patient AND p.code = i.patient AND s.status = 1 \n" +
|
|
|
// "AND s.expenses_status = 1 AND pr.patient=p.code and pr.team_code = i.team_code and pr.`status`>=0 and pr.sign_status=1 " +
|
|
|
// " and (pr.is_manage != 1 OR isnull(pr.is_manage)) ";
|
|
@ -538,8 +538,8 @@ public class RehabilitationInfoService {
|
|
|
*/
|
|
|
public JSONObject downCount(String doctorCode, JSONObject object) {
|
|
|
// String sql1 = "SELECT COUNT(distinct i.patient) \n" +
|
|
|
// "FROM wlyy_specialist.wlyy_patient_rehabilitation_plan i, wlyy_sign_family s, wlyy_patient p ,\n" +
|
|
|
// "wlyy_specialist.wlyy_specialist_patient_relation pr \n" +
|
|
|
// "FROM wlyy_patient_rehabilitation_plan i, wlyy_sign_family s, wlyy_patient p ,\n" +
|
|
|
// "wlyy_specialist_patient_relation pr \n" +
|
|
|
// "WHERE i.create_user = '" + doctorCode + "' AND i.status != 0 AND i.patient = s.patient AND p.code = i.patient AND s.status = 1 \n" +
|
|
|
// "AND s.expenses_status = 1 AND pr.patient=p.code and pr.team_code = i.team_code and pr.`status`>=0 and pr.sign_status=1 ";
|
|
|
String sql1 = "SELECT \n" +
|
|
@ -553,7 +553,7 @@ public class RehabilitationInfoService {
|
|
|
|
|
|
//康复计划数量
|
|
|
// String sql2 = "SELECT COUNT(distinct i.id) \n" +
|
|
|
// "FROM wlyy_specialist.wlyy_patient_rehabilitation_plan i, wlyy_sign_family s, wlyy_patient p\n" +
|
|
|
// "FROM wlyy_patient_rehabilitation_plan i, wlyy_sign_family s, wlyy_patient p\n" +
|
|
|
// "WHERE i.create_user = '" + doctorCode + "' AND i.status != 0 AND i.patient = s.patient AND p.code = i.patient \n" +
|
|
|
// "AND s.status = 1 AND s.expenses_status = 1 ";
|
|
|
String sql2 = "SELECT COUNT(distinct i.id) \n" +
|
|
@ -566,8 +566,8 @@ public class RehabilitationInfoService {
|
|
|
|
|
|
//家医接收
|
|
|
// String sql3 = "SELECT COUNT(distinct i.patient) " +
|
|
|
// " FROM wlyy_specialist.wlyy_patient_rehabilitation_plan i, wlyy_sign_family s, wlyy_patient p ,\n" +
|
|
|
// " wlyy_specialist.wlyy_specialist_patient_relation pr \n" +
|
|
|
// " FROM wlyy_patient_rehabilitation_plan i, wlyy_sign_family s, wlyy_patient p ,\n" +
|
|
|
// " wlyy_specialist_patient_relation pr \n" +
|
|
|
// " WHERE i.create_user = '" + doctorCode + "' AND i.status != 0 AND i.patient = s.patient AND p.code = i.patient AND s.status = 1 \n" +
|
|
|
// " AND s.expenses_status = 1 AND pr.patient=p.code and pr.team_code = i.team_code and pr.`status`>=0 and pr.sign_status=1 and pr.is_manage=1";
|
|
|
// Integer list3 = jdbcTemplate.queryForObject(sql3, Integer.class);
|
|
@ -587,8 +587,8 @@ public class RehabilitationInfoService {
|
|
|
// " i. STATUS, p. NAME patientName, p.address, CONCAT(s.doctor_name,'(全科医生)' ) AS doctorName, \n" +
|
|
|
// "IFNULL(CONCAT(s.doctor_health_name,'(健管师)'), s.doctor_health_name ) doctorHealthName, s.hospital_name hospitalName, \n" +
|
|
|
// "s.admin_team_code teamCode ,pr.is_manage isManage \n" +
|
|
|
// "FROM wlyy_specialist.wlyy_patient_rehabilitation_plan i, wlyy_sign_family s, wlyy_patient p ,\n" +
|
|
|
// "wlyy_specialist.wlyy_specialist_patient_relation pr \n" +
|
|
|
// "FROM wlyy_patient_rehabilitation_plan i, wlyy_sign_family s, wlyy_patient p ,\n" +
|
|
|
// "wlyy_specialist_patient_relation pr \n" +
|
|
|
// "WHERE i.create_user = '" + doctorCode + "' AND i.status != 0 AND i.patient = s.patient AND p.code = i.patient AND s.status = 1 \n" +
|
|
|
// "AND s.expenses_status = 1 AND pr.patient=p.code and pr.team_code = i.team_code and pr.`status`>=0 and pr.sign_status=1 and pr.is_manage=1";
|
|
|
|
|
@ -635,8 +635,8 @@ public class RehabilitationInfoService {
|
|
|
// " i. STATUS, p. NAME patientName, p.address, CONCAT(s.doctor_name,'(全科医生)' ) AS doctorName, \n" +
|
|
|
// "IFNULL(CONCAT(s.doctor_health_name,'(健管师)'), s.doctor_health_name ) doctorHealthName, s.hospital_name hospitalName, \n" +
|
|
|
// "s.admin_team_code teamCode ,pr.is_manage isManage \n" +
|
|
|
// "FROM wlyy_specialist.wlyy_patient_rehabilitation_plan i, wlyy_sign_family s, wlyy_patient p ,\n" +
|
|
|
// "wlyy_specialist.wlyy_specialist_patient_relation pr \n" +
|
|
|
// "FROM wlyy_patient_rehabilitation_plan i, wlyy_sign_family s, wlyy_patient p ,\n" +
|
|
|
// "wlyy_specialist_patient_relation pr \n" +
|
|
|
// "WHERE i.create_user = '" + doctorCode + "' AND i.status != 0 AND i.patient = s.patient AND p.code = i.patient AND s.status = 1 \n" +
|
|
|
// "AND s.expenses_status = 1 AND pr.patient=p.code and pr.team_code = i.team_code and pr.`status`>=0 and pr.sign_status=1 ";
|
|
|
|
|
@ -771,15 +771,15 @@ public class RehabilitationInfoService {
|
|
|
String sql1 = "SELECT s.idcard, s.patient, i. STATUS, p. NAME patientName, p.address, CONCAT(s.doctor_name,'(全科医生)' ) AS doctorName, \n" +
|
|
|
"IFNULL(CONCAT(s.doctor_health_name,'(健管师)'), s.doctor_health_name ) doctorHealthName, s.hospital_name hospitalName, \n" +
|
|
|
"s.admin_team_code teamCode ,pr.is_manage isManage \n" +
|
|
|
"FROM wlyy_specialist.wlyy_patient_rehabilitation_plan i, wlyy_sign_family s, wlyy_patient p ,\n" +
|
|
|
"wlyy_specialist.wlyy_specialist_patient_relation pr \n" +
|
|
|
"FROM wlyy_patient_rehabilitation_plan i, wlyy_sign_family s, wlyy_patient p ,\n" +
|
|
|
"wlyy_specialist_patient_relation pr \n" +
|
|
|
"WHERE i.create_user = '" + doctorCode + "' AND i.status != 0 AND i.patient = s.patient AND p.code = i.patient AND s.status = 1 \n" +
|
|
|
"AND s.expenses_status = 1 AND pr.patient=p.code GROUP BY i.patient ORDER BY i.create_time DESC ";
|
|
|
List<Map<String, Object>> list1 = jdbcTemplate.queryForList(sql1);
|
|
|
//康复计划数量
|
|
|
String sql2 = "SELECT s.idcard, s.patient, i. STATUS, p. NAME patientName, p.address, CONCAT(s.doctor_name,'(全科医生)' ) AS doctorName, \n" +
|
|
|
"IFNULL(CONCAT(s.doctor_health_name,'(健管师)'), s.doctor_health_name ) doctorHealthName, s.hospital_name hospitalName, s.admin_team_code teamCode \n" +
|
|
|
"FROM wlyy_specialist.wlyy_patient_rehabilitation_plan i, wlyy_sign_family s, wlyy_patient p\n" +
|
|
|
"FROM wlyy_patient_rehabilitation_plan i, wlyy_sign_family s, wlyy_patient p\n" +
|
|
|
"WHERE i.create_user = '" + doctorCode + "' AND i.status != 0 AND i.patient = s.patient AND p.code = i.patient \n" +
|
|
|
"AND s.status = 1 AND s.expenses_status = 1 GROUP BY i.id";
|
|
|
List<Map<String, Object>> list2 = jdbcTemplate.queryForList(sql2);
|
|
@ -789,8 +789,8 @@ public class RehabilitationInfoService {
|
|
|
"SELECT s.idcard, s.patient, i. STATUS, p. NAME patientName, p.address, CONCAT(s.doctor_name,'(全科医生)' ) AS doctorName, \n" +
|
|
|
"IFNULL(CONCAT(s.doctor_health_name,'(健管师)'), s.doctor_health_name ) doctorHealthName, s.hospital_name hospitalName, \n" +
|
|
|
"s.admin_team_code teamCode ,pr.is_manage isManage \n" +
|
|
|
"FROM wlyy_specialist.wlyy_patient_rehabilitation_plan i, wlyy_sign_family s, wlyy_patient p ,\n" +
|
|
|
"wlyy_specialist.wlyy_specialist_patient_relation pr \n" +
|
|
|
"FROM wlyy_patient_rehabilitation_plan i, wlyy_sign_family s, wlyy_patient p ,\n" +
|
|
|
"wlyy_specialist_patient_relation pr \n" +
|
|
|
"WHERE i.create_user = '" + doctorCode + "' AND i.status != 0 AND i.patient = s.patient AND p.code = i.patient AND s.status = 1 \n" +
|
|
|
"AND s.expenses_status = 1 AND pr.patient=p.code GROUP BY i.patient ORDER BY i.create_time DESC\n" +
|
|
|
") aa\n" +
|
|
@ -1288,8 +1288,16 @@ public class RehabilitationInfoService {
|
|
|
/**
|
|
|
* 查询病例信息
|
|
|
*/
|
|
|
public List<PatientMedicalRecordsDO> getPatientMedicalRecordsByPatientId(String patientId) {
|
|
|
String sql = "select * from wlyy_patient_medical_records_rehabilitation where patient='" + patientId + "' order by create_time desc ";
|
|
|
public List<PatientMedicalRecordsDO> getPatientMedicalRecordsByPlanId(String planId) {
|
|
|
String sql = "SELECT\n" +
|
|
|
" a.* \n" +
|
|
|
"FROM\n" +
|
|
|
" wlyy_patient_medical_records_rehabilitation a\n" +
|
|
|
" INNER JOIN wlyy_patient_rehabilitation_plan b ON a.`CODE` = b.medical_records_code \n" +
|
|
|
"WHERE\n" +
|
|
|
" b.id = '" + planId + "' \n" +
|
|
|
"ORDER BY\n" +
|
|
|
" create_time DESC ";
|
|
|
List<PatientMedicalRecordsDO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(PatientMedicalRecordsDO.class));
|
|
|
return list;
|
|
|
}
|