修改生成任务时患者信息获取。

This commit is contained in:
haown 2024-06-12 08:51:12 +08:00
parent 2ff9acbd2f
commit 67d43d4e19
8 changed files with 466 additions and 26 deletions

View File

@ -0,0 +1,241 @@
package com.xinelu.manage.domain.patientinfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 患者全部信息视图对象 patient_all_info_view
*
* @author xinelu
* @date 2024-06-11
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "患者全部信息视图对象", description = "patient_all_info_view")
public class PatientAllInfoView {
private static final long serialVersionUID=1L;
/** 患者主键 */
@ApiModelProperty(value = "患者主键")
@Excel(name = "患者主键")
private Long patientId;
/** 患者姓名 */
@ApiModelProperty(value = "患者姓名")
@Excel(name = "患者姓名")
private String patientName;
/** 患者电话 */
@ApiModelProperty(value = "患者电话")
@Excel(name = "患者电话")
private String patientPhone;
/** 家属电话 */
@ApiModelProperty(value = "家属电话")
@Excel(name = "家属电话")
private String familyMemberPhone;
/** 出生日期格式yyyy-MM-dd */
@ApiModelProperty(value = "出生日期格式yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "出生日期格式yyyy-MM-dd", width = 30, dateFormat = "yyyy-MM-dd")
private LocalDate birthDate;
/** 身份证号 */
@ApiModelProperty(value = "身份证号")
@Excel(name = "身份证号")
private String cardNo;
/** 性别MALEFEMALE */
@ApiModelProperty(value = "性别MALEFEMALE")
@Excel(name = "性别MALEFEMALE")
private String sex;
/** 住址 */
@ApiModelProperty(value = "住址")
@Excel(name = "住址")
private String address;
/** 患者类型预住院患者PRE_HOSPITALIZED_PATIENT在院患者IN_HOSPITAL_PATIENT门诊患者OUTPATIENT出院患者DISCHARGED_PATIENT签约患者CONTRACTED_PATIENT */
@ApiModelProperty(value = "患者类型预住院患者PRE_HOSPITALIZED_PATIENT在院患者IN_HOSPITAL_PATIENT门诊患者OUTPATIENT出院患者DISCHARGED_PATIENT签约患者CONTRACTED_PATIENT")
@Excel(name = "患者类型预住院患者PRE_HOSPITALIZED_PATIENT在院患者IN_HOSPITAL_PATIENT门诊患者OUTPATIENT出院患者DISCHARGED_PATIENT签约患者CONTRACTED_PATIENT")
private String patientType;
/** 就诊记录id */
@ApiModelProperty(value = "就诊记录id")
@Excel(name = "就诊记录id")
private Long patientVisitRecordId;
/** 就诊类型门诊OUTPATIENT_SERVICE住院BE_HOSPITALIZED */
@ApiModelProperty(value = "就诊类型门诊OUTPATIENT_SERVICE住院BE_HOSPITALIZED")
@Excel(name = "就诊类型门诊OUTPATIENT_SERVICE住院BE_HOSPITALIZED")
private String visitMethod;
/** 就诊时间格式yyyy-MM-dd HH:mm:ss */
@ApiModelProperty(value = "就诊时间格式yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
@Excel(name = "就诊时间格式yyyy-MM-dd HH:mm:ss", width = 30, dateFormat = "yyyy-MM-dd")
private LocalDateTime visitDate;
/** 所属医院名称 */
@ApiModelProperty(value = "所属医院名称")
@Excel(name = "所属医院名称")
private String hospitalAgencyName;
/** 所属院区名称 */
@ApiModelProperty(value = "所属院区名称")
@Excel(name = "所属院区名称")
private String campusAgencyName;
/** 所属科室名称 */
@ApiModelProperty(value = "所属科室名称")
@Excel(name = "所属科室名称")
private String departmentName;
/** 所属病区名称 */
@ApiModelProperty(value = "所属病区名称")
@Excel(name = "所属病区名称")
private String wardName;
/** 主治医生姓名 */
@ApiModelProperty(value = "主治医生姓名")
@Excel(name = "主治医生姓名")
private String attendingPhysicianName;
/** 主要诊断 */
@ApiModelProperty(value = "主要诊断")
private String mainDiagnosis;
/** 入院时间 */
@ApiModelProperty(value = "入院时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime admissionTime;
/** 出院时间 */
@ApiModelProperty(value = "出院时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime dischargeTime;
/** 住院天数(出院记录),单位为:天 */
@ApiModelProperty(value = "住院天数")
@Excel(name = "住院天数", readConverterExp = "出=院记录")
private Integer hospitalizationDays;
/** 入院病历信息,存储患者入院的整个病历信息 */
@ApiModelProperty(value = "入院病历信息,存储患者入院的整个病历信息")
@Excel(name = "入院病历信息,存储患者入院的整个病历信息")
private String inHospitalInfo;
/** 出院病历信息,存储患者出院的整个病历信息 */
@ApiModelProperty(value = "出院病历信息,存储患者出院的整个病历信息")
@Excel(name = "出院病历信息,存储患者出院的整个病历信息")
private String outHospitalInfo;
/** 就诊流水号 */
@ApiModelProperty(value = "就诊流水号")
@Excel(name = "就诊流水号")
private String visitSerialNumber;
/** 门诊/住院号 */
@ApiModelProperty(value = "门诊/住院号")
@Excel(name = "门诊/住院号")
private String inHospitalNumber;
/** 责任护士 */
@ApiModelProperty(value = "责任护士")
@Excel(name = "责任护士")
private String responsibleNurse;
/** 手术名称 */
@ApiModelProperty(value = "手术名称")
@Excel(name = "手术名称")
private String surgicalName;
/** 手术记录 */
@ApiModelProperty(value = "手术记录")
@Excel(name = "手术记录")
private String surgicalRecord;
/** 签约记录表id */
@ApiModelProperty(value = "签约记录表id")
@Excel(name = "签约记录表id")
private Long signPatientRecordId;
/** 缴费状态已缴费PAID未交费UNPAID_FEES */
@ApiModelProperty(value = "缴费状态已缴费PAID未交费UNPAID_FEES")
@Excel(name = "缴费状态已缴费PAID未交费UNPAID_FEES")
private String paymentStatus;
/** 所属健康管理师名称(用户表名称) */
@ApiModelProperty(value = "所属健康管理师名称")
@Excel(name = "所属健康管理师名称", readConverterExp = "用=户表名称")
private String healthManageName;
/** 服务状态意向签约INTENTIONAL_SIGNING服务中SERVICE_CENTER服务结束SERVICE_END */
@ApiModelProperty(value = "服务状态意向签约INTENTIONAL_SIGNING服务中SERVICE_CENTER服务结束SERVICE_END")
@Excel(name = "服务状态意向签约INTENTIONAL_SIGNING服务中SERVICE_CENTER服务结束SERVICE_END")
private String serviceStatus;
/** 签约状态在签IN_SIGN忽略IGNORE_SIGN解约SEPARATE_SIGN续约CONTINUOUS_SIGN */
@ApiModelProperty(value = "签约状态在签IN_SIGN忽略IGNORE_SIGN解约SEPARATE_SIGN续约CONTINUOUS_SIGN")
@Excel(name = "签约状态在签IN_SIGN忽略IGNORE_SIGN解约SEPARATE_SIGN续约CONTINUOUS_SIGN")
private String signStatus;
/** 开单医生姓名(意向签约) */
@ApiModelProperty(value = "开单医生姓名")
@Excel(name = "开单医生姓名", readConverterExp = "意=向签约")
private String billingDoctorName;
/** 签约时间格式yyyy-MM-dd HH:mm:ss */
@ApiModelProperty(value = "签约时间格式yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime signTime;
/** 服务包名称 */
@ApiModelProperty(value = "服务包名称")
@Excel(name = "服务包名称")
private String packageName;
/** 服务包缴费状态已缴费PAID未交费UNPAID_FEES */
@ApiModelProperty(value = "服务包缴费状态已缴费PAID未交费UNPAID_FEES")
@Excel(name = "服务包缴费状态已缴费PAID未交费UNPAID_FEES")
private String packagePaymentStatus;
/** 服务包价格,小数点后两位 */
@ApiModelProperty(value = "服务包价格,小数点后两位")
@Excel(name = "服务包价格,小数点后两位")
private BigDecimal packagePrice;
/** 服务开始时间格式yyyy-MM-dd HH:mm:ss */
@ApiModelProperty(value = "服务开始时间格式yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "服务开始时间格式yyyy-MM-dd HH:mm:ss", width = 30, dateFormat = "yyyy-MM-dd")
private LocalDateTime serviceStartTime;
/** 服务结束时间格式yyyy-MM-dd HH:mm:ss */
@ApiModelProperty(value = "服务结束时间格式yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "服务结束时间格式yyyy-MM-dd HH:mm:ss", width = 30, dateFormat = "yyyy-MM-dd")
private LocalDateTime serviceEndTime;
/** 服务包期限 */
@ApiModelProperty(value = "服务包期限")
@Excel(name = "服务包期限")
private Integer packageTerm;
/** 服务包期限单位,年,月,日 */
@ApiModelProperty(value = "服务包期限单位,年,月,日")
@Excel(name = "服务包期限单位,年,月,日")
private String packageTermUnit;
}

View File

@ -0,0 +1,30 @@
package com.xinelu.manage.mapper.patientinfo;
import com.xinelu.manage.domain.patientinfo.PatientAllInfoView;
import java.util.List;
/**
* 患者全部信息视图Mapper接口
*
* @author xinelu
* @date 2024-06-11
*/
public interface PatientAllInfoViewMapper {
/**
* 查询患者全部信息视图对象
*
* @param patientId 患者主键
* @return 患者全部信息视图对象
*/
PatientAllInfoView selectPatientAllInfoViewByPatientId(Long patientId);
/**
* 查询患者全部信息视图对象列表
*
* @param patientAllInfoView 患者全部信息视图对象
* @return 患者全部信息视图对象集合
*/
List<PatientAllInfoView> selectPatientAllInfoViewList(PatientAllInfoView patientAllInfoView);
}

View File

@ -0,0 +1,30 @@
package com.xinelu.manage.service.patientinfo;
import com.xinelu.manage.domain.patientinfo.PatientAllInfoView;
import java.util.List;
/**
* 患者全部信息视图Service接口
*
* @author xinelu
* @date 2024-06-11
*/
public interface IPatientAllInfoViewService {
/**
* 查询患者全部信息视图对象
*
* @param patientId 患者主键
* @return 患者全部信息视图对象
*/
PatientAllInfoView selectPatientAllInfoViewByPatientId(Long patientId);
/**
* 查询患者全部信息视图对象列表
*
* @param patientAllInfoView 患者全部信息视图对象
* @return 患者全部信息视图对象集合
*/
List<PatientAllInfoView> selectPatientAllInfoViewList(PatientAllInfoView patientAllInfoView);
}

View File

@ -0,0 +1,43 @@
package com.xinelu.manage.service.patientinfo.impl;
import com.xinelu.manage.domain.patientinfo.PatientAllInfoView;
import com.xinelu.manage.mapper.patientinfo.PatientAllInfoViewMapper;
import com.xinelu.manage.service.patientinfo.IPatientAllInfoViewService;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
/**
* 患者全部信息视图Service业务层处理
*
* @author xinelu
* @date 2024-06-11
*/
@Service
public class PatientAllInfoViewServiceImpl implements IPatientAllInfoViewService {
@Resource
private PatientAllInfoViewMapper patientAllInfoViewMapper;
/**
* 查询患者全部信息视图对象
*
* @param patientId 患者主键
* @return 患者全部信息视图对象
*/
@Override
public PatientAllInfoView selectPatientAllInfoViewByPatientId(Long patientId) {
return patientAllInfoViewMapper.selectPatientAllInfoViewByPatientId(patientId);
}
/**
* 查询患者全部信息视图对象列表
*
* @param patientAllInfoView 患者全部信息视图对象
* @return 患者全部信息视图对象
*/
@Override
public List<PatientAllInfoView> selectPatientAllInfoViewList(PatientAllInfoView patientAllInfoView) {
return patientAllInfoViewMapper.selectPatientAllInfoViewList(patientAllInfoView);
}
}

View File

@ -217,7 +217,7 @@ public class PropagandaInfoServiceImpl implements IPropagandaInfoService {
}
@Override
@DataScope(agencyAlias = "d")
@DataScope(agencyAlias = "d", deptAlias = "p")
public List<DepartmentVO> selectNumByDept(PropagandaInfoDto propagandaInfoDto) {
return propagandaInfoMapper.selectNumByDept(propagandaInfoDto);
}

View File

@ -9,7 +9,7 @@ import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.BaseUtil;
import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.manage.domain.patientinfo.PatientInfo;
import com.xinelu.manage.domain.patientinfo.PatientAllInfoView;
import com.xinelu.manage.domain.patientnodeparamscurrent.PatientNodeParamsCurrent;
import com.xinelu.manage.domain.specialdiseasenode.SpecialDiseaseNode;
import com.xinelu.manage.domain.specialdiseaseroute.SpecialDiseaseRoute;
@ -17,11 +17,22 @@ import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
import com.xinelu.manage.mapper.patientnodeparamslcurrent.PatientNodeParamsCurrentMapper;
import com.xinelu.manage.mapper.specialdiseasenode.SpecialDiseaseNodeMapper;
import com.xinelu.manage.mapper.specialdiseaseroute.SpecialDiseaseRouteMapper;
import com.xinelu.manage.service.patientinfo.IPatientAllInfoViewService;
import com.xinelu.manage.service.specialdiseasenode.ISpecialDiseaseNodeService;
import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeVO;
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.TreeSet;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
@ -30,12 +41,6 @@ import org.jsoup.select.Elements;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
/**
* 专病路径-管理节点信息Service业务层处理
*
@ -53,6 +58,8 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService
private PatientNodeParamsCurrentMapper patientNodeParamsCurrentMapper;
@Resource
private PatientInfoMapper patientInfoMapper;
@Resource
private IPatientAllInfoViewService patientAllInfoViewService;
/**
@ -230,7 +237,7 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService
List<PatientNodeParamsCurrent> diseaseNodeParams = new ArrayList<>();
SpecialDiseaseNode specialDiseaseNode = specialDiseaseNodeMapper.selectSpecialDiseaseNodeById(id);
if (StringUtils.isNotBlank(specialDiseaseNode.getNodeContent()) && specialDiseaseNode.getNodeContent().contains("data-fieldMark")) {
JSONObject paramValues = getParamsValue(specialDiseaseNode.getTaskSubdivision(), patientId);
JSONObject paramValues = getParamsValue(patientId);
Document document = Jsoup.parse(specialDiseaseNode.getNodeContent());
// 需要提取的span
Elements spanlist = document.select("span[data-w-e-type]");
@ -264,27 +271,19 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService
/**
* 根据任务细分类型获取患者的真实信息
*
* @param taskSubdivision 任务细分类型code
* @param patientId 患者主键
* @return 实际信息
*/
private JSONObject getParamsValue(String taskSubdivision, Long patientId) {
private JSONObject getParamsValue(Long patientId) {
JSONObject retObj = new JSONObject();
PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(patientId);
switch (taskSubdivision) {
// 健康档案
case "HEALTH_ARCHIVE":
retObj = JSONObject.parseObject(JSONObject.toJSONString(patientInfo));
// 性别转换成中文计算年龄
retObj.fluentPut("sex", PatientSexEnum.getInfoByCode(patientInfo.getSex()).getInfo()).fluentPut("age", BaseUtil.getAge(patientInfo.getBirthDate()));
break;
default:
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
retObj.fluentPut("patientName", patientInfo.getPatientName())
.fluentPut("dischargeTime", patientInfo.getDischargeTime() == null ? "" : patientInfo.getDischargeTime().format(df))
.fluentPut("visitDate", patientInfo.getVisitDate().format(df));
break;
}
PatientAllInfoView patientAllInfoView = patientAllInfoViewService.selectPatientAllInfoViewByPatientId(patientId);
if (ObjectUtils.isEmpty(patientAllInfoView)) {
throw new ServiceException("患者信息获取错误,请联系管理员!");
}
retObj = JSONObject.parseObject(JSONObject.toJSONString(patientAllInfoView));
// 性别转换成中文计算年龄
retObj.fluentPut("sex", PatientSexEnum.getInfoByCode(patientAllInfoView.getSex()).getInfo())
.fluentPut("age", BaseUtil.getAge(patientAllInfoView.getBirthDate()));
return retObj;
}
}

View File

@ -0,0 +1,76 @@
<?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.manage.mapper.patientinfo.PatientAllInfoViewMapper">
<resultMap type="PatientAllInfoView" id="PatientAllInfoViewResult">
<result property="patientId" column="patient_id"/>
<result property="patientName" column="patient_name"/>
<result property="patientPhone" column="patient_phone"/>
<result property="familyMemberPhone" column="family_member_phone"/>
<result property="birthDate" column="birth_date"/>
<result property="cardNo" column="card_no"/>
<result property="sex" column="sex"/>
<result property="address" column="address"/>
<result property="patientType" column="patient_type"/>
<result property="patientVisitRecordId" column="patient_visit_record_id"/>
<result property="visitMethod" column="visit_method"/>
<result property="visitDate" column="visit_date"/>
<result property="hospitalAgencyName" column="hospital_agency_name"/>
<result property="campusAgencyName" column="campus_agency_name"/>
<result property="departmentName" column="department_name"/>
<result property="wardName" column="ward_name"/>
<result property="attendingPhysicianName" column="attending_physician_name"/>
<result property="mainDiagnosis" column="main_diagnosis"/>
<result property="admissionTime" column="admission_time"/>
<result property="dischargeTime" column="discharge_time"/>
<result property="hospitalizationDays" column="hospitalization_days"/>
<result property="inHospitalInfo" column="in_hospital_info"/>
<result property="outHospitalInfo" column="out_hospital_info"/>
<result property="visitSerialNumber" column="visit_serial_number"/>
<result property="inHospitalNumber" column="in_hospital_number"/>
<result property="responsibleNurse" column="responsible_nurse"/>
<result property="surgicalName" column="surgical_name"/>
<result property="surgicalRecord" column="surgical_record"/>
<result property="signPatientRecordId" column="sign_patient_record_id"/>
<result property="paymentStatus" column="payment_status"/>
<result property="healthManageName" column="health_manage_name"/>
<result property="serviceStatus" column="service_status"/>
<result property="signStatus" column="sign_status"/>
<result property="billingDoctorName" column="billing_doctor_name"/>
<result property="signTime" column="sign_time"/>
<result property="packageName" column="package_name"/>
<result property="packagePaymentStatus" column="package_payment_status"/>
<result property="packagePrice" column="package_price"/>
<result property="serviceStartTime" column="service_start_time"/>
<result property="serviceEndTime" column="service_end_time"/>
<result property="packageTerm" column="package_term"/>
<result property="packageTermUnit" column="package_term_unit"/>
</resultMap>
<sql id="selectPatientAllInfoViewVo">
select patient_id, patient_name, patient_phone, family_member_phone, birth_date, card_no, sex, address, patient_type, patient_visit_record_id, visit_method, visit_date, hospital_agency_name, campus_agency_name, department_name, ward_name, attending_physician_name, main_diagnosis, admission_time, discharge_time, hospitalization_days, in_hospital_info, out_hospital_info, visit_serial_number, in_hospital_number, responsible_nurse, surgical_name, surgical_record, sign_patient_record_id, payment_status, health_manage_name, service_status, sign_status, billing_doctor_name, sign_time, package_name, package_payment_status, package_price, service_start_time, service_end_time, package_term, package_term_unit from patient_all_info_view
</sql>
<select id="selectPatientAllInfoViewList" parameterType="PatientAllInfoView" resultMap="PatientAllInfoViewResult">
<include refid="selectPatientAllInfoViewVo" />
<where>
<if test="patientId != null ">
and patient_id = #{patientId}
</if>
<if test="patientVisitRecordId != null ">
and patient_visit_record_id = #{patientVisitRecordId}
</if>
<if test="signPatientRecordId != null ">
and sign_patient_record_id = #{signPatientRecordId}
</if>
</where>
</select>
<select id="selectPatientAllInfoViewByPatientId" parameterType="Long" resultMap="PatientAllInfoViewResult">
<include refid="selectPatientAllInfoViewVo" />
where patient_id = #{patientId}
</select>
</mapper>

View File

@ -258,12 +258,33 @@
<if test="propagandaStatus != null and propagandaStatus != ''">
and propaganda_status = #{propagandaStatus}
</if>
<if test="hospitalAgencyId != null ">
and hospital_agency_id = #{hospitalAgencyId}
</if>
<if test="departmentId != null ">
and department_id = #{departmentId}
</if>
<if test="propagandaType != null and propagandaType != ''">
and propaganda_type = #{propagandaType}
</if>
<if test="propagandaStatus != null and propagandaStatus != ''">
and propaganda_status = #{propagandaStatus}
</if>
<if test="createTimeStart != null">
and date_format(create_time, '%y%m%d') >= date_format(#{createTimeStart}, '%y%m%d')
</if>
<if test="createTimeEnd != null">
and date_format(create_time, '%y%m%d') &lt;= date_format(#{createTimeEnd}, '%y%m%d')
</if>
</where>
) as p on d.id = p.department_id
<where>
<if test="departmentName != null and departmentName != ''">
and d.department_name like concat('%', #{departmentName}, '%')
</if>
<if test="hospitalAgencyId != null ">
and d.hospital_agency_id = #{hospitalAgencyId}
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>