|
@ -1,15 +1,9 @@
|
|
|
package com.yihu.jw.service.rehabilitation;
|
|
|
|
|
|
import com.yihu.jw.dao.SpecialistPatientRelationDao;
|
|
|
import com.yihu.jw.dao.rehabilitation.GuidanceMessageLogDao;
|
|
|
import com.yihu.jw.dao.rehabilitation.PatientRehabilitationPlanDao;
|
|
|
import com.yihu.jw.dao.rehabilitation.RehabilitationDetailDao;
|
|
|
import com.yihu.jw.dao.rehabilitation.RehabilitationOperateRecordsDao;
|
|
|
import com.yihu.jw.dao.rehabilitation.*;
|
|
|
import com.yihu.jw.entity.specialist.SpecialistPatientRelationDO;
|
|
|
import com.yihu.jw.entity.specialist.rehabilitation.GuidanceMessageLogDO;
|
|
|
import com.yihu.jw.entity.specialist.rehabilitation.PatientRehabilitationPlanDO;
|
|
|
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationDetailDO;
|
|
|
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationOperateRecordsDO;
|
|
|
import com.yihu.jw.entity.specialist.rehabilitation.*;
|
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
|
import com.yihu.jw.restmodel.web.MixEnvelop;
|
|
|
import com.yihu.jw.restmodel.web.ObjEnvelop;
|
|
@ -21,7 +15,6 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONArray;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.data.domain.Sort;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
@ -51,6 +44,32 @@ public class RehabilitationManageService {
|
|
|
private SpecialistPatientRelationDao specialistPatientRelationDao;
|
|
|
@Autowired
|
|
|
private RehabilitationOperateRecordsDao rehabilitationOperateRecordsDao;
|
|
|
@Autowired
|
|
|
private RehabilitationDetailAppointmentDao rehabilitationDetailAppointmentDao;
|
|
|
|
|
|
/**
|
|
|
* 预约协诊
|
|
|
* @param doctor
|
|
|
* @param doctorName
|
|
|
* @param sendTime
|
|
|
* @param planDetailId
|
|
|
*/
|
|
|
public ObjEnvelop appointmentConsultation(String patient,String doctor, String doctorName,
|
|
|
String appointmentDoctor,String appointmentDoctorName,String sendTime, String planDetailId){
|
|
|
RehabilitationDetailAppointmentDO appointment = new RehabilitationDetailAppointmentDO();
|
|
|
appointment.setAppointmentTime(sendTime+":00");
|
|
|
appointment.setCreateTime(new Date());
|
|
|
appointment.setDoctor(doctor);
|
|
|
appointment.setDoctorName(doctorName);
|
|
|
appointment.setAppointmentDoctor(appointmentDoctor);
|
|
|
appointment.setAppointmentDoctorName(appointmentDoctorName);
|
|
|
appointment.setIsSend(0);
|
|
|
appointment.setRehabilitationPlanDetailId(planDetailId);
|
|
|
appointment.setPatient(patient);
|
|
|
rehabilitationDetailAppointmentDao.save(appointment);
|
|
|
|
|
|
return ObjEnvelop.getSuccess("获取成功",appointment);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 康复管理(专科)-- 计划列表
|
|
@ -693,9 +712,11 @@ public class RehabilitationManageService {
|
|
|
String sql = "select h.name as title,h.content as content,h.code as itemType,d.id,d.execute_time,d.hospital_name,d.status,d.type,d.expense,d.doctor as executeDoctor, " +
|
|
|
" d.doctor_name as executeDoctorName,p.patient ,p.name as patientName,p.create_user as createDoctor,p.create_user_name as createDoctorName, p.status as planStatus," +
|
|
|
" p.disease,p.disease_name as diseaseName,p.title as planTitle,d.plan_id as planId,d.relation_code as relationCode,d.frequency_code as frequencyCode,d.remark "+
|
|
|
" ,a.appointment_time appointmentTime,a.appointment_doctor appointmentDoctor,a.appointment_doctor_name appointmentDoctorName,d.reservation_type reservationType" +
|
|
|
" from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
|
|
|
" LEFT JOIN wlyy_specialist.wlyy_rehabilitation_service_item h on d.hospital_service_item_id = h.code "+
|
|
|
" LEFT JOIN wlyy_specialist.wlyy_patient_rehabilitation_plan p on d.plan_id=p.id " +
|
|
|
" LEFT JOIN wlyy_specialist.wlyy_plan_detail_appointment a on d.id=.a.rehabilitation_plan_detail_id " +
|
|
|
" where d.id = '"+planDetailId+"'";
|
|
|
List<Map<String,Object>> serviceItemList = jdbcTemplate.queryForList(sql);
|
|
|
Map<String,Object> one = serviceItemList.get(0);
|
|
@ -706,6 +727,12 @@ public class RehabilitationManageService {
|
|
|
if(StringUtils.isNotEmpty(doctorCode)&&doctorCode.equals(one.get("executeDoctor")+"")){
|
|
|
isMyTask=1;
|
|
|
}
|
|
|
// 协诊预约信息
|
|
|
resultMap.put("appointmentTime",one.get("appointmentTime"));
|
|
|
resultMap.put("appointmentDoctor",one.get("appointmentDoctor"));
|
|
|
resultMap.put("appointmentDoctorName",one.get("appointmentDoctorName"));
|
|
|
resultMap.put("reservationType",one.get("reservationType"));//复诊类型:1线上,2线下,3远程
|
|
|
|
|
|
resultMap.put("frequencyCode",one.get("frequencyCode")+"");
|
|
|
resultMap.put("isMyTask",isMyTask);//0不是自己的任务,1是自己的任务
|
|
|
// if(!(one.get("specialistDoctor")+"").equals((one.get("create_user")+""))){
|