From f9d2a978bf5bf5da8bc2a9c56736983badb634b6 Mon Sep 17 00:00:00 2001 From: zhangheng <3226558941@qq.com> Date: Thu, 28 Nov 2024 13:52:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=82=A3=E8=80=85=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/满意度调查系统资料.xlsx | Bin 0 -> 9403 bytes .../patientinfo/PatientInfoController.java | 42 ++- .../domain/patientinfo/PatientInfo.java | 8 + .../patientinfoimport/PatientInfoImport.java | 155 ++++++++++ .../mapper/department/DepartmentMapper.java | 8 + .../mapper/patientinfo/PatientInfoMapper.java | 17 ++ .../PatientInfoImportMapper.java | 77 +++++ .../residentinfo/ResidentInfoMapper.java | 9 + .../patientinfo/IPatientInfoService.java | 20 ++ .../impl/PatientInfoServiceImpl.java | 251 +++++++++++++++- .../vo/patientinfo/PatientBaseInfoVo.java | 3 + .../manage/vo/patientinfo/PatientInfoVo.java | 3 + .../vo/patientinfoimport/DeptAliasVO.java | 57 ++++ .../PatientInfoImportVO.java | 35 +++ .../manage/department/DepartmentMapper.xml | 20 +- .../manage/patientinfo/PatientInfoMapper.xml | 62 +++- .../PatientInfoImportMapper.xml | 267 ++++++++++++++++++ .../residentinfo/ResidentInfoMapper.xml | 23 +- 18 files changed, 1029 insertions(+), 28 deletions(-) create mode 100644 postdischarge-admin/src/main/resources/template/满意度调查系统资料.xlsx create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientinfoimport/PatientInfoImport.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientinfoimport/PatientInfoImportMapper.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientinfoimport/DeptAliasVO.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientinfoimport/PatientInfoImportVO.java create mode 100644 postdischarge-manage/src/main/resources/mapper/manage/patientinfoimport/PatientInfoImportMapper.xml diff --git a/postdischarge-admin/src/main/resources/template/满意度调查系统资料.xlsx b/postdischarge-admin/src/main/resources/template/满意度调查系统资料.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..082a2af38ec6b15a5a1d54b379c43405a4d06504 GIT binary patch literal 9403 zcmaJ{1z40z+eT8lyGvNQJEfP9PC*)!Sem7C>F$v34h011?vU;h5CQ2_;RikEJLmA7 z|C{ULU9Q{N87{qr(IuBSrNK;t`X9W<}OT_7u4k{;i1ye*I! zXgpJn3b&-pNP_R0`=rUMk+Dsd0rv3LZe6OtkA4f+;$1daSf{hcJW+v?b7ji}^CpVI zla9nnp@W=`diMx@%@+HEak0JC+v$;?H(y<@o3!;sf9957pq+Xv7`_sH-VE~ydvm5i z<$LT+?y<-GJN70Z2eSw8BjZ|>y4Y|at~4u@Cz*UoS9Njf&{Ls6*?b1$cl(PoRQ6Ph zF&Fv-sRUp~FxuOE)DlC(_hXG&V~q|R^9hhk=!Je@K?p46iP$kvwhlNUly!sO&zS`1 z2m^|T)fEJk z{}EaNC1V5*lCM@^8?r+_+w%)?k?lY*{aGH4M!^>Z4OE^n#KQQoS(hz;x+7K;@wVXo z;)3%+59vF&!=8>7b_X^dMQkp6{H`s!D=iIo1#jd#6cK!#Hjt4rakRK;BQ3^7M*-p@IjQ2z?Pk zp0Q1t!=7VwH7DZ9wko~PI=Fm#N13^^P8&I9DJk78OtI%c?j62Q{7?Ar#DSKK_wZxh z!;k$B_?;b{KsFBnD2Ua!3Sh$tIz;%6PI;MzZdE45{066&g=cPNk&?aMU#`2`)@;9x zwP3H8#pRto+2~N$X=c2&!4?#nF-MCgfJP)pjJ|Tw;6U~2Oxpt!wwI^W2EIZPDY~;= z(Zwrq>4iH^`~l<%T8;wJ<`gO zOtOj2Wy9!OedVy~clOi&gGjmb@{->bcwn3Cl~yqjj~+q8rR}F;I0fl&Z+K|Zt2@q& zRJ6MIod!ORQKlh@OodPzmyiyuECeHml(<)-Ex~lgpZ%Xbi3E2Re$LqX>~?W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_rcrH#L<{a0FhZ0B(`@h>|C_Z0KL)fOLHcw8Cz%K|ahZwvpall(8R{yBH^ zr@vJHG$=Kd|t>+e3u2en util = new ExcelUtil<>(PatientInfoImport.class); + List list = util.importExcel(file.getInputStream()); + return patientInfoService.patientUpload(list); + } + + @ApiOperation("未识别科室名称导入") + @PostMapping("/secondaryUpload") + public AjaxResult secondaryUpload(PatientInfoImportVO patientInfoImportVO) { + return patientInfoService.secondaryUpload(patientInfoImportVO); + } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientinfo/PatientInfo.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientinfo/PatientInfo.java index a9e16a97..fed5c1e6 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientinfo/PatientInfo.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientinfo/PatientInfo.java @@ -344,4 +344,12 @@ public class PatientInfo extends BaseEntity { /** 删除标识,0:未删除,1:已删除 */ private Integer delFlag; + @ApiModelProperty(value = "导入流水号") + private String sn; + + @ApiModelProperty(value = "年龄") + private Integer age; + + @ApiModelProperty(value = "导入患者表id") + private Integer patientInfoImportId; } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientinfoimport/PatientInfoImport.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientinfoimport/PatientInfoImport.java new file mode 100644 index 00000000..2c03579a --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientinfoimport/PatientInfoImport.java @@ -0,0 +1,155 @@ +package com.xinelu.manage.domain.patientinfoimport; + +import com.xinelu.common.annotation.Excel; +import com.xinelu.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.time.LocalDateTime; +import java.util.Objects; + +/** + * 患者导入表对象 patient_info_import + * + * @author xinelu + * @date 2024-11-26 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@ApiModel(value = "患者导入表对象", description = "patient_info_import") +public class PatientInfoImport extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + private Long id; + + /** + * 序号 + */ + @ApiModelProperty(value = "序号") + @Excel(name = "序号") + private Long orderNum; + + /** + * 科室名称(别名) + */ + @ApiModelProperty(value = "科室名称") + @Excel(name = "科室名称") + private String deptAlias; + + /** + * 就诊时间(门诊患者),时间格式:yyyy-MM-dd + */ + @ApiModelProperty(value = "就诊时间") + @Excel(name = "就诊时间") + private LocalDateTime visitDate; + + /** + * 门诊/住院号 + */ + @ApiModelProperty(value = "门诊/住院号") + @Excel(name = "就诊号") + private String inHospitalNumber; + + /** + * 患者姓名 + */ + @ApiModelProperty(value = "患者姓名") + @Excel(name = "患者姓名") + private String patientName; + + /** + * 身份证号 + */ + @ApiModelProperty(value = "身份证号") + @Excel(name = "身份证号") + private String cardNo; + + /** + * 年龄 + */ + @ApiModelProperty(value = "年龄") + @Excel(name = "年龄") + private Integer age; + + /** + * 主要诊断 + */ + @ApiModelProperty(value = "主要诊断") + @Excel(name = "诊断名称") + private String mainDiagnosis; + + /** + * 患者电话 + */ + @ApiModelProperty(value = "患者电话") + @Excel(name = "手机号号码") + private String patientPhone; + + /** + * 匹配的科室ID + */ + @ApiModelProperty(value = "匹配的科室ID") + @Excel(name = "匹配的科室ID") + private Long departmentId; + + /** + * 匹配的科室名称 + */ + @ApiModelProperty(value = "匹配的科室名称") + @Excel(name = "科室名称") + private String departmentName; + + /** + * 流水号 + */ + @ApiModelProperty(value = "流水号") + @Excel(name = "流水号") + private String sn; + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatientInfoImport that = (PatientInfoImport) o; + return Objects.equals(patientName, that.patientName) && Objects.equals(patientPhone, that.patientPhone); + } + + @Override + public int hashCode() { + return Objects.hash(patientName, patientPhone); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("orderNum", getOrderNum()) + .append("deptAlias", getDeptAlias()) + .append("visitDate", getVisitDate()) + .append("inHospitalNumber", getInHospitalNumber()) + .append("patientName", getPatientName()) + .append("cardNo", getCardNo()) + .append("age", getAge()) + .append("mainDiagnosis", getMainDiagnosis()) + .append("patientPhone", getPatientPhone()) + .append("departmentId", getDepartmentId()) + .append("departmentName", getDepartmentName()) + .append("sn", getSn()) + .append("createTime", getCreateTime()) + .append("createBy", getCreateBy()) + .toString(); + } +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/department/DepartmentMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/department/DepartmentMapper.java index 92a0e381..bc08a92b 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/department/DepartmentMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/department/DepartmentMapper.java @@ -153,4 +153,12 @@ public interface DepartmentMapper { * @return int */ List selectDepartmentNameCount(Department department); + + /** + * 批量修改科室别名 + * + * @param departmentList + * @return int + */ + int updateDepartmentListByIds(List departmentList); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientinfo/PatientInfoMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientinfo/PatientInfoMapper.java index 3dcb0fc5..9aa82744 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientinfo/PatientInfoMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientinfo/PatientInfoMapper.java @@ -1,6 +1,7 @@ package com.xinelu.manage.mapper.patientinfo; import com.xinelu.manage.domain.patientinfo.PatientInfo; +import com.xinelu.manage.domain.patientinfoimport.PatientInfoImport; import com.xinelu.manage.domain.residentinfo.ResidentInfo; import com.xinelu.manage.dto.patientinfo.PatientInfoDto; import com.xinelu.manage.vo.patientinfo.PatientBaseInfoVo; @@ -139,4 +140,20 @@ public interface PatientInfoMapper { * @return int */ int selectPatientSignServiceCount(); + + /** + * 批量查询患者信息 + * + * @param list 集合 + * @return PatientInfo + */ + List selectPatientInfoByPatientName(@Param("list") List list); + + /** + * 新增患者信息 + * + * @param patientInfo 患者信息 + * @return 结果 + */ + int insertPatientInfoList(List patientInfo); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientinfoimport/PatientInfoImportMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientinfoimport/PatientInfoImportMapper.java new file mode 100644 index 00000000..daf40426 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientinfoimport/PatientInfoImportMapper.java @@ -0,0 +1,77 @@ +package com.xinelu.manage.mapper.patientinfoimport; + +import com.xinelu.manage.domain.patientinfoimport.PatientInfoImport; + +import java.util.List; + +/** + * 导入患者暂存表Mapper接口 + * + * @author xinelu + * @date 2024-11-27 + */ +public interface PatientInfoImportMapper { + /** + * 查询导入患者暂存表 + * + * @param id 导入患者暂存表主键 + * @return 导入患者暂存表 + */ + PatientInfoImport selectPatientInfoImportById(Long id); + + /** + * 查询导入患者暂存表列表 + * + * @param patientInfoImport 导入患者暂存表 + * @return 导入患者暂存表集合 + */ + List selectPatientInfoImportList(PatientInfoImport patientInfoImport); + + /** + * 新增导入患者暂存表 + * + * @param patientInfoImport 导入患者暂存表 + * @return 结果 + */ + int insertPatientInfoImport(PatientInfoImport patientInfoImport); + + /** + * 修改导入患者暂存表 + * + * @param patientInfoImport 导入患者暂存表 + * @return 结果 + */ + int updatePatientInfoImport(PatientInfoImport patientInfoImport); + + /** + * 删除导入患者暂存表 + * + * @param id 导入患者暂存表主键 + * @return 结果 + */ + int deletePatientInfoImportById(Long id); + + /** + * 批量删除导入患者暂存表 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + int deletePatientInfoImportByIds(Long[] ids); + + /** + * 新增导入患者暂存表 + * + * @param patientInfoImport 导入患者暂存表 + * @return 结果 + */ + int insertPatientInfoImportList(List patientInfoImport); + + /** + * 根据序列号查询数据 + * + * @param sn 序列号 + * @return PatientInfoImport + */ + List selectPatientInfoImportBySn(String sn); +} \ No newline at end of file diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/residentinfo/ResidentInfoMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/residentinfo/ResidentInfoMapper.java index 70ed372c..97157ac2 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/residentinfo/ResidentInfoMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/residentinfo/ResidentInfoMapper.java @@ -1,5 +1,6 @@ package com.xinelu.manage.mapper.residentinfo; +import com.xinelu.manage.domain.patientinfoimport.PatientInfoImport; import com.xinelu.manage.domain.residentinfo.ResidentInfo; import org.apache.ibatis.annotations.Param; @@ -85,4 +86,12 @@ public interface ResidentInfoMapper { * @return 结果 */ int updateResidentInfoOpenid(ResidentInfo residentInfo); + + /** + * 批量新增居民信息 + * + * @param patientInfoImports 居民信息 + * @return 结果 + */ + int insertResidentInfoList(List patientInfoImports); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/IPatientInfoService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/IPatientInfoService.java index e55ecea2..0e108466 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/IPatientInfoService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/IPatientInfoService.java @@ -1,9 +1,13 @@ package com.xinelu.manage.service.patientinfo; +import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.manage.domain.patientinfo.PatientInfo; +import com.xinelu.manage.domain.patientinfoimport.PatientInfoImport; import com.xinelu.manage.dto.patientinfo.PatientBaseInfoDto; import com.xinelu.manage.dto.patientinfo.PatientInfoDto; import com.xinelu.manage.vo.patientinfo.PatientInfoVo; +import com.xinelu.manage.vo.patientinfoimport.PatientInfoImportVO; + import java.util.List; /** @@ -85,4 +89,20 @@ public interface IPatientInfoService { * @return 结果 */ int deletePatientInfoById(Long id); + + /** + * 患者导入 + * + * @param list 患者信息结合 + * @return AjaxResult + */ + AjaxResult patientUpload(List list); + + /** + * 未识别科室名称导入 + * + * @param patientInfoImportVO + * @return AjaxResult + */ + AjaxResult secondaryUpload(PatientInfoImportVO patientInfoImportVO); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/impl/PatientInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/impl/PatientInfoServiceImpl.java index d3c3391c..8cf9c0ab 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/impl/PatientInfoServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientinfo/impl/PatientInfoServiceImpl.java @@ -2,34 +2,50 @@ package com.xinelu.manage.service.patientinfo.impl; import com.xinelu.common.annotation.DataScope; import com.xinelu.common.constant.SignRecordServiceStatusConstants; +import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.common.core.domain.entity.SysUser; import com.xinelu.common.enums.PatientSourceEnum; import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.BaseUtil; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.StringUtils; import com.xinelu.common.utils.bean.BeanUtils; +import com.xinelu.common.utils.regex.RegexUtil; +import com.xinelu.manage.domain.department.Department; import com.xinelu.manage.domain.patientinfo.PatientInfo; +import com.xinelu.manage.domain.patientinfoimport.PatientInfoImport; import com.xinelu.manage.domain.patientvisitrecord.PatientVisitRecord; import com.xinelu.manage.domain.residentinfo.ResidentInfo; import com.xinelu.manage.domain.signpatientrecord.SignPatientRecord; import com.xinelu.manage.dto.patientinfo.PatientBaseInfoDto; import com.xinelu.manage.dto.patientinfo.PatientInfoDto; import com.xinelu.manage.dto.patientvisitrecord.PatientVisitRecordDto; +import com.xinelu.manage.mapper.department.DepartmentMapper; import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper; +import com.xinelu.manage.mapper.patientinfoimport.PatientInfoImportMapper; +import com.xinelu.manage.mapper.patientvisitrecord.PatientVisitRecordMapper; import com.xinelu.manage.mapper.residentinfo.ResidentInfoMapper; import com.xinelu.manage.mapper.signpatientrecord.SignPatientRecordMapper; import com.xinelu.manage.service.patientinfo.IPatientInfoService; import com.xinelu.manage.service.patientvisitrecord.IPatientVisitRecordService; import com.xinelu.manage.vo.patientinfo.PatientInfoVo; -import java.time.LocalDateTime; -import java.util.List; -import java.util.Objects; -import javax.annotation.Resource; +import com.xinelu.manage.vo.patientinfoimport.DeptAliasVO; +import com.xinelu.manage.vo.patientinfoimport.PatientInfoImportVO; +import com.xinelu.system.mapper.SysUserMapper; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.ObjectUtils; 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.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + /** * 患者信息Service业务层处理 * @@ -41,12 +57,22 @@ public class PatientInfoServiceImpl implements IPatientInfoService { @Resource private PatientInfoMapper patientInfoMapper; - @Resource - private ResidentInfoMapper residentInfoMapper; - @Resource - private IPatientVisitRecordService patientVisitRecordService; - @Resource - private SignPatientRecordMapper signPatientRecordMapper; + @Resource + private ResidentInfoMapper residentInfoMapper; + @Resource + private IPatientVisitRecordService patientVisitRecordService; + @Resource + private SignPatientRecordMapper signPatientRecordMapper; + @Resource + private SysUserMapper sysUserMapper; + @Resource + private DepartmentMapper departmentMapper; + @Resource + private PatientInfoImportMapper patientInfoImportMapper; + @Resource + private PatientVisitRecordMapper patientVisitRecordMapper; + @Resource + private RegexUtil regexUtil; /** * 查询患者信息 @@ -288,4 +314,209 @@ public class PatientInfoServiceImpl implements IPatientInfoService { public int deletePatientInfoById(Long id) { return patientInfoMapper.deletePatientInfoById(id); } + + @Transactional(rollbackFor = Exception.class) + @Override + public AjaxResult patientUpload(List list) { + if (CollectionUtils.isEmpty(list) || list.size() == 0) { + return AjaxResult.error("导入用户数据不能为空!"); + } + PatientInfoImport regexPhone = list.stream().filter(item -> StringUtils.isNotBlank(item.getPatientPhone())).filter(item -> BooleanUtils.isFalse(regexUtil.regexPhone(item.getPatientPhone()))).findFirst().orElse(new PatientInfoImport()); + if (StringUtils.isNotBlank(regexPhone.getPatientPhone())) { + return AjaxResult.error("手机号号码:" + regexPhone.getPatientPhone() + " 格式不正确,请重新录入!"); + } + PatientInfoImport regexCardNo = list.stream().filter(item -> StringUtils.isNotBlank(item.getCardNo())).filter(item -> BooleanUtils.isFalse(regexUtil.regexCardNo(item.getCardNo()))).findFirst().orElse(new PatientInfoImport()); + if (StringUtils.isNotBlank(regexCardNo.getCardNo())) { + return AjaxResult.error("身份证号:" + regexCardNo.getCardNo() + " 格式不正确,请重新录入!"); + } + //导入重复 + List distinctCollect = list.stream().filter(Objects::nonNull).distinct().collect(Collectors.toList()); + if (list.size() != distinctCollect.size()) { + List contains = list.stream().filter(item -> !distinctCollect.contains(item)).collect(Collectors.toList()); + return AjaxResult.error("导入数据重复", contains); + } + //与数据库重复 + List patientInfos = patientInfoMapper.selectPatientInfoByPatientName(list); + if (CollectionUtils.isEmpty(patientInfos)) { + return AjaxResult.error("有" + patientInfos.size() + "条记录当天已导入,是否继续导入"); + } + //sn + String sn = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")); + //登录用户科室信息 + SysUser sysUser = sysUserMapper.selectUserById(SecurityUtils.getUserId()); + Department department = new Department(); + if (Objects.isNull(sysUser.getHospitalAgencyId())) { + return AjaxResult.error("该账号无所属医院信息,请先添加该账号所属的医院信息!"); + } + department.setHospitalAgencyId(sysUser.getHospitalAgencyId()); + List departmentList = departmentMapper.selectDepartmentNameCount(department); + if (CollectionUtils.isEmpty(departmentList)) { + return AjaxResult.error("该账号所属医院无下级科室,请先维护所属医院的下级科室信息!"); + } + PatientInfoImportVO patientInfoImportVO = new PatientInfoImportVO(); + List deptAliasVOS = new ArrayList<>(); + //组装数据 + for (PatientInfoImport patientInfoImport : list) { + //判断是否有科室名称或别名一致 + Department equalsDepartment = departmentList.stream().filter(Objects::nonNull).filter(item -> patientInfoImport.getDeptAlias().equals(item.getDepartmentName()) || item.getDepartmentAbbreviation().contains(patientInfoImport.getDeptAlias())).findFirst().orElse(new Department()); + patientInfoImport.setSn(sn); + patientInfoImport.setCreateBy(SecurityUtils.getUsername()); + patientInfoImport.setCreateTime(LocalDateTime.now()); + //一致塞值,不一致取数据返回 + if (Objects.nonNull(equalsDepartment.getId())) { + patientInfoImport.setDepartmentId(equalsDepartment.getId()); + patientInfoImport.setDepartmentName(patientInfoImport.getDepartmentName()); + } else { + DeptAliasVO deptAliasVO = new DeptAliasVO(); + deptAliasVO.setSn(sn); + deptAliasVO.setDeptAlias(patientInfoImport.getDeptAlias()); + deptAliasVOS.add(deptAliasVO); + } + } + List patientInfoImports = new ArrayList<>(list); + patientInfoImportVO.setSn(sn); + patientInfoImportVO.setDepartments(departmentList); + if (CollectionUtils.isNotEmpty(deptAliasVOS)) { + deptAliasVOS = deptAliasVOS.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getDepartmentId())).distinct().collect(Collectors.toList()); + patientInfoImportVO.setDeptAliasVOS(deptAliasVOS); + } + //新增缓存表 + int insertCount = patientInfoImportMapper.insertPatientInfoImportList(list); + if (insertCount <= 0) { + return AjaxResult.error("导入失败,请联系管理员!"); + } + //科室名称全符合新增患者表,否则返回数据 + if (CollectionUtils.isNotEmpty(deptAliasVOS)) { + return AjaxResult.success("科室名称不存在", patientInfoImportVO); + } else { + int i = patientInfoMapper.insertPatientInfoList(list); + if (i <= 0) { + return AjaxResult.error("导入失败,请联系管理员!"); + } + List patientInfoIds = new ArrayList<>(list); + int residentCount = residentInfoMapper.insertResidentInfoList(list); + if (residentCount <= 0) { + return AjaxResult.error("导入失败,请联系管理员!"); + } + List residentIds = new ArrayList<>(list); + List patientVisitRecords = new ArrayList<>(); + for (PatientInfoImport patientInfoImport : patientInfoImports) { + PatientInfoImport patientInfoId = patientInfoIds.stream().filter(Objects::nonNull).filter(item -> patientInfoImport.getPatientName().equals(item.getPatientName()) && patientInfoImport.getPatientPhone().equals(item.getPatientPhone())).findFirst().orElse(new PatientInfoImport()); + PatientInfoImport residentId = residentIds.stream().filter(Objects::nonNull).filter(item -> patientInfoImport.getPatientName().equals(item.getPatientName()) && patientInfoImport.getPatientPhone().equals(item.getPatientPhone())).findFirst().orElse(new PatientInfoImport()); + PatientVisitRecord patientVisitRecord = new PatientVisitRecord(); + patientVisitRecord.setPatientId(patientInfoId.getId()); + patientVisitRecord.setResidentId(residentId.getId()); +// patientVisitRecord.setVisitDate(patientInfoImport.getVisitDate()); +// patientVisitRecord.setCardNo(patientInfoImport.getCardNo()); +// patientVisitRecord.setAge(patientInfoImport.getAge()); +// patientVisitRecord.setMainDiagnosis(patientInfoImport.getMainDiagnosis()); +// patientVisitRecord.setPatientPhone(patientInfoImport.getPatientPhone()); +// patientVisitRecord.setPatientName(patientInfoImport.getPatientName()); +// patientVisitRecord.setDepartmentId(patientInfoImport.getDepartmentId()); +// patientVisitRecord.setDepartmentName(patientInfoImport.getDepartmentName()); + BeanUtils.copyProperties(patientInfoImport, patientVisitRecord); + patientVisitRecord.setDelFlag(0); + patientVisitRecord.setHospitalAgencyId(departmentList.get(0).getHospitalAgencyId()); + patientVisitRecord.setHospitalAgencyName(departmentList.get(0).getHospitalAgencyName()); + patientVisitRecord.setCreateBy(SecurityUtils.getUsername()); + patientVisitRecord.setCreateTime(LocalDateTime.now()); + patientVisitRecords.add(patientVisitRecord); + } + int patientVisitRecordCount = patientVisitRecordMapper.insertBatch(patientVisitRecords); + if (patientVisitRecordCount <= 0) { + return AjaxResult.error("导入失败,请联系管理员!"); + } + } + return AjaxResult.success(); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public AjaxResult secondaryUpload(PatientInfoImportVO patientInfoImportVO) { + if (Objects.isNull(patientInfoImportVO) || CollectionUtils.isEmpty(patientInfoImportVO.getDeptAliasVOS()) || StringUtils.isEmpty(patientInfoImportVO.getSn())) { + return AjaxResult.success(); + } + //根据sn查询数据 + List patientInfoImports = patientInfoImportMapper.selectPatientInfoImportBySn(patientInfoImportVO.getSn()); + for (PatientInfoImport patientInfoImport : patientInfoImports) { + if (StringUtils.isEmpty(patientInfoImport.getDepartmentName()) || Objects.isNull(patientInfoImport.getDepartmentId())) { + DeptAliasVO deptAliasVO = patientInfoImportVO.getDeptAliasVOS().stream().filter(Objects::nonNull).filter(item -> StringUtils.isNotBlank(item.getDepartmentName()) && StringUtils.isNotEmpty(item.getDeptAlias()) && patientInfoImport.getDeptAlias().equals(item.getDeptAlias())).findFirst().orElse(new DeptAliasVO()); + patientInfoImport.setDepartmentId(deptAliasVO.getDepartmentId()); + patientInfoImport.setDepartmentName(deptAliasVO.getDepartmentName()); + } + } + //科室、医院 + SysUser sysUser = sysUserMapper.selectUserById(SecurityUtils.getUserId()); + Department department = new Department(); + if (Objects.isNull(sysUser.getHospitalAgencyId())) { + return AjaxResult.error("该账号无所属医院信息,请先添加该账号所属的医院信息!"); + } + department.setHospitalAgencyId(sysUser.getHospitalAgencyId()); + List departmentList = departmentMapper.selectDepartmentNameCount(department); + if (CollectionUtils.isEmpty(departmentList)) { + return AjaxResult.error("该账号所属医院无下级科室,请先维护所属医院的下级科室信息!"); + } + List departments = new ArrayList<>(); + for (Department department1 : departmentList) { + Department deptAliasdepartment = new Department(); + DeptAliasVO deptAliasVO = patientInfoImportVO.getDeptAliasVOS().stream().filter(Objects::nonNull).filter(item -> department1.getDepartmentName().equals(item.getDepartmentName())).findFirst().orElse(new DeptAliasVO()); + if (Objects.nonNull(deptAliasVO.getDeptAlias()) && StringUtils.isNotEmpty(department1.getDepartmentAbbreviation())) { + deptAliasdepartment.setDepartmentAbbreviation(department1.getDepartmentAbbreviation() + "|" + deptAliasVO.getDeptAlias()); + deptAliasdepartment.setId(department1.getId()); + deptAliasdepartment.setUpdateBy(SecurityUtils.getUsername()); + deptAliasdepartment.setUpdateTime(LocalDateTime.now()); + departments.add(deptAliasdepartment); + } else if (Objects.nonNull(deptAliasVO.getDeptAlias()) && StringUtils.isEmpty(department1.getDepartmentAbbreviation())) { + department1.setDepartmentAbbreviation(deptAliasVO.getDeptAlias()); + deptAliasdepartment.setId(department1.getId()); + deptAliasdepartment.setUpdateBy(SecurityUtils.getUsername()); + deptAliasdepartment.setUpdateTime(LocalDateTime.now()); + departments.add(deptAliasdepartment); + } + } + if (CollectionUtils.isNotEmpty(departments)) { + int i = departmentMapper.updateDepartmentListByIds(departments); + if (i <= 0) { + return AjaxResult.error("导入失败,请联系管理员!"); + } + } + int i = patientInfoMapper.insertPatientInfoList(patientInfoImports); + if (i <= 0) { + return AjaxResult.error("导入失败,请联系管理员!"); + } + List patientInfoIds = new ArrayList<>(patientInfoImports); + int residentCount = residentInfoMapper.insertResidentInfoList(patientInfoImports); + if (residentCount <= 0) { + return AjaxResult.error("导入失败,请联系管理员!"); + } + List residentIds = new ArrayList<>(patientInfoImports); + List patientVisitRecords = new ArrayList<>(); + for (PatientInfoImport patientInfoImport : patientInfoImports) { + PatientInfoImport patientInfoId = patientInfoIds.stream().filter(Objects::nonNull).filter(item -> patientInfoImport.getPatientName().equals(item.getPatientName()) && patientInfoImport.getPatientPhone().equals(item.getPatientPhone())).findFirst().orElse(new PatientInfoImport()); + PatientInfoImport residentId = residentIds.stream().filter(Objects::nonNull).filter(item -> patientInfoImport.getPatientName().equals(item.getPatientName()) && patientInfoImport.getPatientPhone().equals(item.getPatientPhone())).findFirst().orElse(new PatientInfoImport()); + PatientVisitRecord patientVisitRecord = new PatientVisitRecord(); + patientVisitRecord.setPatientId(patientInfoId.getId()); + patientVisitRecord.setResidentId(residentId.getId()); +// patientVisitRecord.setVisitDate(patientInfoImport.getVisitDate()); +// patientVisitRecord.setCardNo(patientInfoImport.getCardNo()); +// patientVisitRecord.setAge(patientInfoImport.getAge()); +// patientVisitRecord.setMainDiagnosis(patientInfoImport.getMainDiagnosis()); +// patientVisitRecord.setPatientPhone(patientInfoImport.getPatientPhone()); +// patientVisitRecord.setPatientName(patientInfoImport.getPatientName()); +// patientVisitRecord.setDepartmentId(patientInfoImport.getDepartmentId()); +// patientVisitRecord.setDepartmentName(patientInfoImport.getDepartmentName()); + BeanUtils.copyProperties(patientInfoImport, patientVisitRecord); + patientVisitRecord.setDelFlag(0); + patientVisitRecord.setHospitalAgencyId(department.getHospitalAgencyId()); + patientVisitRecord.setHospitalAgencyName(department.getHospitalAgencyName()); + patientVisitRecord.setCreateBy(SecurityUtils.getUsername()); + patientVisitRecord.setCreateTime(LocalDateTime.now()); + patientVisitRecords.add(patientVisitRecord); + } + int patientVisitRecordCount = patientVisitRecordMapper.insertBatch(patientVisitRecords); + if (patientVisitRecordCount <= 0) { + return AjaxResult.error("导入失败,请联系管理员!"); + } + return AjaxResult.success(); + } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientinfo/PatientBaseInfoVo.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientinfo/PatientBaseInfoVo.java index d32f008a..c9a00661 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientinfo/PatientBaseInfoVo.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientinfo/PatientBaseInfoVo.java @@ -52,4 +52,7 @@ public class PatientBaseInfoVo { @ApiModelProperty(value = "住址") @Excel(name = "住址") private String address; + + @ApiModelProperty(value = "年龄") + private Integer age; } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientinfo/PatientInfoVo.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientinfo/PatientInfoVo.java index d4865a82..4a0b9d8c 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientinfo/PatientInfoVo.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientinfo/PatientInfoVo.java @@ -244,4 +244,7 @@ public class PatientInfoVo { @ApiModelProperty(value = "下次任务执行时间") @JsonFormat(pattern = "yyyy-MM-dd") private LocalDateTime nextTaskTime; + + @ApiModelProperty(value = "年龄") + private Integer age; } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientinfoimport/DeptAliasVO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientinfoimport/DeptAliasVO.java new file mode 100644 index 00000000..d4e60ddb --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientinfoimport/DeptAliasVO.java @@ -0,0 +1,57 @@ +package com.xinelu.manage.vo.patientinfoimport; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Objects; + +/** + * 科室别名集合 + * + * @author zh + * @date 2024-11-26 + */ +@Data +public class DeptAliasVO { + + /** + * 科室名称(别名) + */ + @ApiModelProperty(value = "科室名称") + private String deptAlias; + + /** + * 匹配的科室ID + */ + @ApiModelProperty(value = "匹配的科室ID") + private Long departmentId; + + /** + * 匹配的科室名称 + */ + @ApiModelProperty(value = "匹配的科室名称") + private String departmentName; + + /** + * 流水号 + */ + @ApiModelProperty(value = "流水号") + private String sn; + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeptAliasVO that = (DeptAliasVO) o; + return Objects.equals(deptAlias, that.deptAlias); + } + + @Override + public int hashCode() { + return Objects.hash(deptAlias); + } +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientinfoimport/PatientInfoImportVO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientinfoimport/PatientInfoImportVO.java new file mode 100644 index 00000000..de8cd15e --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientinfoimport/PatientInfoImportVO.java @@ -0,0 +1,35 @@ +package com.xinelu.manage.vo.patientinfoimport; + +import com.xinelu.common.core.domain.BaseEntity; +import com.xinelu.manage.domain.department.Department; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 科室对象 + * + * @author zh + * @date 2024-11-26 + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class PatientInfoImportVO extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 序列号 + */ + private String sn; + + /** + * 科室别名集合 + */ + private List deptAliasVOS; + + /** + * 科室集合 + */ + private List departments; +} diff --git a/postdischarge-manage/src/main/resources/mapper/manage/department/DepartmentMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/department/DepartmentMapper.xml index f298ce16..fad8da1c 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/department/DepartmentMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/department/DepartmentMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -61,7 +61,7 @@ from department - @@ -334,7 +334,7 @@ d.department_code - insert into department @@ -492,7 +492,7 @@ - + update department parent_department_id = @@ -571,7 +571,7 @@ where id = #{id} - + update department parent_department_id = #{parentDepartmentId}, @@ -633,4 +633,14 @@ + + + + update department + + department_abbreviation =#{item.departmentAbbreviation}, + + where id = #{item.id} + + \ No newline at end of file diff --git a/postdischarge-manage/src/main/resources/mapper/manage/patientinfo/PatientInfoMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/patientinfo/PatientInfoMapper.xml index 50c26bba..0c41c575 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/patientinfo/PatientInfoMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/patientinfo/PatientInfoMapper.xml @@ -46,6 +46,9 @@ + + + @@ -96,6 +99,9 @@ p.patient_source, p.surgical_name, p.del_flag, + p.sn, + p.patient_info_import_id, + p.age, p.create_by, p.create_time, p.update_by, @@ -228,6 +234,7 @@ p.sign_patient_record_id, p.visit_date AS visit_date, p.patient_source AS patient_source, + p.age AS age, CASE WHEN isnull( p.sign_patient_record_id) THEN '新建' WHEN sign.service_status = 'INTENTIONAL_SIGNING' THEN '意向签约' @@ -379,7 +386,8 @@ birth_date, card_no, sex, - address + address, + age from patient_info where id = #{id} @@ -784,7 +792,7 @@ - SELECT id, patient_name, @@ -849,4 +857,54 @@ where del_flag = 0 and service_status = 'SERVICE_CENTER' + + + + + insert into patient_info( + patient_info_import_id, + visit_date, + in_hospital_number, + patient_name, + card_no, + age, + main_diagnosis, + patient_phone, + department_id, + department_name, + sn, + del_flag, + create_time, + create_by + ) values + + ( + #{PatientInfoImport.id}, + #{PatientInfoImport.visitDate}, + #{PatientInfoImport.inHospitalNumber}, + #{PatientInfoImport.patientName}, + #{PatientInfoImport.cardNo}, + #{PatientInfoImport.age}, + #{PatientInfoImport.mainDiagnosis}, + #{PatientInfoImport.patientPhone}, + #{PatientInfoImport.departmentId}, + #{PatientInfoImport.departmentName}, + #{PatientInfoImport.sn}, + 0, + #{PatientInfoImport.createTime}, + #{PatientInfoImport.createBy} + ) + + diff --git a/postdischarge-manage/src/main/resources/mapper/manage/patientinfoimport/PatientInfoImportMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/patientinfoimport/PatientInfoImportMapper.xml new file mode 100644 index 00000000..983ecf45 --- /dev/null +++ b/postdischarge-manage/src/main/resources/mapper/manage/patientinfoimport/PatientInfoImportMapper.xml @@ -0,0 +1,267 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, + order_num, + dept_alias, + visit_date, + in_hospital_number, + patient_name, + card_no, + age, + main_diagnosis, + patient_phone, + department_id, + department_name, + sn, + create_time, + create_by + from patient_info_import + + + + + + + + insert into patient_info_import + + id, + + order_num, + + dept_alias, + + visit_date, + + in_hospital_number, + + patient_name, + + card_no, + + age, + + main_diagnosis, + + patient_phone, + + department_id, + + department_name, + + sn, + + create_time, + + create_by, + + + + #{id}, + + #{orderNum}, + + #{deptAlias}, + + #{visitDate}, + + #{inHospitalNumber}, + + #{patientName}, + + #{cardNo}, + + #{age}, + + #{mainDiagnosis}, + + #{patientPhone}, + + #{departmentId}, + + #{departmentName}, + + #{sn}, + + #{createTime}, + + #{createBy}, + + + + + + update patient_info_import + + order_num = + #{orderNum}, + + dept_alias = + #{deptAlias}, + + visit_date = + #{visitDate}, + + in_hospital_number = + #{inHospitalNumber}, + + patient_name = + #{patientName}, + + card_no = + #{cardNo}, + + age = + #{age}, + + main_diagnosis = + #{mainDiagnosis}, + + patient_phone = + #{patientPhone}, + + department_id = + #{departmentId}, + + department_name = + #{departmentName}, + + sn = + #{sn}, + + create_time = + #{createTime}, + + create_by = + #{createBy}, + + + where id = #{id} + + + + delete + from patient_info_import + where id = #{id} + + + + delete from patient_info_import where id in + + #{id} + + + + + insert into patient_info_import( + order_num, + dept_alias, + visit_date, + in_hospital_number, + patient_name, + card_no, + age, + main_diagnosis, + patient_phone, + department_id, + department_name, + sn, + create_time, + create_by + ) values + + ( + #{PatientInfoImport.orderNum}, + #{PatientInfoImport.deptAlias}, + #{PatientInfoImport.visitDate}, + #{PatientInfoImport.inHospitalNumber}, + #{PatientInfoImport.patientName}, + #{PatientInfoImport.cardNo}, + #{PatientInfoImport.age}, + #{PatientInfoImport.mainDiagnosis}, + #{PatientInfoImport.patientPhone}, + #{PatientInfoImport.departmentId}, + #{PatientInfoImport.departmentName}, + #{PatientInfoImport.sn}, + #{PatientInfoImport.createTime}, + #{PatientInfoImport.createBy} + ) + + + + + \ No newline at end of file diff --git a/postdischarge-manage/src/main/resources/mapper/manage/residentinfo/ResidentInfoMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/residentinfo/ResidentInfoMapper.xml index 762c29e6..f06c6410 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/residentinfo/ResidentInfoMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/residentinfo/ResidentInfoMapper.xml @@ -124,7 +124,7 @@ - + update resident_info patient_name = @@ -214,4 +214,25 @@ + + + insert into resident_info( + patient_name, + patient_phone, + card_no, + del_flag, + create_by, + create_time + ) values + + ( + #{PatientInfoImport.patientName}, + #{PatientInfoImport.patientPhone}, + #{PatientInfoImport.cardNo}, + 0, + #{PatientInfoImport.createBy}, + #{PatientInfoImport.createTime} + ) + + \ No newline at end of file