|
@ -6,14 +6,12 @@ import com.yihu.device.entity.DevicePatientHealthIndex;
|
|
|
import com.yihu.wlyy.entity.device.PatientDevice;
|
|
|
import com.yihu.wlyy.entity.message.Message;
|
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
|
import com.yihu.wlyy.entity.patient.PatientAimSports;
|
|
|
import com.yihu.wlyy.entity.patient.PatientHealthStandard;
|
|
|
import com.yihu.wlyy.entity.patient.SignFamily;
|
|
|
import com.yihu.wlyy.health.repository.DevicePatientHealthIndexDao;
|
|
|
import com.yihu.wlyy.repository.message.MessageDao;
|
|
|
import com.yihu.wlyy.repository.patient.PatientDao;
|
|
|
import com.yihu.wlyy.repository.patient.PatientDeviceDao;
|
|
|
import com.yihu.wlyy.repository.patient.PatientHealthStandardDao;
|
|
|
import com.yihu.wlyy.repository.patient.SignFamilyDao;
|
|
|
import com.yihu.wlyy.repository.patient.*;
|
|
|
import com.yihu.wlyy.service.BaseService;
|
|
|
import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
|
|
|
import com.yihu.wlyy.task.HealthIndexUploadTask;
|
|
@ -40,6 +38,7 @@ import org.springside.modules.persistence.SearchFilter;
|
|
|
import org.springside.modules.persistence.SearchFilter.Operator;
|
|
|
import org.springside.modules.utils.Clock;
|
|
|
|
|
|
import java.text.DecimalFormat;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
@ -59,22 +58,20 @@ public class PatientHealthIndexService extends BaseService {
|
|
|
private MessageDao messageDao;
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
@Autowired
|
|
|
private SignFamilyDao signFamilyDao;
|
|
|
|
|
|
@Autowired
|
|
|
private ObjectMapper objectMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private PatientDeviceDao patientDeviceDao;
|
|
|
@Autowired
|
|
|
private DoctorWorkTimeService doctorWorkTimeService;
|
|
|
|
|
|
@Autowired
|
|
|
private CommonUtil CommonUtil;
|
|
|
@Autowired
|
|
|
private PushMsgTask pushMsgTask;
|
|
|
@Autowired
|
|
|
private PatientAimSportsDao patientAimSportsDao;
|
|
|
|
|
|
|
|
|
|
|
@ -724,7 +721,36 @@ public class PatientHealthIndexService extends BaseService {
|
|
|
}
|
|
|
case "3": {
|
|
|
obj.setType(3);
|
|
|
obj.setValue1(map.get("weight")); //体重
|
|
|
|
|
|
String weight = map.get("weight");
|
|
|
String height = map.get("height");
|
|
|
|
|
|
obj.setValue1(weight); //体重
|
|
|
obj.setValue2(height); //身高
|
|
|
|
|
|
PatientAimSports patientAimSports = new PatientAimSports();
|
|
|
patientAimSports = patientAimSportsDao.getPatientAimSportsByPatientCode(patientCode);
|
|
|
//如果该患者没有设置运动目标,则获取预置数据
|
|
|
if(patientAimSports == null || StringUtils.isBlank(patientAimSports.getCode())){
|
|
|
patientAimSports = patientAimSportsDao.findByCode("default");
|
|
|
}
|
|
|
|
|
|
double bmi = CommonUtil.getBMIByWeightAndHeight(map.get("weight"),map.get("height"));
|
|
|
DecimalFormat df1 = new DecimalFormat("###.00");
|
|
|
obj.setValue3(df1.format(bmi));
|
|
|
|
|
|
if(patientAimSports != null && StringUtils.isNoneEmpty(patientAimSports.getCode())){
|
|
|
|
|
|
//设置BMI值
|
|
|
if(bmi < Double.parseDouble(patientAimSports.getBmiMin())){
|
|
|
obj.setValue4("1");
|
|
|
}else if(bmi > Double.parseDouble(patientAimSports.getBmiMax())){
|
|
|
obj.setValue4("-1");
|
|
|
}else{
|
|
|
obj.setValue4("0");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
}
|
|
|
case "4": {
|