|
@ -296,12 +296,13 @@ public class SurveyScreenResultService extends BaseService {
|
|
|
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"));
|
|
|
String doctorCode = String.valueOf(infoMap.get("doctor"));
|
|
|
String patientCode = String.valueOf(infoMap.get("patient_code"));
|
|
|
/* Doctor doctor = doctorDao.findByCode(doctorCode);
|
|
|
Doctor doctor = doctorDao.findByCode(doctorCode);
|
|
|
if (doctor!=null){
|
|
|
infoMap.put("level",doctor.getLevel());
|
|
|
infoMap.put("doctorName",doctor.getName());
|
|
|
}*/
|
|
|
}
|
|
|
json.put("info",infoMap);
|
|
|
/*String healthSql ="SELECT value1,value2 FROM device.wlyy_patient_health_index WHERE user='"+patientCode+"' AND type=3 ORDER BY record_date DESC LIMIT 1";
|
|
|
List<Map<String,Object>> healthMapList = jdbcTemplate.queryForList(healthSql);
|
|
@ -386,7 +387,7 @@ public class SurveyScreenResultService extends BaseService {
|
|
|
for (SurveyTemplates surveyTemplates : templates){
|
|
|
Map<String,Object> sMap = new HashedMap();
|
|
|
sMap.put("surveyTemplate",surveyTemplates);
|
|
|
int count = surveyScreenResultDao.getByPatientCodeAndTemplateCode(patientCode,surveyTemplates.getCode()).size();
|
|
|
int count = surveyScreenResultDao.getByPatientCodeAndTemplateCode(patientCode,surveyTemplates.getCode(),2).size();
|
|
|
sMap.put("myRecordCount",count);
|
|
|
mapList.add(sMap);
|
|
|
}
|
|
@ -395,14 +396,14 @@ public class SurveyScreenResultService extends BaseService {
|
|
|
}
|
|
|
public List<SurveyScreenResult> patientGetResult(String patientCode){
|
|
|
Map<String,Object> map = new HashedMap();
|
|
|
String sql = "SELECT a.* FROM (SELECT * FROM wlyy_survey_screen_result WHERE patient_code='"+patientCode+"' ORDER BY czrq DESC) a GROUP BY a.template_code";
|
|
|
String sql = "SELECT a.* FROM (SELECT * FROM wlyy_survey_screen_result WHERE source=2 and patient_code='"+patientCode+"' ORDER BY czrq DESC) a GROUP BY a.template_code";
|
|
|
List<SurveyScreenResult> surveyScreenResultList = jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(SurveyScreenResult.class));
|
|
|
return surveyScreenResultList;
|
|
|
}
|
|
|
|
|
|
public List<Map<String,Object>> getResultByTemplateCode(int pageNo,int pageSize,String templateCode,String patientCode){
|
|
|
int start = (pageNo-1)*pageSize;
|
|
|
String sql ="SELECT st.*,ssr.code screenCode,ssr.screen_result,ssr.screen_result_score,ssr.czrq as screenCzrq,ssr.is_again FROM wlyy_survey_templates st LEFT JOIN wlyy_survey_screen_result ssr ON st.code = ssr.template_code WHERE st.`code`='"+templateCode+"' AND ssr.patient_code='"+patientCode+"' order by ssr.czrq limit ?,?";
|
|
|
String sql ="SELECT st.*,ssr.code screenCode,ssr.screen_result,ssr.screen_result_score,ssr.czrq as screenCzrq,ssr.is_again FROM wlyy_survey_templates st LEFT JOIN wlyy_survey_screen_result ssr ON st.code = ssr.template_code WHERE ssr.source=2 and st.`code`='"+templateCode+"' AND ssr.patient_code='"+patientCode+"' order by ssr.czrq limit ?,?";
|
|
|
return jdbcTemplate.queryForList(sql,new Object[]{start,pageSize});
|
|
|
}
|
|
|
|