|
@ -78,6 +78,72 @@ public class PatientHealthIndexService extends BaseService {
|
|
|
@Autowired
|
|
|
private DoctorHealthStandardDao doctorHealthStandardDao;
|
|
|
|
|
|
/**
|
|
|
* 获取居民标准预警值
|
|
|
* @param type
|
|
|
* @param patientCode
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONObject getealthStandard(Integer type,String patientCode){
|
|
|
//血糖校验
|
|
|
JSONObject json = new JSONObject();
|
|
|
if (type == 1) {
|
|
|
// 血糖记录,查询患者血糖预警值
|
|
|
PatientHealthStandard standard = patientHealthStandardDao.findByPatientType(patientCode, 1);
|
|
|
Double maxValueBefore = SystemConf.HEALTH_STANDARD_ST_MAX_BEFORE;
|
|
|
Double minValueBefore = SystemConf.HEALTH_STANDARD_ST_MIN_BEFORE;
|
|
|
Double maxValueAfter = SystemConf.HEALTH_STANDARD_ST_MAX_AFTER;
|
|
|
Double minValueAfter = SystemConf.HEALTH_STANDARD_ST_MIN_AFTER;
|
|
|
if (standard != null) {
|
|
|
if (standard.getMaxValue1() > 0) {
|
|
|
maxValueBefore = standard.getMaxValue1();
|
|
|
}
|
|
|
if (standard.getMinValue1() > 0) {
|
|
|
minValueBefore = standard.getMinValue1();
|
|
|
}
|
|
|
if (standard.getMaxValue2() > 0) {
|
|
|
maxValueAfter = standard.getMaxValue2();
|
|
|
}
|
|
|
if (standard.getMinValue2() > 0) {
|
|
|
minValueAfter = standard.getMinValue2();
|
|
|
}
|
|
|
}
|
|
|
json.put("maxValueAfter",maxValueAfter);
|
|
|
json.put("maxValueBefore",maxValueBefore);
|
|
|
json.put("minValueBefore",minValueBefore);
|
|
|
json.put("minValueAfter",minValueAfter);
|
|
|
}
|
|
|
//血压校验
|
|
|
else if (type == 2) {
|
|
|
// 血压记录,查询患者血压预警值
|
|
|
PatientHealthStandard standard = patientHealthStandardDao.findByPatientType(patientCode, 2);
|
|
|
Double maxValueSSY = SystemConf.HEALTH_STANDARD_SSY_MAX;
|
|
|
Double minValueSSY = SystemConf.HEALTH_STANDARD_SSY_MIN;
|
|
|
Double maxValueSZY = SystemConf.HEALTH_STANDARD_SZY_MAX;
|
|
|
Double minValueSZY = SystemConf.HEALTH_STANDARD_SZY_MIN;
|
|
|
if (standard != null) {
|
|
|
if (standard.getMaxValue1() > 0) {
|
|
|
maxValueSSY = standard.getMaxValue1();
|
|
|
}
|
|
|
if (standard.getMinValue1() > 0) {
|
|
|
minValueSSY = standard.getMinValue1();
|
|
|
}
|
|
|
if (standard.getMaxValue2() > 0) {
|
|
|
maxValueSZY = standard.getMaxValue2();
|
|
|
}
|
|
|
if (standard.getMinValue2() > 0) {
|
|
|
minValueSZY = standard.getMinValue2();
|
|
|
}
|
|
|
}
|
|
|
json.put("minValueSZY",minValueSZY);
|
|
|
json.put("maxValueSZY",maxValueSZY);
|
|
|
json.put("minValueSSY",minValueSSY);
|
|
|
json.put("maxValueSSY",maxValueSSY);
|
|
|
|
|
|
}
|
|
|
return json;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
//更改接口(包括手动记录的修改和所有的删除)
|
|
@ -667,6 +733,7 @@ public class PatientHealthIndexService extends BaseService {
|
|
|
Date currentTime = new Date();
|
|
|
obj.setCzrq(currentTime);
|
|
|
obj.setDel("1");
|
|
|
obj.setStatus(0);
|
|
|
Date time = currentTime;
|
|
|
if (map.containsKey("time")) {
|
|
|
String da = map.get("time");
|