人工随访代办列表查询

This commit is contained in:
youxilong 2024-04-02 17:23:32 +08:00
parent c580965139
commit f34dbc1d41
7 changed files with 344 additions and 19 deletions

View File

@ -7,19 +7,15 @@ import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.enums.BusinessType;
import com.xinelu.common.utils.poi.ExcelUtil;
import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute;
import com.xinelu.manage.dto.manualfollowup.ManualFollowUpDTO;
import com.xinelu.manage.service.signpatientmanageroute.ISignPatientManageRouteService;
import java.util.List;
import com.xinelu.manage.vo.manualfollowup.ManualFollowUpVO;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 签约患者管理任务路径Controller
@ -33,11 +29,11 @@ public class SignPatientManageRouteController extends BaseController {
@Resource
private ISignPatientManageRouteService signPatientManageRouteService;
/**
* 查询签约患者管理任务路径列表
*/
@PreAuthorize("@ss.hasPermi('manage:signroute:list')")
@GetMapping("/list")
/**
* 查询签约患者管理任务路径列表
*/
@PreAuthorize("@ss.hasPermi('manage:signroute:list')")
@GetMapping("/list")
public TableDataInfo list(SignPatientManageRoute signPatientManageRoute) {
startPage();
List<SignPatientManageRoute> list = signPatientManageRouteService.selectSignPatientManageRouteList(signPatientManageRoute);
@ -52,7 +48,7 @@ public class SignPatientManageRouteController extends BaseController {
@PostMapping("/export")
public void export(HttpServletResponse response, SignPatientManageRoute signPatientManageRoute) {
List<SignPatientManageRoute> list = signPatientManageRouteService.selectSignPatientManageRouteList(signPatientManageRoute);
ExcelUtil<SignPatientManageRoute> util = new ExcelUtil<SignPatientManageRoute>(SignPatientManageRoute. class);
ExcelUtil<SignPatientManageRoute> util = new ExcelUtil<SignPatientManageRoute>(SignPatientManageRoute.class);
util.exportExcel(response, list, "签约患者管理任务路径数据");
}
@ -94,4 +90,15 @@ public class SignPatientManageRouteController extends BaseController {
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(signPatientManageRouteService.deleteSignPatientManageRouteByIds(ids));
}
/**
* 查询人工随访代办列表
*/
@GetMapping("/manualFollowUpList")
public TableDataInfo getManualFollowUpList(ManualFollowUpDTO manualFollowUpDTO) {
startPage();
List<ManualFollowUpVO> list = signPatientManageRouteService.selectManualFollowUpList(manualFollowUpDTO);
return getDataTable(list);
}
}

View File

@ -0,0 +1,97 @@
package com.xinelu.manage.dto.manualfollowup;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 人工随访查询DTO
*
* @author : youxilong
* @date : 2024/4/2 10:36
*/
@Data
public class ManualFollowUpDTO {
@ApiModelProperty(value = "随访开始时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDateTime followStartTime;
@ApiModelProperty(value = "随访结束时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDateTime followEndTime;
@ApiModelProperty(value = "患者姓名")
private String patientName;
@ApiModelProperty(value = "患者电话")
private String patientPhone;
@ApiModelProperty(value = "所属医院id")
private Long hospitalAgencyId;
@ApiModelProperty(value = "所属医院名称")
private String hospitalAgencyName;
@ApiModelProperty(value = "所属院区id")
private Long campusAgencyId;
@ApiModelProperty(value = "所属院区名称")
private String campusAgencyName;
@ApiModelProperty(value = "所属科室id")
private Long departmentId;
@ApiModelProperty(value = "所属科室名称")
private String departmentName;
@ApiModelProperty(value = "所属病区id")
private Long wardId;
@ApiModelProperty(value = "所属病区名称")
private String wardName;
@ApiModelProperty(value = "就诊方式门诊OUTPATIENT_SERVICE住院BE_IN_HOSPITAL")
private String visitMethod;
@ApiModelProperty(value = "就诊流水号")
private String visitSerialNumber;
@ApiModelProperty(value = "入院开始时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDateTime admissionStartTime;
@ApiModelProperty(value = "入院结束时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDateTime admissionEndTime;
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "门诊(门诊患者)开始时间")
private LocalDateTime clinicalStartTime;
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "门诊(门诊患者)结束时间")
private LocalDateTime clinicalEndTime;
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "出院时间(出院患者)开始时间")
private LocalDateTime dischargeStartTime;
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "门诊/出院时间(出院患者)结束时间")
private LocalDateTime dischargeEndTime;
@ApiModelProperty(value = "主要诊断")
private String mainDiagnosis;
@ApiModelProperty(value = "主治医生id")
private Long attendingPhysicianId;
@ApiModelProperty(value = "主治医生姓名")
private String attendingPhysicianName;
}

View File

@ -1,6 +1,9 @@
package com.xinelu.manage.mapper.signpatientmanageroute;
import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute;
import com.xinelu.manage.dto.manualfollowup.ManualFollowUpDTO;
import com.xinelu.manage.vo.manualfollowup.ManualFollowUpVO;
import java.util.List;
@ -58,4 +61,12 @@ public interface SignPatientManageRouteMapper {
* @return 结果
*/
public int deleteSignPatientManageRouteByIds(Long[] ids);
/**
* 查询人工随访代办列表
* @param manualFollowUpDTO 人工随访查询DTO
* @return ManualFollowUpVO 人工随访代办VO
*/
List<ManualFollowUpVO> selectManualFollowUpList(ManualFollowUpDTO manualFollowUpDTO);
}

View File

@ -1,6 +1,9 @@
package com.xinelu.manage.service.signpatientmanageroute;
import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute;
import com.xinelu.manage.dto.manualfollowup.ManualFollowUpDTO;
import com.xinelu.manage.vo.manualfollowup.ManualFollowUpVO;
import java.util.List;
@ -58,4 +61,11 @@ public interface ISignPatientManageRouteService {
* @return 结果
*/
public int deleteSignPatientManageRouteById(Long id);
/**
* 查询人工随访代办列表
* @param manualFollowUpDTO 人工随访查询DTO
* @return ManualFollowUpVO 人工随访代办VO
*/
List<ManualFollowUpVO> selectManualFollowUpList(ManualFollowUpDTO manualFollowUpDTO);
}

View File

@ -1,11 +1,15 @@
package com.xinelu.manage.service.signpatientmanageroute.impl;
import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute;
import com.xinelu.manage.dto.manualfollowup.ManualFollowUpDTO;
import com.xinelu.manage.mapper.signpatientmanageroute.SignPatientManageRouteMapper;
import com.xinelu.manage.service.signpatientmanageroute.ISignPatientManageRouteService;
import java.time.LocalDateTime;
import java.util.List;
import javax.annotation.Resource;
import com.xinelu.manage.vo.manualfollowup.ManualFollowUpVO;
import org.springframework.stereotype.Service;
/**
@ -49,8 +53,8 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
*/
@Override
public int insertSignPatientManageRoute(SignPatientManageRoute signPatientManageRoute) {
signPatientManageRoute.setCreateTime(LocalDateTime.now());
return signPatientManageRouteMapper.insertSignPatientManageRoute(signPatientManageRoute);
signPatientManageRoute.setCreateTime(LocalDateTime.now());
return signPatientManageRouteMapper.insertSignPatientManageRoute(signPatientManageRoute);
}
/**
@ -61,7 +65,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
*/
@Override
public int updateSignPatientManageRoute(SignPatientManageRoute signPatientManageRoute) {
signPatientManageRoute.setUpdateTime(LocalDateTime.now());
signPatientManageRoute.setUpdateTime(LocalDateTime.now());
return signPatientManageRouteMapper.updateSignPatientManageRoute(signPatientManageRoute);
}
@ -86,4 +90,14 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
public int deleteSignPatientManageRouteById(Long id) {
return signPatientManageRouteMapper.deleteSignPatientManageRouteById(id);
}
/**
* 查询人工随访代办列表
* @param manualFollowUpDTO 人工随访查询DTO
* @return ManualFollowUpVO 人工随访代办VO
*/
@Override
public List<ManualFollowUpVO> selectManualFollowUpList(ManualFollowUpDTO manualFollowUpDTO) {
return signPatientManageRouteMapper.selectManualFollowUpList(manualFollowUpDTO);
}
}

View File

@ -0,0 +1,95 @@
package com.xinelu.manage.vo.manualfollowup;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 人工随访代办VO
*
* @author : youxilong
* @date : 2024/4/2 10:36
*/
@Data
public class ManualFollowUpVO {
@ApiModelProperty(value = "患者姓名")
private String patientName;
@ApiModelProperty(value = "患者电话")
private String patientPhone;
@ApiModelProperty(value = "性别MALEFEMALE")
private String sex;
@ApiModelProperty(value = "所属医院id")
private Long hospitalAgencyId;
@ApiModelProperty(value = "所属医院名称")
private String hospitalAgencyName;
@ApiModelProperty(value = "所属院区id")
private Long campusAgencyId;
@ApiModelProperty(value = "所属院区名称")
private String campusAgencyName;
@ApiModelProperty(value = "所属科室id")
private Long departmentId;
@ApiModelProperty(value = "所属科室名称")
private String departmentName;
@ApiModelProperty(value = "所属病区id")
private Long wardId;
@ApiModelProperty(value = "所属病区名称")
private String wardName;
@ApiModelProperty(value = "门诊/住院号 ")
private String inHospitalNumber;
@ApiModelProperty(value = "就诊流水号")
private String visitSerialNumber;
@ApiModelProperty(value = "主要诊断")
private String mainDiagnosis;
@ApiModelProperty(value = "手术名称")
private String surgicalName;
@ApiModelProperty(value = "主治医生id")
private Long attendingPhysicianId;
@ApiModelProperty(value = "主治医生姓名")
private String attendingPhysicianName;
@ApiModelProperty(value = "就诊方式门诊OUTPATIENT_SERVICE住院BE_IN_HOSPITAL")
private String visitMethod;
@ApiModelProperty(value = "入院时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDateTime admissionTime;
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "门诊/出院时间")
private LocalDateTime visitOrDischargeTime;
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "随访时间")
private LocalDateTime executeTime;
@ApiModelProperty(value = "任务类型电话外呼PHONE_OUTBOUND问卷量表QUESTIONNAIRE_SCALE宣教文章PROPAGANDA_ARTICLE文字提醒TEXT_REMIND人工随访ARTIFICIAL_FOLLOW_UP")
private String taskType;
@ApiModelProperty(value = "随访模板")
private String templateName;
@ApiModelProperty(value = "模板id")
private String templateId;
}

View File

@ -93,6 +93,97 @@
where id = #{id}
</select>
<select id="selectManualFollowUpList"
resultType="com.xinelu.manage.vo.manualfollowup.ManualFollowUpVO">
SELECT
pi.patient_name,
pi.patient_phone,
pi.sex,
pi.hospital_agency_id,
pi.hospital_agency_name,
pi.campus_agency_id,
pi.campus_agency_name,
pi.department_id,
pi.department_name,
pi.ward_id,
pi.ward_name,
pi.in_hospital_number,
pi.visit_serial_number,
pi.main_diagnosis,
pvr.surgical_name,
pi.attending_physician_id,
pi.attending_physician_name,
pi.visit_method,
IF(pi.visit_method = 'OUTPATIENT_SERVICE',NULL,pi.admission_time) AS 'admissionTime',
IF(pi.visit_method = 'OUTPATIENT_SERVICE',pi.visit_date,pi.discharge_time) AS 'visitOrDischargeTime',
pter.execute_time AS 'executeTime',
spmrn.task_type,
CASE
WHEN spmrn.task_type = 'PHONE_OUTBOUND' THEN spmrn.phone_template_name
WHEN spmrn.task_type = 'QUESTIONNAIRE_SCALE' THEN spmrn.questionnaire_name
WHEN spmrn.task_type = 'ARTIFICIAL_FOLLOW_UP' THEN spmrn.follow_template_name
END AS 'templateName',
CASE
WHEN spmrn.task_type = 'PHONE_OUTBOUND' THEN spmrn.phone_template_id
WHEN spmrn.task_type = 'QUESTIONNAIRE_SCALE' THEN spmrn.question_info_id
WHEN spmrn.task_type = 'ARTIFICIAL_FOLLOW_UP' THEN spmrn.follow_template_id
END AS 'templateId'
FROM
sign_patient_manage_route spmr
LEFT JOIN sign_patient_manage_route_node spmrn ON spmr.id = spmrn.manage_route_id
LEFT JOIN patient_task_execute_record pter on spmr.id = pter.manage_route_id and spmrn.id = pter.manage_route_node_id
LEFT JOIN patient_info pi ON spmr.patient_id = pi.id
LEFT JOIN patient_visit_record pvr ON pi.patient_visit_record_id = pvr.id
<where>
pi.del_flag = '0' AND spmrn.node_execute_status = 'UNEXECUTED'
<if test="patientName != null and patientName != ''">
AND pi.patient_name = #{patientName}
</if>
<if test="patientPhone != null and patientPhone != ''">
AND pi.patient_phone = #{patientPhone}
</if>
<if test="hospitalAgencyId != null">
AND pi.hospital_agency_id = #{hospitalAgencyId}
</if>
<if test="hospitalAgencyName != null and hospitalAgencyName != ''">
AND pi.hospital_agency_name LIKE concat('%', #{hospitalAgencyName}, '%')
</if>
<if test="visitMethod != null and visitMethod != ''">
AND pi.visit_method = #{visitMethod}
</if>
<if test="visitSerialNumber != null and visitSerialNumber != ''">
AND pi.visit_serial_number = #{visitSerialNumber}
</if>
<if test="clinicalStartTime != null">
AND pi.visit_date >= #{clinicalStartTime}
</if>
<if test="clinicalEndTime != null">
AND pi.visit_date &lt;= #{clinicalEndTime}
</if>
<if test="dischargeStartTime != null">
AND pi.discharge_time >= #{dischargeStartTime}
</if>
<if test="dischargeEndTime != null">
AND pi.discharge_time &lt;= #{dischargeEndTime}
</if>
<if test="admissionStartTime != null">
AND pi.admission_time >= #{admissionStartTime}
</if>
<if test="admissionEndTime != null">
AND pi.admission_time &lt;= #{admissionEndTime}
</if>
<if test="mainDiagnosis != null and mainDiagnosis != ''">
AND pi.main_diagnosis LIKE concat('%', #{mainDiagnosis}, '%')
</if>
<if test="attendingPhysicianId != null">
AND pi.attending_physician_id = #{attendingPhysicianId}
</if>
<if test="attendingPhysicianName != null and attendingPhysicianName != ''">
AND pi.attending_physician_name = #{attendingPhysicianName}
</if>
</where>
</select>
<insert id="insertSignPatientManageRoute" parameterType="com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute" useGeneratedKeys="true"
keyProperty="id">
insert into sign_patient_manage_route