Browse Source

代码修改

LAPTOP-KB9HII50\70708 2 months ago
parent
commit
ea1f2f0c28

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DevicePatientHealthIndex.java

@ -27,7 +27,7 @@ public class DevicePatientHealthIndex extends IdEntity {
	private String value2;
	// 午餐空腹/BMI
	private String value3;
	// 午餐后/偏胖-1/正常0/偏瘦1
	// 午餐后/偏胖-1/正常0/偏瘦1/2异常
	private String value4;
	// 晚餐空腹
	private String value5;

+ 39 - 2
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/health/service/DeviceUploadService.java

@ -332,6 +332,19 @@ public class DeviceUploadService {
                    obj.setType(1);
                    obj.setValue1(data);     //血糖值
                    obj.setValue2(formatBloodSuger(user,deviceSn,DateUtil.dateToStr(time, DateUtil.YYYY_MM_DD_HH_MM_SS)));
                    double tmp1 = new Double(value1);
                    double top = 7.0;
                    String gi_type = obj.getValue2();
                    if("2".equals(gi_type)||"4".equals(gi_type)||"6".equals(gi_type)){
                        top = 11.0;
                    }
                    if(tmp1 < 4.0){
                        obj.setValue4("-1");
                    }else if(tmp1 > top){
                        obj.setValue4("1");
                    }else {
                        obj.setValue4("1");
                    }
                    break;
                case "2":
                    obj.setType(2);
@ -345,8 +358,32 @@ public class DeviceUploadService {
                    if (value.length > 2) {
                        obj.setValue3(value[2]);     //脉搏
                    }
                    if (value.length > 3) {
                        obj.setValue4(value[3]);     //有无心率不齐
                    double sys = new Double(obj.getValue1());
                    double dia = new Double(obj.getValue2());
                    double v1 = 90;
                    double v2 = 139;
                    double v3 = 60;
                    double v4 = 89;
                    int sys1 = 0;
                    int dia1 = 0;
                    if (sys < v1) {
                        sys1 = -1;
                    }else if(sys > v2){
                        sys1 = 1;
                    }
                    if (dia < v3) {
                        dia1 = -1;
                    }else if(dia > v4){
                        dia1 = 1;
                    }
                    if(sys1==0&&dia1==0){
                        obj.setValue4("0");
                    }else if ((sys1<0&&dia1<=0)||(dia1<0&&sys1<=0)){
                        obj.setValue4("-1");
                    }else if ((sys1>0&&dia1>=0)||(dia1>0&&sys1>=0)){
                        obj.setValue4("1");
                    }else{
                        obj.setValue4("2");
                    }
                    break;
                case "3":

+ 43 - 23
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/health/service/PatientHealthIndexService.java

@ -991,7 +991,7 @@ public class PatientHealthIndexService {
            switch (type) {
                case "1": {
                    obj.setType(1);
                    String value1 = map.get("gi");  //血糖值
                    String value1 = map.get("gi");  //血糖值 4-7,4-11
                    String gi_type = map.get("gi_type"); //血糖值类型对应1到7
                    String recordDate = map.get("recordDate");
                    obj.setValue1(value1);
@ -999,46 +999,68 @@ public class PatientHealthIndexService {
                    if (StringUtils.isNotBlank(recordDate)) {
                        obj.setRecordDate(DateUtil.strToDateAppendNowTime(recordDate, DateUtil.YYYY_MM_DD_HH_MM_SS));
                    }
                    double tmp1 = new Double(value1);
                    double top = 7.0;
                    if("2".equals(gi_type)||"4".equals(gi_type)||"6".equals(gi_type)){
                        top = 11.0;
                    }
                    if(tmp1 < 4.0){
                        obj.setValue4("-1");
                    }else if(tmp1 > top){
                        obj.setValue4("1");
                    }else {
                        obj.setValue4("1");
                    }
                    break;
                }
                case "2": {
                    obj.setType(2);
                    String value1 = map.get("sys");  //收缩压
                    String value2 = map.get("dia");  //舒张压
                    String value1 = map.get("sys");  //收缩压 90-139
                    String value2 = map.get("dia");  //舒张压 60-89
                    obj.setValue1(value1);
                    obj.setValue2(value2);
                    obj.setValue3(map.get("pul"));     //脉搏
                    obj.setValue4(map.get("ano"));     //有无心率不齐
                    obj.setValue3(map.get("pul"));     //脉搏60-100
                    double sys = new Double(value1);
                    double dia = new Double(value2);
                    double v1 = 90;
                    double v2 = 139;
                    double v3 = 60;
                    double v4 = 89;
                    int sys1 = 0;
                    int dia1 = 0;
                    if (sys < v1) {
                        sys1 = -1;
                    }else if(sys > v2){
                        sys1 = 1;
                    }
                    if (dia < v3) {
                        dia1 = -1;
                    }else if(dia > v4){
                        dia1 = 1;
                    }
                    if(sys1==0&&dia1==0){
                        obj.setValue4("0");
                    }else if ((sys1<0&&dia1<=0)||(dia1<0&&sys1<=0)){
                        obj.setValue4("-1");
                    }else if ((sys1>0&&dia1>=0)||(dia1>0&&sys1>=0)){
                        obj.setValue4("1");
                    }else{
                        obj.setValue4("2");
                    }
                    break;
                }
                case "3": {
                    obj.setType(3);
                    
                    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));
                    
                    double bmiMin = new Double("18.5");
                    double bmiMax = new Double("23.9");
                    
                    if (patientAimSports != null && StringUtils.isNoneEmpty(patientAimSports.getCode())) {
                        bmiMin = Double.parseDouble(patientAimSports.getBmiMin());
                        bmiMax = Double.parseDouble(patientAimSports.getBmiMax());
                    }
                    
                    //设置BMI值
                    if (bmi < bmiMin) {
                        obj.setValue4("1");
@ -1068,8 +1090,6 @@ public class PatientHealthIndexService {
        } else {
            throw new ServiceException("不存在该患者!");
        }
        
        
        return obj;
    }