初始化
parent
755f92ac1e
commit
c886392ae9
@ -1,4 +1,4 @@
|
||||
package com.shibofu.spring;
|
||||
package com.example;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
@ -0,0 +1,40 @@
|
||||
package com.example.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.service.ApiInfo;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
/**
|
||||
* @ClassName SwaggerConfig
|
||||
* @Description swagger配置类
|
||||
* @Author linjj
|
||||
* @Date 2024/12/10 21:18
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
public class SwaggerConfig {
|
||||
@Bean
|
||||
public Docket api() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.select()
|
||||
.apis(RequestHandlerSelectors.any())
|
||||
.paths(PathSelectors.any())
|
||||
.build()
|
||||
.apiInfo(apiInfo());
|
||||
}
|
||||
|
||||
private ApiInfo apiInfo() {
|
||||
return new ApiInfoBuilder()
|
||||
.title("连州人医API文档")
|
||||
.description("连州人医接口文档")
|
||||
.version("1.0.0")
|
||||
.build();
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.example.controller;
|
||||
|
||||
import com.example.service.ArchiveService;
|
||||
import com.example.util.CommonResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @ClassName ArchiveController
|
||||
* @Description 归档接口
|
||||
* @Author linjj
|
||||
* @Date 2024/12/13 13:21
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/archive")
|
||||
@Api(tags = "归档测试接口", description = "Example API Description")
|
||||
public class ArchiveController {
|
||||
@Autowired
|
||||
private ArchiveService archiveService;
|
||||
|
||||
@GetMapping("/archivePdf")
|
||||
@ApiOperation(value = "pdf归档测试接口")
|
||||
public CommonResult<?> archivePdf() {
|
||||
archiveService.archive();
|
||||
return CommonResult.success("执行完成");
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.example.controller;
|
||||
|
||||
import com.example.service.QualityService;
|
||||
import com.example.util.CommonResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @ClassName QualityController
|
||||
* @Description 质检接口
|
||||
* @Author linjj
|
||||
* @Date 2025/1/14 16:32
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/quality")
|
||||
@Api(tags = "质检测试接口", description = "Example API Description")
|
||||
public class QualityController {
|
||||
|
||||
@Autowired
|
||||
private QualityService qualityService;
|
||||
@GetMapping("/qualityPdf")
|
||||
@ApiOperation(value = "pdf质检测试接口")
|
||||
public CommonResult<?> qualityPdf() {
|
||||
qualityService.Quality();
|
||||
return CommonResult.success("执行完成");
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.example.db1.dao;
|
||||
|
||||
import com.example.dto.AddDetailDto;
|
||||
import com.example.vo.ArchiveDetailVo;
|
||||
import lombok.Data;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @InterfaceName ArchiveDetailrDao
|
||||
* @Description 文件表接口
|
||||
* @Author linjj
|
||||
* @Date 2024/12/12 16:33
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface ArchiveDetailDao {
|
||||
|
||||
boolean addArchiveDetail(@Param("list") List<AddDetailDto> list);
|
||||
|
||||
List<String> getPdfPath(String masterId);
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.example.db1.dao;
|
||||
|
||||
import com.example.dto.AddCommonTableDto;
|
||||
import com.example.dto.UpIsPdfDto;
|
||||
import com.example.vo.QualityVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @InterfaceName CommonTableDao
|
||||
* @Description CommonTable表接口
|
||||
* @Author linjj
|
||||
* @Date 2024/12/13 16:31
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface CommonTableDao {
|
||||
|
||||
/**
|
||||
* @description: 新增CommonTable表接口
|
||||
* @params: AddCommonTable
|
||||
* @return: Boolean
|
||||
* @author linjj
|
||||
* @date: 2024/12/13 16:32
|
||||
*/
|
||||
Boolean addCommonTable(AddCommonTableDto addCommonTableDto);
|
||||
/**
|
||||
* @description: 根据id删除接口
|
||||
* @params: id
|
||||
* @return: Boolean
|
||||
* @author linjj
|
||||
* @date: 2024/12/13 16:35
|
||||
*/
|
||||
Boolean delCommonTableById(String id);
|
||||
/**
|
||||
* @description: 查询需要质检数据
|
||||
* @author linjj
|
||||
* @date: 2025/1/14 15:36
|
||||
*/
|
||||
List<QualityVo> getCommonTableId();
|
||||
/**
|
||||
* @description: 批量更新isPDF字段的方法
|
||||
* @params: UpIsPdfDto
|
||||
* @return: Boolean
|
||||
* @author linjj
|
||||
* @date: 2025/1/14 16:22
|
||||
*/
|
||||
Boolean updateIsPDFByIds(@Param("list") List<UpIsPdfDto> list);
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
package com.example.db2.dao;
|
||||
|
||||
import com.example.dto.GetMedicalDto;
|
||||
import com.example.vo.ArchiveMasterVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @InterfaceName ArchiveMasterDao
|
||||
* @Description 患者信息接口
|
||||
* @Author linjj
|
||||
* @Date 2024/12/11 14:05
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface MedicalDao {
|
||||
|
||||
/**
|
||||
* @description: 获取视图中患者信息接口
|
||||
* @params: GetMedicalDto
|
||||
* @return: ArchiveMasterVo
|
||||
* @author linjj
|
||||
* @date: 2024/12/11 14:08
|
||||
*/
|
||||
List<ArchiveMasterVo> GetMedicalInfo(GetMedicalDto getMedicalDto);
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.example.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName AddCommonTable
|
||||
* @Description CommonTable
|
||||
* @Author linjj
|
||||
* @Date 2024/12/13 16:18
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class AddCommonTableDto {
|
||||
|
||||
@ApiModelProperty(value = "patientId")
|
||||
private String patientId;
|
||||
@ApiModelProperty(value = "*病案ID号")
|
||||
private String admissId;
|
||||
@ApiModelProperty(value = "*住院次数")
|
||||
private String admissTimes;
|
||||
@ApiModelProperty(value = "*病案号")
|
||||
private String inpatientNo;
|
||||
@ApiModelProperty(value = "患者姓名")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "患者性别")
|
||||
private String sex;
|
||||
@ApiModelProperty(value = "*入院日期")
|
||||
private String admissDate;
|
||||
@ApiModelProperty(value = "出院日期")
|
||||
private String disDate;
|
||||
@ApiModelProperty(value = "出院科室")
|
||||
private String disDept;
|
||||
@ApiModelProperty(value = "*主治医师")
|
||||
private String attending;
|
||||
@ApiModelProperty(value = "*住院医师")
|
||||
private String admissDoctor;
|
||||
@ApiModelProperty(value = "出院科室名称")
|
||||
private String disDeptName;
|
||||
@ApiModelProperty(value = "身份证号")
|
||||
private String idCard;
|
||||
@ApiModelProperty(value = "标识")
|
||||
private String splitName;
|
||||
@ApiModelProperty(value = "盘号")
|
||||
private String ph;
|
||||
@ApiModelProperty(value = "光点号")
|
||||
private String gdh;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.example.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ClassName AddDetailDto
|
||||
* @Description 保存文件表实体类
|
||||
* @Author linjj
|
||||
* @Date 2024/12/12 13:04
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class AddDetailDto {
|
||||
@ApiModelProperty(value = "文件id")
|
||||
private String ID;
|
||||
|
||||
@ApiModelProperty(value = "文件路径")
|
||||
private String PDF_PATH;
|
||||
|
||||
@ApiModelProperty(value = "MasterID")
|
||||
private String MasterID;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date UpLoadDateTime;
|
||||
|
||||
@ApiModelProperty(value = "分段id")
|
||||
private String AssortID;
|
||||
|
||||
@ApiModelProperty(value = "来源")
|
||||
private String Source;
|
||||
|
||||
@ApiModelProperty(value = "分段信息")
|
||||
private String SubAssort;
|
||||
|
||||
@ApiModelProperty(value = "文件名")
|
||||
private String Title;
|
||||
|
||||
@ApiModelProperty(value = "标识")
|
||||
private String flag;
|
||||
|
||||
@ApiModelProperty(value = "标识")
|
||||
private String Sys;
|
||||
|
||||
@ApiModelProperty(value = "标识")
|
||||
private String splitName;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.example.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ClassName AddArchiveMasterDto
|
||||
* @Description 新增归档患者基础信息实体类
|
||||
* @Author linjj
|
||||
* @Date 2024/12/11 15:28
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class AddMasterDto {
|
||||
@ApiModelProperty(value = "主键id")
|
||||
private String id;
|
||||
@ApiModelProperty(value = "病人id")
|
||||
private String patientId;
|
||||
@ApiModelProperty(value = "住院号")
|
||||
private String inpNo;
|
||||
@ApiModelProperty(value = "住院次数")
|
||||
private String visitId;
|
||||
@ApiModelProperty(value = "姓名")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "性别")
|
||||
private String sex;
|
||||
@ApiModelProperty(value = "出院科室")
|
||||
private String deptName;
|
||||
@ApiModelProperty(value = "出院时间")
|
||||
private String dischargeDateTime;
|
||||
@ApiModelProperty(value = "归档状态")
|
||||
private String ArchiveState;
|
||||
@ApiModelProperty(value = "住院时间")
|
||||
private String admissionDateTime;
|
||||
@ApiModelProperty(value = "住院科室")
|
||||
private String deptAdmissionTo;
|
||||
@ApiModelProperty(value = "确认开始时间")
|
||||
private Date checkDatetime;
|
||||
@ApiModelProperty(value = "确认开始结束时间")
|
||||
private Date checkedDatetime;
|
||||
@ApiModelProperty(value = "主治医生")
|
||||
private String DOCTOR_IN_CHARGE;
|
||||
@ApiModelProperty(value = "身份证号")
|
||||
private String ID_NO;
|
||||
@ApiModelProperty(value = "标识")
|
||||
private String splitName;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.example.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName GetMasterDto
|
||||
* @Description 获取ArchiveMasterId dto
|
||||
* @Author linjj
|
||||
* @Date 2024/12/11 15:10
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class GetMasterIdDto {
|
||||
|
||||
@ApiModelProperty(value = "病人id")
|
||||
private String patientId;
|
||||
|
||||
@ApiModelProperty(value = "姓名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "住院号")
|
||||
private String inpNo;
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.example.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName GetMedicalDto
|
||||
* @Description 获取患者信息所需参数
|
||||
* @Author linjj
|
||||
* @Date 2024/12/11 14:09
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class GetMedicalDto {
|
||||
|
||||
@ApiModelProperty(value = "病人id")
|
||||
private String SICK_ID;
|
||||
|
||||
@ApiModelProperty(value = "姓名")
|
||||
private String NAME;
|
||||
|
||||
@ApiModelProperty(value = "住院号")
|
||||
private String RESIDENCE_NO;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.example.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName UpIsPdfDto
|
||||
* @Description 修改CommonTable isPdf标识
|
||||
* @Author linjj
|
||||
* @Date 2025/1/14 16:04
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class UpIsPdfDto {
|
||||
|
||||
private String patientId;
|
||||
|
||||
private int isPdf;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.example.quartz;
|
||||
|
||||
|
||||
|
||||
import com.example.service.ArchiveService;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.quartz.QuartzJobBean;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @description: 定时任务采集
|
||||
* @author linjj
|
||||
* @date: 2024/12/13 9:22
|
||||
*/
|
||||
public class ArchiveQuartz extends QuartzJobBean {
|
||||
|
||||
|
||||
@Resource
|
||||
private ArchiveService archiveService;
|
||||
|
||||
|
||||
@Override
|
||||
protected void executeInternal(JobExecutionContext jobExecutionContext) {
|
||||
archiveService.archive();
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.example.service;
|
||||
|
||||
/**
|
||||
* @InterfaceName ArchiveService
|
||||
* @Description 连州归档接口
|
||||
* @Author linjj
|
||||
* @Date 2024/12/13 13:14
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface ArchiveService {
|
||||
|
||||
|
||||
/**
|
||||
* @description: 归档接口
|
||||
* @author linjj
|
||||
* @date: 2025/1/14 15:34
|
||||
*/
|
||||
boolean archive();
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.example.service;
|
||||
|
||||
/**
|
||||
* @InterfaceName QualityService
|
||||
* @Description 质检接口
|
||||
* @Author linjj
|
||||
* @Date 2025/1/14 15:30
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface QualityService {
|
||||
|
||||
/**
|
||||
* @description: 质检接口
|
||||
* @author linjj
|
||||
* @date: 2025/1/14 15:34
|
||||
*/
|
||||
Boolean Quality();
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.shibofu.spring.util;
|
||||
package com.example.util;
|
||||
|
||||
|
||||
|
@ -0,0 +1,152 @@
|
||||
package com.example.util;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author docus
|
||||
* @date 2020/3/28 16:23
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("响应")
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CommonResult<T> {
|
||||
@ApiModelProperty("响应码")
|
||||
private Integer code;
|
||||
@ApiModelProperty("响应消息")
|
||||
private String msg;
|
||||
@ApiModelProperty("响应实体")
|
||||
private T data;
|
||||
|
||||
public CommonResult(Integer code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功返回结果
|
||||
*
|
||||
* @param data 获取的数据
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> success(T data) {
|
||||
return new CommonResult<T>(ResultCode.SUCCESS.getCode(), ResultCode.SUCCESS.getMessage(), data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功返回结果
|
||||
*
|
||||
* @param data 获取的数据
|
||||
* @param message 提示信息
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> success(T data, String message) {
|
||||
return new CommonResult<T>(ResultCode.SUCCESS.getCode(), message, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回结果
|
||||
*
|
||||
* @param errorCode 错误码
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> failed(IErrorCode errorCode) {
|
||||
return new CommonResult<T>(errorCode.getCode(), errorCode.getMessage(), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回结果
|
||||
*
|
||||
* @param errorCode 错误码
|
||||
* @param message 提示信息
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> failed(IErrorCode errorCode, String message) {
|
||||
return new CommonResult<T>(errorCode.getCode(), message, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回结果
|
||||
*
|
||||
* @param message 提示信息
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> failed(String message) {
|
||||
return new CommonResult<T>(ResultCode.FAILED.getCode(), message, null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 失败返回结果
|
||||
*
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> failed() {
|
||||
return failed(ResultCode.FAILED);
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数验证失败返回结果
|
||||
*
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> validateFailed() {
|
||||
return failed(ResultCode.VALIDATE_FAILED);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提示信息
|
||||
*
|
||||
* @param message 提示信息
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> validateFailed(String message) {
|
||||
return new CommonResult<T>(ResultCode.VALIDATE_FAILED.getCode(), message, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 未登录返回结果
|
||||
*
|
||||
* @param data 获取的数据
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> unauthorized(T data) {
|
||||
return new CommonResult<T>(ResultCode.UNAUTHORIZED.getCode(), ResultCode.UNAUTHORIZED.getMessage(), data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重防及重复请求
|
||||
*
|
||||
* @param data 获取的数据
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> preventreplay(T data) {
|
||||
return new CommonResult<T>(ResultCode.PREVENT_REPLAY.getCode(), ResultCode.PREVENT_REPLAY.getMessage(), data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 未授权返回结果
|
||||
*
|
||||
* @param data 获取的数据
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> forbidden(T data) {
|
||||
return new CommonResult<T>(ResultCode.FORBIDDEN.getCode(), ResultCode.FORBIDDEN.getMessage(), data);
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.shibofu.spring.util;
|
||||
package com.example.util;
|
||||
|
||||
|
||||
public enum ExceptionCode {
|
@ -0,0 +1,12 @@
|
||||
package com.example.util;
|
||||
|
||||
/**
|
||||
* @InterfaceName FieldSelector
|
||||
* @Description
|
||||
* @Author linjj
|
||||
* @Date 2023/6/29 16:41
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface FieldSelector<Type, FieldType> {
|
||||
FieldType select(Type type);
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.example.util;
|
||||
|
||||
/**
|
||||
* @Description 封装API的错误码
|
||||
* @Author JacksonTu
|
||||
* @Date 2020/3/28 16:26
|
||||
*/
|
||||
public interface IErrorCode {
|
||||
Integer getCode();
|
||||
|
||||
String getMessage();
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.shibofu.spring.util;
|
||||
package com.example.util;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
@ -0,0 +1,73 @@
|
||||
package com.example.util;
|
||||
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public final class ListUtil {
|
||||
public static <T, K> Map<K, T> toMap(List<T> list, FieldSelector<T, K> selector) {
|
||||
if (CollectionUtils.isEmpty(list)) return Collections.emptyMap();
|
||||
Map<K, T> map = new HashMap<>(list.size());
|
||||
for (T t : list) {
|
||||
K key = selector.select(t);
|
||||
if (key != null) map.put(key, t);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static <T, K> Map<K, List<T>> groupBy(List<T> list, FieldSelector<T, K> selector) {
|
||||
if (CollectionUtils.isEmpty(list)) return Collections.emptyMap();
|
||||
Map<K, List<T>> map = new HashMap<>();
|
||||
for (T t : list) {
|
||||
K key = selector.select(t);
|
||||
if (key == null) continue;
|
||||
if (!map.containsKey(key)) {
|
||||
map.put(key, new ArrayList<T>());
|
||||
}
|
||||
map.get(key).add(t);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static <T, K> List<K> select(List<T> list, FieldSelector<T, K> selector) {
|
||||
if (CollectionUtils.isEmpty(list)) return Collections.emptyList();
|
||||
List<K> filedList = new ArrayList<>(list.size());
|
||||
for (T t : list) {
|
||||
K key = selector.select(t);
|
||||
if (key != null) filedList.add(key);
|
||||
}
|
||||
return filedList;
|
||||
}
|
||||
|
||||
public static <T, K> List<K> distinctSelect(List<T> list, FieldSelector<T, K> selector) {
|
||||
if (CollectionUtils.isEmpty(list)) return Collections.emptyList();
|
||||
Set<K> filedSet = new HashSet<>();
|
||||
for (T t : list) {
|
||||
K key = selector.select(t);
|
||||
if (key != null) filedSet.add(key);
|
||||
}
|
||||
return new ArrayList<>(filedSet);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
public static <T> List<T> unionWithoutDuplicate(List<T>... values) {
|
||||
if (null == values || values.length <= 0) return Collections.emptyList();
|
||||
Set<T> unionFiledSet = new HashSet<>();
|
||||
for (List<T> value : values) {
|
||||
if (!CollectionUtils.isEmpty(value)) {
|
||||
unionFiledSet.addAll(value);
|
||||
}
|
||||
}
|
||||
return new ArrayList<>(unionFiledSet);
|
||||
}
|
||||
|
||||
public static <T, K> List<T> skipDuplicateKey(List<T> list, FieldSelector<T, K> selector) {
|
||||
if (CollectionUtils.isEmpty(list)) return Collections.emptyList();
|
||||
List<T> filedList = new ArrayList<>(list.size());
|
||||
Map<K, T> map = toMap(list, selector);
|
||||
for (K key : map.keySet()) {
|
||||
filedList.add(map.get(key));
|
||||
}
|
||||
return filedList;
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.shibofu.spring.util;
|
||||
package com.example.util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
@ -0,0 +1,42 @@
|
||||
package com.example.util;
|
||||
|
||||
|
||||
/**
|
||||
* @Description 枚举一些常用API操作码
|
||||
* @Author JacksonTu
|
||||
* @Date 2020/3/28 16:26
|
||||
*/
|
||||
public enum ResultCode implements IErrorCode {
|
||||
|
||||
SUCCESS(0, "操作成功"),
|
||||
FAILED(500, "操作失败"),
|
||||
VALIDATE_FAILED(404, "参数检验失败"),
|
||||
UNAUTHORIZED(401, "暂未登录或token已经过期"),
|
||||
FORBIDDEN(403, "没有相关权限"),
|
||||
PREVENT_REPLAY(405,"重复请求"),
|
||||
NOT_EXIST(601,"数据不存在"),
|
||||
NOT_ENABLE(600,"数据未启用");
|
||||
|
||||
|
||||
|
||||
|
||||
private Integer code;
|
||||
private String message;
|
||||
|
||||
private ResultCode(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.shibofu.spring.vo;
|
||||
package com.example.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
@ -0,0 +1,44 @@
|
||||
package com.example.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName ArchiveMasterVo
|
||||
* @Description 患者基础信息
|
||||
* @Author linjj
|
||||
* @Date 2024/12/11 13:57
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ArchiveMasterVo {
|
||||
|
||||
@ApiModelProperty(value = "病人id")
|
||||
private String SICK_ID;
|
||||
@ApiModelProperty(value = "住院号")
|
||||
private String RESIDENCE_NO;
|
||||
@ApiModelProperty(value = "住院次数")
|
||||
private String VISIT_NUMBER;
|
||||
@ApiModelProperty(value = "姓名")
|
||||
private String NAME;
|
||||
@ApiModelProperty(value = "性别")
|
||||
private String SEX;
|
||||
@ApiModelProperty(value = "入院时间")
|
||||
private String ADMISSION_TIME;
|
||||
@ApiModelProperty(value = "出院时间")
|
||||
private String DISCHARGE_TIME;
|
||||
@ApiModelProperty(value = "出院科室")
|
||||
private String DETP_NAME;
|
||||
@ApiModelProperty(value = "出院科室编码")
|
||||
private String DEPT_CODE;
|
||||
@ApiModelProperty(value = "入院科室编码")
|
||||
private String ADMISSION_DEPT_CODE;
|
||||
@ApiModelProperty(value = "身份证号")
|
||||
private String ID_CARD_NO;
|
||||
|
||||
@ApiModelProperty(value = "主管医生")
|
||||
private String DOCTOR;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private String STATUS;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.example.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName GetZdAssortVo
|
||||
* @Description 获取分段id
|
||||
* @Author linjj
|
||||
* @Date 2024/12/12 16:52
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class GetZdAssortVo {
|
||||
@ApiModelProperty(value = "分段名称")
|
||||
private String assortName;
|
||||
|
||||
@ApiModelProperty(value = "分段Id")
|
||||
private String assortId;
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.example.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName QualityVo
|
||||
* @Description 质检查询返回
|
||||
* @Author linjj
|
||||
* @Date 2025/1/14 15:44
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class QualityVo {
|
||||
|
||||
private String patientId;
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
package com.shibofu.spring.controller;
|
||||
|
||||
import com.shibofu.spring.db1.service.ECGPollingService;
|
||||
import com.shibofu.spring.db1.serviceImpl.ECGPollingServiceImpl;
|
||||
import com.shibofu.spring.util.Msg;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author potter.fu
|
||||
* @date 2018-12-07 15:38
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/makeUp")
|
||||
public class MoneyController {
|
||||
@Autowired
|
||||
private ECGPollingService ecgPollingService;
|
||||
|
||||
|
||||
@GetMapping("/makeUpECG")
|
||||
public Msg makeUpByNeed() {
|
||||
Msg msg = ecgPollingService.ECGDayPolling();
|
||||
return msg;
|
||||
}
|
||||
|
||||
@GetMapping("/makeUpECGByPatientId")
|
||||
public Msg makeUpECGByPatientId(String patientId) {
|
||||
Msg msg = ecgPollingService.ECGDayPollingByPatientId(patientId);
|
||||
return msg;
|
||||
}
|
||||
|
||||
@GetMapping("/makeUpTime")
|
||||
public Msg makeUp() {
|
||||
return ecgPollingService.makeUp();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
package com.shibofu.spring.db1.dao;
|
||||
|
||||
import com.shibofu.spring.dto.ArchiveDetailDto;
|
||||
import com.shibofu.spring.vo.ArchiveDetailVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @InterfaceName ArchiveDetailDao
|
||||
* @Description 操作文件表接口
|
||||
* @Author linjj
|
||||
* @Date 2024/1/19 9:01
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface ArchiveDetailDao {
|
||||
|
||||
boolean addArchiveDetail(@Param("list") List<ArchiveDetailDto> list);
|
||||
|
||||
List<ArchiveDetailVo> getArchiveDetailBySourceAndMid(@Param("source")String source,@Param("mid")String mid);
|
||||
|
||||
boolean delDetailBySourceAndMid(@Param("source")String source,@Param("mid")String mid);
|
||||
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
package com.shibofu.spring.db1.dao;
|
||||
|
||||
import com.shibofu.spring.vo.ArchiveMasterVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @InterfaceName ArchiveMasterDao
|
||||
* @Description
|
||||
* @Author linjj
|
||||
* @Date 2024/1/18 9:47
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface ArchiveMasterDao {
|
||||
//查询24小时内出院病历
|
||||
List<ArchiveMasterVo> PollingECG();
|
||||
//根据记帐号查询病历
|
||||
List<ArchiveMasterVo> PollingECGByPatientId(String patientId);
|
||||
//整年心电数据补偿
|
||||
List<ArchiveMasterVo> makeUp();
|
||||
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
package com.shibofu.spring.db1.service;
|
||||
|
||||
import com.shibofu.spring.util.Msg;
|
||||
|
||||
/**
|
||||
* @InterfaceName ECGPollingService
|
||||
* @Description 心电接口
|
||||
* @Author linjj
|
||||
* @Date 2024/7/8 8:55
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface ECGPollingService {
|
||||
|
||||
|
||||
/**
|
||||
* @description: 定时查询每天出院患者
|
||||
* @author linjj
|
||||
* @date: 2024/1/18 9:29
|
||||
*/
|
||||
Msg ECGDayPolling() ;
|
||||
|
||||
Msg ECGDayPollingByPatientId(String patientId);
|
||||
|
||||
Msg makeUp();
|
||||
}
|
@ -1,233 +0,0 @@
|
||||
package com.shibofu.spring.db1.serviceImpl;
|
||||
|
||||
import com.shibofu.spring.db1.dao.ArchiveDetailDao;
|
||||
import com.shibofu.spring.db1.dao.ArchiveMasterDao;
|
||||
import com.shibofu.spring.db1.service.ECGPollingService;
|
||||
import com.shibofu.spring.db2.dao.ECGDao;
|
||||
import com.shibofu.spring.dto.ArchiveDetailDto;
|
||||
import com.shibofu.spring.util.Msg;
|
||||
import com.shibofu.spring.vo.ArchiveDetailVo;
|
||||
import com.shibofu.spring.vo.ArchiveMasterVo;
|
||||
import com.shibofu.spring.vo.ECGVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ECGPollingServiceImpl
|
||||
* @Description 心电接口
|
||||
* @Author linjj
|
||||
* @Date 2024/7/8 8:55
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ECGPollingServiceImpl implements ECGPollingService {
|
||||
|
||||
@Autowired
|
||||
private ArchiveMasterDao archiveMasterDao;
|
||||
@Autowired
|
||||
private ECGDao ecgDao;
|
||||
@Value("${savePath}")
|
||||
private String savePath;
|
||||
@Autowired
|
||||
private ArchiveDetailDao archiveDetailDao;
|
||||
|
||||
@Override
|
||||
public Msg ECGDayPolling() {
|
||||
//查询当前时间24小时内需要采集数据
|
||||
List<ArchiveMasterVo> archiveMasters = archiveMasterDao.PollingECG();
|
||||
if (CollectionUtils.isEmpty(archiveMasters)) {
|
||||
log.info("当前时间段查询不到心跳数据");
|
||||
return Msg.success("当前时间段查询不到心跳数据");
|
||||
}
|
||||
log.info("--------------------------------------------当前时间段心电需要采集:" + archiveMasters.size() + "个患者--------------------------------------------");
|
||||
//循环所有患者采集
|
||||
for (ArchiveMasterVo list : archiveMasters) {
|
||||
log.info("---------------------开始采集记帐号为:" + list.getPatientId() + "的患者---------------------");
|
||||
List<ECGVo> ecgs = ecgDao.getECG(list.getPatientId());
|
||||
if (CollectionUtils.isEmpty(ecgs)) {
|
||||
log.info("记帐号为:" + list.getPatientId() + "的患者没有心电数据");
|
||||
continue;
|
||||
}
|
||||
//获取需要插入archiveDetai表数据
|
||||
ArrayList<ArchiveDetailDto> archiveDetailList = getArchiveDetailDtos(list, ecgs);
|
||||
if (CollectionUtils.isEmpty(archiveDetailList)) {
|
||||
log.info("记帐号为:" + list.getPatientId()+"没有保存文件表数据");
|
||||
continue;
|
||||
}
|
||||
//更新文件表
|
||||
updateArchiveDetail(list, archiveDetailList);
|
||||
}
|
||||
log.info("--------------------------------------------此时间段采集完成--------------------------------------------");
|
||||
return Msg.success("此时间段采集完成");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Msg ECGDayPollingByPatientId(String patientId){
|
||||
List<ArchiveMasterVo> archiveMasters = archiveMasterDao.PollingECGByPatientId(patientId);
|
||||
if (CollectionUtils.isEmpty(archiveMasters)) {
|
||||
log.info("当前时间段查询不到心跳数据");
|
||||
return Msg.success("当前时间段查询不到心跳数据");
|
||||
}
|
||||
log.info("--------------------------------------------心电按需:" + archiveMasters.size() + "个患者--------------------------------------------");
|
||||
//循环所有患者采集
|
||||
for (ArchiveMasterVo list : archiveMasters) {
|
||||
log.info("---------------------开始采集记帐号为:" + list.getPatientId() + "的患者---------------------");
|
||||
List<ECGVo> ecgs = ecgDao.getECG(list.getPatientId());
|
||||
if (CollectionUtils.isEmpty(ecgs)) {
|
||||
log.info("记帐号为:" + list.getPatientId() + "的患者没有心电数据");
|
||||
continue;
|
||||
}
|
||||
//获取需要插入archiveDetai表数据
|
||||
ArrayList<ArchiveDetailDto> archiveDetailList = getArchiveDetailDtos(list, ecgs);
|
||||
if (CollectionUtils.isEmpty(archiveDetailList)) {
|
||||
log.info("记帐号为:" + list.getPatientId()+"没有保存文件表数据");
|
||||
continue;
|
||||
}
|
||||
//更新文件表
|
||||
updateArchiveDetail(list, archiveDetailList);
|
||||
}
|
||||
log.info("--------------------------------------------心电按需采集完成--------------------------------------------");
|
||||
return Msg.success("心电按需采集完成");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Msg makeUp() {
|
||||
List<ArchiveMasterVo> archiveMasters = archiveMasterDao.makeUp();
|
||||
if (CollectionUtils.isEmpty(archiveMasters)) {
|
||||
log.info("当前时间段查询不到心跳数据");
|
||||
return Msg.success("当前时间段查询不到心跳数据");
|
||||
}
|
||||
log.info("--------------------------------------------心电补偿:" + archiveMasters.size() + "个患者--------------------------------------------");
|
||||
//循环所有患者采集
|
||||
for (ArchiveMasterVo list : archiveMasters) {
|
||||
log.info("---------------------开始采集记帐号为:" + list.getPatientId() + "的患者---------------------");
|
||||
List<ECGVo> ecgs = ecgDao.getECG(list.getPatientId());
|
||||
if (CollectionUtils.isEmpty(ecgs)) {
|
||||
log.info("记帐号为:" + list.getPatientId() + "的患者没有心电数据");
|
||||
continue;
|
||||
}
|
||||
//获取需要插入archiveDetai表数据
|
||||
ArrayList<ArchiveDetailDto> archiveDetailList = getArchiveDetailDtos(list, ecgs);
|
||||
if (CollectionUtils.isEmpty(archiveDetailList)) {
|
||||
log.info("记帐号为:" + list.getPatientId()+"没有保存文件表数据");
|
||||
continue;
|
||||
}
|
||||
//更新文件表
|
||||
updateArchiveDetail(list, archiveDetailList);
|
||||
}
|
||||
log.info("--------------------------------------------心电补偿采集完成--------------------------------------------");
|
||||
return Msg.success("心电补偿采集完成");
|
||||
}
|
||||
//更新文件表数据
|
||||
private void updateArchiveDetail(ArchiveMasterVo list, ArrayList<ArchiveDetailDto> archiveDetailList) {
|
||||
//判断是否存在数据,存在删除并且删除原文件
|
||||
List<ArchiveDetailVo> ecgList = archiveDetailDao.getArchiveDetailBySourceAndMid("ECG", list.getId());
|
||||
if (!CollectionUtils.isEmpty(ecgList)) {
|
||||
archiveDetailDao.delDetailBySourceAndMid("ECG", list.getId());
|
||||
//删除原文件数据
|
||||
deleteFliepath(ecgList);
|
||||
}
|
||||
if (archiveDetailDao.addArchiveDetail(archiveDetailList)){
|
||||
log.info("记帐号为:" + list.getPatientId()+"采集了"+ archiveDetailList.size()+"张图像");
|
||||
}
|
||||
}
|
||||
|
||||
private ArrayList<ArchiveDetailDto> getArchiveDetailDtos(ArchiveMasterVo list, List<ECGVo> ecgs) {
|
||||
ArrayList<ArchiveDetailDto> archiveDetailList = null;
|
||||
try {
|
||||
String filePathdir;
|
||||
//文件保存目录
|
||||
filePathdir = savePath + File.separatorChar + list.getPatientId();
|
||||
// 本地磁盘的路径
|
||||
Path localPath = Paths.get(filePathdir);
|
||||
//确保目录存在
|
||||
if (createDirectory(localPath)) return null;
|
||||
//保存文件表集合
|
||||
archiveDetailList = new ArrayList<>();
|
||||
//患者所有心电记录采集到本地磁盘
|
||||
for (ECGVo ecg : ecgs) {
|
||||
String newPath;
|
||||
String pPath = ecg.getPPath();
|
||||
//使用yyyyMMddHHmmssSSS格式作为文件名
|
||||
Date date = new Date();
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
||||
String newDate = format.format(date);
|
||||
String savaPath = filePathdir + File.separatorChar + newDate + ".PDF";
|
||||
if (pPath.contains("E:\\ecgdata\\ECG")) {
|
||||
newPath = pPath.replace("E:\\ecgdata\\ECG", "Z:");
|
||||
} else {
|
||||
newPath = pPath.replace("E:\\ECGDATA\\ECG", "Z:");
|
||||
}
|
||||
// 构建网络文件的完整路径
|
||||
Path networkFilePath = Paths.get(newPath);
|
||||
// 从网络磁盘拷贝文件到本地磁盘
|
||||
try {
|
||||
Files.copy(networkFilePath, Paths.get(savaPath));
|
||||
} catch (Exception e) {
|
||||
log.error("记帐号为:" + list.getPatientId() + "的病历文件名为:" + networkFilePath.getFileName() + "的文件拷贝失败", e);
|
||||
continue;
|
||||
}
|
||||
if (new File(savaPath).exists()) {
|
||||
//组织保存文件表数据
|
||||
ArchiveDetailDto archiveDetailDto = new ArchiveDetailDto();
|
||||
archiveDetailDto.setMasterId(list.getId());
|
||||
archiveDetailDto.setUploadDateTime(new Date());
|
||||
archiveDetailDto.setAssortId("DA342ED81CEE4A8EA827424626F3F577");
|
||||
archiveDetailDto.setSource("ECG");
|
||||
archiveDetailDto.setFlag("0");
|
||||
archiveDetailDto.setSys("ECG");
|
||||
archiveDetailDto.setTitle("心电图报告");
|
||||
archiveDetailDto.setPdfPath(savaPath);
|
||||
archiveDetailList.add(archiveDetailDto);
|
||||
}else {
|
||||
log.error("记帐号为:" + list.getPatientId() + "的病历文件名为:" + networkFilePath.getFileName() + "为损坏文件");
|
||||
}
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("记帐号为:" + list.getPatientId() + "的病历异常处理");
|
||||
return null;
|
||||
}
|
||||
return archiveDetailList;
|
||||
}
|
||||
|
||||
|
||||
private void deleteFliepath(List<ArchiveDetailVo> ecgList) {
|
||||
for (ArchiveDetailVo list : ecgList) {
|
||||
File file = new File(list.getPdfPath());
|
||||
try {
|
||||
file.delete(); // 删除照片
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean createDirectory(Path localPath) {
|
||||
try {
|
||||
if (!Files.exists(localPath)) {
|
||||
Files.createDirectories(localPath);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
package com.shibofu.spring.db2.dao;
|
||||
|
||||
import com.shibofu.spring.vo.ECGVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ECGDao
|
||||
* @Description 心跳接口
|
||||
* @Author linjj
|
||||
* @Date 2024/7/8 9:05
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface ECGDao {
|
||||
|
||||
List<ECGVo> getECG(@Param("patientID") String patientID);
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
package com.shibofu.spring.db2.service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author potter.fu
|
||||
* @date 2018-12-07 15:34
|
||||
*/
|
||||
@Service
|
||||
public class MoneyService {
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
package com.shibofu.spring.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ClassName ArchiveDetailDto
|
||||
* @Description 保存文件表记录dto
|
||||
* @Author linjj
|
||||
* @Date 2024/1/18 17:29
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ArchiveDetailDto {
|
||||
//文件id
|
||||
private String id;
|
||||
//文件路径
|
||||
private String pdfPath;
|
||||
//病案id
|
||||
private String masterId;
|
||||
//生成时间
|
||||
private Date uploadDateTime;
|
||||
//分段id
|
||||
private String assortId;
|
||||
//来源
|
||||
private String source;
|
||||
//来源id
|
||||
private String subAssort;
|
||||
//文件名
|
||||
private String title;
|
||||
private String flag;
|
||||
private String sys;
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
package com.shibofu.spring.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName ArchiveMasterVo
|
||||
* @Description
|
||||
* @Author linjj
|
||||
* @Date 2024/1/18 9:33
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ArchiveMasterDto {
|
||||
//病案id
|
||||
private String id;
|
||||
//患者姓名
|
||||
private String name;
|
||||
//住院次数
|
||||
private String visitId;
|
||||
//住院号
|
||||
private String inpNo;
|
||||
//入院时间
|
||||
private String admissionDateTime;
|
||||
//出院时间
|
||||
private String dischargeDateTime;
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
package com.shibofu.spring.quartz;
|
||||
|
||||
|
||||
|
||||
import com.shibofu.spring.db1.service.ECGPollingService;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.springframework.scheduling.quartz.QuartzJobBean;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @description: pacs定时任务采集
|
||||
* @author linjj
|
||||
* @date: 2024/1/18 9:22
|
||||
*/
|
||||
public class ECGQuartz extends QuartzJobBean {
|
||||
|
||||
|
||||
|
||||
@Resource
|
||||
private ECGPollingService ecgPollingService;
|
||||
|
||||
@Override
|
||||
protected void executeInternal(JobExecutionContext jobExecutionContext) {
|
||||
//每天轮询查询昨天数据进来采集
|
||||
ecgPollingService.ECGDayPolling();
|
||||
}
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
package com.shibofu.spring.text;
|
||||
|
||||
import com.shibofu.spring.MainApplication;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName test
|
||||
* @Description 测试类
|
||||
* @Author linjj
|
||||
* @Date 2024/1/18 9:54
|
||||
* @Version 1.0
|
||||
*/
|
||||
@SpringBootTest(classes = MainApplication.class)
|
||||
@RunWith(SpringRunner.class)
|
||||
@Slf4j
|
||||
public class test {
|
||||
|
||||
@Value("${savePath}")
|
||||
private String savePath;
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(test.class);
|
||||
|
||||
|
||||
@Test
|
||||
public void testDemo() {
|
||||
String newPath;
|
||||
String path = "E:\\ecgdata\\ECG\\2024-02-28\\1.2.826.0.1.3680043.2.377.114.21.20240228005228255.141737_1.PDF";
|
||||
if (path.contains("E:\\ecgdata\\ECG")) {
|
||||
newPath = path.replace("E:\\ecgdata\\ECG", "Z:");
|
||||
} else {
|
||||
newPath = path.replace("E:\\ECGDATA\\ECG", "Z:");
|
||||
}
|
||||
|
||||
System.out.println("newPath" + newPath);
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
package com.shibofu.spring.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
/**
|
||||
* @ClassName ArchiveMasterVo
|
||||
* @Description
|
||||
* @Author linjj
|
||||
* @Date 2024/1/18 9:33
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ArchiveMasterVo {
|
||||
|
||||
//病案id
|
||||
private String id;
|
||||
//患者姓名
|
||||
private String name;
|
||||
//住院次数
|
||||
private String visitId;
|
||||
//住院号
|
||||
private String inpNo;
|
||||
//入院时间
|
||||
private String admissionDateTime;
|
||||
//出院时间
|
||||
private String dischargeDateTime;
|
||||
//记帐号
|
||||
private String patientId;
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package com.shibofu.spring.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName ECGVo
|
||||
* @Description 心跳返回实体类
|
||||
* @Author linjj
|
||||
* @Date 2024/7/8 9:09
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ECGVo {
|
||||
private String patientId;
|
||||
|
||||
private String WriteDateTime;
|
||||
|
||||
private String PPath;
|
||||
}
|
@ -1,27 +1,24 @@
|
||||
server.port=3397
|
||||
#sqlserver
|
||||
#spring.datasource.hikari.db1.jdbc-url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=yd_record
|
||||
#spring.datasource.hikari.db1.jdbc-url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=lz_record
|
||||
#spring.datasource.hikari.db1.username=sa
|
||||
#spring.datasource.hikari.db1.password=admin123
|
||||
#spring.datasource.hikari.db1.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
###sqlserver
|
||||
#spring.datasource.hikari.db2.jdbc-url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=qf_record
|
||||
#spring.datasource.hikari.db2.username=sa
|
||||
#spring.datasource.hikari.db2.password=admin123
|
||||
#spring.datasource.hikari.db2.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
|
||||
|
||||
#sqlserver
|
||||
spring.datasource.hikari.db1.jdbc-url=jdbc:sqlserver://10.36.116.108:1433;DatabaseName=emr_record
|
||||
spring.datasource.hikari.db1.jdbc-url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=DB_PrivilegeManagement_LZRMYY
|
||||
spring.datasource.hikari.db1.username=sa
|
||||
spring.datasource.hikari.db1.password=xjgs+docus911
|
||||
spring.datasource.hikari.db1.password=docus@904
|
||||
spring.datasource.hikari.db1.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
#ECG
|
||||
spring.datasource.hikari.db2.jdbc-url=jdbc:sqlserver://192.168.10.50:1433;DatabaseName=medexmemrsECG
|
||||
spring.datasource.hikari.db2.username=sa
|
||||
spring.datasource.hikari.db2.password=MedExSQLServerAdmin
|
||||
spring.datasource.hikari.db2.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
#Oracle JDBC
|
||||
#spring.datasource.hikari.db2.jdbc-url=jdbc:oracle:thin:@127.0.0.1:1521:ORCL
|
||||
#spring.datasource.hikari.db2.username=system
|
||||
#spring.datasource.hikari.db2.password=lin589288
|
||||
#spring.datasource.hikari.db2.driver-class-name=oracle.jdbc.driver.OracleDriver
|
||||
spring.datasource.hikari.db2.jdbc-url=jdbc:oracle:thin:@//10.120.120.9:1521/lzrmyy
|
||||
spring.datasource.hikari.db2.username=jsgdxx
|
||||
spring.datasource.hikari.db2.password=JS!@2024
|
||||
spring.datasource.hikari.db2.driver-class-name=oracle.jdbc.driver.OracleDriver
|
||||
|
||||
|
||||
# MyBatis-Plus ??
|
||||
mybatis-plus.mapper-locations=classpath:mapper/db1/*.xml,classpath:mapper/db2/*.xml
|
||||
mybatis-plus.type-aliases-package=com.shibofu.spring.vo
|
||||
mybatis-plus.type-aliases-package=com.example.vo
|
||||
|
@ -1,4 +1,8 @@
|
||||
#文件保存路径
|
||||
savePath: F:\ECG\reload
|
||||
#定时补偿任务时间
|
||||
quartzTime: 0 0 3 * * ?
|
||||
#院方保存路径
|
||||
emr_pdf_files: F:\emr_pdf_files
|
||||
#归档文件保存路径
|
||||
save_pdf_files: F:\jiaShi_emr_pdf_files
|
||||
#定时任务时间
|
||||
#quartzTime: 0 0 3 * * ?
|
||||
|
||||
quartzTime: 0/15 * * * * ?
|
||||
|
@ -0,0 +1,22 @@
|
||||
<?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.example.db1.dao.ArchiveDetailDao">
|
||||
|
||||
<insert id="addArchiveDetail">
|
||||
insert into
|
||||
archive_detail(ID,PDF_PATH,MasterID,UpLoadDateTime,AssortID,Source,SubAssort,Title,flag,Sys,splitName
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(replace(newid(), '-', ''),#{item.PDF_PATH},#{item.MasterID},#{item.UpLoadDateTime},#{item.AssortID},#{item.Source},
|
||||
#{item.SubAssort},#{item.Title},#{item.flag},#{item.Sys},#{item.splitName})
|
||||
</foreach>
|
||||
</insert>
|
||||
<select id="getPdfPath" resultType="java.lang.String">
|
||||
SELECT PDF_PATH FROM archive_detail WHERE MasterID=#{masterId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
@ -1,24 +0,0 @@
|
||||
<?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.shibofu.spring.db1.dao.ArchiveDetailDao">
|
||||
|
||||
<insert id="addArchiveDetail">
|
||||
insert into
|
||||
archive_detail(id,PDF_PATH,MasterID,UpLoadDateTime,AssortID,Source,Title,flag,Sys
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(replace(newid(), '-', ''),#{item.pdfPath},#{item.masterId},#{item.uploadDateTime},#{item.assortId},#{item.source},
|
||||
#{item.title},#{item.flag},#{item.sys})
|
||||
</foreach>
|
||||
</insert>
|
||||
<delete id="delDetailBySourceAndMid">
|
||||
delete from archive_detail where MasterID=#{mid} and Source=#{source}
|
||||
</delete>
|
||||
<select id="getArchiveDetailBySourceAndMid" resultType="com.shibofu.spring.vo.ArchiveDetailVo">
|
||||
select id,PDF_PATH pdfPath from archive_detail where MasterID=#{mid} and Source=#{source}
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,28 @@
|
||||
<?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.example.db1.dao.CommonTableDao">
|
||||
<insert id="addCommonTable">
|
||||
insert into CommonTable (patient_id, admiss_id, admiss_times, inpatient_no, name, sex, id_card,
|
||||
admiss_date, dis_date,dis_dept,attending,
|
||||
dis_dept_name,admiss_doctor,splitName,ph,gdh)
|
||||
values (#{patientId}, #{admissId}, #{admissTimes}, #{inpatientNo}, #{name}, #{sex}, #{idCard},
|
||||
#{admissDate},#{disDate},#{disDept},#{attending},#{disDeptName},#{admissDoctor},#{splitName},#{ph},#{gdh})
|
||||
</insert>
|
||||
<update id="updateIsPDFByIds">
|
||||
<foreach collection="list" item="dto" separator=";">
|
||||
UPDATE CommonTable
|
||||
SET isPdf = #{dto.isPdf}
|
||||
WHERE patient_id = #{dto.patientId}
|
||||
</foreach>
|
||||
</update>
|
||||
<delete id="delCommonTableById">
|
||||
DELETE FROM CommonTable WHERE patient_id=#{id};
|
||||
</delete>
|
||||
<select id="getCommonTableId" resultType="com.example.vo.QualityVo">
|
||||
SELECT patient_id AS patientId FROM CommonTable WHERE gdh IS NULL AND isPdf IS NULL
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,11 @@
|
||||
<?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.example.db1.dao.ZdAssortDao">
|
||||
|
||||
|
||||
<select id="getZdAssort" resultType="com.example.vo.GetZdAssortVo">
|
||||
SELECT assort_id as assortId ,assort_name as assortName FROM zd_assort
|
||||
</select>
|
||||
</mapper>
|
@ -1,11 +0,0 @@
|
||||
<?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.shibofu.spring.db2.dao.ECGDao">
|
||||
|
||||
|
||||
<select id="getECG" resultType="com.shibofu.spring.vo.ECGVo">
|
||||
select patientid AS patientId, WriteDateTime, ReportFileLocate+reportfileName 'PPath' from [dbo].[v_EMR_Report] where PatientID=#{patientID}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,9 @@
|
||||
<?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.example.db2.dao.MedicalDao">
|
||||
<select id="GetMedicalInfo" resultType="com.example.vo.ArchiveMasterVo">
|
||||
select * from V_JSBLGD where NAME=#{NAME} AND SICK_ID=#{SICK_ID} AND RESIDENCE_NO=#{RESIDENCE_NO} AND STATUS=1
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue