Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
2026-03-19 10:25:59 +08:00
30 changed files with 3170 additions and 294 deletions

View File

@@ -118,6 +118,7 @@ public class DoctorScheduleAppServiceImpl implements IDoctorScheduleAppService {
newSchedule.setIsStopped(doctorSchedule.getIsStopped() != null ? doctorSchedule.getIsStopped() : false);
newSchedule.setStopReason(doctorSchedule.getStopReason() != null ? doctorSchedule.getStopReason() : "");
newSchedule.setDeptId(doctorSchedule.getDeptId());
newSchedule.setRegType(doctorSchedule.getRegType() != null ? doctorSchedule.getRegType() : 0);
newSchedule.setDoctorId(doctorSchedule.getDoctorId());
// 不设置id字段让数据库自动生成
@@ -183,6 +184,7 @@ public class DoctorScheduleAppServiceImpl implements IDoctorScheduleAppService {
newSchedule.setIsStopped(doctorSchedule.getIsStopped() != null ? doctorSchedule.getIsStopped() : false);
newSchedule.setStopReason(doctorSchedule.getStopReason() != null ? doctorSchedule.getStopReason() : "");
newSchedule.setDeptId(doctorSchedule.getDeptId());
newSchedule.setRegType(doctorSchedule.getRegType() != null ? doctorSchedule.getRegType() : 0);
newSchedule.setDoctorId(doctorSchedule.getDoctorId());
// 不设置id字段让数据库自动生成
@@ -213,14 +215,48 @@ public class DoctorScheduleAppServiceImpl implements IDoctorScheduleAppService {
}
}
@Transactional
@Override
public R<?> updateDoctorSchedule(DoctorSchedule doctorSchedule) {
if (ObjectUtil.isEmpty(doctorSchedule) || ObjectUtil.isEmpty(doctorSchedule.getId())) {
return R.fail("医生排班ID不能为空");
}
// 注意:此为核心更新,暂未处理号源池和号源槽的同步更新
int result = doctorScheduleMapper.updateDoctorSchedule(doctorSchedule);
return result > 0 ? R.ok(result) : R.fail("更新排班信息失败");
if (result <= 0) {
return R.fail("更新排班信息失败");
}
// 同步更新号源池,避免查询联表时医生/诊室等字段看起来“未更新”
boolean needSyncPool = doctorSchedule.getDoctorId() != null
|| doctorSchedule.getDoctor() != null
|| doctorSchedule.getClinic() != null
|| doctorSchedule.getStartTime() != null
|| doctorSchedule.getEndTime() != null
|| doctorSchedule.getLimitNumber() != null
|| doctorSchedule.getStopReason() != null
|| doctorSchedule.getRegType() != null
|| doctorSchedule.getRegisterFee() != null;
if (needSyncPool) {
schedulePoolService.lambdaUpdate()
.eq(SchedulePool::getScheduleId, doctorSchedule.getId())
.set(doctorSchedule.getDoctorId() != null, SchedulePool::getDoctorId, doctorSchedule.getDoctorId())
.set(doctorSchedule.getDoctor() != null, SchedulePool::getDoctorName, doctorSchedule.getDoctor())
.set(doctorSchedule.getClinic() != null, SchedulePool::getClinicRoom, doctorSchedule.getClinic())
.set(doctorSchedule.getStartTime() != null, SchedulePool::getStartTime, doctorSchedule.getStartTime())
.set(doctorSchedule.getEndTime() != null, SchedulePool::getEndTime, doctorSchedule.getEndTime())
.set(doctorSchedule.getLimitNumber() != null, SchedulePool::getTotalQuota,
doctorSchedule.getLimitNumber())
.set(doctorSchedule.getStopReason() != null, SchedulePool::getStopReason, doctorSchedule.getStopReason())
.set(doctorSchedule.getRegType() != null, SchedulePool::getRegType, String.valueOf(doctorSchedule.getRegType()))
.set(doctorSchedule.getRegisterFee() != null, SchedulePool::getFee, doctorSchedule.getRegisterFee() / 100.0)
.set(doctorSchedule.getRegisterFee() != null, SchedulePool::getInsurancePrice,
doctorSchedule.getRegisterFee() / 100.0)
.update();
}
return R.ok(result);
}
/**

View File

@@ -53,7 +53,6 @@ public class DoctorScheduleController {
/*
* 新增医生排班(带具体日期)
*
* */
@PostMapping("/add-with-date")
public R<?> addDoctorScheduleWithDate(@RequestBody DoctorSchedule doctorSchedule) {
@@ -77,7 +76,7 @@ public class DoctorScheduleController {
* */
@DeleteMapping("/delete/{doctorScheduleId}")
public R<?> removeDoctorSchedule(@PathVariable Integer doctorScheduleId){
return R.ok(doctorScheduleAppService.removeDoctorSchedule(doctorScheduleId));
return doctorScheduleAppService.removeDoctorSchedule(doctorScheduleId);
}
/*

View File

@@ -1,12 +1,14 @@
package com.openhis.web.basedatamanage.appservice.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.core.common.core.domain.R;
import com.core.common.utils.AssignSeqUtil;
import com.core.common.utils.MessageUtils;
import com.core.common.utils.StringUtils;
import com.openhis.administration.domain.Organization;
import com.openhis.administration.mapper.OrganizationMapper;
import com.openhis.administration.service.IOrganizationService;
import com.openhis.common.constant.CommonConstants;
import com.openhis.common.constant.PromptMsgConstant;
@@ -35,12 +37,15 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
@Resource
private AssignSeqUtil assignSeqUtil;
@Resource
private OrganizationMapper organizationMapper;
@Override
public Page<OrganizationDto> getOrganizationTree(Integer pageNo, Integer pageSize, String name, Integer typeEnum,
List<String> classEnumList,
String sortField, String sortOrder, HttpServletRequest request) {
// 使用Page对象进行分页查询
// 使用 Page 对象进行分页查询
Page<Organization> page = new Page<>(pageNo, pageSize);
// 创建查询条件
@@ -54,7 +59,7 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
queryWrapper.eq(Organization::getTypeEnum, typeEnum);
}
if (classEnumList != null && !classEnumList.isEmpty()) {
// 使用OR条件来匹配class_enum字段中包含任一值的记录
// 使用 OR 条件来匹配 class_enum 字段中包含任一值的记录
queryWrapper.and(wrapper -> {
for (int i = 0; i < classEnumList.size(); i++) {
String classEnum = classEnumList.get(i);
@@ -63,18 +68,18 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
wrapper.and(subWrapper -> {
subWrapper.eq(Organization::getClassEnum, classEnum) // 精确匹配
.or() // 或者
.likeRight(Organization::getClassEnum, classEnum + ",") // 以"值,"开头
.likeRight(Organization::getClassEnum, classEnum + ",") // 以"值"开头
.or() // 或者
.likeLeft(Organization::getClassEnum, "," + classEnum) // 以",值"结尾
.or() // 或者
.like(Organization::getClassEnum, "," + classEnum + ","); // 在中间,被逗号包围
});
} else {
// 后续条件使用OR连接
// 后续条件使用 OR 连接
wrapper.or(subWrapper -> {
subWrapper.eq(Organization::getClassEnum, classEnum) // 精确匹配
.or() // 或者
.likeRight(Organization::getClassEnum, classEnum + ",") // 以"值,"开头
.likeRight(Organization::getClassEnum, classEnum + ",") // 以"值"开头
.or() // 或者
.likeLeft(Organization::getClassEnum, "," + classEnum) // 以",值"结尾
.or() // 或者
@@ -88,7 +93,7 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
// 执行分页查询
Page<Organization> resultPage = organizationService.page(page, queryWrapper);
// 将查询结果转为DTO并构建树结构
// 将查询结果转为 DTO 并构建树结构
List<Organization> organizationList = resultPage.getRecords();
List<OrganizationDto> orgTree = buildTree(organizationList);
@@ -109,7 +114,7 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
* @return tree
*/
private List<OrganizationDto> buildTree(List<Organization> records) {
// 按b_no的层级排序确保父节点先处理
// 按 b_no 的层级排序,确保父节点先处理
List<Organization> sortedRecords = records.stream()
.sorted(Comparator.comparingInt(r -> r.getBusNo().split("\\.").length)).collect(Collectors.toList());
@@ -131,7 +136,7 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
// 根节点
tree.add(node);
} else {
// 获取父节点的b_no去掉最后一部分
// 获取父节点的 b_no去掉最后一部分
String parentBNo = String.join(".", Arrays.copyOf(parts, parts.length - 1));
OrganizationDto parent = nodeMap.get(parentBNo);
@@ -149,7 +154,7 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
/**
* 机构信息详情
*
* @param orgId 机构信息id
* @param orgId 机构信息 id
* @return 机构信息详情
*/
@Override
@@ -159,7 +164,7 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, new Object[] { "机构信息" }));
}
// 转换为DTO对象确保数据格式一致
// 转换为 DTO 对象,确保数据格式一致
OrganizationDto organizationDto = new OrganizationDto();
BeanUtils.copyProperties(organization, organizationDto);
organizationDto
@@ -181,7 +186,7 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
@Override
public R<?> addOrEditOrganization(OrganizationDto organizationDto) {
// 新增organization信息
// 新增 organization 信息
Organization organization = new Organization();
BeanUtils.copyProperties(organizationDto, organization);
@@ -191,9 +196,9 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
} else {
// 活动标识:有效
organization.setActiveFlag(AccountStatus.ACTIVE.getValue());
// 采番bus_no三位
// 采番 bus_no 三位
String code = assignSeqUtil.getSeq(AssignSeqEnum.ORGANIZATION_BUS_NO.getPrefix(), 3);
// 如果传了上级科室 把当前的code拼到后边
// 如果传了上级科室 把当前的 code 拼到后边
if (StringUtils.isNotEmpty(organization.getBusNo())) {
organization.setBusNo(String.format(CommonConstants.Common.MONTAGE_FORMAT, organization.getBusNo(),
CommonConstants.Common.POINT, code));
@@ -203,7 +208,7 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
// 生成待发送的机构信息
organizationService.save(organization);
}
// 返回机构id
// 返回机构 id
return R.ok(organization.getId(),
MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] { "机构信息更新添加" }));
}
@@ -211,7 +216,7 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
/**
* 删除机构
*
* @param orgIds 机构信息id
* @param orgIds 机构信息 id
* @return 操作结果
*/
@Override
@@ -232,7 +237,7 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
/**
* 机构启用
*
* @param orgId 机构信息id
* @param orgId 机构信息 id
* @return 操作结果
*/
@Override
@@ -247,7 +252,7 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
/**
* 机构停用
*
* @param orgId 机构信息id
* @param orgId 机构信息 id
* @return 操作结果
*/
@Override
@@ -299,38 +304,27 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
*/
@Override
public R<?> getRegisterOrganizations(Integer pageNo, Integer pageSize, String name, String orgName) {
// 使用Page对象进行分页查询
// 使用 Page 对象进行分页查询
Page<Organization> page = new Page<>(pageNo != null ? pageNo : 1, pageSize != null ? pageSize : 10);
// 创建查询条件只查询register_flag为1的组织机构
LambdaQueryWrapper<Organization> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Organization::getRegisterFlag, 1); // 只获取挂号科室
queryWrapper.eq(Organization::getDeleteFlag, "0"); // 确保未删除
// 使用 Mapper 方法关联查询 sys_tenant 表获取租户名称
IPage<Organization> resultPage = organizationMapper.selectRegisterOrganizationsWithTenant(
page,
1, // register_flag = 1
"0", // delete_flag = '0'
name,
orgName
);
// 添加名称过滤条件
if (StringUtils.isNotEmpty(name)) {
queryWrapper.like(Organization::getName, name);
}
// 如果有机构名称筛选
if (StringUtils.isNotEmpty(orgName)) {
// 这里假设 orgName 是父机构名称,如果需要更复杂的关联查询可在此扩展
// 当前逻辑暂保持与原逻辑一致的过滤方式或根据需求调整
}
// 按编码排序
queryWrapper.orderByAsc(Organization::getBusNo);
// 执行分页查询
Page<Organization> resultPage = organizationService.page(page, queryWrapper);
// 转换为DTO对象并设置字典文本
// 转换为 DTO 对象并设置字典文本
List<OrganizationDto> organizationDtoList = resultPage.getRecords().stream().map(org -> {
OrganizationDto dto = new OrganizationDto();
BeanUtils.copyProperties(org, dto);
dto.setTypeEnum_dictText(EnumUtils.getInfoByValue(OrganizationType.class, dto.getTypeEnum()));
dto.setClassEnum_dictText(formatClassEnumDictText(dto.getClassEnum()));
dto.setActiveFlag_dictText(EnumUtils.getInfoByValue(AccountStatus.class, dto.getActiveFlag()));
// 设置租户名称
dto.setOrgName(org.getTenantName());
return dto;
}).collect(Collectors.toList());

View File

@@ -8,7 +8,6 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.experimental.Accessors;
import lombok.ToString;
import java.util.ArrayList;
import java.util.List;
@@ -60,18 +59,20 @@ public class OrganizationDto {
private Integer displayOrder;
/** 子集合 */
@ToString.Exclude
private List<OrganizationDto> children = new ArrayList<>();
/** 挂号科室标记 */
private Integer registerFlag;
/** 科室位置 */
private String location;
/** 科室简介 */
private String intro;
/** 备注 */
private String remark;
/** 租户名称 */
private String orgName;
}

View File

@@ -294,24 +294,19 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
}
/**
* 获取诊查项目列表医保类型为02
* 获取诊查项目列表医保类型为02,返回全量数据
*
* @param orgId 科室ID
* @param orgId 科室ID(兼容保留,不参与过滤)
* @return 诊查项目列表
*/
@Override
public R<?> getClinicItems(Long orgId) {
// 构建查询条件只查询医保类型为02费)的项目
// 构建查询条件只查询医保类型为02费)的项目,不按科室过滤
QueryWrapper<DiagnosisTreatmentDto> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("T2.yb_type", "02"); // 使用T2表的yb_type字段避免歧义
queryWrapper.eq("T1.delete_flag", "0"); // 只查询未删除的记录
queryWrapper.eq("T2.instance_table", "wor_activity_definition"); // 确保关联正确
// 如果提供了科室ID则过滤该科室的项目
if (orgId != null) {
queryWrapper.eq("T1.org_id", orgId); // 使用机构ID进行过滤
}
// 分页查询,设置一个较大的页大小以获取所有诊查项目
IPage<DiagnosisTreatmentDto> diseaseTreatmentPage
= activityDefinitionManageMapper.getDiseaseTreatmentPage(new Page<DiagnosisTreatmentDto>(1, 100), queryWrapper);

View File

@@ -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);

View File

@@ -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<String> cardNos, String auditOpinion, String status);
/**
* 批量退回传染病报卡(功能暂未实现)
*
* @param cardNos 报卡编号列表
* @param returnReason 退回原因
* @param status 审核状态
* @return 结果
*/
// R<?> batchReturn(List<String> cardNos, String returnReason, String status);
/**
* 导出传染病报卡
*
* @param param 查询参数
* @param response 响应对象
*/
void export(InfectiousCardParam param, HttpServletResponse response);
/**
* 获取科室树
*
* @return 科室树数据
*/
R<?> getDeptTree();
}

View File

@@ -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<InfectiousCardDto> page = new Page<>(pageNo, pageSize);
IPage<InfectiousCardDto> 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<String> 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<String> 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<Organization> organizations = organizationService.list();
List<TreeNode> tree = buildTree(organizations);
return R.ok(tree);
} catch (Exception e) {
log.error("获取科室树失败", e);
return R.fail("获取科室树失败:" + e.getMessage());
}
}
/**
* 构建树形结构
*/
private List<TreeNode> buildTree(List<Organization> list) {
List<TreeNode> 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<TreeNode> 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<TreeNode> getChildren() { return children; }
public void setChildren(List<TreeNode> children) { this.children = children; }
}
}

View File

@@ -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<String> 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<String> 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();
}
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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<InfectiousCardDto> selectCardPage(Page<InfectiousCardDto> page, @Param("param") InfectiousCardParam param);
/**
* 根据卡号查询报卡详情(联查科室名称)
* @param cardNo 卡号
* @return 报卡详情
*/
InfectiousCardDto selectCardByCardNo(@Param("cardNo") String cardNo);
}

View File

@@ -23,6 +23,7 @@
is_stopped,
stop_reason,
dept_id,
reg_type,
doctor_id
<if test="createTime != null">, create_time</if>
<if test="updateTime != null">, update_time</if>
@@ -43,6 +44,7 @@
#{isStopped},
#{stopReason},
#{deptId},
#{regType},
#{doctorId}
<if test="createTime != null">, #{createTime}</if>
<if test="updateTime != null">, #{updateTime}</if>
@@ -68,6 +70,7 @@
<if test="isStopped != null">is_stopped = #{isStopped},</if>
<if test="stopReason != null">stop_reason = #{stopReason},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="regType != null">reg_type = #{regType},</if>
<if test="doctorId != null">doctor_id = #{doctorId},</if>
<if test="updateTime != null">update_time = #{updateTime}</if>
</set>
@@ -97,12 +100,16 @@
ds.is_stopped AS is_stopped,
ds.stop_reason AS stop_reason,
ds.dept_id AS dept_id,
ds.reg_type AS reg_type,
sp.doctor_id AS doctor_id,
sp.schedule_date AS schedule_date
FROM adm_doctor_schedule ds
LEFT JOIN adm_schedule_pool sp ON sp.schedule_id = ds.id
AND sp.delete_flag = '0'
LEFT JOIN adm_organization org ON ds.dept_id = org.id
AND org.delete_flag = '0'
WHERE ds.dept_id = #{deptId}
AND ds.delete_flag = '0'
AND sp.schedule_date BETWEEN #{startDate}::date AND #{endDate}::date
ORDER BY sp.schedule_date, ds.time_period
</select>
@@ -129,12 +136,16 @@
ds.is_stopped AS is_stopped,
ds.stop_reason AS stop_reason,
ds.dept_id AS dept_id,
ds.reg_type AS reg_type,
sp.doctor_id AS doctor_id,
sp.schedule_date AS schedule_date
FROM adm_doctor_schedule ds
INNER JOIN adm_schedule_pool sp ON sp.schedule_id = ds.id
AND sp.delete_flag = '0'
LEFT JOIN adm_organization org ON ds.dept_id = org.id
AND org.delete_flag = '0'
WHERE sp.schedule_date = #{today}::date
AND ds.delete_flag = '0'
AND (ds.is_stopped = false OR ds.is_stopped IS NULL)
ORDER BY ds.time_period
</select>
@@ -161,12 +172,16 @@
ds.is_stopped AS is_stopped,
ds.stop_reason AS stop_reason,
ds.dept_id AS dept_id,
ds.reg_type AS reg_type,
sp.doctor_id AS doctor_id,
sp.schedule_date AS schedule_date
FROM adm_doctor_schedule ds
INNER JOIN adm_schedule_pool sp ON sp.schedule_id = ds.id
AND sp.delete_flag = '0'
LEFT JOIN adm_organization org ON ds.dept_id = org.id
AND org.delete_flag = '0'
WHERE sp.schedule_date = #{today}::date
AND ds.delete_flag = '0'
AND sp.doctor_id = #{doctorId}
AND (ds.is_stopped = false OR ds.is_stopped IS NULL)
ORDER BY ds.time_period

View File

@@ -0,0 +1,153 @@
<?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.openhis.web.reportManagement.mapper.ReportManageCardMapper">
<!-- 分页查询报卡列表 -->
<select id="selectCardPage" resultType="com.openhis.web.reportManagement.dto.InfectiousCardDto">
SELECT
t1.card_no AS cardNo,
'传染病报告卡' AS cardName,
t1.disease_code AS diseaseCode,
CASE
WHEN t1.disease_code = '0101' THEN '鼠疫'
WHEN t1.disease_code = '0102' THEN '霍乱'
WHEN t1.disease_code = '0201' THEN '传染性非典型肺炎'
WHEN t1.disease_code = '0202' THEN '艾滋病'
WHEN t1.disease_code = '0203' THEN '病毒性肝炎'
WHEN t1.disease_code = '0211' THEN '炭疽'
WHEN t1.disease_code = '0213' THEN '肺结核'
WHEN t1.disease_code = '0222' THEN '梅毒'
WHEN t1.disease_code = '0224' THEN '血吸虫病'
WHEN t1.disease_code = '0225' THEN '疟疾'
WHEN t1.disease_code = '0301' THEN '流行性感冒'
WHEN t1.disease_code = '0302' THEN '流行性腮腺炎'
WHEN t1.disease_code = '0303' THEN '风疹'
WHEN t1.disease_code = '0310' THEN '其它感染性腹泻病'
WHEN t1.disease_code = '0311' THEN '手足口病'
ELSE t1.disease_code
END AS diseaseName,
t1.pat_name AS patientName,
t1.sex AS sex,
t1.age AS age,
t1.dept_id AS deptId,
t2.name AS deptName,
t1.registration_source AS registrationSource,
t1.report_date AS reportDate,
t1.status AS status,
t1.id_type AS idType,
t1.id_no AS idNo,
t1.parent_name AS parentName,
t1.birthday AS birthday,
t1.age_unit AS ageUnit,
t1.workplace AS workplace,
t1.phone AS phone,
t1.contact_phone AS contactPhone,
t1.address_prov AS addressProv,
t1.address_city AS addressCity,
t1.address_county AS addressCounty,
t1.address_town AS addressTown,
t1.address_village AS addressVillage,
t1.address_house AS addressHouse,
t1.patient_belong AS patientBelong,
t1.occupation AS occupation,
t1.disease_type AS diseaseType,
t1.case_class AS caseClass,
t1.onset_date AS onsetDate,
t1.diag_date AS diagDate,
t1.death_date AS deathDate,
t1.report_org AS reportOrg,
t1.report_doc AS reportDoc,
t1.withdraw_reason AS withdrawReason,
t1.correct_name AS correctName,
t1.other_disease AS otherDisease
FROM infectious_card t1
LEFT JOIN adm_organization t2 ON t1.dept_id = t2.id
WHERE t1.delete_flag = '0'
<if test="param.cardNo != null and param.cardNo != ''">
AND t1.card_no = #{param.cardNo}
</if>
<if test="param.patientName != null and param.patientName != ''">
AND t1.pat_name LIKE CONCAT('%', #{param.patientName}, '%')
</if>
<if test="param.status != null">
AND t1.status = #{param.status}
</if>
<if test="param.registrationSource != null">
AND t1.registration_source = #{param.registrationSource}
</if>
<if test="param.deptId != null">
AND t1.dept_id = #{param.deptId}
</if>
<if test="param.startDate != null and param.startDate != ''">
AND t1.report_date &gt;= TO_DATE(#{param.startDate}, 'YYYY-MM-DD')
</if>
<if test="param.endDate != null and param.endDate != ''">
AND t1.report_date &lt;= TO_DATE(#{param.endDate}, 'YYYY-MM-DD')
</if>
ORDER BY t1.report_date DESC
</select>
<!-- 根据卡号查询报卡详情 -->
<select id="selectCardByCardNo" resultType="com.openhis.web.reportManagement.dto.InfectiousCardDto">
SELECT
t1.card_no AS cardNo,
'传染病报告卡' AS cardName,
t1.disease_code AS diseaseCode,
CASE
WHEN t1.disease_code = '0101' THEN '鼠疫'
WHEN t1.disease_code = '0102' THEN '霍乱'
WHEN t1.disease_code = '0201' THEN '传染性非典型肺炎'
WHEN t1.disease_code = '0202' THEN '艾滋病'
WHEN t1.disease_code = '0203' THEN '病毒性肝炎'
WHEN t1.disease_code = '0211' THEN '炭疽'
WHEN t1.disease_code = '0213' THEN '肺结核'
WHEN t1.disease_code = '0222' THEN '梅毒'
WHEN t1.disease_code = '0224' THEN '血吸虫病'
WHEN t1.disease_code = '0225' THEN '疟疾'
WHEN t1.disease_code = '0301' THEN '流行性感冒'
WHEN t1.disease_code = '0302' THEN '流行性腮腺炎'
WHEN t1.disease_code = '0303' THEN '风疹'
WHEN t1.disease_code = '0310' THEN '其它感染性腹泻病'
WHEN t1.disease_code = '0311' THEN '手足口病'
ELSE t1.disease_code
END AS diseaseName,
t1.pat_name AS patientName,
t1.sex AS sex,
t1.age AS age,
t1.dept_id AS deptId,
t2.name AS deptName,
t1.registration_source AS registrationSource,
t1.report_date AS reportDate,
t1.status AS status,
t1.id_type AS idType,
t1.id_no AS idNo,
t1.parent_name AS parentName,
t1.birthday AS birthday,
t1.age_unit AS ageUnit,
t1.workplace AS workplace,
t1.phone AS phone,
t1.contact_phone AS contactPhone,
t1.address_prov AS addressProv,
t1.address_city AS addressCity,
t1.address_county AS addressCounty,
t1.address_town AS addressTown,
t1.address_village AS addressVillage,
t1.address_house AS addressHouse,
t1.patient_belong AS patientBelong,
t1.occupation AS occupation,
t1.disease_type AS diseaseType,
t1.case_class AS caseClass,
t1.onset_date AS onsetDate,
t1.diag_date AS diagDate,
t1.death_date AS deathDate,
t1.report_org AS reportOrg,
t1.report_doc AS reportDoc,
t1.withdraw_reason AS withdrawReason,
t1.correct_name AS correctName,
t1.other_disease AS otherDisease
FROM infectious_card t1
LEFT JOIN adm_organization t2 ON t1.dept_id = t2.id
WHERE t1.delete_flag = '0' AND t1.card_no = #{cardNo}
</select>
</mapper>

View File

@@ -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;
}
}

View File

@@ -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;
/** 患者姓*/
/** 患者姓<EFBFBD>?*/
private String patName;
/** 家长姓名≤14岁必填 */
private String parentName;
/** 性别 1男 2女 0未知 */
/** 性别 1<EFBFBD>?2<>?0未知 */
private String sex;
/** 出生日期 */
private LocalDate birthday;
private Date birthday;
/** 实足年龄 */
private Integer age;
/** 年龄单位 1岁 2月 3天 */
/** 年龄单位 1<EFBFBD>?2<>?3<>?*/
private String ageUnit;
/** 工作单位(学生填学校 */
/** 工作单位(学生填学校<EFBFBD>?*/
private String workplace;
/** 联系电话(患者本人电话) */
@@ -74,58 +73,58 @@ public class InfectiousDiseaseReport extends HisBaseEntity {
/** 紧急联系人电话 */
private String contactPhone;
/** 现住址*/
/** 现住址<EFBFBD>?*/
private String addressProv;
/** 现住址*/
/** 现住址<EFBFBD>?*/
private String addressCity;
/** 现住址*/
/** 现住址<EFBFBD>?*/
private String addressCounty;
/** 现住址街道 */
private String addressTown;
/** 现住址村/居委 */
/** 现住址<EFBFBD>?居委 */
private String addressVillage;
/** 现住址门牌*/
/** 现住址门牌<EFBFBD>?*/
private String addressHouse;
/** 病人属于 1本县区/2本市其他/3本省其他/4外省/5港澳台/6外籍 */
/** 病人属于 1本县<EFBFBD>?2本市其他/3本省其他/4外省/5港澳<EFBFBD>?6外籍 */
private Integer patientBelong;
/** 职业 */
private String occupation;
/** 疾病名称WS 218-2020 */
/** 疾病名称WS 218-2020<EFBFBD>?*/
private String diseaseCode;
/** 分型6类必分型疾病必填 */
/** 分型<EFBFBD>?类必分型疾病必填<EFBFBD>?*/
private String diseaseType;
/** 其他法定管理以及重点监测传染*/
/** 其他法定管理以及重点监测传染<EFBFBD>?*/
private String otherDisease;
/** 病例分类 1疑似病例/2临床诊断病例/3确诊病例/4病原携带/5阳性检测结*/
/** 病例分类 1疑似病例/2临床诊断病例/3确诊病例/4病原携带/5阳性检测结<EFBFBD>?*/
private Integer caseClass;
/** 发病日期(默认诊断时间,病原携带者填初检日期 */
private LocalDate onsetDate;
/** 发病日期(默认诊断时间,病原携带者填初检日期<EFBFBD>?*/
private Date onsetDate;
/** 诊断日期(精确到小时 */
private LocalDateTime diagDate;
/** 诊断日期(精确到小时<EFBFBD>?*/
private Date diagDate;
/** 死亡日期(死亡病例必填) */
private LocalDate deathDate;
private Date deathDate;
/** 订正病名(订正报告必填) */
private String correctName;
/** 退卡原因(退卡时必填 */
/** 退卡原因(退卡时必填<EFBFBD>?*/
private String withdrawReason;
/** 报告单位(统一信用代码/医院名称 */
/** 报告单位(统一信用代码/医院名称<EFBFBD>?*/
private String reportOrg;
/** 报告单位联系电话 */
@@ -135,15 +134,15 @@ public class InfectiousDiseaseReport extends HisBaseEntity {
private String reportDoc;
/** 填卡日期 */
private LocalDate reportDate;
private Date reportDate;
/** 报卡名称代码 1-中华人民共和国传染病报告*/
/** 报卡名称代码 1-中华人民共和国传染病报告<EFBFBD>?*/
private Integer cardNameCode;
/** 登记来源 1门诊/2住院 */
private Integer registrationSource;
/** 状0暂存 1已提2已审3已上4失败 5作废 */
/** 状<EFBFBD>?0暂存 1已提<EFBFBD>?2已审<EFBFBD>?3已上<EFBFBD>?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;
}
}

View File

@@ -1,6 +1,7 @@
package com.openhis.administration.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.core.common.core.domain.HisBaseEntity;
@@ -91,4 +92,8 @@ public class Organization extends HisBaseEntity {
/** 备注 */
private String remark;
/** 租户名称(从 sys_tenant 表关联查询,非数据库字段) */
@TableField(exist = false)
private String tenantName;
}

View File

@@ -1,6 +1,8 @@
package com.openhis.administration.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.openhis.administration.domain.Organization;
import com.openhis.administration.dto.OrgDataDto;
import org.apache.ibatis.annotations.Param;
@@ -9,7 +11,7 @@ import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 机构管理Mapper接口
* 机构管理 Mapper 接口
*
* @author system
* @date 2025-02-20
@@ -25,5 +27,21 @@ public interface OrganizationMapper extends BaseMapper<Organization> {
**/
List<OrgDataDto> searchOrgDataByHealth();
}
/**
* 分页查询挂号科室列表,关联租户表获取租户名称
* @param page 分页对象
* @param registerFlag 挂号标记
* @param deleteFlag 删除标记
* @param name 机构名称
* @param orgName 机构名称筛选
* @return 分页结果
*/
@InterceptorIgnore(tenantLine = "true")
IPage<Organization> selectRegisterOrganizationsWithTenant(
IPage<Organization> page,
@Param("registerFlag") Integer registerFlag,
@Param("deleteFlag") String deleteFlag,
@Param("name") String name,
@Param("orgName") String orgName
);
}

View File

@@ -72,6 +72,9 @@ public class DoctorSchedule extends HisBaseEntity {
/** 关联科室id */
private Long deptId;
/** 号别0=普通1=专家 */
private Integer regType;
/** 医生ID - 不映射到数据库表字段,仅作传输使用 */
private Long doctorId;

View File

@@ -61,6 +61,9 @@ public class DoctorScheduleWithDateDto {
/** 关联科室ID */
private Long deptId;
/** 号别0=普通1=专家 */
private Integer regType;
/** 医生姓名 */
private String doctorName;

View File

@@ -14,5 +14,54 @@
GROUP BY heal.offered_org_id)
</select>
<!-- 分页查询挂号科室列表,关联租户表获取租户名称 -->
<select id="selectRegisterOrganizationsWithTenant" resultType="com.openhis.administration.domain.Organization">
SELECT
org.id,
org.bus_no,
org.name,
org.active_flag,
org.type_enum,
org.class_enum,
org.py_str,
org.wb_str,
org.yb_no,
org.yb_name,
org.caty,
org.display_order,
org.medins_id,
org.medins_admdvs,
org.medins_type,
org.medins_lv,
org.def_doctor_id,
org.register_flag,
org.location,
org.intro,
org.remark,
org.tenant_id,
org.delete_flag,
org.create_by,
org.create_time,
org.update_by,
org.update_time,
st.tenant_name AS tenantName
FROM adm_organization org
LEFT JOIN sys_tenant st ON org.tenant_id = st.id
<where>
<if test="registerFlag != null">
AND org.register_flag = #{registerFlag}
</if>
<if test="deleteFlag != null">
AND org.delete_flag = #{deleteFlag}
</if>
<if test="name != null and name != ''">
AND org.name LIKE CONCAT('%', #{name}, '%')
</if>
<if test="orgName != null and orgName != ''">
AND st.tenant_name = #{orgName}
</if>
</where>
ORDER BY org.bus_no ASC
</select>
</mapper>
</mapper>