trick9191 7 лет назад
Родитель
Сommit
1f6c2cac74

+ 45 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java

@ -15,6 +15,8 @@ import com.yihu.wlyy.health.repository.DevicePatientHealthIndexDao;
import com.yihu.wlyy.repository.consult.ConsultTeamDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.doctor.DoctorSwitchDao;
import com.yihu.wlyy.repository.doctor.PatientAimBloodPressureDao;
import com.yihu.wlyy.repository.doctor.PatientAimBloodSuggerDao;
import com.yihu.wlyy.repository.doctor.health.DoctorHealthStandardDao;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.patient.*;
@ -96,6 +98,10 @@ public class PatientHealthIndexService extends BaseService {
    private TrackPatientDao trackPatientDao;
    @Autowired
    private IotDeviceService iotDeviceService;
    @Autowired
    private PatientAimBloodSuggerDao patientAimBloodSuggerDao;
    @Autowired
    private PatientAimBloodPressureDao patientAimBloodPressureDao;
    /**
     * 获取居民标准预警值
@ -915,6 +921,41 @@ public class PatientHealthIndexService extends BaseService {
	    //连续5次体征值正常,则修改为非预警状态;连续5次异常,修改为预警状态-----END
    }
    /**
     * 设置默认监控方案
     * @param patient
     * @return
     */
    public String setDefaultAim(String patient){
        PatientAimBloodSugger patientAimBloodSugger = patientAimBloodSuggerDao.findByPatientcode(patient);
        PatientAimBloodPressure patientAimBloodPressure =  patientAimBloodPressureDao.findByPatientcode(patient);
        if(patientAimBloodSugger==null){
            PatientAimBloodSugger pa = new PatientAimBloodSugger();
            pa.setPatientcode(patient);
            pa.setCode(getCode());
            pa.setCreateTime(new Date());
            pa.setUnit("mmol/L");
            pa.setFbg("7.0");
            pa.setHpg("11.1");
            pa.setFbgMin("4.0");
            pa.setHpgMin("4.0");
            patientAimBloodSuggerDao.save(pa);
        }
        if(patientAimBloodPressure==null){
            PatientAimBloodPressure pa = new PatientAimBloodPressure();
            pa.setPatientcode(patient);
            pa.setCode(getCode());
            pa.setCreateTime(new Date());
            pa.setSbp("140");
            pa.setSbpMin("90");
            pa.setDbp("90");
            pa.setDbpMin("60");
            pa.setUnit("mmHg");
            patientAimBloodPressureDao.save(pa);
        }
        return "1";
    }
    /**
     * 设置
     * @param patient
@ -950,6 +991,8 @@ public class PatientHealthIndexService extends BaseService {
                    t.setPatientName(p.getName());
                    t.setDel("1");
                    trackPatientDao.save(t);
                    //设置默认控制目标
                    setDefaultAim(patient);
                }else{
                    trackPatient.setDel("1");
                    trackPatientDao.save(trackPatient);
@ -973,6 +1016,8 @@ public class PatientHealthIndexService extends BaseService {
                    t.setPatientName(p.getName());
                    t.setDel("1");
                    trackPatientDao.save(t);
                    //设置默认控制目标
                    setDefaultAim(patient);
                }else{
                    trackPatient.setDel("1");
                    trackPatientDao.save(trackPatient);

+ 5 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java

@ -16,6 +16,7 @@ import com.yihu.wlyy.repository.doctor.SignPatientLabelInfoDao;
import com.yihu.wlyy.repository.patient.*;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.account.PatientInfoService;
import com.yihu.wlyy.service.app.health.PatientHealthIndexService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.IdCardUtil;
@ -77,6 +78,8 @@ public class SignPatientLabelInfoService extends BaseService {
    PatientInfoService patientInfoService;
    @Autowired
    TrackPatientDao trackPatientDao;
    @Autowired
    PatientHealthIndexService patientHealthIndexService;
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
@ -288,6 +291,8 @@ public class SignPatientLabelInfoService extends BaseService {
                return "-1";
            }
            trackPatientDao.save(tkp);
            //设置默认控制目标
            patientHealthIndexService.setDefaultAim(patient);
        }
        return "1";
    }

+ 0 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/scheme/DoctorSchemeService.java

@ -1489,7 +1489,6 @@ public class DoctorSchemeService extends BaseService{
                    patientAimSportsDao.delete(sport);
                }
                net.sf.json.JSONObject sj  = net.sf.json.JSONObject.fromObject(suggerJson);
                net.sf.json.JSONObject pj  = net.sf.json.JSONObject.fromObject(presJson);
                net.sf.json.JSONObject spj  = net.sf.json.JSONObject.fromObject(sportJson);

+ 7 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/PatientService.java

@ -425,6 +425,13 @@ public class PatientService extends TokenService {
        return rs;
    }
    public JSONObject checkCanRenewNew(String patient){
        //判断是否有生效记录SQL
        String sql = "SELECT t.id,t.sign_year signYear FROM wlyy_sign_family t WHERE t.patient ='" + patient + "' AND t.status>=0 AND t.expenses_status='1'";
        return null;
    }
    /**
     * 判断是否可以续签
     *
@ -1099,5 +1106,4 @@ public class PatientService extends TokenService {
        }
        return true;
    }
}

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/DateUtil.java

@ -1234,4 +1234,5 @@ public class DateUtil {
		int week = c.get(Calendar.DAY_OF_WEEK);
		return week;
	}
}