|
@ -181,7 +181,7 @@ public class SurveyScreenResultService extends BaseService {
|
|
|
//查询该筛查的结果设置
|
|
|
SurveyTemplateResult surveyTemplateResult = surveyTemplateResultDao.getByTemplateCodeAndLowScoreAndHighScore(surveyCode,totalScore);
|
|
|
//更新上一条数据为不可再次评估
|
|
|
List<SurveyScreenResult> surveyScreenResultList = surveyScreenResultDao.findNewOneByTemplateCode(surveyCode);
|
|
|
List<SurveyScreenResult> surveyScreenResultList = surveyScreenResultDao.findNewOneByTemplateCode(surveyCode,patientCode);
|
|
|
String lastCode = "";
|
|
|
String originCode = "";
|
|
|
if (surveyScreenResultList!=null && surveyScreenResultList.size()>0){
|
|
@ -251,7 +251,7 @@ public class SurveyScreenResultService extends BaseService {
|
|
|
return json;
|
|
|
}
|
|
|
String idcard = String.valueOf(infoMap.get("idcard"));
|
|
|
infoMap.put("sex",IdCardUtil.getSexForIdcard(idcard));
|
|
|
infoMap.put("sex",IdCardUtil.getSexForIdcard_new(idcard));
|
|
|
infoMap.put("age",IdCardUtil.getAgeForIdcard(idcard));
|
|
|
String templateCode = String.valueOf(infoMap.get("template_code"));
|
|
|
//String doctorCode = String.valueOf(infoMap.get("doctor"));
|
|
@ -415,8 +415,94 @@ public class SurveyScreenResultService extends BaseService {
|
|
|
return resultMap;
|
|
|
}
|
|
|
|
|
|
public int getAmountByDoctor(String json,String doctorCode) {
|
|
|
return getCountByDoctor(json,doctorCode).size();
|
|
|
}
|
|
|
|
|
|
public List<String> getCountByDoctor(String json,String doctorCode) {
|
|
|
// 1.服务 2.健康 3疾病
|
|
|
JSONObject jsonObject = new JSONObject(json);
|
|
|
String sql = "";
|
|
|
|
|
|
String sex = jsonObject.get("sex").toString();
|
|
|
String str = "SELECT DISTINCT lb.patient FROM wlyy_sign_patient_label_info lb,(SELECT DISTINCT ff.patient FROM wlyy_sign_family_server s, " +
|
|
|
" (SELECT f.`code`,f.patient FROM wlyy_sign_family f,wlyy_patient p WHERE p.CODE=f.patient and (f.doctor='"+doctorCode+"' OR f.doctor_health='"+doctorCode+"')";
|
|
|
|
|
|
public void getSpecialDoctorScreenList(String doctor,int type,int pageNo,int pageSize){
|
|
|
if (!"0".equals(sex)) {
|
|
|
str += " AND p.sex= " + sex +
|
|
|
" AND f.STATUS>0 AND p.`openid` IS NOT NULL AND p.`openid`!='')ff WHERE ff.CODE=s.sign_code ";
|
|
|
} else {
|
|
|
str += " AND f.STATUS>0 AND p.`openid`IS NOT NULL AND p.`openid`!='')ff WHERE ff.CODE=s.sign_code ";
|
|
|
}
|
|
|
JSONArray service = jsonObject.getJSONArray("service");
|
|
|
String ser = "";
|
|
|
service:
|
|
|
for (Object serv : service) {
|
|
|
String type = serv.toString();
|
|
|
switch (type) {
|
|
|
case "0":
|
|
|
break service;
|
|
|
default:
|
|
|
ser += " s.server_type= " + type;
|
|
|
break;
|
|
|
}
|
|
|
ser += " OR ";
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(ser)) {
|
|
|
str += " AND ( " + ser.substring(0, ser.lastIndexOf("OR")) + " ) ";
|
|
|
}
|
|
|
str += " )tt WHERE lb.`status` = 1 AND lb.patient=tt.patient ";
|
|
|
|
|
|
JSONArray healthCondition = jsonObject.getJSONArray("healthCondition");
|
|
|
String healSql = "";
|
|
|
String heal = "";
|
|
|
health:
|
|
|
for (Object health : healthCondition) {
|
|
|
String type = health.toString();
|
|
|
switch (type) {
|
|
|
case "0":
|
|
|
break health;
|
|
|
default:
|
|
|
heal += " lb.label= " + type;
|
|
|
break;
|
|
|
}
|
|
|
heal += " OR ";
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(heal)) {
|
|
|
healSql = " (lb.label_type =2 AND ( " + heal.substring(0, heal.lastIndexOf("OR")) + " ) )";
|
|
|
}
|
|
|
|
|
|
JSONArray disease = jsonObject.getJSONArray("disease");
|
|
|
String disSql = "";
|
|
|
String dis = "";
|
|
|
disea:
|
|
|
for (Object disea : disease) {
|
|
|
String type = disea.toString();
|
|
|
switch (type) {
|
|
|
case "0":
|
|
|
break disea;
|
|
|
default:
|
|
|
dis += " lb.label= " + type;
|
|
|
break;
|
|
|
}
|
|
|
dis += " OR ";
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(dis)) {
|
|
|
disSql= " (lb.label_type =3 AND ( " + dis.substring(0, dis.lastIndexOf("OR")) + " ) )";
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isEmpty(heal) && StringUtils.isEmpty(dis)) {
|
|
|
sql = str;
|
|
|
} else if (StringUtils.isEmpty(heal) && StringUtils.isNotEmpty(dis)) {
|
|
|
sql = str + " AND " +disSql;
|
|
|
} else if (StringUtils.isNotEmpty(heal) && StringUtils.isEmpty(dis)) {
|
|
|
sql = str + " AND " +healSql;
|
|
|
} else if (StringUtils.isNotEmpty(heal) && StringUtils.isNotEmpty(dis)) {
|
|
|
sql = str + " AND ( " + disSql +" OR " +healSql +" ) ";
|
|
|
}
|
|
|
|
|
|
System.out.println("=====query sql =======>>>>" + sql);
|
|
|
List<String> patients = jdbcTemplate.queryForList(sql, String.class);
|
|
|
return patients;
|
|
|
}
|
|
|
}
|