修改患者任务接口。

This commit is contained in:
haown 2024-04-10 17:37:35 +08:00
parent be597c2af3
commit 7f75629760
11 changed files with 148 additions and 257 deletions

View File

@ -85,6 +85,7 @@ public class PatientInfoController extends BaseController {
/**
* 修改患者信息
*/
@ApiOperation("修改患者信息")
@PreAuthorize("@ss.hasPermi('manage:patientInfo:edit')")
@Log(title = "患者信息", businessType = BusinessType.UPDATE)
@PutMapping

View File

@ -3,17 +3,16 @@ package com.xinelu.manage.controller.signpatientmanageroutenode;
import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.R;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.RouteNodeCheckDto;
import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService;
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.annotation.Resource;
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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@ -44,12 +43,12 @@ public class SignPatientManageRouteNodeController extends BaseController {
}
/**
* 根据患者主键查询签约路径及节点
* 查询管理任务路径及节点
*/
@ApiOperation("根据患者主键查询患者管理路径节点")
@GetMapping("/getNodesByPatient/{patientId}")
public R<List<SignPatientManageRouteNode>> getNodesByPatient(@PathVariable("patientId") Long patientId) {
List<SignPatientManageRouteNode> list = signNodeService.getNodesByPatient(patientId);
@ApiOperation("查询管理任务路径节点")
@GetMapping("/getRouteNodeList")
public R<List<SignPatientManageRouteNodeVo>> getRouteNodeList(PatientTaskDto patientTaskDto) {
List<SignPatientManageRouteNodeVo> list = signNodeService.getRouteNodeList(patientTaskDto);
return R.ok(list);
}

View File

@ -1,10 +1,10 @@
package com.xinelu.manage.dto.signpatientmanageroutenode;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
/**
* @description: 患者任务查询传输对象
@ -15,15 +15,29 @@ import lombok.Data;
@Data
public class PatientTaskDto {
/** 就诊时间格式yyyy-MM-dd HH:mm:ss */
@ApiModelProperty(value = "就诊时间开始格式yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDateTime visitDateStart;
/**
* 患者主键
*/
@ApiModelProperty("患者主键")
private Long patientId;
/** 就诊时间格式yyyy-MM-dd HH:mm:ss */
@ApiModelProperty(value = "就诊时间结束格式yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDateTime visitDateEnd;
/** 签约记录表id */
@ApiModelProperty(value = "签约记录表id")
private Long signPatientRecordId;
/** 任务创建类型手动创建MANUAL_CREATE自动匹配MANUAL_MATCHE */
@ApiModelProperty(value = "任务创建类型手动创建MANUAL_CREATE自动匹配MANUAL_MATCHE")
private String taskCreateType;
/** 出院时间开始格式yyyy-MM-dd HH:mm:ss */
@ApiModelProperty(value = "出院时间开始格式yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDateTime dischargeTimeStart;
/** 出院时间结束格式yyyy-MM-dd HH:mm:ss */
@ApiModelProperty(value = "出院时间结束格式yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDateTime dischargeTimeEnd;
/** 所属医院id */
@ApiModelProperty(value = "所属医院id")

View File

@ -4,6 +4,7 @@ import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRout
import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.RouteNodeCheckDto;
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeVo;
import java.util.List;
@ -23,12 +24,12 @@ public interface ISignPatientManageRouteNodeService {
public SignPatientManageRouteNode selectSignPatientManageRouteNodeById(Long id);
/**
* 根据患者主键查询患者管理路径节点
* 根据患者管理路径节点
*
* @param patientId 患者主键
* @return 签约患者管理任务路径节点
* @param patientTaskDto 任务查询传输对象
* @return 患者管理任务路径节点
*/
List<SignPatientManageRouteNode> getNodesByPatient(Long patientId);
List<SignPatientManageRouteNodeVo> getRouteNodeList(PatientTaskDto patientTaskDto);
/**
* 查询签约患者管理任务路径节点列表

View File

@ -1,5 +1,6 @@
package com.xinelu.manage.service.signpatientmanageroutenode.impl;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.manage.domain.patientinfo.PatientInfo;
import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute;
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
@ -10,11 +11,12 @@ import com.xinelu.manage.mapper.signpatientmanageroute.SignPatientManageRouteMap
import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper;
import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService;
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeVo;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -44,23 +46,30 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
return signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeById(id);
}
@Override public List<SignPatientManageRouteNode> getNodesByPatient(Long patientId) {
List<SignPatientManageRouteNode> nodeList = new ArrayList<>();
PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(patientId);
if (patientInfo.getSignPatientRecordId() != null) {
// 查询签约路径
SignPatientManageRoute signPatientManageRoute = new SignPatientManageRoute();
signPatientManageRoute.setSignPatientRecordId(patientInfo.getSignPatientRecordId());
signPatientManageRoute.setPatientId(patientId);
List<SignPatientManageRoute> signRoutes = signRouteMapper.selectSignPatientManageRouteList(signPatientManageRoute);
if (CollectionUtils.isNotEmpty(signRoutes)) {
SignPatientManageRoute signRoute = signRoutes.get(0);
SignPatientManageRouteNode nddeQuery = new SignPatientManageRouteNode();
nddeQuery.setManageRouteId(signRoute.getId());
nodeList = signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeList(nddeQuery);
}
@Override public List<SignPatientManageRouteNodeVo> getRouteNodeList(PatientTaskDto patientTaskDto) {
List<SignPatientManageRouteNodeVo> retList = new ArrayList<>();
PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(patientTaskDto.getPatientId());
if (patientTaskDto.getPatientId() == null || ObjectUtils.isEmpty(patientInfo)) {
throw new ServiceException("请选择患者!");
}
return nodeList;
// 查询任务列表
SignPatientManageRoute signPatientManageRoute = new SignPatientManageRoute();
signPatientManageRoute.setSignPatientRecordId(patientTaskDto.getSignPatientRecordId());
signPatientManageRoute.setPatientId(patientTaskDto.getPatientId());
signPatientManageRoute.setTaskCreateType(patientTaskDto.getTaskCreateType());
List<SignPatientManageRoute> signRoutes = signRouteMapper.selectSignPatientManageRouteList(signPatientManageRoute);
for (SignPatientManageRoute route : signRoutes) {
SignPatientManageRouteNode nodeQuery = new SignPatientManageRouteNode();
nodeQuery.setManageRouteId(route.getId());
List<SignPatientManageRouteNode> nodeList = signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeList(nodeQuery);
retList.add(SignPatientManageRouteNodeVo.builder().manageRouteId(route.getId())
.routeName(route.getRouteName())
.taskCreateType(route.getTaskCreateType())
.suitRange(route.getSuitRange())
.nodeList(nodeList).build());
}
return retList;
}
/**

View File

@ -1,211 +0,0 @@
package com.xinelu.manage.vo.signpatientmanageroute;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalTime;
import lombok.Data;
/**
* @description: 居民管理路径查询返回视图类
* @author: haown
* @create: 2024-04-02 08:58
**/
@ApiModel("居民管理路径查询返回视图类")
@Data
public class SignPatientManageRouteNodeVo {
/** 签约记录表id */
@ApiModelProperty(value = "签约记录表id")
private Long signPatientRecordId;
/** 路径主键 */
@ApiModelProperty(value = "路径主键")
private Long routeId;
/** 路径名称(任务名称) */
@ApiModelProperty(value = "路径名称")
private String routeName;
/** 管理路径节点名称出院后AFTER_DISCHARGE入院后AFTER_ADMISSION就诊后AFTER_CONSULTATION就诊/出院后AFTER_VISIT_DISCHARGE术前PREOPERATIVE术后POSTOPERATIVE*/
@ApiModelProperty(value = "管理路径节点名称出院后AFTER_DISCHARGE入院后AFTER_ADMISSION就诊后AFTER_CONSULTATION"
+ "就诊/出院后AFTER_VISIT_DISCHARGE术前PREOPERATIVE术后POSTOPERATIVE")
private String routeNodeName;
/** 管理路径节点时间,时间单位为:天 */
@ApiModelProperty(value = "管理路径节点时间,时间单位为:天")
private Integer routeNodeDay;
/** 任务类型电话外呼PHONE_OUTBOUND问卷量表QUESTIONNAIRE_SCALE宣教文章PROPAGANDA_ARTICLE文字提醒TEXT_REMIND人工随访ARTIFICIAL_FOLLOW_UP */
@ApiModelProperty(value = "任务类型电话外呼PHONE_OUTBOUND问卷量表QUESTIONNAIRE_SCALE宣教文章PROPAGANDA_ARTICLE文字提醒TEXT_REMIND人工随访ARTIFICIAL_FOLLOW_UP")
private String taskType;
/** 任务状态 */
@ApiModelProperty(value = "任务状态")
private String taskStatus;
/** 任务细分 */
@ApiModelProperty(value = "任务细分")
private String taskSubdivision;
/** 二级分类描述 */
@ApiModelProperty(value = "二级分类描述")
private String secondClassifyDescribe;
/** 执行时间格式HH:mm */
@ApiModelProperty(value = "执行时间格式HH:mm")
@JsonFormat(pattern = "HH:mm")
private LocalTime executeTime;
/** 电话推送标识0未开启1已开启 */
@ApiModelProperty(value = "电话推送标识0未开启1已开启")
private Integer phonePushSign;
/** 电话话术表id */
@ApiModelProperty(value = "电话话术表id")
private Long phoneId;
/** 电话模板ID */
@ApiModelProperty(value = "电话模板ID")
private String phoneTemplateId;
/** 电话模板名称 */
@ApiModelProperty(value = "电话模板名称")
private String phoneTemplateName;
/** 电话内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
@ApiModelProperty(value = "电话内容")
private String phoneNodeContent;
/** 电话重拨次数重拨一次REDIAL_ONCE重拨二次REDIAL_TWICE不重播NOT_REPLAY */
@ApiModelProperty(value = "电话重拨次数重拨一次REDIAL_ONCE重拨二次REDIAL_TWICE不重播NOT_REPLAY")
private String phoneRedialTimes;
/** 电话时间间隔,单位为:分钟 */
@ApiModelProperty(value = "电话时间间隔,单位为:分钟")
private Integer phoneTimeInterval;
/** 电话短信提醒不发送短信NOT_SEND_MESSAGE未接通发短信NOT_CONNECTED_SEND_MESSAGE接通后发短信CONNECTED_SEND_MESSAGE所有人发短信EVERYONE_SEND_MESSAGE */
@ApiModelProperty(value = "电话短信提醒不发送短信NOT_SEND_MESSAGE未接通发短信NOT_CONNECTED_SEND_MESSAGE接通后发短信CONNECTED_SEND_MESSAGE所有人发短信EVERYONE_SEND_MESSAGE")
private String phoneMessageRemind;
/** 电话短信模板表id */
@ApiModelProperty(value = "电话短信模板表id")
private Long phoneMessageTemplateId;
/** 电话短信模板名称 */
@ApiModelProperty(value = "电话短信模板名称")
private String phoneMessageTemplateName;
/** 问卷表id */
@ApiModelProperty(value = "问卷表id")
private Long questionInfoId;
/** 问卷模板名称 */
@ApiModelProperty(value = "问卷模板名称")
private String questionnaireName;
/** 问卷模板内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
@ApiModelProperty(value = "问卷模板内容")
private String questionnaireContent;
/** 问卷有效期,单位:天 */
@ApiModelProperty(value = "问卷有效期,单位:天")
private Integer questionExpirationDate;
/** 宣教文章表id */
@ApiModelProperty(value = "宣教文章表id")
private Long propagandaInfoId;
/** 宣教文章模板标题(宣教模板名称) */
@ApiModelProperty(value = "宣教文章模板标题")
private String propagandaTitle;
/** 宣教文章内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
@ApiModelProperty(value = "宣教文章内容")
private String propagandaContent;
/** 短信推送标识0未开启1已开启 */
@ApiModelProperty(value = "短信推送标识0未开启1已开启")
private Integer messagePushSign;
/** 短信模板表id */
@ApiModelProperty(value = "短信模板表id")
private Long messageTemplateId;
/** 短信模板名称 */
@ApiModelProperty(value = "短信模板名称")
private String messageTemplateName;
/** 短信预览 */
@ApiModelProperty(value = "短信预览")
private String messagePreview;
/** 短信节点内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
@ApiModelProperty(value = "短信节点内容")
private String messageNodeContent;
/** 公众号推送标识0未开启1已开启 */
@ApiModelProperty(value = "公众号推送标识0未开启1已开启")
private Integer officialPushSign;
/** 公众号模板表id */
@ApiModelProperty(value = "公众号模板表id")
private Long officialTemplateId;
/** 公众号模板名称 */
@ApiModelProperty(value = "公众号模板名称")
private String officialTemplateName;
/** 公众号提醒内容 */
@ApiModelProperty(value = "公众号提醒内容")
private String officialRemindContent;
/** 公众号节点内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
@ApiModelProperty(value = "公众号节点内容")
private String officialNodeContent;
/** 小程序推送标识0未开启1已开启 */
@ApiModelProperty(value = "小程序推送标识0未开启1已开启")
private Integer appletPushSign;
/** 小程序模板表id */
@ApiModelProperty(value = "小程序模板表id")
private Long appletTemplateId;
/** 小程序模板名称 */
@ApiModelProperty(value = "小程序模板名称")
private String appletTemplateName;
/** 小程序提醒内容 */
@ApiModelProperty(value = "小程序提醒内容")
private String appletRemindContent;
/** 小程序提示说明 */
@ApiModelProperty(value = "小程序提示说明")
private String appletPromptDescription;
/** 小程序节点内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
@ApiModelProperty(value = "小程序节点内容")
private String appletNodeContent;
/** 人工随访模板表id */
@ApiModelProperty(value = "人工随访模板表id")
private Long followTemplateId;
/** 人工随访模板名称 */
@ApiModelProperty(value = "人工随访模板名称")
private String followTemplateName;
/** 人工随访模板内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
@ApiModelProperty(value = "人工随访模板内容")
private String followContent;
/** 节点审核状态同意AGREE不同意DISAGREE */
@ApiModelProperty(value = "节点审核状态同意AGREE不同意DISAGREE")
private String routeCheckStatus;
/** 节点任务执行状态已执行EXECUTED未执行UNEXECUTED */
@ApiModelProperty(value = "节点任务执行状态已执行EXECUTED未执行UNEXECUTED")
private String nodeExecuteStatus;
}

View File

@ -121,10 +121,21 @@ public class PatientTaskVo {
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDateTime visitDate;
/**
* 出院时间出院患者时间格式yyyy-MM-dd
*/
@ApiModelProperty(value = "出院时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDateTime dischargeTime;
/** 手术名称 */
@ApiModelProperty(value = "手术名称")
private String surgicalName;
/** 签约记录表id */
@ApiModelProperty(value = "签约记录表id")
private Long signPatientRecordId;
/** 签约患者管理任务路径节点id */
@ApiModelProperty(value = "签约患者管理任务路径节点id")
private Long manageRouteNodeId;

View File

@ -0,0 +1,45 @@
package com.xinelu.manage.vo.signpatientmanageroutenode;
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @description: 查询管理路任务路径节点返回视图类
* @author: haown
* @create: 2024-04-10 15:40
**/
@ApiModel("查询管理路任务路径节点返回视图类")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SignPatientManageRouteNodeVo {
/** 签约患者管理任务表id */
@ApiModelProperty(value = "签约患者管理任务表id")
private Long manageRouteId;
/** 路径名称(任务名称) */
@ApiModelProperty(value = "路径名称")
private String routeName;
/** 任务创建类型手动创建MANUAL_CREATE自动匹配MANUAL_MATCHE */
@ApiModelProperty(value = "任务创建类型手动创建MANUAL_CREATE自动匹配MANUAL_MATCHE")
private String taskCreateType;
/** 适用范围在院IN_THE_HOSPITAL出院DISCHARGE门诊OUTPATIENT_SERVICE门诊+出院OUTPATIENT_SERVICE_DISCHARGE */
@ApiModelProperty(value = "适用范围在院IN_THE_HOSPITAL出院DISCHARGE门诊OUTPATIENT_SERVICE门诊+出院OUTPATIENT_SERVICE_DISCHARGE")
private String suitRange;
/**
* 节点列表
*/
@ApiModelProperty(value = "节点列表")
List<SignPatientManageRouteNode> nodeList;
}

View File

@ -583,8 +583,8 @@
patient.address,
patient.patient_type, patient.visit_method, patient.attending_physician_id, patient.attending_physician_name, patient.main_diagnosis,
patient.hospital_agency_id, patient.hospital_agency_name, patient.campus_agency_id, patient.campus_agency_name,
patient.department_id, patient.department_name,patient.ward_id, patient.ward_name, patient.in_hospital_number, patient.visit_date,
patient.surgical_name, node.id as manageRouteNodeId, node.manage_route_id, node.manage_route_name,node.route_check_status
patient.department_id, patient.department_name,patient.ward_id, patient.ward_name, patient.in_hospital_number, patient.visit_date, patient.discharge_time,
patient.surgical_name,patient.sign_patient_record_id, node.id as manageRouteNodeId, node.manage_route_id, node.manage_route_name,node.route_check_status
from sign_patient_manage_route_node node
left join sign_patient_manage_route route on node.manage_route_id = route.id
left join patient_info patient on route.patient_id = patient.id
@ -595,9 +595,14 @@
<if test="mainDiagnosis != null and mainDiagnosis != ''">
and patient.main_diagnosis like concat('%', #{mainDiagnosis}, '%')
</if>
<if test="routeCheckStatus != null ">
and node.route_check_status = #{routeCheckStatus}
</if>
<choose>
<when test="routeCheckStatus != null">
and node.route_check_status = #{routeCheckStatus}
</when>
<otherwise>
and node.route_check_status is null
</otherwise>
</choose>
<if test="hospitalAgencyId != null ">
and patient.hospital_agency_id = #{hospitalAgencyId}
</if>
@ -610,11 +615,11 @@
<if test="wardId != null ">
and patient.ward_id = #{wardId}
</if>
<if test="visitDateStart != null ">
and date_format(patient.visit_date,'%y%m%d') &gt;= date_format(#{visitDateStart},'%y%m%d')
<if test="dischargeTimeStart != null ">
and date_format(patient.discharge_time,'%y%m%d') &gt;= date_format(#{dischargeTimeStart},'%y%m%d')
</if>
<if test="visitDateEnd != null ">
and date_format(patient.visit_date,'%y%m%d') &lt;= date_format(#{visitDateEnd},'%y%m%d')
<if test="dischargeTimeEnd != null ">
and date_format(patient.discharge_time,'%y%m%d') &lt;= date_format(#{dischargeTimeEnd},'%y%m%d')
</if>
</where>
group by patient_id

View File

@ -411,7 +411,9 @@
left join sign_patient_manage_route route on route.sign_patient_record_id = sign.id
<where>
sign.del_flag = 0 and sign.id = #{id}
and route.task_create_type = 'MANUAL_MATCHE'
</where>
LIMIT 1
</select>
<select id="getByPatient" parameterType="java.lang.Long" resultType="com.xinelu.manage.vo.signpatientrecord.SignPatientRecordVo">

View File

@ -0,0 +1,15 @@
package com.xinelu.quartz.task;
import org.springframework.stereotype.Component;
/**
* @description: 患者签约服务包到期状态修改定时任务
* @author: haown
* @create: 2024-04-10 10:23
**/
@Component("SignPackageExpireTask")
public class SignPackageExpireTask {
public void SignPackageExpireTask() {
// 查询签约患者
}
}