|
@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@ -127,7 +128,6 @@ public class RehabilitationManageService {
|
|
|
resultMap.put("patientName",one.get("name"));
|
|
|
resultMap.put("patientCode",one.get("patient"));
|
|
|
resultMap.put("id",one.get("id"));
|
|
|
resultMap.put("patientCode",one.get("patient"));
|
|
|
resultMap.put("status",one.get("status"));//康复计划状态
|
|
|
//健康情况
|
|
|
resultMap.put("healthyCondition","康复期");
|
|
@ -140,6 +140,7 @@ public class RehabilitationManageService {
|
|
|
case 3:planTypeName="(转)转家庭病床" ;break;
|
|
|
}
|
|
|
resultMap.put("planTypeName",planTypeName);
|
|
|
resultMap.put("planCreateUser",one.get("create_user"));
|
|
|
//今日待办(即今日全部的项目)
|
|
|
Date beginTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+ " "+"00:00:00");
|
|
|
Date endTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+ " "+"23:59:59");
|
|
@ -260,95 +261,106 @@ public class RehabilitationManageService {
|
|
|
|
|
|
/**
|
|
|
* 康复管理更多计划
|
|
|
* @param doctorCode
|
|
|
* @param currentDoctorCode
|
|
|
* @param patientCode
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public ObjEnvelop findRehabilitationPlanDetailList(String doctorCode,String patientCode) throws Exception{
|
|
|
Map<String,Object> resultMap = new HashMap<>();
|
|
|
resultMap.put("patientCode",patientCode);//居民code
|
|
|
//专科医生
|
|
|
String specialistRelationSql = "select r.*,t.name as teamName,h.name as specialistHospitalName from wlyy_specialist.wlyy_specialist_patient_relation r left join "+basedb+".wlyy_admin_team t on r.team_code=t.id left join "+basedb+".dm_hospital h on t.org_code=h.code where r.sign_status ='1' and r.status in('0','1') and r.patient='"+patientCode+"' and r.doctor='"+doctorCode+"'";
|
|
|
List<Map<String,Object>> specialistRelationList = jdbcTemplate.queryForList(specialistRelationSql);
|
|
|
Map<String,Object> specialistMap = specialistRelationList.get(0);
|
|
|
resultMap.put("specialistAdminTeamName",specialistMap.get("teamName"));
|
|
|
resultMap.put("specialistHospitalName",specialistMap.get("specialistHospitalName"));//专科医生所在医院
|
|
|
String specialistFinishItemSql = "";
|
|
|
Integer specialistUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(doctorCode,patientCode,1);
|
|
|
Integer specialistFinishCount = rehabilitationDetailDao.findItemByDoctor(doctorCode,patientCode);
|
|
|
Integer specialistServiceCount = rehabilitationDetailDao.completeServiceByDoctor(doctorCode,patientCode,1);
|
|
|
resultMap.put("specialistFinishItemCount",specialistFinishCount-specialistUnfinishCount);//完成项目
|
|
|
resultMap.put("specialistServiceRecordCount",specialistServiceCount);//服务次数
|
|
|
|
|
|
//家庭医生(包括全科医生、健管师)
|
|
|
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+"'";
|
|
|
List<Map<String,Object>> signFamilyList = jdbcTemplate.queryForList(signFamilySql);
|
|
|
Map<String,Object> signFamilyMap = signFamilyList.get(0);
|
|
|
resultMap.put("signFamilyAdminTeamName",signFamilyMap.get("teamName"));
|
|
|
resultMap.put("familyHospitalName",signFamilyMap.get("hospital_name"));//家庭医生所在医院
|
|
|
Integer familyUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(signFamilyMap.get("doctor")+"",signFamilyMap.get("doctor_health")+"",patientCode,1);
|
|
|
Integer familyFinishCount = rehabilitationDetailDao.findItemByDoctor(signFamilyMap.get("doctor")+"",signFamilyMap.get("doctor_health")+"",patientCode);
|
|
|
Integer familyServiceCount = rehabilitationDetailDao.completeServiceByDoctor(signFamilyMap.get("doctor")+"",signFamilyMap.get("doctor_health")+"",patientCode,1);
|
|
|
resultMap.put("signFamilyFinishItemCount",familyFinishCount-familyUnfinishCount);//完成项目
|
|
|
resultMap.put("signFamilyServiceRecordCount",familyServiceCount);//服务次数
|
|
|
public ObjEnvelop findRehabilitationPlanDetailList(String currentDoctorCode,String patientCode) throws Exception{
|
|
|
String sql = " select DISTINCT r.* from wlyy_specialist.wlyy_specialist_patient_relation r join wlyy_patient_rehabilitation_plan p on r.patient=p.patient where r.sign_status ='1' and r.status in('0','1') and r.patient='"+patientCode+"' ";
|
|
|
List<Map<String,Object>> specialistPatientRelationList = jdbcTemplate.queryForList(sql);
|
|
|
List<Map<String,Object>> resultList = new ArrayList<>();
|
|
|
for(Map<String,Object> temp: specialistPatientRelationList){
|
|
|
String doctorCode = temp.get("doctor")+"";
|
|
|
Map<String,Object> resultMap = new HashMap<>();
|
|
|
Integer isOperator = 0;
|
|
|
resultMap.put("patientCode",patientCode);//居民code
|
|
|
//专科医生
|
|
|
String specialistRelationSql = "select r.*,t.name as teamName,h.name as specialistHospitalName from wlyy_specialist.wlyy_specialist_patient_relation r left join "+basedb+".wlyy_admin_team t on r.team_code=t.id left join "+basedb+".dm_hospital h on t.org_code=h.code where r.sign_status ='1' and r.status in('0','1') and r.patient='"+patientCode+"' and r.doctor='"+doctorCode+"'";
|
|
|
List<Map<String,Object>> specialistRelationList = jdbcTemplate.queryForList(specialistRelationSql);
|
|
|
Map<String,Object> specialistMap = specialistRelationList.get(0);
|
|
|
resultMap.put("specialistAdminTeamName",specialistMap.get("teamName"));
|
|
|
resultMap.put("specialistHospitalName",specialistMap.get("specialistHospitalName"));//专科医生所在医院
|
|
|
Integer specialistUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(doctorCode,patientCode,1);
|
|
|
Integer specialistFinishCount = rehabilitationDetailDao.findItemByDoctor(doctorCode,patientCode);
|
|
|
Integer specialistServiceCount = rehabilitationDetailDao.completeServiceByDoctor(doctorCode,patientCode,1);
|
|
|
resultMap.put("specialistFinishItemCount",specialistFinishCount-specialistUnfinishCount);//完成项目
|
|
|
resultMap.put("specialistServiceRecordCount",specialistServiceCount);//服务次数
|
|
|
|
|
|
//基础信息
|
|
|
resultMap.put("hospitalName",signFamilyMap.get("hospital_name"));
|
|
|
Integer age = IdCardUtil.getAgeForIdcard(signFamilyMap.get("idcard")+"");
|
|
|
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"));
|
|
|
//疾病类型
|
|
|
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")+"' ";
|
|
|
List<Map<String,Object>> diseaseList = jdbcTemplate.queryForList(diseaseSql);
|
|
|
List<String> disease = new ArrayList<>();
|
|
|
for(Map<String,Object> one2:diseaseList){
|
|
|
disease.add(one2.get("disease_name")+"");
|
|
|
}
|
|
|
resultMap.put("diseaseList",disease);
|
|
|
//家庭医生(包括全科医生、健管师)
|
|
|
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+"'";
|
|
|
List<Map<String,Object>> signFamilyList = jdbcTemplate.queryForList(signFamilySql);
|
|
|
Map<String,Object> signFamilyMap = signFamilyList.get(0);
|
|
|
resultMap.put("signFamilyAdminTeamName",signFamilyMap.get("teamName"));
|
|
|
resultMap.put("familyHospitalName",signFamilyMap.get("hospital_name"));//家庭医生所在医院
|
|
|
Integer familyUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(signFamilyMap.get("doctor")+"",signFamilyMap.get("doctor_health")+"",patientCode,1);
|
|
|
Integer familyFinishCount = rehabilitationDetailDao.findItemByDoctor(signFamilyMap.get("doctor")+"",signFamilyMap.get("doctor_health")+"",patientCode);
|
|
|
Integer familyServiceCount = rehabilitationDetailDao.completeServiceByDoctor(signFamilyMap.get("doctor")+"",signFamilyMap.get("doctor_health")+"",patientCode,1);
|
|
|
resultMap.put("signFamilyFinishItemCount",familyFinishCount-familyUnfinishCount);//完成项目
|
|
|
resultMap.put("signFamilyServiceRecordCount",familyServiceCount);//服务次数
|
|
|
|
|
|
//计划列表
|
|
|
List<PatientRehabilitationPlanDO> list = patientRehabilitationPlanDao.findByPatientAndCreateUser(patientCode,doctorCode);
|
|
|
List<Map<String,Object>> rehabilitationPlanList = new ArrayList<>();
|
|
|
for(PatientRehabilitationPlanDO one:list){
|
|
|
Map<String,Object> planMap = new HashMap<>();
|
|
|
planMap.put("planId",one.getId());
|
|
|
//安排类型
|
|
|
String planTypeName = null;
|
|
|
Integer planTypeTemp = one.getPlanType();
|
|
|
switch (planTypeTemp){
|
|
|
case 1:planTypeName="康复计划" ;break;
|
|
|
case 2:planTypeName="(转)社区医院" ;break;
|
|
|
case 3:planTypeName="(转)转家庭病床" ;break;
|
|
|
//基础信息
|
|
|
resultMap.put("hospitalName",signFamilyMap.get("hospital_name"));
|
|
|
Integer age = IdCardUtil.getAgeForIdcard(signFamilyMap.get("idcard")+"");
|
|
|
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"));
|
|
|
//疾病类型
|
|
|
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")+"' ";
|
|
|
List<Map<String,Object>> diseaseList = jdbcTemplate.queryForList(diseaseSql);
|
|
|
List<String> disease = new ArrayList<>();
|
|
|
for(Map<String,Object> one2:diseaseList){
|
|
|
disease.add(one2.get("disease_name")+"");
|
|
|
}
|
|
|
planMap.put("planTypeName",planTypeName);
|
|
|
planMap.put("status",one.getStatus());//0已中止,1进行中,2已完成
|
|
|
resultMap.put("diseaseList",disease);
|
|
|
|
|
|
//状态(0未完成,1已完成,2已预约)
|
|
|
//今日待办
|
|
|
Date beginTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+ " "+"00:00:00");
|
|
|
Date endTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+ " "+"23:59:59");
|
|
|
Integer todayBacklogCount = rehabilitationDetailDao.todayBacklogCount(one.getId(),beginTime,endTime);
|
|
|
planMap.put("todayBacklogCount",todayBacklogCount);
|
|
|
//已完成
|
|
|
Integer finishedCount = rehabilitationDetailDao.completenessCount(1,one.getId(),beginTime,endTime);
|
|
|
planMap.put("finishedCount",finishedCount);//已完成
|
|
|
//未完成
|
|
|
Integer notstartedCount = rehabilitationDetailDao.completenessCount(0,one.getId(),beginTime,endTime);//未完成
|
|
|
Integer underwayCount = rehabilitationDetailDao.completenessCount(2,one.getId(),beginTime,endTime);//已预约
|
|
|
Integer unfinishedCount = notstartedCount+underwayCount;
|
|
|
planMap.put("unfinishedCount",unfinishedCount);//未完成
|
|
|
//完成度(已完成/(已完成+未完成))
|
|
|
Integer allFinishCount = rehabilitationDetailDao.findByStatusAndPlanId(1,one.getId());
|
|
|
Integer allCount = rehabilitationDetailDao.findAllByPlanId(one.getId());
|
|
|
planMap.put("allCount",allCount);//总数
|
|
|
planMap.put("allFinishCount",allFinishCount);//全部已完成数
|
|
|
rehabilitationPlanList.add(planMap);
|
|
|
//计划列表
|
|
|
List<PatientRehabilitationPlanDO> list = patientRehabilitationPlanDao.findByPatientAndCreateUser(patientCode,doctorCode);
|
|
|
List<Map<String,Object>> rehabilitationPlanList = new ArrayList<>();
|
|
|
for(PatientRehabilitationPlanDO one:list){
|
|
|
Map<String,Object> planMap = new HashMap<>();
|
|
|
planMap.put("planId",one.getId());
|
|
|
//安排类型
|
|
|
String planTypeName = null;
|
|
|
Integer planTypeTemp = one.getPlanType();
|
|
|
switch (planTypeTemp){
|
|
|
case 1:planTypeName="康复计划" ;break;
|
|
|
case 2:planTypeName="(转)社区医院" ;break;
|
|
|
case 3:planTypeName="(转)转家庭病床" ;break;
|
|
|
}
|
|
|
planMap.put("planTypeName",planTypeName);
|
|
|
planMap.put("status",one.getStatus());//0已中止,1进行中,2已完成
|
|
|
if(currentDoctorCode.equals(doctorCode)){
|
|
|
isOperator = 1;
|
|
|
}
|
|
|
planMap.put("isOperator",isOperator);
|
|
|
//状态(0未完成,1已完成,2已预约)
|
|
|
//今日待办
|
|
|
Date beginTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+ " "+"00:00:00");
|
|
|
Date endTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+ " "+"23:59:59");
|
|
|
Integer todayBacklogCount = rehabilitationDetailDao.todayBacklogCount(one.getId(),beginTime,endTime);
|
|
|
planMap.put("todayBacklogCount",todayBacklogCount);
|
|
|
//已完成
|
|
|
Integer finishedCount = rehabilitationDetailDao.completenessCount(1,one.getId(),beginTime,endTime);
|
|
|
planMap.put("finishedCount",finishedCount);//已完成
|
|
|
//未完成
|
|
|
Integer notstartedCount = rehabilitationDetailDao.completenessCount(0,one.getId(),beginTime,endTime);//未完成
|
|
|
Integer underwayCount = rehabilitationDetailDao.completenessCount(2,one.getId(),beginTime,endTime);//已预约
|
|
|
Integer unfinishedCount = notstartedCount+underwayCount;
|
|
|
planMap.put("unfinishedCount",unfinishedCount);//未完成
|
|
|
//完成度(已完成/(已完成+未完成))
|
|
|
Integer allFinishCount = rehabilitationDetailDao.findByStatusAndPlanId(1,one.getId());
|
|
|
Integer allCount = rehabilitationDetailDao.findAllByPlanId(one.getId());
|
|
|
planMap.put("allCount",allCount);//总数
|
|
|
planMap.put("allFinishCount",allFinishCount);//全部已完成数
|
|
|
rehabilitationPlanList.add(planMap);
|
|
|
}
|
|
|
resultMap.put("rehabilitationPlanList",rehabilitationPlanList);
|
|
|
resultList.add(resultMap);
|
|
|
}
|
|
|
resultMap.put("rehabilitationPlanList",rehabilitationPlanList);
|
|
|
return ObjEnvelop.getSuccess(SpecialistMapping.api_success,resultMap);
|
|
|
|
|
|
return ObjEnvelop.getSuccess(SpecialistMapping.api_success,resultList);
|
|
|
}
|
|
|
|
|
|
|
|
@ -372,12 +384,14 @@ public class RehabilitationManageService {
|
|
|
// sql+="and d.type='"+role+"' " ;
|
|
|
// }
|
|
|
sql+=" and d.doctor='"+doctorCode+"' " ;
|
|
|
}else{
|
|
|
sql+=" and i.type='"+searchTask+"' " ;
|
|
|
}else if(searchTask==2||searchTask==4){
|
|
|
sql+=" and i.type="+searchTask+" " ;
|
|
|
}else if(searchTask==3){
|
|
|
sql+=" and i.reserve="+searchTask+" " ;
|
|
|
}
|
|
|
}
|
|
|
if(status!=null){
|
|
|
sql+= "and d.status="+status;
|
|
|
sql+= " and d.status="+status;
|
|
|
}
|
|
|
|
|
|
List<Map<String,Object>> rehabilitationDetailList = jdbcTemplate.queryForList(sql);
|
|
@ -487,8 +501,10 @@ public class RehabilitationManageService {
|
|
|
if(searchTask!=null){
|
|
|
if(searchTask==1){
|
|
|
sql+="and d.doctor='"+doctorCode+"' ";
|
|
|
}else{
|
|
|
sql+=" and i.type='"+searchTask+"' " ;
|
|
|
}else if(searchTask==2||searchTask==4){
|
|
|
sql+=" and i.type="+searchTask+" " ;
|
|
|
}else if(searchTask==3){
|
|
|
sql+=" and i.reserve="+searchTask+" " ;
|
|
|
}
|
|
|
}
|
|
|
if(status!=null){
|
|
@ -513,7 +529,7 @@ public class RehabilitationManageService {
|
|
|
}
|
|
|
String planDetailResult = StringUtils.isNotEmpty(planDetailList)?planDetailList.substring(1):"";
|
|
|
String sql = "select i.title,i.content,i.type as itemType,i.reserve,d.id,d.execute_time,d.hospital_name,d.status,d.type as detailType,d.expense,d.doctor as specialistDoctor," +
|
|
|
" d.doctor_name as specialistDoctorName,p.patient ,p.create_user ,p.create_user_name " +
|
|
|
" d.doctor_name as specialistDoctorName,p.patient ,p.create_user ,p.create_user_name, p.status as planStatus " +
|
|
|
" from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
|
|
|
" LEFT JOIN wlyy_specialist.wlyy_hospital_service_item h on d.hospital_service_item_id = h.id "+
|
|
|
" LEFT JOIN wlyy_specialist.wlyy_service_item i on i.id = h.service_item_id " +
|
|
@ -531,9 +547,10 @@ public class RehabilitationManageService {
|
|
|
isMyTask=1;
|
|
|
}
|
|
|
resultMap.put("isMyTask",isMyTask);//0不是自己的任务,1是自己的任务
|
|
|
if(!(one.get("specialistDoctor")+"").equals((one.get("create_user")+""))){
|
|
|
executeDoctorList.add(one.get("create_user_name")+"");
|
|
|
}
|
|
|
// if(!(one.get("specialistDoctor")+"").equals((one.get("create_user")+""))){
|
|
|
// executeDoctorList.add(one.get("create_user_name")+"");
|
|
|
// }
|
|
|
resultMap.put("executeDoctorCode",one.get("specialistDoctor")+"");//执行医生code
|
|
|
executeDoctorList.add(one.get("specialistDoctorName")+"");
|
|
|
resultMap.put("specialistDoctorCode",one.get("create_user")+"");//专科医生code
|
|
|
resultMap.put("specialistDoctorName",one.get("create_user_name")+"");//专科医生名字
|
|
@ -546,6 +563,7 @@ public class RehabilitationManageService {
|
|
|
resultMap.put("executeTime",one.get("execute_time"));//执行时间
|
|
|
resultMap.put("expense",one.get("expense"));//收费
|
|
|
resultMap.put("reserve",one.get("reserve"));//是否需要预约(1预约、0不预约)
|
|
|
resultMap.put("planStatus",one.get("planStatus"));//计划的状态
|
|
|
Integer status = Integer.valueOf(one.get("status").toString());//状态(0未完成,1已完成,2已预约)
|
|
|
String statusName = "";
|
|
|
switch (status){
|
|
@ -594,7 +612,7 @@ public class RehabilitationManageService {
|
|
|
*/
|
|
|
public ObjEnvelop serviceItem(String planDetailId,String doctorCode) throws Exception{
|
|
|
String sql = "select i.title,i.content,i.type as itemType,i.reserve,d.id,d.execute_time,d.hospital_name,d.status,d.type,d.expense,d.doctor as specialistDoctor, " +
|
|
|
" d.doctor_name as specialistDoctorName,p.patient ,p.name as patientName,p.create_user ,p.create_user_name " +
|
|
|
" d.doctor_name as specialistDoctorName,p.patient ,p.name as patientName,p.create_user ,p.create_user_name, p.status as planStatus" +
|
|
|
" from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
|
|
|
" LEFT JOIN wlyy_specialist.wlyy_hospital_service_item h on d.hospital_service_item_id = h.id "+
|
|
|
" LEFT JOIN wlyy_specialist.wlyy_service_item i on i.id = h.service_item_id " +
|
|
@ -609,11 +627,12 @@ public class RehabilitationManageService {
|
|
|
isMyTask=1;
|
|
|
}
|
|
|
resultMap.put("isMyTask",isMyTask);//0不是自己的任务,1是自己的任务
|
|
|
if(!(one.get("specialistDoctor")+"").equals((one.get("create_user")+""))){
|
|
|
executeDoctorList.add(one.get("create_user_name")+"");
|
|
|
}
|
|
|
// if(!(one.get("specialistDoctor")+"").equals((one.get("create_user")+""))){
|
|
|
// executeDoctorList.add(one.get("create_user_name")+"");
|
|
|
// }
|
|
|
executeDoctorList.add(one.get("specialistDoctorName")+"");
|
|
|
resultMap.put("executeDoctorList",executeDoctorList);
|
|
|
resultMap.put("executeDoctorCode",one.get("specialistDoctor")+"");//执行医生code
|
|
|
resultMap.put("specialistDoctorCode",one.get("create_user")+"");//专科医生code
|
|
|
resultMap.put("specialistDoctorName",one.get("create_user_name")+"");//专科医生名字
|
|
|
resultMap.put("title",one.get("title"));//项目标题
|
|
@ -623,6 +642,7 @@ public class RehabilitationManageService {
|
|
|
resultMap.put("executeTime",one.get("execute_time"));//执行时间
|
|
|
resultMap.put("expense",one.get("expense"));//收费
|
|
|
resultMap.put("reserve",one.get("reserve"));//是否需要预约(1预约、0不预约)
|
|
|
resultMap.put("planStatus",one.get("planStatus"));//计划的状态
|
|
|
Integer status = Integer.valueOf(one.get("status").toString());//状态(0未完成,1已完成,2已预约)
|
|
|
String statusName = "";
|
|
|
switch (status){
|
|
@ -726,7 +746,7 @@ public class RehabilitationManageService {
|
|
|
serviceDoctorList.add(healthDoctorMap);
|
|
|
}
|
|
|
|
|
|
String specialistRelationSql = "select * from wlyy_specialist.wlyy_specialist_patient_relation where patient='"+patientCode+"' and sign_status='1' and status='1'";
|
|
|
String specialistRelationSql = "select * from wlyy_specialist.wlyy_specialist_patient_relation where patient='"+patientCode+"' and sign_status='1' and status >=0 ";
|
|
|
List<Map<String,Object>> specialistRelationList = jdbcTemplate.queryForList(specialistRelationSql);
|
|
|
for(Map<String,Object> one:specialistRelationList){
|
|
|
String doctor = one.get("doctor")+"";
|
|
@ -746,7 +766,7 @@ public class RehabilitationManageService {
|
|
|
|
|
|
//康复计划
|
|
|
List<Map<String,Object>> planList = new ArrayList<>();
|
|
|
List<PatientRehabilitationPlanDO> list = patientRehabilitationPlanDao.findbyPatients(patientCode);
|
|
|
List<PatientRehabilitationPlanDO> list = patientRehabilitationPlanDao.findByPatients(patientCode);
|
|
|
Integer planUnderway = 0;//进行中
|
|
|
Integer planFinish = 0;//已完成
|
|
|
for(PatientRehabilitationPlanDO one:list){
|
|
@ -1083,7 +1103,7 @@ public class RehabilitationManageService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 更新康复计划项目操作日志并且确认完成更新status
|
|
|
* 更新康复计划项目操作日志并且确认完成更新status.
|
|
|
* @param node
|
|
|
* @param image
|
|
|
* @param planDeatilId
|
|
@ -1093,6 +1113,21 @@ public class RehabilitationManageService {
|
|
|
Map<String,Object> resultMap = new HashedMap();
|
|
|
int i = rehabilitationDetailDao.updateStatusById(1,planDeatilId);
|
|
|
int j = rehabilitationOperateRecordsDao.updateNodeAndRelationRecordImg(node,image,planDeatilId);
|
|
|
//如果整个计划的服务项都完成了,整个计划也完成了
|
|
|
String allSql ="SELECT * FROM wlyy_rehabilitation_plan_detail where plan_id = (SELECT plan_id FROM `wlyy_rehabilitation_plan_detail` WHERE id='"+planDeatilId+"')";
|
|
|
List<RehabilitationDetailDO> rehabilitationDetailDOList = jdbcTemplate.query(allSql,new BeanPropertyRowMapper<>(RehabilitationDetailDO.class));
|
|
|
int allCount=0;
|
|
|
String planId="";
|
|
|
for (RehabilitationDetailDO rehabilitationDetailDO : rehabilitationDetailDOList){
|
|
|
if (rehabilitationDetailDO.getStatus()==1){
|
|
|
allCount++;
|
|
|
}
|
|
|
}
|
|
|
if (rehabilitationDetailDOList.size()>0 && rehabilitationDetailDOList.size()==allCount){
|
|
|
planId = rehabilitationDetailDOList.get(0).getPlanId();
|
|
|
patientRehabilitationPlanDao.updateStatusById(2,planId);
|
|
|
}
|
|
|
//更新返回数据提供发送消息使用
|
|
|
String sql ="SELECT" +
|
|
|
" i.service_item_id," +
|
|
|
" r.doctor_code," +
|
|
@ -1145,4 +1180,14 @@ public class RehabilitationManageService {
|
|
|
resultMap.put("healthyCondition","康复期");
|
|
|
return ObjEnvelop.getSuccess(SpecialistMapping.api_success,resultMap);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据居民获取康复计划
|
|
|
* @param patient
|
|
|
* @return
|
|
|
*/
|
|
|
public ObjEnvelop planListByPatient(String patient){
|
|
|
List<PatientRehabilitationPlanDO> list = patientRehabilitationPlanDao.findByPatients(patient);
|
|
|
return ObjEnvelop.getSuccess(SpecialistMapping.api_success,list);
|
|
|
}
|
|
|
}
|