|
@ -52,6 +52,7 @@ public class DoctorFeldsherTemplateJob implements Job {
|
|
|
c.setTime(today);
|
|
|
int weekday=c.get(Calendar.DAY_OF_WEEK);
|
|
|
|
|
|
//查询当天医生设置的监测方案
|
|
|
List<DoctorSchemeBloodSugger> patientCodeList = schemeListDao.findSuggerPatient((short)weekday);
|
|
|
for (DoctorSchemeBloodSugger patientCodeLis : patientCodeList) {
|
|
|
String schemecode = patientCodeLis.getCode();
|
|
@ -240,21 +241,27 @@ public class DoctorFeldsherTemplateJob implements Job {
|
|
|
Date today = new Date();
|
|
|
|
|
|
if (minutes <= 30 && minutes > 0) {
|
|
|
PatientSchemeList patient = schemeListDao.findPatientBySchemecode(schemecode,type);
|
|
|
String patientCode = patient.getPatientcode();
|
|
|
//查询使用同一套监测方案的所有居民
|
|
|
List<PatientSchemeList> patientList = schemeListDao.findPatientBySchemecode(schemecode,type);
|
|
|
for (PatientSchemeList patient :patientList) {
|
|
|
String patientCode = patient.getPatientcode();
|
|
|
|
|
|
String day = formatDay.format(today);
|
|
|
Date begin = formatTime.parse(day + beginTime);
|
|
|
Date end = formatTime.parse(day + endTime);
|
|
|
List<DevicePatientHealthIndex> healthIndices = patientHealthIndexDao.findByPatient(patientCode, type, begin, end);
|
|
|
if (healthIndices==null || healthIndices.size()==0) {
|
|
|
try {
|
|
|
//为居民发送监测代办事项提醒消息
|
|
|
feldsherTemplateService.sendChangeTemplate(type, patientCode, comment);
|
|
|
} catch (Exception e) {
|
|
|
logger.info("DoctorFeldsherTemplateJob error ..........continue this JOB,CODE:" + patientCode + ",message:" + e.getMessage());
|
|
|
String day = formatDay.format(today);
|
|
|
Date begin = formatTime.parse(day + beginTime);
|
|
|
Date end = formatTime.parse(day + endTime);
|
|
|
//查询监测提醒时间段居民是否有对应设备数据上传
|
|
|
List<DevicePatientHealthIndex> healthIndices = patientHealthIndexDao.findByPatient(patientCode, type, begin, end);
|
|
|
if (healthIndices==null || healthIndices.size()==0) {
|
|
|
try {
|
|
|
//为居民发送监测代办事项提醒消息
|
|
|
feldsherTemplateService.sendChangeTemplate(type, patientCode, comment);
|
|
|
} catch (Exception e) {
|
|
|
logger.info("DoctorFeldsherTemplateJob error ..........continue this JOB,CODE:" + patientCode + ",message:" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|