|
@ -105,7 +105,7 @@ public class DoctorSchemeService {
|
|
|
public List<String> getPatientsByDiseaseConditionDiseaseDeviceType(String teamCode, Integer disease, String diseaseCondition, Integer deviceType, String doctorcode, String trackFlag) throws Exception {
|
|
|
String sql = "SELECT a.id\n" +
|
|
|
"FROM base_patient a \n" +
|
|
|
"INNER JOIN base_patient_doctor_relation b ON a.id=b.patient_id\n";
|
|
|
"INNER JOIN wlyy_outpatient b ON a.id=b.patient\n";
|
|
|
|
|
|
//1.4.2加入跟踪居民过滤
|
|
|
if (StringUtils.isNotBlank(trackFlag) && "1".equals(trackFlag)) {
|
|
@ -409,7 +409,7 @@ public class DoctorSchemeService {
|
|
|
" a.disease_condition \n" +
|
|
|
"FROM\n" +
|
|
|
" base_patient a \n" +
|
|
|
" INNER JOIN base_patient_doctor_relation b ON a.id=b.patient_id\n" +
|
|
|
" INNER JOIN wlyy_outpatient b ON a.id=b.patient\n" +
|
|
|
"WHERE 1=1\n" +
|
|
|
"AND a.disease_condition IN('1','2','3')\n" +
|
|
|
"AND a.disease IN ('1','2','1,2','2,1')\n" +
|
|
@ -2132,38 +2132,42 @@ public class DoctorSchemeService {
|
|
|
// 高血压预警
|
|
|
String sql01 = "SELECT count(DISTINCT a.id)\n" +
|
|
|
"FROM base_patient a \n" +
|
|
|
"INNER JOIN base_patient_doctor_relation b ON a.id=b.patient_id\n" +
|
|
|
"INNER JOIN wlyy_outpatient b ON a.id=b.patient " +
|
|
|
"INNER join wlyy_patient_label l on l.patient=a.id AND l.label_type='2' " +
|
|
|
"WHERE 1=1\n" +
|
|
|
"AND a.standard_status='1'\n" +
|
|
|
"AND a.disease_condition IN('1','2','3')\n" +
|
|
|
"AND a.disease IN ('1','3') \n" +
|
|
|
"AND b.doctor_id ='" + doctorId + "'";
|
|
|
"and l.label_name='高血压' " +
|
|
|
"AND b.doctor ='" + doctorId + "'";
|
|
|
// 高血压
|
|
|
String sql02 = "SELECT count(DISTINCT a.id)\n" +
|
|
|
"FROM base_patient a \n" +
|
|
|
"INNER JOIN base_patient_doctor_relation b ON a.id=b.patient_id\n" +
|
|
|
"INNER JOIN wlyy_outpatient b ON a.id=b.patient\n" +
|
|
|
"INNER join wlyy_patient_label l on l.patient=a.id AND l.label_type='2' " +
|
|
|
"WHERE 1=1\n" +
|
|
|
"AND a.disease_condition IN('1','2','3')\n" +
|
|
|
"AND a.disease IN ('1','3') \n" +
|
|
|
"AND b.doctor_id ='" + doctorId + "'";
|
|
|
"and l.label_name='高血压' " +
|
|
|
"AND b.doctor ='" + doctorId + "'";
|
|
|
|
|
|
// 糖尿病预警
|
|
|
String sql03 = "SELECT count(DISTINCT a.id)\n" +
|
|
|
"FROM base_patient a \n" +
|
|
|
"INNER JOIN base_patient_doctor_relation b ON a.id=b.patient_id\n" +
|
|
|
"INNER JOIN wlyy_outpatient b ON a.id=b.patient\n" +
|
|
|
"INNER join wlyy_patient_label l on l.patient=a.id AND l.label_type='2' " +
|
|
|
"WHERE 1=1\n" +
|
|
|
"AND a.standard_status='1'\n" +
|
|
|
"AND a.disease_condition IN('1','2','3')\n" +
|
|
|
"AND a.disease IN ('2','3') \n" +
|
|
|
"AND b.doctor_id ='" + doctorId + "'";
|
|
|
"and l.label_name='糖尿病' " +
|
|
|
"AND b.doctor ='" + doctorId + "'";
|
|
|
// 糖尿病
|
|
|
String sql04 = "SELECT count(DISTINCT a.id)\n" +
|
|
|
"FROM base_patient a \n" +
|
|
|
"INNER JOIN base_patient_doctor_relation b ON a.id=b.patient_id\n" +
|
|
|
"INNER JOIN wlyy_outpatient b ON a.id=b.patient\n" +
|
|
|
"INNER join wlyy_patient_label l on l.patient=a.id AND l.label_type='2' " +
|
|
|
"WHERE 1=1\n" +
|
|
|
"AND a.disease_condition IN('1','2','3')\n" +
|
|
|
"AND a.disease IN ('2','3') \n" +
|
|
|
"AND b.doctor_id ='" + doctorId + "'";
|
|
|
"and l.label_name='糖尿病' " +
|
|
|
"AND b.doctor ='" + doctorId + "'";
|
|
|
|
|
|
CompletableFuture<Integer> future01 = CompletableFuture.supplyAsync(() -> {
|
|
|
Integer count = jdbcTemplate.queryForObject(sql01, Integer.class);
|
|
@ -2202,18 +2206,19 @@ public class DoctorSchemeService {
|
|
|
*/
|
|
|
public List<Map<String, Object>> getLabelDetail(String doctorId, String labelType, String searchContent, int page, int pageSize) {
|
|
|
String sql = "SELECT DISTINCT a.id,a.`name`,a.idcard,a.mobile,a.ssc, TIMESTAMPDIFF(YEAR, a.birthday, CURDATE()) AS age " +
|
|
|
",a.sex,a.disease,a.disease_condition diseaseCondition,a.photo,a.standard_status standardStatus" +
|
|
|
",a.sex,a.disease,a.disease_condition diseaseCondition,a.photo,a.standard_status standardStatus " +
|
|
|
"FROM base_patient a \n" +
|
|
|
"INNER JOIN base_patient_doctor_relation b ON a.id=b.patient_id\n" +
|
|
|
"INNER JOIN wlyy_outpatient b ON a.id=b.patient\n" +
|
|
|
"INNER join wlyy_patient_label l on l.patient=a.id AND l.label_type='2' " +
|
|
|
"WHERE 1=1\n" +
|
|
|
"AND a.disease_condition IN('1','2','3') " +
|
|
|
"AND b.doctor_id ='" + doctorId + "'";
|
|
|
"AND b.doctor ='" + doctorId + "'";
|
|
|
if (StringUtils.isNotBlank(labelType)) {
|
|
|
if ("1".equals(labelType)) {
|
|
|
sql += "AND a.disease IN ('1','3') \n";
|
|
|
sql += "AND l.label_name='高血压' \n";
|
|
|
}
|
|
|
if ("2".equals(labelType)) {
|
|
|
sql += "AND a.disease IN ('2','3') \n";
|
|
|
sql += "AND l.label_name='糖尿病' \n";
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(searchContent)) {
|