|
@ -6,7 +6,6 @@ import com.yihu.jw.dao.SpecialistPatientRelationDao;
|
|
|
import com.yihu.jw.dao.rehabilitation.*;
|
|
|
import com.yihu.jw.entity.specialist.SpecialistPatientRelationDO;
|
|
|
import com.yihu.jw.entity.specialist.rehabilitation.*;
|
|
|
import com.yihu.jw.entity.util.AesEncryptUtils;
|
|
|
import com.yihu.jw.entity.util.TransforSqlUtl;
|
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
|
import com.yihu.jw.restmodel.web.MixEnvelop;
|
|
@ -504,6 +503,32 @@ public class RehabilitationManageService {
|
|
|
sql +=" order by d.execute_time desc ";
|
|
|
sql = TransforSqlUtl.wlyy_rehabilitation_plan_detailAll2(sql);
|
|
|
List<Map<String,Object>> rehabilitationDetailList = jdbcTemplate.queryForList(sql);
|
|
|
|
|
|
String planPatientSql = " SELECT patient FROM wlyy_specialist.wlyy_rehabilitation_plan_detail WHERE id in ("+planCondition+" )";
|
|
|
List<Map<String, Object>> patientCodeList = jdbcTemplate.queryForList(planPatientSql);
|
|
|
|
|
|
List<Map<String, Object>> list = null;
|
|
|
if (list.size()>0) {
|
|
|
String patient = list.get(0).get("patient").toString();
|
|
|
if (7 == searchTask){ //处方续方
|
|
|
String cfxfSql = "SELECT LEFT ( pr.create_time, 19 ) AS createTime ,LEFT ( pr.pres_create_time, 19 ) AS buildCreateTime , pr.doctor AS doctorCode, pr.doctor_name AS doctorNmae,pr.`status`," +
|
|
|
" pr.hospital_name, pr.hospital, p.`name` AS patientName,p.code AS patientCode,pr.`code` AS id,7 as code " +
|
|
|
" FROM wlyy_prescription pr LEFT JOIN wlyy_patient p ON pr.patient = p.`code` WHERE " +
|
|
|
" 1 = 1 AND pr.STATUS = '100' AND p.code= '"+patient+"' GROUP BY pr.CODE ";
|
|
|
|
|
|
list = jdbcTemplate.queryForList(cfxfSql);
|
|
|
}
|
|
|
if (6 == searchTask){ //随访
|
|
|
String sfSql = "SELECT DISTINCT wf.followup_date followupDate,wf.followup_plan_date followupPlanDate,wf.doctor_code doctorCode," +
|
|
|
" wf.patient_code AS patientCode,wf.patient_name AS patientName,wf.doctor_name doctorName,wf.`status` AS `status`,wf.org_name orgName," +
|
|
|
" wf.org_code orgCode,sd.value AS `value`, wf.followup_type followupType,wf.id AS id, 6 AS code FROM wlyy_followup wf " +
|
|
|
" LEFT JOIN system_dict sd ON wf.followup_type = sd.CODE " +
|
|
|
" AND sd.dict_name = 'FOLLOWUP_WAY_DICT' WHERE wf.status !=0 AND wf.patient_code = '"+patient+"' ";
|
|
|
list = jdbcTemplate.queryForList(sfSql);
|
|
|
}
|
|
|
if (list.size()>0)rehabilitationDetailList.addAll(list);
|
|
|
}
|
|
|
|
|
|
return ObjEnvelop.getSuccess(SpecialistMapping.api_success,rehabilitationDetailList);
|
|
|
}
|
|
|
|