|
@ -7,9 +7,11 @@ import com.yihu.jw.device.dao.DevicePatientHealthIndexDao;
|
|
|
import com.yihu.jw.device.dao.PatientAimBloodPressureDao;
|
|
|
import com.yihu.jw.device.dao.PatientAimBloodSuggerDao;
|
|
|
import com.yihu.jw.device.dao.PatientAimSportsDao;
|
|
|
import com.yihu.jw.doctor.dao.BaseDoctorDao;
|
|
|
import com.yihu.jw.entity.base.device.PatientAimBloodPressure;
|
|
|
import com.yihu.jw.entity.base.device.PatientAimBloodSugger;
|
|
|
import com.yihu.jw.entity.base.device.PatientAimSports;
|
|
|
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
|
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
|
import com.yihu.jw.entity.care.device.DevicePatientHealthIndex;
|
|
|
import com.yihu.jw.entity.scheme.*;
|
|
@ -68,7 +70,8 @@ public class DoctorSchemeService {
|
|
|
|
|
|
@Autowired
|
|
|
private BasePatientDao patientDao;
|
|
|
|
|
|
@Autowired
|
|
|
private BaseDoctorDao doctorDao;
|
|
|
@Autowired
|
|
|
private DevicePatientHealthIndexDao devicePatientHealthIndexDao;
|
|
|
|
|
@ -90,6 +93,56 @@ public class DoctorSchemeService {
|
|
|
@Value("${im.data_base_name}")
|
|
|
private String im_dataBase_name;
|
|
|
|
|
|
//取消重点关注
|
|
|
public void delTrack(String patient,String doctor){
|
|
|
synchronized (patient.intern()){
|
|
|
//查询是否与医生建立重点跟踪关系,诺无关系则建立
|
|
|
TrackPatient trackPatient = trackPatientDao.findByDoctorCodeAndPatientCode(doctor,patient);
|
|
|
if(trackPatient == null){
|
|
|
BaseDoctorDO doctorDO = doctorDao.findByIdAndDel(doctor);
|
|
|
BasePatientDO patientDO = patientDao.findByIdAndDel(patient,"1");
|
|
|
TrackPatient t = new TrackPatient();
|
|
|
t.setCreateTime(new Date());
|
|
|
t.setDoctorCode(doctorDO.getId());
|
|
|
t.setDoctorName(doctorDO.getName());
|
|
|
t.setIdcard(patientDO.getIdcard());
|
|
|
t.setSsc(patientDO.getSsc());
|
|
|
t.setPatientCode(patient);
|
|
|
t.setPatientName(patientDO.getName());
|
|
|
t.setDel("0");
|
|
|
trackPatientDao.save(t);
|
|
|
}else {
|
|
|
trackPatient.setDel("0");
|
|
|
trackPatientDao.save(trackPatient);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//添加重点关注
|
|
|
public void addTrack(String patient,String doctor){
|
|
|
synchronized (patient.intern()){
|
|
|
//查询是否与医生建立重点跟踪关系,诺无关系则建立
|
|
|
TrackPatient trackPatient = trackPatientDao.findByDoctorCodeAndPatientCode(doctor,patient);
|
|
|
if(trackPatient == null){
|
|
|
BaseDoctorDO doctorDO = doctorDao.findByIdAndDel(doctor);
|
|
|
BasePatientDO patientDO = patientDao.findByIdAndDel(patient,"1");
|
|
|
TrackPatient t = new TrackPatient();
|
|
|
t.setCreateTime(new Date());
|
|
|
t.setDoctorCode(doctorDO.getId());
|
|
|
t.setDoctorName(doctorDO.getName());
|
|
|
t.setIdcard(patientDO.getIdcard());
|
|
|
t.setSsc(patientDO.getSsc());
|
|
|
t.setPatientCode(patient);
|
|
|
t.setPatientName(patientDO.getName());
|
|
|
t.setDel("1");
|
|
|
trackPatientDao.save(t);
|
|
|
}else {
|
|
|
trackPatient.setDel("1");
|
|
|
trackPatientDao.save(trackPatient);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 根据团队CODE/居民标签/病情/设备绑定状态查询团队具名CODE列表
|
|
@ -1044,7 +1097,6 @@ public class DoctorSchemeService {
|
|
|
}
|
|
|
|
|
|
public Map<String, Object> getTrackPatientCountTitle(String doctor, String startDate, String endDate) {
|
|
|
// List<TrackPatient> trackPatients = trackPatientDao.findByDoctorCodeAndTeamCodeAndDel(doctor, teamCode, "1");
|
|
|
List<TrackPatient> trackPatients = trackPatientDao.findByDoctor(doctor, "1");
|
|
|
Map<String, Object> rs = new HashedMap();
|
|
|
rs.put("trackPatientCount", trackPatients.size());
|