| 
															
																@ -991,7 +991,7 @@ public class PatientHealthIndexService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            switch (type) { 
															 | 
															
															 | 
															
																            switch (type) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                case "1": { 
															 | 
															
															 | 
															
																                case "1": { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    obj.setType(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 gi_type = map.get("gi_type"); //血糖值类型对应1到7 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    String recordDate = map.get("recordDate"); 
															 | 
															
															 | 
															
																                    String recordDate = map.get("recordDate"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    obj.setValue1(value1); 
															 | 
															
															 | 
															
																                    obj.setValue1(value1); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -999,46 +999,68 @@ public class PatientHealthIndexService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    if (StringUtils.isNotBlank(recordDate)) { 
															 | 
															
															 | 
															
																                    if (StringUtils.isNotBlank(recordDate)) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                        obj.setRecordDate(DateUtil.strToDateAppendNowTime(recordDate, DateUtil.YYYY_MM_DD_HH_MM_SS)); 
															 | 
															
															 | 
															
																                        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; 
															 | 
															
															 | 
															
																                    break; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                } 
															 | 
															
															 | 
															
																                } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                case "2": { 
															 | 
															
															 | 
															
																                case "2": { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    obj.setType(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.setValue1(value1); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    obj.setValue2(value2); 
															 | 
															
															 | 
															
																                    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; 
															 | 
															
															 | 
															
																                    break; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                } 
															 | 
															
															 | 
															
																                } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                case "3": { 
															 | 
															
															 | 
															
																                case "3": { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    obj.setType(3); 
															 | 
															
															 | 
															
																                    obj.setType(3); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    String weight = map.get("weight"); 
															 | 
															
															 | 
															
																                    String weight = map.get("weight"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    String height = map.get("height"); 
															 | 
															
															 | 
															
																                    String height = map.get("height"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    obj.setValue1(weight); //体重 
															 | 
															
															 | 
															
																                    obj.setValue1(weight); //体重 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    obj.setValue2(height); //身高 
															 | 
															
															 | 
															
																                    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")); 
															 | 
															
															 | 
															
																                    double bmi = CommonUtil.getBMIByWeightAndHeight(map.get("weight"), map.get("height")); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    DecimalFormat df1 = new DecimalFormat("###.00"); 
															 | 
															
															 | 
															
																                    DecimalFormat df1 = new DecimalFormat("###.00"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    obj.setValue3(df1.format(bmi)); 
															 | 
															
															 | 
															
																                    obj.setValue3(df1.format(bmi)); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     
															 | 
															
															 | 
															
																                     
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    double bmiMin = new Double("18.5"); 
															 | 
															
															 | 
															
																                    double bmiMin = new Double("18.5"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    double bmiMax = new Double("23.9"); 
															 | 
															
															 | 
															
																                    double bmiMax = new Double("23.9"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    if (patientAimSports != null && StringUtils.isNoneEmpty(patientAimSports.getCode())) { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                        bmiMin = Double.parseDouble(patientAimSports.getBmiMin()); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                        bmiMax = Double.parseDouble(patientAimSports.getBmiMax()); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    } 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    //设置BMI值 
															 | 
															
															 | 
															
																                    //设置BMI值 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    if (bmi < bmiMin) { 
															 | 
															
															 | 
															
																                    if (bmi < bmiMin) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                        obj.setValue4("1"); 
															 | 
															
															 | 
															
																                        obj.setValue4("1"); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -1068,8 +1090,6 @@ public class PatientHealthIndexService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } else { 
															 | 
															
															 | 
															
																        } else { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            throw new ServiceException("不存在该患者!"); 
															 | 
															
															 | 
															
																            throw new ServiceException("不存在该患者!"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        return obj; 
															 | 
															
															 | 
															
																        return obj; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    } 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     
															 | 
															
															 | 
															
																     
															 |