我的随访
This commit is contained in:
parent
152a88d3c9
commit
e8e21cca90
@ -0,0 +1,49 @@
|
||||
package com.xinelu.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @Description 管理路径节点名称
|
||||
* @Author zh
|
||||
* @Date 2024-04-18
|
||||
*/
|
||||
@Getter
|
||||
public enum RouteNodeNameEnum {
|
||||
|
||||
/**
|
||||
* 出院后
|
||||
*/
|
||||
AFTER_DISCHARGE("AFTER_DISCHARGE"),
|
||||
|
||||
/**
|
||||
* 入院后
|
||||
*/
|
||||
AFTER_ADMISSION("AFTER_ADMISSION"),
|
||||
|
||||
/**
|
||||
* 就诊后
|
||||
*/
|
||||
AFTER_CONSULTATION("AFTER_CONSULTATION"),
|
||||
|
||||
/**
|
||||
* 就诊/出院后
|
||||
*/
|
||||
AFTER_VISIT_DISCHARGE("AFTER_VISIT_DISCHARGE"),
|
||||
|
||||
/**
|
||||
* 术前
|
||||
*/
|
||||
PREOPERATIVE("PREOPERATIVE"),
|
||||
|
||||
/**
|
||||
* 术后
|
||||
*/
|
||||
POSTOPERATIVE("POSTOPERATIVE"),
|
||||
;
|
||||
|
||||
final private String info;
|
||||
|
||||
RouteNodeNameEnum(String info) {
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.xinelu.mobile.controller.homepage;
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.mobile.service.homepage.HomePageService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 机构信息Controller
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-04-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/postDischarge/homePage")
|
||||
public class HomePageController {
|
||||
|
||||
@Resource
|
||||
private HomePageService homePageService;
|
||||
|
||||
@GetMapping("/myFollowUp")
|
||||
public AjaxResult myFollowUp(Long residentId) {
|
||||
return homePageService.myFollowUp(residentId);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.xinelu.mobile.mapper.homepage;
|
||||
|
||||
import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 院后小程序首页Mapper层
|
||||
* @Author zh
|
||||
* @Date 2024-04-18
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface HomePageMapper {
|
||||
|
||||
List<MyFollowUpVO> selectManageRouteNode(@Param("residentId") Long residentId, @Param("routeNodeName") String routeNodeName);
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
package com.xinelu.mobile.service.homepage;
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
|
||||
public interface HomePageService {
|
||||
|
||||
AjaxResult myFollowUp(Long residentId);
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.xinelu.mobile.service.homepage.Impl;
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.enums.RouteNodeNameEnum;
|
||||
import com.xinelu.mobile.mapper.homepage.HomePageMapper;
|
||||
import com.xinelu.mobile.service.homepage.HomePageService;
|
||||
import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class HomePageServiceImpl implements HomePageService {
|
||||
|
||||
@Resource
|
||||
private HomePageMapper homePageMapper;
|
||||
|
||||
@Override
|
||||
public AjaxResult myFollowUp(Long residentId) {
|
||||
List<MyFollowUpVO> myFollowUpList = homePageMapper.selectManageRouteNode(residentId, RouteNodeNameEnum.AFTER_ADMISSION.getInfo());
|
||||
for (MyFollowUpVO myFollowUpVO : myFollowUpList) {
|
||||
if (Objects.nonNull(myFollowUpVO) && Objects.nonNull(myFollowUpVO.getDischargeTime())) {
|
||||
myFollowUpVO.setFollowDate(myFollowUpVO.getDischargeTime().plusDays(myFollowUpVO.getRouteNodeDay()));
|
||||
}
|
||||
myFollowUpVO.setRouteNodeName((myFollowUpVO.getRouteNodeName() == null ? "出院后" : myFollowUpVO.getRouteNodeName()) + myFollowUpVO.getRouteNodeDay());
|
||||
}
|
||||
return AjaxResult.success(myFollowUpList);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package com.xinelu.mobile.vo.myfollowup;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 我的随访对象vo
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-04-18
|
||||
*/
|
||||
@Data
|
||||
public class MyFollowUpVO {
|
||||
|
||||
/**
|
||||
* 随访时间
|
||||
*/
|
||||
private LocalDate followDate;
|
||||
|
||||
/**
|
||||
* 管理路径节点名称
|
||||
*/
|
||||
private String routeNodeName;
|
||||
|
||||
/**
|
||||
* 随访方式
|
||||
*/
|
||||
private String taskType;
|
||||
|
||||
/**
|
||||
* 管理路径节点时间
|
||||
*/
|
||||
private Integer routeNodeDay;
|
||||
|
||||
/**
|
||||
* 出院时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate dischargeTime;
|
||||
|
||||
/**
|
||||
* 是否随访标记 0:否 1:是
|
||||
*/
|
||||
private Integer sign;
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xinelu.mobile.mapper.homepage.HomePageMapper">
|
||||
|
||||
<select id="selectManageRouteNode" resultType="com.xinelu.mobile.vo.myfollowup.MyFollowUpVO">
|
||||
select spmrn.task_type,
|
||||
spmrn.route_node_name,
|
||||
IFNULL( spmrn.route_node_day,0) routeNodeDay,
|
||||
pi.discharge_time,
|
||||
IF(pter.id==NULL,0,1) sign
|
||||
FROM patient_info pi
|
||||
LEFT JOIN sign_patient_manage_route spmr ON spmr.patient_id = pi.id
|
||||
LEFT JOIN sign_patient_manage_route_node spmrn ON spmrn.manage_route_id = spmr.id
|
||||
LEFT JOIN patient_task_execute_record pter ON pter.manage_route_node_id = spmrn.id
|
||||
<where>
|
||||
<if test="residentId != null ">
|
||||
and resident_id = #{residentId}
|
||||
</if>
|
||||
<if test="routeNodeName != null and routeNodeName != ''">
|
||||
and route_node_name = #{routeNodeName}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user