|
@ -34,6 +34,8 @@ public class RehabilitationManageService {
|
|
|
|
|
|
@Value("${basedb.name}")
|
|
|
private String basedb;
|
|
|
@Value("${encrypt.key}")
|
|
|
private String key;
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
@Autowired
|
|
@ -91,7 +93,7 @@ public class RehabilitationManageService {
|
|
|
// leftSql += " left join "+basedb+".wlyy_patient_disease_server s on p.patient=s.patient and s.del=1 and s.disease ='"+diseaseCode+"'" ;
|
|
|
// }
|
|
|
String leftSql = "";
|
|
|
String sql = " select p.* from wlyy_specialist.wlyy_patient_rehabilitation_plan p " ;
|
|
|
String sql = " select p.*,CAST(AES_DECRYPT(from_base64(p.name), '" + key + "') AS char) as patientName from wlyy_specialist.wlyy_patient_rehabilitation_plan p " ;
|
|
|
|
|
|
if(doctorType==2){//家医是根据签约关系过滤
|
|
|
leftSql =" join "+basedb+".wlyy_sign_family f on f.patient=p.patient and f.expenses_status='1' and f.status=1 ";
|
|
@ -107,7 +109,7 @@ public class RehabilitationManageService {
|
|
|
sql+=" and p.disease='"+diseaseCode+"'";
|
|
|
}
|
|
|
if(StringUtils.isNotEmpty(patientCondition)){
|
|
|
sql += " and p.name like '%"+patientCondition+"%' ";
|
|
|
sql += " and CAST(AES_DECRYPT(from_base64(p.name), '" + key + "') AS char) like '%"+patientCondition+"%' ";
|
|
|
}
|
|
|
String finalSql = "";
|
|
|
|
|
@ -149,7 +151,7 @@ public class RehabilitationManageService {
|
|
|
// resultMap.put("age",age);
|
|
|
resultMap.put("hospitalName",one.get("hospital_name"));
|
|
|
// resultMap.put("sex","1".equals(sex)?"男":("2".equals(sex)?"女":"未知"));
|
|
|
resultMap.put("patientName",one.get("name"));
|
|
|
resultMap.put("patientName",one.get("patientName"));
|
|
|
resultMap.put("patientCode",one.get("patient"));
|
|
|
resultMap.put("id",one.get("id"));
|
|
|
resultMap.put("status",one.get("status"));//康复计划状态
|
|
@ -254,7 +256,7 @@ public class RehabilitationManageService {
|
|
|
resultMap.put("specialistFinishItemCount",specialistFinishCount1-specialistUnfinishCount1+specialistFinishCount2-specialistUnfinishCount2);//完成项目
|
|
|
resultMap.put("specialistServiceRecordCount",specialistServiceCount1+specialistServiceCount2);//服务次数
|
|
|
//家庭医生(包括全科医生、健管师)
|
|
|
String signFamilySql = "SELECT f.*,t.name as teamName FROM "+basedb+".wlyy_sign_family f LEFT JOIN "+basedb+".wlyy_admin_team t on f.admin_team_code=t.id where f.status =1 and f.expenses_status='1' and f.patient='"+patientCode+"'";
|
|
|
String signFamilySql = "SELECT f.*,t.name as teamName,CAST(AES_DECRYPT(from_base64(f.name), '" + key + "') AS char) as patientName FROM "+basedb+".wlyy_sign_family f LEFT JOIN "+basedb+".wlyy_admin_team t on f.admin_team_code=t.id where f.status =1 and f.expenses_status='1' and f.patient='"+patientCode+"'";
|
|
|
List<Map<String,Object>> signFamilyList = jdbcTemplate.queryForList(signFamilySql);
|
|
|
if(signFamilyList != null && signFamilyList.size() >0 ) {
|
|
|
Map<String, Object> signFamilyMap = signFamilyList.get(0);
|
|
@ -282,7 +284,7 @@ public class RehabilitationManageService {
|
|
|
String sex = IdCardUtil.getSexForIdcard_new(signFamilyMap.get("idcard") + "");
|
|
|
resultMap.put("age", age);
|
|
|
resultMap.put("sex", "1".equals(sex) ? "男" : ("2".equals(sex) ? "女" : "未知"));
|
|
|
resultMap.put("patientName", signFamilyMap.get("name"));
|
|
|
resultMap.put("patientName", signFamilyMap.get("patientName"));
|
|
|
}
|
|
|
//疾病类型
|
|
|
String diseaseSql = " select s.* from "+basedb+".wlyy_patient_disease_server s where s.del=1 and s.patient='"+patientCode+"' and s.specialist_relation_code='"+specialistMap.get("id")+"' ";
|