| 
					
				 | 
			
			
				@ -69,6 +69,8 @@ public class SignPatientLabelInfoService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    SignPatientLabelDao labelDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    SignPatientLabelInfoDao signPatientLabelInfoDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    SignFamilyRenewDao signFamilyRenewDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private final Logger logger = LoggerFactory.getLogger(this.getClass()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1206,6 +1208,92 @@ public class SignPatientLabelInfoService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 1.3.5取缔setPatientLabels 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 设置患者标签 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param patient 患者code 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param health 健康情况 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param disease 疾病类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param custom 自定义标签 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public int setPatientLabelInfos(String patient, String health, String disease, String custom){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Patient p = patientDao.findByCode(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (p == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //存储健康情况,不可为空 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isNotBlank(health)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //删除居民所有标签信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String deleteSql = "DELETE FROM wlyy_sign_patient_label_info WHERE patient='"+patient+"'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            jdbcTemplate.execute(deleteSql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //存储健康情况标签 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String[] healthArr = health.split(","); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for(int i=0;i<healthArr.length;i++){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                SignPatientLabelInfo signPatientLabelInfo = new SignPatientLabelInfo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                SignPatientLabel signPatientLabel = labelService.getLabelByCodeAndType(healthArr[i],"2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if(signPatientLabel!=null&&StringUtils.isNotBlank(signPatientLabel.getLabelName())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    signPatientLabelInfo.setLabelName(signPatientLabel.getLabelName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    return -1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                signPatientLabelInfo.setPatient(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                signPatientLabelInfo.setPname(p.getName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                signPatientLabelInfo.setLabel(healthArr[i]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                signPatientLabelInfo.setStatus(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                signPatientLabelInfo.setLabelType("2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                signPatientLabelInfo.setCzrq(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //保存存储健康情况 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                labelInfoDao.save(signPatientLabelInfo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return -2; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //保存疾病类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isNotBlank(disease)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String[] diseaseArr = disease.split(","); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for(int i=0;i<diseaseArr.length;i++){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                SignPatientLabelInfo signPatientLabelInfo = new SignPatientLabelInfo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                SignPatientLabel signPatientLabel = labelService.getLabelByCodeAndType(diseaseArr[i],"3"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if(signPatientLabel!=null&&StringUtils.isNotBlank(signPatientLabel.getLabelName())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    signPatientLabelInfo.setLabelName(signPatientLabel.getLabelName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    return -1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                signPatientLabelInfo.setPatient(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                signPatientLabelInfo.setPname(p.getName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                signPatientLabelInfo.setLabel(diseaseArr[i]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                signPatientLabelInfo.setStatus(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                signPatientLabelInfo.setLabelType("3"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                signPatientLabelInfo.setCzrq(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //保存居民疾病类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                labelInfoDao.save(signPatientLabelInfo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //保存自定义标签 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isNotBlank(custom)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String[] customArr = custom.split(","); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for(int i=0;i<customArr.length;i++){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                SignPatientLabelInfo signPatientLabelInfo = new SignPatientLabelInfo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                SignPatientLabel signPatientLabel = labelService.getLabelByCodeAndType(customArr[i],"4"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if(signPatientLabel!=null&&StringUtils.isNotBlank(signPatientLabel.getLabelName())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    signPatientLabelInfo.setLabelName(signPatientLabel.getLabelName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    return -1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                signPatientLabelInfo.setPatient(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                signPatientLabelInfo.setPname(p.getName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                signPatientLabelInfo.setLabel(customArr[i]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                signPatientLabelInfo.setLabelType("4"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                signPatientLabelInfo.setStatus(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                signPatientLabelInfo.setCzrq(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //保存居民疾病类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                labelInfoDao.save(signPatientLabelInfo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 设置患者标签 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1217,6 +1305,7 @@ public class SignPatientLabelInfoService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param custom      自定义标签 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Deprecated 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public int setPatientLabels(String patient, String idcard, String patientName, String health, String disease, String custom, String doctor, String caller) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Patient p = patientDao.findByCode(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 |