diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationDiagnosisAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationDiagnosisAppServiceImpl.java index 36c21c1d..cd9f8ce2 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationDiagnosisAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationDiagnosisAppServiceImpl.java @@ -36,10 +36,11 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; -import java.time.LocalDate; +import java.util.Date; import java.util.*; import static com.openhis.common.constant.CommonConstants.FieldName.DeleteFlag; +import static com.openhis.common.enums.ReportCardStatus.SUBMITTED; import static java.time.LocalDateTime.now; /** @@ -603,15 +604,16 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn * 报告单位,报告医生,报告日期 */ infectiousDiseaseReport.setReportOrg(null); - infectiousDiseaseReport.setReportDate(LocalDate.now()); + infectiousDiseaseReport.setReportDate(new Date()); // 如果状态为空,设置为草稿状态 if (infectiousDiseaseReport.getStatus() == null) { - infectiousDiseaseReport.setStatus(0); // 0-草稿 + infectiousDiseaseReport.setStatus(SUBMITTED.getValue()); //已提交。草稿状态 } log.debug("保存传染病报告卡数据getReportOrg:{}", infectiousDiseaseReport.getReportOrg()); log.debug("保存传染病报告卡数据:{}", infectiousDiseaseReport.getDeleteFlag()); log.debug("保存传染病报告卡数据,更新日期:{}",infectiousDiseaseReport.getUpdateTime()); + log.debug("保存传染病报告卡数据getStatus:{}",infectiousDiseaseReport.getStatus()); // 保存到数据库 boolean success = iInfectiousDiseaseReportService.save(infectiousDiseaseReport); diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/appservice/IInfectiousCardAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/appservice/IInfectiousCardAppService.java new file mode 100644 index 00000000..6ef9bd32 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/appservice/IInfectiousCardAppService.java @@ -0,0 +1,98 @@ +package com.openhis.web.reportManagement.appservice; + +import com.core.common.core.domain.R; +import com.openhis.web.reportManagement.dto.InfectiousCardParam; + +import javax.servlet.http.HttpServletResponse; +// import java.util.List; // 批量操作功能暂未实现 + +/** + * 传染病报卡 AppService 接口 + * + * @author system + * @date 2026-03-17 + */ +public interface IInfectiousCardAppService { + + /** + * 分页查询传染病报卡列表 + * + * @param param 查询参数 + * @param pageNo 当前页码 + * @param pageSize 每页数量 + * @return 传染病报卡列表 + */ + R listPage(InfectiousCardParam param, Integer pageNo, Integer pageSize); + + /** + * 根据 ID 查询传染病报卡详情 + * + * @param id 报卡 ID + * @return 传染病报卡详情 + */ + R getById(Long id); + + /** + * 根据卡号查询传染病报卡详情 + * + * @param cardNo 报卡编号 + * @return 传染病报卡详情 + */ + R getByCardNo(String cardNo); + + /** + * 审核传染病报卡(功能暂未实现) + * + * @param cardNo 报卡编号 + * @param auditOpinion 审核意见 + * @param status 审核状态 + * @return 结果 + */ + // R audit(String cardNo, String auditOpinion, String status); + + /** + * 退回传染病报卡(功能暂未实现) + * + * @param cardNo 报卡编号 + * @param returnReason 退回原因 + * @param status 审核状态 + * @return 结果 + */ + // R returnCard(String cardNo, String returnReason, String status); + + /** + * 批量审核传染病报卡(功能暂未实现) + * + * @param cardNos 报卡编号列表 + * @param auditOpinion 审核意见 + * @param status 审核状态 + * @return 结果 + */ + // R batchAudit(List cardNos, String auditOpinion, String status); + + /** + * 批量退回传染病报卡(功能暂未实现) + * + * @param cardNos 报卡编号列表 + * @param returnReason 退回原因 + * @param status 审核状态 + * @return 结果 + */ + // R batchReturn(List cardNos, String returnReason, String status); + + /** + * 导出传染病报卡 + * + * @param param 查询参数 + * @param response 响应对象 + */ + void export(InfectiousCardParam param, HttpServletResponse response); + + /** + * 获取科室树 + * + * @return 科室树数据 + */ + R getDeptTree(); + +} \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/appservice/impl/InfectiousCardAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/appservice/impl/InfectiousCardAppServiceImpl.java new file mode 100644 index 00000000..50001aa1 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/appservice/impl/InfectiousCardAppServiceImpl.java @@ -0,0 +1,269 @@ +package com.openhis.web.reportManagement.appservice.impl; + +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; +import com.openhis.administration.domain.InfectiousDiseaseReport; +import com.openhis.administration.domain.Organization; +import com.openhis.administration.mapper.InfectiousDiseaseReportMapper; +import com.openhis.administration.service.IOrganizationService; +import com.openhis.web.reportManagement.appservice.IInfectiousCardAppService; +import com.openhis.web.reportManagement.dto.InfectiousCardDto; +import com.openhis.web.reportManagement.dto.InfectiousCardParam; +import com.openhis.web.reportManagement.mapper.ReportManageCardMapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.Date; + import java.util.List; + +/** + * 传染病报卡 AppService 实现 + * + * @author system + * @date 2026-03-17 + */ +@Service +@Slf4j +public class InfectiousCardAppServiceImpl implements IInfectiousCardAppService { + + @Autowired + private ReportManageCardMapper reportManageCardMapper; + + @Autowired + private InfectiousDiseaseReportMapper infectiousDiseaseReportMapper; + + @Autowired + private IOrganizationService organizationService; + + /** + * 分页查询传染病报卡列表 + * @param param 查询参数 + * @param pageNo 页码 + * @param pageSize 每页条数 + * @return 报卡列表 + */ + @Override + public R listPage(InfectiousCardParam param, Integer pageNo, Integer pageSize) { + try { + Page page = new Page<>(pageNo, pageSize); + IPage resultPage = reportManageCardMapper.selectCardPage(page, param); + + JSONObject result = new JSONObject(); + result.put("rows", resultPage.getRecords()); + result.put("total", resultPage.getTotal()); + + return R.ok(result); + } catch (Exception e) { + log.error("查询传染病报卡列表失败", e); + return R.fail("查询失败:" + e.getMessage()); + } + } + + /** + * 根据 ID 查询传染病报卡详情 + * @param id 报卡 ID(实际为 cardNo) + * @return 报卡详情 + */ + @Override + public R getById(Long id) { + try { + // 注:id 参数实际是 cardNo,需要转换为 String + InfectiousCardDto dto = reportManageCardMapper.selectCardByCardNo(String.valueOf(id)); + if (dto == null) { + return R.fail("报卡不存在"); + } + return R.ok(dto); + } catch (Exception e) { + log.error("根据 ID 查询传染病报卡失败", e); + return R.fail("查询失败:" + e.getMessage()); + } + } + + /** + * 根据卡号查询传染病报卡详情 + * @param cardNo 卡号 + * @return 报卡详情 + */ + @Override + public R getByCardNo(String cardNo) { + try { + InfectiousCardDto dto = reportManageCardMapper.selectCardByCardNo(cardNo); + if (dto == null) { + return R.fail("报卡不存在"); + } + return R.ok(dto); + } catch (Exception e) { + log.error("根据卡号查询传染病报卡失败", e); + return R.fail("查询失败:" + e.getMessage()); + } + } + + /** + * 审核传染病报卡(功能暂未实现) + * @param cardNo 卡号 + * @param auditOpinion 审核意见 + * @param status 审核状态 + * @return 审核结果 + */ + // @Override + // public R audit(String cardNo, String auditOpinion, String status) { + // try { + // InfectiousDiseaseReport report = infectiousDiseaseReportMapper.selectById(cardNo); + // if (report == null) { + // return R.fail("报卡不存在"); + // } + + // report.setStatus(Integer.parseInt(status)); + // report.setUpdateTime(new Date()); + + // infectiousDiseaseReportMapper.updateById(report); + + // return R.ok("审核成功"); + // } catch (Exception e) { + // log.error("审核传染病报卡失败", e); + // return R.fail("审核失败:" + e.getMessage()); + // } + // } + + /** + * 退回传染病报卡(功能暂未实现) + * @param cardNo 卡号 + * @param returnReason 退回原因 + * @param status 退回状态 + * @return 退回结果 + */ + // @Override + // public R returnCard(String cardNo, String returnReason, String status) { + // try { + // InfectiousDiseaseReport report = infectiousDiseaseReportMapper.selectById(cardNo); + // if (report == null) { + // return R.fail("报卡不存在"); + // } + + // report.setStatus(Integer.parseInt(status)); + // report.setWithdrawReason(returnReason); + // report.setUpdateTime(new Date()); + + // infectiousDiseaseReportMapper.updateById(report); + + // return R.ok("退回成功"); + // } catch (Exception e) { + // log.error("退回传染病报卡失败", e); + // return R.fail("退回失败:" + e.getMessage()); + // } + // } + + /** + * 批量审核传染病报卡(功能暂未实现) + * @param cardNos 卡号列表 + * @param auditOpinion 审核意见 + * @param status 审核状态 + * @return 批量审核结果 + */ + // @Override + // public R batchAudit(List cardNos, String auditOpinion, String status) { + // try { + // for (String cardNo : cardNos) { + // InfectiousDiseaseReport report = infectiousDiseaseReportMapper.selectById(cardNo); + // if (report != null) { + // report.setStatus(Integer.parseInt(status)); + // report.setUpdateTime(new Date()); + // infectiousDiseaseReportMapper.updateById(report); + // } + // } + // return R.ok("批量审核成功"); + // } catch (Exception e) { + // log.error("批量审核传染病报卡失败", e); + // return R.fail("批量审核失败:" + e.getMessage()); + // } + // } + + /** + * 批量退回传染病报卡(功能暂未实现) + * @param cardNos 卡号列表 + * @param returnReason 退回原因 + * @param status 退回状态 + * @return 批量退回结果 + */ + // @Override + // public R batchReturn(List cardNos, String returnReason, String status) { + // try { + // for (String cardNo : cardNos) { + // InfectiousDiseaseReport report = infectiousDiseaseReportMapper.selectById(cardNo); + // if (report != null) { + // report.setStatus(Integer.parseInt(status)); + // report.setWithdrawReason(returnReason); + // report.setUpdateTime(new Date()); + // infectiousDiseaseReportMapper.updateById(report); + // } + // } + // return R.ok("批量退回成功"); + // } catch (Exception e) { + // log.error("批量退回传染病报卡失败", e); + // return R.fail("批量退回失败:" + e.getMessage()); + // } + // } + + /** + * 导出传染病报卡数据 + * @param param 查询参数 + * @param response HTTP 响应对象 + */ + @Override + public void export(InfectiousCardParam param, HttpServletResponse response) { + log.warn("导出功能暂未实现"); + } + + /** + * 获取科室树 + * @return 科室树数据 + */ + @Override + public R getDeptTree() { + try { + // 查询所有启用的机构/科室 + List organizations = organizationService.list(); + List tree = buildTree(organizations); + return R.ok(tree); + } catch (Exception e) { + log.error("获取科室树失败", e); + return R.fail("获取科室树失败:" + e.getMessage()); + } + } + + /** + * 构建树形结构 + */ + private List buildTree(List list) { + List tree = new ArrayList<>(); + for (Organization org : list) { + TreeNode node = new TreeNode(); + node.value = org.getId(); + node.label = org.getName(); + node.children = new ArrayList<>(); + tree.add(node); + } + return tree; + } + + /** + * 树形节点 DTO + */ + private static class TreeNode { + private Long value; + private String label; + private List children; + + public Long getValue() { return value; } + public void setValue(Long value) { this.value = value; } + public String getLabel() { return label; } + public void setLabel(String label) { this.label = label; } + public List getChildren() { return children; } + public void setChildren(List children) { this.children = children; } + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/controller/reportManagementController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/controller/reportManagementController.java new file mode 100644 index 00000000..ff92cfdc --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/controller/reportManagementController.java @@ -0,0 +1,145 @@ +package com.openhis.web.reportManagement.controller; + +import com.core.common.core.domain.R; +import com.openhis.web.reportManagement.appservice.IInfectiousCardAppService; +import com.openhis.web.reportManagement.dto.InfectiousCardParam; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +// import java.util.List; // 批量操作功能暂未实现 + +/** + * 传染病报卡管理 Controller + * + * @author wangjian963 + * @date 2026-03-17 + */ +@RestController +@RequestMapping("/report-manage/infectiousDiseaseReport") +@Slf4j +public class reportManagementController { + + @Autowired + private IInfectiousCardAppService infectiousCardAppService; + + /** + * 分页查询传染病报卡列表 + * + * @param param 查询参数 + * @param pageNo 当前页码 + * @param pageSize 每页数量 + * @return 传染病报卡列表 + */ + @GetMapping("/list-page") + public R listPage(InfectiousCardParam param, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { + return infectiousCardAppService.listPage(param, pageNo, pageSize); + } + + /** + * 根据 ID 查询传染病报卡详情 + * + * @param id 报卡 ID + * @return 传染病报卡详情 + */ + @GetMapping("/{id}") + public R getById(@PathVariable Long id) { + return infectiousCardAppService.getById(id); + } + + /** + * 根据卡号查询传染病报卡详情 + * + * @param cardNo 报卡编号 + * @return 传染病报卡详情 + */ + @GetMapping("/detail/{cardNo}") + public R getByCardNo(@PathVariable String cardNo) { + return infectiousCardAppService.getByCardNo(cardNo); + } + + /** + * 审核传染病报卡(功能暂未实现) + * + * @param cardNo 报卡编号 + * @param auditOpinion 审核意见 + * @param status 审核状态 + * @return 结果 + */ + // @PostMapping("/audit") + // public R audit(@RequestParam String cardNo, + // @RequestParam String auditOpinion, + // @RequestParam String status) { + // return infectiousCardAppService.audit(cardNo, auditOpinion, status); + // } + + /** + * 退回传染病报卡(功能暂未实现) + * + * @param cardNo 报卡编号 + * @param returnReason 退回原因 + * @param status 审核状态 + * @return 结果 + */ + // @PostMapping("/return") + // public R returnCard(@RequestParam String cardNo, + // @RequestParam String returnReason, + // @RequestParam String status) { + // return infectiousCardAppService.returnCard(cardNo, returnReason, status); + // } + + /** + * 批量审核传染病报卡(功能暂未实现) + * + * @param cardNos 报卡编号列表 + * @param auditOpinion 审核意见 + * @param status 审核状态 + * @return 结果 + */ + // @PostMapping("/batchAudit") + // public R batchAudit(@RequestBody List cardNos, + // @RequestParam String auditOpinion, + // @RequestParam String status) { + // return infectiousCardAppService.batchAudit(cardNos, auditOpinion, status); + // } + + /** + * 批量退回传染病报卡(功能暂未实现) + * + * @param cardNos 报卡编号列表 + * @param returnReason 退回原因 + * @param status 审核状态 + * @return 结果 + */ + // @PostMapping("/batchReturn") + // public R batchReturn(@RequestBody List cardNos, + // @RequestParam String returnReason, + // @RequestParam String status) { + // return infectiousCardAppService.batchReturn(cardNos, returnReason, status); + // } + + /** + * 导出传染病报卡 + * + * @param param 查询参数 + * @param response 响应对象 + */ + @PostMapping("/export") + public void export(InfectiousCardParam param, HttpServletResponse response) { + infectiousCardAppService.export(param, response); + } + + /** + * 获取科室树 + * + * @return 科室树数据 + */ + @GetMapping("/dept-tree") + public R getDeptTree() { + return infectiousCardAppService.getDeptTree(); + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/dto/InfectiousCardDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/dto/InfectiousCardDto.java new file mode 100644 index 00000000..c8ae75f0 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/dto/InfectiousCardDto.java @@ -0,0 +1,142 @@ +package com.openhis.web.reportManagement.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; + +import java.util.Date; + +/** + * 传染病报卡详情 DTO + * + * @author system + * @date 2026-03-17 + */ +@Data +public class InfectiousCardDto { + + /** 卡片编号(主键) */ + private String cardNo; + + /** 报卡名称 */ + private String cardName; + + /** 病种名称 */ + private String diseaseName; + + /** 疾病编码 */ + private String diseaseCode; + + /** 患者姓名 */ + private String patientName; + + /** 性别 (1 男/2 女/0 未知) */ + private String sex; + + /** 实足年龄 */ + private Integer age; + + /** 科室 ID */ + @JsonSerialize(using = ToStringSerializer.class) + private Long deptId; + + /** 科室名称 */ + private String deptName; + + /** 登记来源 (1 门诊/2 住院/3 急诊/4 体检) */ + private Integer registrationSource; + + /** 报告日期 */ + private Date reportDate; + + /** 状态 (0 暂存/1 待审核/2 已审核/3 已上报/4 失败/5 退回) */ + private Integer status; + + /** 证件类型 */ + private Integer idType; + + /** 证件号码 */ + private String idNo; + + /** 家长姓名 */ + private String parentName; + + /** 出生日期 */ + private Date birthday; + + /** 年龄单位 (1 岁/2 月/3 天) */ + private String ageUnit; + + /** 工作单位 */ + private String workplace; + + /** 联系电话 */ + private String phone; + + /** 紧急联系人电话 */ + private String contactPhone; + + /** 现住址省 */ + private String addressProv; + + /** 现住址市 */ + private String addressCity; + + /** 现住址县 */ + private String addressCounty; + + /** 现住址街道 */ + private String addressTown; + + /** 现住址村/居委 */ + private String addressVillage; + + /** 现住址门牌号 */ + private String addressHouse; + + /** 病人属于 */ + private Integer patientBelong; + + /** 职业 */ + private String occupation; + + /** 疾病分型 */ + private String diseaseType; + + /** 病例分类 */ + private Integer caseClass; + + /** 发病日期 */ + private Date onsetDate; + + /** 诊断日期 */ + private Date diagDate; + + /** 死亡日期 */ + private Date deathDate; + + /** 报告单位 */ + private String reportOrg; + + /** 报告医生 */ + private String reportDoc; + + /** 备注 */ + private String remark; + + /** 审核意见 */ + private String auditOpinion; + + /** 退回原因 */ + private String returnReason; + + /** 订正病名 */ + private String correctName; + + /** 退卡原因 */ + private String withdrawReason; + + /** 其他传染病 */ + private String otherDisease; + +} \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/dto/InfectiousCardParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/dto/InfectiousCardParam.java new file mode 100644 index 00000000..2b57aca7 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/dto/InfectiousCardParam.java @@ -0,0 +1,35 @@ +package com.openhis.web.reportManagement.dto; + +import lombok.Data; + +/** + * 传染病报卡查询参数 + * + * @author system + * @date 2026-03-17 + */ +@Data +public class InfectiousCardParam { + + /** 报卡编号 */ + private String cardNo; + + /** 患者姓名 */ + private String patientName; + + /** 审核状态 (0 暂存/1 待审核/2 已审核/3 已上报/4 失败/5 退回) */ + private Integer status; + + /** 登记来源 (1 门诊/2 住院/3 急诊/4 体检) */ + private Integer registrationSource; + + /** 科室 ID */ + private Long deptId; + + /** 开始日期 */ + private String startDate; + + /** 结束日期 */ + private String endDate; + +} \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/mapper/ReportManageCardMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/mapper/ReportManageCardMapper.java new file mode 100644 index 00000000..c750e350 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/mapper/ReportManageCardMapper.java @@ -0,0 +1,33 @@ +package com.openhis.web.reportManagement.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.openhis.web.reportManagement.dto.InfectiousCardDto; +import com.openhis.web.reportManagement.dto.InfectiousCardParam; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +/** + * 传染病报卡 Mapper 接口 + * + * @author system + * @date 2026-03-18 + */ +@Repository +public interface ReportManageCardMapper { + + /** + * 分页查询报卡列表(联查科室名称) + * @param page 分页对象 + * @param param 查询参数 + * @return 报卡列表 + */ + IPage selectCardPage(Page page, @Param("param") InfectiousCardParam param); + + /** + * 根据卡号查询报卡详情(联查科室名称) + * @param cardNo 卡号 + * @return 报卡详情 + */ + InfectiousCardDto selectCardByCardNo(@Param("cardNo") String cardNo); +} diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/reportManagement/InfectiousCardMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/reportManagement/InfectiousCardMapper.xml new file mode 100644 index 00000000..638f8ff5 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/reportManagement/InfectiousCardMapper.xml @@ -0,0 +1,153 @@ + + + + + + + + + + + diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/ReportCardStatus.java b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/ReportCardStatus.java new file mode 100644 index 00000000..9e388cba --- /dev/null +++ b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/enums/ReportCardStatus.java @@ -0,0 +1,68 @@ +package com.openhis.common.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 传染病报告卡状态枚举 + * 0 暂存/1 已提交=待审核/2 已审核=审核通过/3 已上报/4 失败/5 退回=审核失败 + * + * @author system + * @date 2026-03-18 + */ +@Getter +@AllArgsConstructor +public enum ReportCardStatus implements HisEnumInterface { + + DRAFT(0, "draft", "暂存"), + + SUBMITTED(1, "submitted", "已提交"), + + AUDITED(2, "audited", "已审核"), + + REPORTED(3, "reported", "已上报"), + + FAILED(4, "failed", "失败"), + + RETURNED(5, "returned", "退回"); + + @EnumValue + private final Integer value; + private final String code; + private final String info; + + /** + * 根据值获取枚举 + * @param value 状态值 + * @return 枚举对象 + */ + public static ReportCardStatus getByValue(Integer value) { + if (value == null) { + return null; + } + for (ReportCardStatus val : values()) { + if (val.getValue().equals(value)) { + return val; + } + } + return null; + } + + /** + * 根据编码获取枚举 + * @param code 状态编码 + * @return 枚举对象 + */ + public static ReportCardStatus getByCode(String code) { + if (code == null) { + return null; + } + for (ReportCardStatus val : values()) { + if (val.getCode().equals(code)) { + return val; + } + } + return null; + } +} \ No newline at end of file diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/domain/InfectiousDiseaseReport.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/domain/InfectiousDiseaseReport.java index 663fa275..71809aa9 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/domain/InfectiousDiseaseReport.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/administration/domain/InfectiousDiseaseReport.java @@ -10,8 +10,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; -import java.time.LocalDate; -import java.time.LocalDateTime; +import java.util.Date; /** * 传染病报告卡实体 @@ -30,15 +29,15 @@ public class InfectiousDiseaseReport extends HisBaseEntity { private String cardNo; /** 本次就诊ID */ - @JsonSerialize(using = ToStringSerializer.class) + // removed private Long visitId; /** 诊断记录唯一ID */ - @JsonSerialize(using = ToStringSerializer.class) + // removed private Long diagId; /** 患者主索引 */ - @JsonSerialize(using = ToStringSerializer.class) + // removed private Long patId; /** 证件类型 */ @@ -47,25 +46,25 @@ public class InfectiousDiseaseReport extends HisBaseEntity { /** 证件号码 */ private String idNo; - /** 患者姓名 */ + /** 患者姓�?*/ private String patName; /** 家长姓名(≤14岁必填) */ private String parentName; - /** 性别 1男 2女 0未知 */ + /** 性别 1�?2�?0未知 */ private String sex; /** 出生日期 */ - private LocalDate birthday; + private Date birthday; /** 实足年龄 */ private Integer age; - /** 年龄单位 1岁 2月 3天 */ + /** 年龄单位 1�?2�?3�?*/ private String ageUnit; - /** 工作单位(学生填学校) */ + /** 工作单位(学生填学校�?*/ private String workplace; /** 联系电话(患者本人电话) */ @@ -74,58 +73,58 @@ public class InfectiousDiseaseReport extends HisBaseEntity { /** 紧急联系人电话 */ private String contactPhone; - /** 现住址省 */ + /** 现住址�?*/ private String addressProv; - /** 现住址市 */ + /** 现住址�?*/ private String addressCity; - /** 现住址县 */ + /** 现住址�?*/ private String addressCounty; /** 现住址街道 */ private String addressTown; - /** 现住址村/居委 */ + /** 现住址�?居委 */ private String addressVillage; - /** 现住址门牌号 */ + /** 现住址门牌�?*/ private String addressHouse; - /** 病人属于 1本县区/2本市其他/3本省其他/4外省/5港澳台/6外籍 */ + /** 病人属于 1本县�?2本市其他/3本省其他/4外省/5港澳�?6外籍 */ private Integer patientBelong; /** 职业 */ private String occupation; - /** 疾病名称(WS 218-2020) */ + /** 疾病名称(WS 218-2020�?*/ private String diseaseCode; - /** 分型(6类必分型疾病必填) */ + /** 分型�?类必分型疾病必填�?*/ private String diseaseType; - /** 其他法定管理以及重点监测传染病 */ + /** 其他法定管理以及重点监测传染�?*/ private String otherDisease; - /** 病例分类 1疑似病例/2临床诊断病例/3确诊病例/4病原携带/5阳性检测结果 */ + /** 病例分类 1疑似病例/2临床诊断病例/3确诊病例/4病原携带/5阳性检测结�?*/ private Integer caseClass; - /** 发病日期(默认诊断时间,病原携带者填初检日期) */ - private LocalDate onsetDate; + /** 发病日期(默认诊断时间,病原携带者填初检日期�?*/ + private Date onsetDate; - /** 诊断日期(精确到小时) */ - private LocalDateTime diagDate; + /** 诊断日期(精确到小时�?*/ + private Date diagDate; /** 死亡日期(死亡病例必填) */ - private LocalDate deathDate; + private Date deathDate; /** 订正病名(订正报告必填) */ private String correctName; - /** 退卡原因(退卡时必填) */ + /** 退卡原因(退卡时必填�?*/ private String withdrawReason; - /** 报告单位(统一信用代码/医院名称) */ + /** 报告单位(统一信用代码/医院名称�?*/ private String reportOrg; /** 报告单位联系电话 */ @@ -135,15 +134,15 @@ public class InfectiousDiseaseReport extends HisBaseEntity { private String reportDoc; /** 填卡日期 */ - private LocalDate reportDate; + private Date reportDate; - /** 报卡名称代码 1-中华人民共和国传染病报告卡 */ + /** 报卡名称代码 1-中华人民共和国传染病报告�?*/ private Integer cardNameCode; /** 登记来源 1门诊/2住院 */ private Integer registrationSource; - /** 状态 0暂存 1已提交 2已审核 3已上报 4失败 5作废 */ + /** 状�?0暂存 1已提�?2已审�?3已上�?4失败 5作废 */ private Integer status; /** 失败原因(国家平台返回) */ @@ -153,10 +152,11 @@ public class InfectiousDiseaseReport extends HisBaseEntity { private String xmlContent; /** 科室ID */ + // removed @JsonSerialize(using = ToStringSerializer.class) private Long deptId; /** 医生ID */ - @JsonSerialize(using = ToStringSerializer.class) + // removed private Long doctorId; -} \ No newline at end of file +} diff --git a/openhis-ui-vue3/src/views/diseaseReportManagement/ReportManagement/api.js b/openhis-ui-vue3/src/views/diseaseReportManagement/ReportManagement/api.js new file mode 100644 index 00000000..44ce4627 --- /dev/null +++ b/openhis-ui-vue3/src/views/diseaseReportManagement/ReportManagement/api.js @@ -0,0 +1,151 @@ +import request from '@/utils/request'; + +/** + * 查询传染病报卡列表 + * @param {Object} params - 查询参数 + * @param {string} params.cardNo - 报卡编号 + * @param {string} params.patientName - 患者姓名 + * @param {string} params.status - 审核状态 + * @param {string} params.registrationSource - 登记来源 + * @param {string} params.deptId - 科室 ID + * @param {string} params.startDate - 开始日期 + * @param {string} params.endDate - 结束日期 + * @param {number} params.pageNum - 页码 + * @param {number} params.pageSize - 每页数量 + */ +export function listInfectiousCards(params) { + return request({ + url: '/report-manage/infectiousDiseaseReport/list-page', + method: 'get', + params, + }); +} + +/** + * 查询传染病报卡详情 + * @param {string} cardNo - 报卡编号 + */ +export function getInfectiousCard(cardNo) { + return request({ + url: `/report-manage/infectiousDiseaseReport/detail/${cardNo}`, + method: 'get', + }); +} + +/** + * 保存传染病报卡 + * @param {Object} data - 报卡数据 + */ +export function saveInfectiousDiseaseReport(data) { + return request({ + url: '/report-manage/infectiousDiseaseReport', + method: 'post', + data, + }); +} + +/** + * 修改传染病报卡 + * @param {Object} data - 报卡数据 + */ +export function updateInfectiousDiseaseReport(data) { + return request({ + url: '/report-manage/infectiousDiseaseReport', + method: 'put', + data, + }); +} + +/** + * 删除传染病报卡 + * @param {string} cardNo - 报卡编号 + */ +export function deleteInfectiousCard(cardNo) { + return request({ + url: `/report-manage/infectiousDiseaseReport/${cardNo}`, + method: 'delete', + }); +} + +/** + * 审核传染病报卡(功能暂未实现) + * @param {Object} data - 审核数据 + * @param {string} data.cardNo - 报卡编号 + * @param {string} data.auditOpinion - 审核意见 + * @param {string} data.status - 审核状态(2:通过) + */ +// export function auditInfectiousCard(data) { +// return request({ +// url: '/report-manage/infectiousDiseaseReport/audit', +// method: 'post', +// data, +// }); +// } + +/** + * 退回传染病报卡(功能暂未实现) + * @param {Object} data - 退回数据 + * @param {string} data.cardNo - 报卡编号 + * @param {string} data.returnReason - 退回原因 + * @param {string} data.status - 审核状态(5:审核失败) + */ +// export function returnInfectiousCard(data) { +// return request({ +// url: '/report-manage/infectiousDiseaseReport/return', +// method: 'post', +// data, +// }); +// } + +/** + * 批量审核传染病报卡(功能暂未实现) + * @param {Object} data - 批量审核数据 + * @param {Array} data.cardNos - 报卡编号数组 + * @param {string} data.auditOpinion - 审核意见 + * @param {string} data.status - 审核状态(2:通过) + */ +// export function batchAuditCards(data) { +// return request({ +// url: '/report-manage/infectiousDiseaseReport/batchAudit', +// method: 'post', +// data, +// }); +// } + +/** + * 批量退回传染病报卡(功能暂未实现) + * @param {Object} data - 批量退回数据 + * @param {Array} data.cardNos - 报卡编号数组 + * @param {string} data.returnReason - 退回原因 + * @param {string} data.status - 审核状态(5:审核失败) + */ +// export function batchReturnCards(data) { +// return request({ +// url: '/report-manage/infectiousDiseaseReport/batchReturn', +// method: 'post', +// data, +// }); +// } + +/** + * 获取科室树 + * @param {string} deptId - 科室 ID(可选) + */ +export function getDeptTree(deptId) { + return request({ + url: '/report-manage/infectiousDiseaseReport/dept-tree', + method: 'get', + params: { deptId }, + }); +} + +/** + * 查询审核记录 + * @param {string} cardNo - 报卡编号 + */ +export function getAuditRecords(cardNo) { + return request({ + url: `/report-manage/infectiousDiseaseReport/auditRecords/${cardNo}`, + method: 'get', + }); +} diff --git a/openhis-ui-vue3/src/views/diseaseReportManagement/ReportManagement/index.vue b/openhis-ui-vue3/src/views/diseaseReportManagement/ReportManagement/index.vue new file mode 100644 index 00000000..47dc1b78 --- /dev/null +++ b/openhis-ui-vue3/src/views/diseaseReportManagement/ReportManagement/index.vue @@ -0,0 +1,1396 @@ + + + + + \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/infectiousDiseaseReportDialog.vue b/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/infectiousDiseaseReportDialog.vue index 50d46b8a..92cc79ce 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/infectiousDiseaseReportDialog.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/infectiousDiseaseReportDialog.vue @@ -1314,7 +1314,7 @@ async function buildSubmitData() { reportDate: formData.reportDate || null, cardNameCode: 1, // 默认中华人民共和国传染病报告卡 registrationSource: 1, // 默认门诊 - status: 0, + status: '', deptId: props.deptId || null, doctorId: props.doctorId || null, };