|
@ -4506,85 +4506,93 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
|
//1.清空居民标签
|
|
|
String delSql = " DELETE FROM wlyy_sign_patient_label_info WHERE patient ='"+patient+"'";
|
|
|
jdbcTemplate.execute(delSql);
|
|
|
//2.新增健康情况标签
|
|
|
String healths[] = health.split(",");
|
|
|
//获取所有健康情况标签
|
|
|
List<Map<String,Object>> healthList = getLabelsByType("2");
|
|
|
//减低循环层级
|
|
|
Map<String,Map<String,Object>> healthMap = new HashedMap();
|
|
|
for(Map<String,Object> map : healthList){
|
|
|
String code = (String)map.get("code");
|
|
|
healthMap.put(code,map);
|
|
|
}
|
|
|
|
|
|
if(healths!=null&&healths.length>0){
|
|
|
for(int i=0;i<healths.length;i++){
|
|
|
SignPatientLabelInfo info = new SignPatientLabelInfo();
|
|
|
info.setCzrq(new Date());
|
|
|
info.setLabelType("2");
|
|
|
info.setPatient(patient);
|
|
|
info.setPname(p.getName());
|
|
|
info.setLabel(healths[i]);
|
|
|
info.setStatus(1);
|
|
|
String name = (String)healthMap.get(healths[i]).get("name");
|
|
|
info.setLabelName(name);
|
|
|
signPatientLabelInfoDao.save(info);
|
|
|
//2.新增健康情况标签
|
|
|
if(StringUtils.isNotBlank(health)){
|
|
|
String healths[] = health.split(",");
|
|
|
//获取所有健康情况标签
|
|
|
List<Map<String,Object>> healthList = getLabelsByType("2");
|
|
|
//减低循环层级
|
|
|
Map<String,Map<String,Object>> healthMap = new HashedMap();
|
|
|
for(Map<String,Object> map : healthList){
|
|
|
String code = (String)map.get("code");
|
|
|
healthMap.put(code,map);
|
|
|
}
|
|
|
if(healths!=null&&healths.length>0){
|
|
|
for(int i=0;i<healths.length;i++){
|
|
|
SignPatientLabelInfo info = new SignPatientLabelInfo();
|
|
|
info.setCzrq(new Date());
|
|
|
info.setLabelType("2");
|
|
|
info.setPatient(patient);
|
|
|
info.setPname(p.getName());
|
|
|
info.setLabel(healths[i]);
|
|
|
info.setStatus(1);
|
|
|
String name = (String)healthMap.get(healths[i]).get("name");
|
|
|
info.setLabelName(name);
|
|
|
signPatientLabelInfoDao.save(info);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//2.新增疾病标签
|
|
|
String diseases[] = disease.split(",");
|
|
|
//获取所有健康情况标签
|
|
|
List<Map<String,Object>> diseaseList = getLabelsByType("3");
|
|
|
//减低循环层级
|
|
|
Map<String,Map<String,Object>> diseaseMap = new HashedMap();
|
|
|
for(Map<String,Object> map : diseaseList){
|
|
|
String code = (String)map.get("code");
|
|
|
diseaseMap.put(code,map);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(disease)){
|
|
|
String diseases[] = disease.split(",");
|
|
|
//获取所有健康情况标签
|
|
|
List<Map<String,Object>> diseaseList = getLabelsByType("3");
|
|
|
//减低循环层级
|
|
|
Map<String,Map<String,Object>> diseaseMap = new HashedMap();
|
|
|
for(Map<String,Object> map : diseaseList){
|
|
|
String code = (String)map.get("code");
|
|
|
diseaseMap.put(code,map);
|
|
|
}
|
|
|
|
|
|
if(diseases!=null&&diseases.length>0){
|
|
|
for(int i=0;i<diseases.length;i++){
|
|
|
SignPatientLabelInfo info = new SignPatientLabelInfo();
|
|
|
info.setCzrq(new Date());
|
|
|
info.setLabelType("3");
|
|
|
info.setPatient(patient);
|
|
|
info.setPname(p.getName());
|
|
|
info.setLabel(diseases[i]);
|
|
|
String name = (String)diseaseMap.get(diseases[i]).get("name");
|
|
|
info.setLabelName(name);
|
|
|
info.setStatus(1);
|
|
|
signPatientLabelInfoDao.save(info);
|
|
|
if(diseases!=null&&diseases.length>0){
|
|
|
for(int i=0;i<diseases.length;i++){
|
|
|
SignPatientLabelInfo info = new SignPatientLabelInfo();
|
|
|
info.setCzrq(new Date());
|
|
|
info.setLabelType("3");
|
|
|
info.setPatient(patient);
|
|
|
info.setPname(p.getName());
|
|
|
info.setLabel(diseases[i]);
|
|
|
String name = (String)diseaseMap.get(diseases[i]).get("name");
|
|
|
info.setLabelName(name);
|
|
|
info.setStatus(1);
|
|
|
signPatientLabelInfoDao.save(info);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//3.新增自定义标签
|
|
|
String customs[] = custom.split(",");
|
|
|
//获取所有健康情况标签
|
|
|
List<Map<String,Object>> customList = getLabelsByType("4");
|
|
|
//减低循环层级
|
|
|
Map<String,Map<String,Object>> customMap = new HashedMap();
|
|
|
for(Map<String,Object> map : customList){
|
|
|
String code = (String)map.get("code");
|
|
|
customMap.put(code,map);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(custom)){
|
|
|
String customs[] = custom.split(",");
|
|
|
//获取所有健康情况标签
|
|
|
List<Map<String,Object>> customList = getLabelsByType("4");
|
|
|
//减低循环层级
|
|
|
Map<String,Map<String,Object>> customMap = new HashedMap();
|
|
|
for(Map<String,Object> map : customList){
|
|
|
String code = (String)map.get("code");
|
|
|
customMap.put(code,map);
|
|
|
}
|
|
|
|
|
|
if(customs!=null&&customs.length>0){
|
|
|
for(int i=0;i<customs.length;i++){
|
|
|
SignPatientLabelInfo info = new SignPatientLabelInfo();
|
|
|
info.setCzrq(new Date());
|
|
|
info.setLabelType("4");
|
|
|
info.setPatient(patient);
|
|
|
info.setPname(p.getName());
|
|
|
info.setLabel(customs[i]);
|
|
|
String name = (String)customMap.get(customs[i]).get("name");
|
|
|
info.setLabelName(name);
|
|
|
info.setStatus(1);
|
|
|
signPatientLabelInfoDao.save(info);
|
|
|
if(customs!=null&&customs.length>0){
|
|
|
for(int i=0;i<customs.length;i++){
|
|
|
SignPatientLabelInfo info = new SignPatientLabelInfo();
|
|
|
info.setCzrq(new Date());
|
|
|
info.setLabelType("4");
|
|
|
info.setPatient(patient);
|
|
|
info.setPname(p.getName());
|
|
|
info.setLabel(customs[i]);
|
|
|
String name = (String)customMap.get(customs[i]).get("name");
|
|
|
info.setLabelName(name);
|
|
|
info.setStatus(1);
|
|
|
signPatientLabelInfoDao.save(info);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
}
|
|
|
|