feat(surgery): 完善手术管理功能模块
- 添加手术申请相关API接口,包括根据患者ID查询就诊列表功能 - 在医生工作站界面集成手术申请功能选项卡 - 实现手术管理页面的完整功能,包括手术申请的增删改查 - 添加手术排期、开始、完成等状态流转功能 - 优化手术管理页面表格展示,增加手术类型、等级、计划时间等字段 - 实现手术申请表单的完整编辑和查看模式 - 集成患者信息和就诊记录关联功能 - 添加手术室、医生、护士等资源选择功能 - 更新系统依赖配置,添加core-common模块 - 优化图标资源和manifest配置文件 - 调整患者档案和门诊记录相关状态枚举
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
package com.openhis.administration.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.openhis.common.enums.LocationStatus;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 手术室管理Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-01-04
|
||||
*/
|
||||
@Data
|
||||
@TableName("adm_operating_room")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class OperatingRoom extends HisBaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 手术室名称 */
|
||||
private String name;
|
||||
|
||||
/** 所属机构ID */
|
||||
private Long organizationId;
|
||||
|
||||
/** 位置描述 */
|
||||
private String locationDescription;
|
||||
|
||||
/** 设备配置 */
|
||||
private String equipmentConfig;
|
||||
|
||||
/** 容纳人数 */
|
||||
private Integer capacity;
|
||||
|
||||
/** 状态编码(1-启用,0-停用) */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 显示顺序 */
|
||||
private Integer displayOrder;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
public OperatingRoom() {
|
||||
this.statusEnum = LocationStatus.ACTIVE.getValue();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.openhis.administration.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.administration.domain.OperatingRoom;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 手术室Mapper接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-01-04
|
||||
*/
|
||||
@Mapper
|
||||
public interface OperatingRoomMapper extends BaseMapper<OperatingRoom> {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.openhis.administration.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.OperatingRoom;
|
||||
|
||||
/**
|
||||
* 手术室Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-01-04
|
||||
*/
|
||||
public interface IOperatingRoomService extends IService<OperatingRoom> {
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.OperatingRoom;
|
||||
import com.openhis.administration.mapper.OperatingRoomMapper;
|
||||
import com.openhis.administration.service.IOperatingRoomService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 手术室Service实现类
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-01-04
|
||||
*/
|
||||
@Service
|
||||
public class OperatingRoomServiceImpl extends ServiceImpl<OperatingRoomMapper, OperatingRoom>
|
||||
implements IOperatingRoomService {
|
||||
}
|
||||
@@ -38,10 +38,35 @@ public class Surgery extends HisBaseEntity {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/** 患者姓名 */
|
||||
@TableField("patient_name")
|
||||
private String patientName;
|
||||
|
||||
/** 就诊ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 申请医生ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@TableField("apply_doctor_id")
|
||||
private Long applyDoctorId;
|
||||
|
||||
/** 申请医生姓名 */
|
||||
@TableField("apply_doctor_name")
|
||||
private String applyDoctorName;
|
||||
|
||||
/** 申请科室ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@TableField("apply_dept_id")
|
||||
private Long applyDeptId;
|
||||
|
||||
/** 申请科室名称 */
|
||||
@TableField("apply_dept_name")
|
||||
private String applyDeptName;
|
||||
|
||||
/** 手术指征 */
|
||||
private String surgeryIndication;
|
||||
|
||||
/** 手术名称 */
|
||||
private String surgeryName;
|
||||
|
||||
@@ -49,112 +74,141 @@ public class Surgery extends HisBaseEntity {
|
||||
private String surgeryCode;
|
||||
|
||||
/** 手术类型编码 */
|
||||
@TableField("surgery_type_enum")
|
||||
private Integer surgeryTypeEnum;
|
||||
|
||||
/** 手术等级 */
|
||||
@TableField("surgery_level")
|
||||
private Integer surgeryLevel;
|
||||
|
||||
/** 手术状态 */
|
||||
@TableField("status_enum")
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 计划手术时间 */
|
||||
@TableField("planned_time")
|
||||
private Date plannedTime;
|
||||
|
||||
/** 实际开始时间 */
|
||||
@TableField("actual_start_time")
|
||||
private Date actualStartTime;
|
||||
|
||||
/** 实际结束时间 */
|
||||
@TableField("actual_end_time")
|
||||
private Date actualEndTime;
|
||||
|
||||
/** 主刀医生ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@TableField("main_surgeon_id")
|
||||
private Long mainSurgeonId;
|
||||
|
||||
/** 主刀医生姓名 */
|
||||
@TableField("main_surgeon_name")
|
||||
private String mainSurgeonName;
|
||||
|
||||
/** 助手1 ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@TableField("assistant_1_id")
|
||||
private Long assistant1Id;
|
||||
|
||||
/** 助手1 姓名 */
|
||||
@TableField("assistant_1_name")
|
||||
private String assistant1Name;
|
||||
|
||||
/** 助手2 ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@TableField("assistant_2_id")
|
||||
private Long assistant2Id;
|
||||
|
||||
/** 助手2 姓名 */
|
||||
@TableField("assistant_2_name")
|
||||
private String assistant2Name;
|
||||
|
||||
/** 麻醉医生ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@TableField("anesthetist_id")
|
||||
private Long anesthetistId;
|
||||
|
||||
/** 麻醉医生姓名 */
|
||||
@TableField("anesthetist_name")
|
||||
private String anesthetistName;
|
||||
|
||||
/** 巡回护士ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@TableField("scrub_nurse_id")
|
||||
private Long scrubNurseId;
|
||||
|
||||
/** 巡回护士姓名 */
|
||||
@TableField("scrub_nurse_name")
|
||||
private String scrubNurseName;
|
||||
|
||||
/** 麻醉方式编码 */
|
||||
@TableField("anesthesia_type_enum")
|
||||
private Integer anesthesiaTypeEnum;
|
||||
|
||||
/** 手术部位 */
|
||||
@TableField("body_site")
|
||||
private String bodySite;
|
||||
|
||||
/** 手术切口等级 */
|
||||
@TableField("incision_level")
|
||||
private Integer incisionLevel;
|
||||
|
||||
/** 手术切口愈合等级 */
|
||||
@TableField("healing_level")
|
||||
private Integer healingLevel;
|
||||
|
||||
/** 手术室 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@TableField("operating_room_id")
|
||||
private Long operatingRoomId;
|
||||
|
||||
/** 手术室名称 */
|
||||
@TableField("operating_room_name")
|
||||
private String operatingRoomName;
|
||||
|
||||
/** 执行科室ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@TableField("org_id")
|
||||
private Long orgId;
|
||||
|
||||
/** 执行科室名称 */
|
||||
@TableField("org_name")
|
||||
private String orgName;
|
||||
|
||||
/** 术前诊断 */
|
||||
@TableField("preoperative_diagnosis")
|
||||
private String preoperativeDiagnosis;
|
||||
|
||||
/** 术后诊断 */
|
||||
@TableField("postoperative_diagnosis")
|
||||
private String postoperativeDiagnosis;
|
||||
|
||||
/** 手术经过描述 */
|
||||
@TableField("surgery_description")
|
||||
private String surgeryDescription;
|
||||
|
||||
/** 术后医嘱 */
|
||||
@TableField("postoperative_advice")
|
||||
private String postoperativeAdvice;
|
||||
|
||||
/** 并发症描述 */
|
||||
@TableField("complications")
|
||||
private String complications;
|
||||
|
||||
/** 手术费用 */
|
||||
@TableField("surgery_fee")
|
||||
private BigDecimal surgeryFee;
|
||||
|
||||
/** 麻醉费用 */
|
||||
@TableField("anesthesia_fee")
|
||||
private BigDecimal anesthesiaFee;
|
||||
|
||||
/** 总费用 */
|
||||
@TableField("total_fee")
|
||||
private BigDecimal totalFee;
|
||||
|
||||
/** 备注信息 */
|
||||
@TableField("remark")
|
||||
private String remark;
|
||||
|
||||
/** 租户ID(表不存在此字段,仅用于继承基类) */
|
||||
@TableField(exist = false)
|
||||
private Integer tenantId;
|
||||
}
|
||||
}
|
||||
@@ -2,32 +2,26 @@ package com.openhis.clinical.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.openhis.clinical.domain.Surgery;
|
||||
import com.openhis.clinical.mapper.SurgeryMapper;
|
||||
import com.openhis.clinical.service.ISurgeryService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* 手术管理Service业务层处理
|
||||
*
|
||||
* @author system
|
||||
* @date 2025-12-30
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SurgeryServiceImpl extends ServiceImpl<SurgeryMapper, Surgery> implements ISurgeryService {
|
||||
|
||||
@Resource
|
||||
private SurgeryMapper surgeryMapper;
|
||||
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
/**
|
||||
* 新增手术信息
|
||||
*
|
||||
@@ -37,22 +31,53 @@ public class SurgeryServiceImpl extends ServiceImpl<SurgeryMapper, Surgery> impl
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long insertSurgery(Surgery surgery) {
|
||||
// 生成手术编号
|
||||
String surgeryNo = assignSeqUtil.getSeq("SS", 10);
|
||||
// 生成手术单号:OP+年月日+4位随机数
|
||||
String surgeryNo = generateSurgeryNo();
|
||||
surgery.setSurgeryNo(surgeryNo);
|
||||
surgery.setCreateTime(new Date());
|
||||
surgery.setUpdateTime(new Date());
|
||||
surgery.setDeleteFlag("0");
|
||||
|
||||
// 默认状态为待排期
|
||||
// 默认状态为待排期(新开)
|
||||
if (surgery.getStatusEnum() == null) {
|
||||
surgery.setStatusEnum(0);
|
||||
}
|
||||
|
||||
// 添加日志,检查字段的值
|
||||
log.info("准备插入手术记录 - applyDoctorId: {}, applyDoctorName: {}, applyDeptId: {}, applyDeptName: {}",
|
||||
surgery.getApplyDoctorId(), surgery.getApplyDoctorName(),
|
||||
surgery.getApplyDeptId(), surgery.getApplyDeptName());
|
||||
|
||||
surgeryMapper.insert(surgery);
|
||||
|
||||
// 插入后再查询一次,验证是否保存成功
|
||||
Surgery inserted = surgeryMapper.selectById(surgery.getId());
|
||||
log.info("插入后查询结果 - applyDoctorId: {}, applyDoctorName: {}, applyDeptId: {}, applyDeptName: {}",
|
||||
inserted.getApplyDoctorId(), inserted.getApplyDoctorName(),
|
||||
inserted.getApplyDeptId(), inserted.getApplyDeptName());
|
||||
|
||||
return surgery.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成手术单号
|
||||
* 格式:OP+年月日+4位随机数
|
||||
* 示例:OP2025092003
|
||||
*
|
||||
* @return 手术单号
|
||||
*/
|
||||
private String generateSurgeryNo() {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
||||
String dateStr = sdf.format(new Date());
|
||||
|
||||
// 生成4位随机数
|
||||
Random random = new Random();
|
||||
int randomNum = random.nextInt(10000);
|
||||
String randomStr = String.format("%04d", randomNum);
|
||||
|
||||
return "OP" + dateStr + randomStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改手术信息
|
||||
*
|
||||
@@ -142,4 +167,4 @@ public class SurgeryServiceImpl extends ServiceImpl<SurgeryMapper, Surgery> impl
|
||||
|
||||
return surgeryMapper.updateById(surgery) > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user