diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/warning/WarningController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/warning/WarningController.java index 535b81910..b8dfcba8b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/warning/WarningController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/warning/WarningController.java @@ -8,6 +8,9 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; +import java.time.LocalDateTime; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.*; import java.io.IOException; @@ -43,6 +46,11 @@ public class WarningController { @Operation(summary = "创建危急值记录") @PreAuthorize("@ss.hasPermission('system:warning:create')") public CommonResult createWarning(@Valid @RequestBody WarningSaveReqVO createReqVO) { + UUID guid = UUID.randomUUID(); + LocalDateTime dateTime = LocalDateTime.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")), + DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + createReqVO.setId(guid.toString()); + createReqVO.setReportDate(dateTime); return success(warningService.createWarning(createReqVO)); } @@ -54,6 +62,40 @@ public class WarningController { return success(true); } + @PutMapping("/Saveupdate") + @Operation(summary = "更新危急值记录") + public CommonResult SaveupdateWarning(@Valid @RequestBody WarningSaveReqVO updateReqVO) { + + + warningService.updateWarning(updateReqVO); + return success(true); + } + + @GetMapping("/updateWarningdate") + @Operation(summary = "更新危急值接收时间和发送回执记录") + public CommonResult updateWarningdate( @RequestParam("id") String id,@RequestParam("readDateTime") String readDateTime,@RequestParam("receiptDateTime") String receiptDateTime) { + + WarningSaveReqVO warningSaveReqVO = new WarningSaveReqVO(); + warningSaveReqVO.setId(id); + if(!readDateTime.isEmpty()) + { + LocalDateTime dateTime = LocalDateTime.parse(readDateTime, DateTimeFormatter.ofPattern("yyyy-M-d H:mm:ss")); + + warningSaveReqVO.setReadDateTime(dateTime); + } + if(!receiptDateTime.isEmpty()) + { + LocalDateTime dateTime = LocalDateTime.parse(receiptDateTime, DateTimeFormatter.ofPattern("yyyy-M-d H:mm:ss")); + warningSaveReqVO.setReceiptDateTime(dateTime); + + } + + warningService.updateWarning(warningSaveReqVO); + + return success(true); + } + + @DeleteMapping("/delete") @Operation(summary = "删除危急值记录") @Parameter(name = "id", description = "编号", required = true) @@ -72,6 +114,14 @@ public class WarningController { return success(BeanUtils.toBean(warning, WarningRespVO.class)); } + @GetMapping("/getexmidororgiddata") + @Operation(summary = "获得当前危急值记录") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + public CommonResult c(@RequestParam("examID") String examID,@RequestParam("orgID") String orgID) { + WarningDO warning = warningService.getexmidororgiddata(examID,orgID); + return success(BeanUtils.toBean(warning, WarningRespVO.class)); + } + @GetMapping("/page") @Operation(summary = "获得危急值记录分页") @PreAuthorize("@ss.hasPermission('system:warning:query')") diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/warning/vo/WarningRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/warning/vo/WarningRespVO.java index 9daf4f070..05c92c9ba 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/warning/vo/WarningRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/warning/vo/WarningRespVO.java @@ -66,7 +66,11 @@ public class WarningRespVO { private String remark; @Schema(description = "危急值报告进程:Json格式") - @ExcelProperty("危急值报告进程:Json格式") private String warningProcess; + private String readDateTime; + private String receiptDateTime; + private String readremark; + + } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/warning/vo/WarningSaveReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/warning/vo/WarningSaveReqVO.java index 578c31a0e..b8a8229c0 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/warning/vo/WarningSaveReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/warning/vo/WarningSaveReqVO.java @@ -52,4 +52,8 @@ public class WarningSaveReqVO { @Schema(description = "危急值报告进程:Json格式") private String warningProcess; + private LocalDateTime readDateTime; + private LocalDateTime receiptDateTime; + private String readremark; + } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/warning/WarningDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/warning/WarningDO.java index f0069c7ad..3d48b2081 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/warning/WarningDO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/warning/WarningDO.java @@ -15,12 +15,11 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; @TableName("tb_warning") @KeySequence("tb_warning_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data -@EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @Builder @NoArgsConstructor @AllArgsConstructor -public class WarningDO extends BaseDO { +public class WarningDO { /** * 主键 @@ -92,5 +91,20 @@ public class WarningDO extends BaseDO { */ @TableField("warningProcess") private String warningProcess; + /** + * 检查端收到危急值时间 + */ + @TableField("readDateTime") + private LocalDateTime readDateTime; + /** + * 检查段发送回执消息时间 + */ + @TableField("receiptDateTime") + private LocalDateTime receiptDateTime; + /* + * 检查端确认备注 + * */ + @TableField("readremark") + private String readremark; } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/warning/WarningMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/warning/WarningMapper.java index 72eba91f6..6f0ccd580 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/warning/WarningMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/warning/WarningMapper.java @@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.module.system.dal.dataobject.warning.WarningDO; +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import org.apache.ibatis.annotations.Mapper; import cn.iocoder.yudao.module.system.controller.admin.warning.vo.*; @@ -15,6 +16,7 @@ import cn.iocoder.yudao.module.system.controller.admin.warning.vo.*; * @author 李晓东 */ @Mapper +@InterceptorIgnore(tenantLine = "true") public interface WarningMapper extends BaseMapperX { default PageResult selectPage(WarningPageReqVO reqVO) { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/warning/WarningService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/warning/WarningService.java index 9960e5ea2..4d2bc6044 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/warning/WarningService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/warning/WarningService.java @@ -44,7 +44,10 @@ public interface WarningService { * @return 危急值记录 */ WarningDO getWarning(String id); - + /* + * 通过检查ID和机构ID查询患者信息 + * */ + WarningDO getexmidororgiddata(String examid,String orgid); /** * 获得危急值记录分页 * diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/warning/WarningServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/warning/WarningServiceImpl.java index 0aa67e927..e2499ad29 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/warning/WarningServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/warning/WarningServiceImpl.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.system.service.warning; import cn.iocoder.yudao.framework.common.exception.ErrorCode; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import org.springframework.transaction.annotation.Transactional; @@ -68,6 +69,14 @@ public class WarningServiceImpl implements WarningService { return warningMapper.selectById(id); } + @Override + public WarningDO getexmidororgiddata(String examid, String orgid) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("examId", examid); + queryWrapper.eq("orgId", orgid); + return warningMapper.selectOne(queryWrapper); + } + @Override public PageResult getWarningPage(WarningPageReqVO pageReqVO) { return warningMapper.selectPage(pageReqVO); diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/PatientexamlistController.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/PatientexamlistController.java index 3f3e2fd92..6951aee7e 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/PatientexamlistController.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/PatientexamlistController.java @@ -165,11 +165,18 @@ public class PatientexamlistController { .filter(PatientexamlistDO -> (PatientexamlistDO.getDeviceType().contains("CSH1"))) .sorted(Comparator.comparing(PatientexamlistDO::getExamDate, Comparator.nullsLast(Comparator.reverseOrder()))) // 降序排序,null值排在后面 .collect(Collectors.toList()); + } else if (devicetype != null && devicetype.contains("ECG"))//表示只查询心电的数据 + { + // 筛选条件: + doList = pageResult.getList().stream() + .filter(PatientexamlistDO -> (PatientexamlistDO.getDeviceType().contains("ECG"))) + .sorted(Comparator.comparing(PatientexamlistDO::getExamDate, Comparator.nullsLast(Comparator.reverseOrder()))) // 降序排序,null值排在后面 + .collect(Collectors.toList()); } else if (devicetype != null && !devicetype.trim().isEmpty())//表示只查询影像的数据 { // 筛选条件: doList = pageResult.getList().stream() - .filter(PatientexamlistDO -> !(PatientexamlistDO.getDeviceType().contains("US")) && !(PatientexamlistDO.getDeviceType().contains("CSH1"))) + .filter(PatientexamlistDO -> !(PatientexamlistDO.getDeviceType().contains("US")) && !(PatientexamlistDO.getDeviceType().contains("CSH1")) && !(PatientexamlistDO.getDeviceType().contains("ECG"))) .sorted(Comparator.comparing(PatientexamlistDO::getExamDate, Comparator.nullsLast(Comparator.reverseOrder()))) // 降序排序,null值排在后面 .collect(Collectors.toList()); } else //devicetype为空,查询全部数据 @@ -180,6 +187,7 @@ public class PatientexamlistController { } pageResult.setList(doList); + pageResult.setTotal((long) doList.size()); return success(BeanUtils.toBean(pageResult, PatientexamlistRespVO.class)); } @@ -269,6 +277,8 @@ public class PatientexamlistController { @LogRecord(type = "检查列表", subType = "申请", bizNo = "999999", success = "ID为{{#id}}的患者申请") public CommonResult UPDATEHigOrg(@RequestParam("id") String id, @RequestParam("orgId") String orgId) { + //获取当前登陆用户 + AdminUserDO user = userService.getUser(getLoginUserId()); //先拿orgid查询出来对应的org表的上级机构代码 String hiorgid = OrgService.GetOrgHiORGId(orgId); log.debug("查询出来对应的org表的上级机构代码" + hiorgid); @@ -276,6 +286,7 @@ public class PatientexamlistController { PatientexamlistSaveReqVO updateReqVO = new PatientexamlistSaveReqVO(); updateReqVO.setId(id); updateReqVO.setHighLevelOrgId(hiorgid); + updateReqVO.setApplyhighLevelname(user.getNickname()); updateReqVO.setApplicationDate(LocalDateTime.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); patientexamlistService.updatePatientexamlist(updateReqVO); diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/PatientexamlistPageReqVO.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/PatientexamlistPageReqVO.java index b0468dc3d..e3f71821c 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/PatientexamlistPageReqVO.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/PatientexamlistPageReqVO.java @@ -117,4 +117,7 @@ public class PatientexamlistPageReqVO extends PageParam { private LocalDateTime FavouriteTime; private String pdfurl; + + private String warning; + private String applyhighLevelname; } \ No newline at end of file diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/PatientexamlistRespVO.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/PatientexamlistRespVO.java index e5f4c96a2..d8f717773 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/PatientexamlistRespVO.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/PatientexamlistRespVO.java @@ -134,4 +134,6 @@ public class PatientexamlistRespVO { private LocalDateTime FavouriteTime; private String pdfurl; + private String warning; + private String applyhighLevelname; } \ No newline at end of file diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/PatientexamlistSaveReqVO.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/PatientexamlistSaveReqVO.java index e5ccec7de..9b0225ba2 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/PatientexamlistSaveReqVO.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/PatientexamlistSaveReqVO.java @@ -110,4 +110,7 @@ public class PatientexamlistSaveReqVO { private LocalDateTime FavouriteTime; private String pdfurl; + private String warning; + private String applyhighLevelname; + } \ No newline at end of file diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/dal/dataobject/patientexamlist/PatientexamlistDO.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/dal/dataobject/patientexamlist/PatientexamlistDO.java index 0ccc86dcb..86c475be1 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/dal/dataobject/patientexamlist/PatientexamlistDO.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/dal/dataobject/patientexamlist/PatientexamlistDO.java @@ -183,4 +183,9 @@ public class PatientexamlistDO extends BaseDO { @TableField(value = "pdfurl") private String pdfurl; + @TableField(value = "applyhighLevelname") + private String applyhighLevelname; + + @TableField(value = "warning") + private String warning; } \ No newline at end of file diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/dal/mysql/patientexamlist/PatientexamlistMapper.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/dal/mysql/patientexamlist/PatientexamlistMapper.java index 9ba6dbc06..3620f46de 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/dal/mysql/patientexamlist/PatientexamlistMapper.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/dal/mysql/patientexamlist/PatientexamlistMapper.java @@ -79,12 +79,18 @@ public interface PatientexamlistMapper extends BaseMapperX { .betweenIfPresent(PatientexamlistDO::getCreateTime, reqVO.getCreateTime()) //.eqIfPresent(PatientexamlistDO::getOrgId, reqVO.getHighLevelOrgId()) .eqIfPresent(PatientexamlistDO::getIsFavourite, reqVO.getIsFavourite()) - .eq(PatientexamlistDO::getOrgId, reqVO.getOrgId()) // 始终添加orgId条件 - .or(wrapper -> { - // if (reqVO.getHighLevelOrgId() != null) { - wrapper.eq(PatientexamlistDO::getHighLevelOrgId, reqVO.getOrgId()); - // } - }) + // .eq(PatientexamlistDO::getOrgId, reqVO.getOrgId()) // 始终添加orgId条件 + // 单独的LIKE条件 + .and(wrapper -> wrapper + .eq(PatientexamlistDO::getOrgId, reqVO.getOrgId()) + .or() + .eq(PatientexamlistDO::getHighLevelOrgId, reqVO.getOrgId()) + ) +// .or(wrapper -> { +// // if (reqVO.getHighLevelOrgId() != null) { +// wrapper.eq(PatientexamlistDO::getHighLevelOrgId, reqVO.getOrgId()); +// // } +// }) .orderByDesc(PatientexamlistDO::getId)); }