Compare commits
7 Commits
fix/BUG#61
...
xunyu
| Author | SHA1 | Date | |
|---|---|---|---|
| 775785df21 | |||
| 154decbaa1 | |||
| 5a5d8fa904 | |||
| b1a3f5d762 | |||
| 956c048058 | |||
| f9487664fc | |||
| d9a8ab3e1e |
@@ -1,87 +0,0 @@
|
||||
package com.openhis.web.appointment.service;
|
||||
|
||||
import com.openhis.web.appointment.entity.Appointment;
|
||||
import com.openhis.web.appointment.mapper.AppointmentMapper;
|
||||
import com.openhis.web.appointment.mapper.ScheduleSlotMapper;
|
||||
import com.openhis.web.appointment.mapper.OrderMainMapper;
|
||||
import com.openhis.web.appointment.mapper.SchedulePoolMapper;
|
||||
import com.openhis.web.appointment.mapper.RefundLogMapper;
|
||||
import com.openhis.web.appointment.dto.AppointmentParam;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 门诊预约挂号服务实现
|
||||
*/
|
||||
@Service
|
||||
public class AppointmentServiceImpl implements AppointmentService {
|
||||
|
||||
private final AppointmentMapper appointmentMapper;
|
||||
private final ScheduleSlotMapper scheduleSlotMapper;
|
||||
private final OrderMainMapper orderMainMapper;
|
||||
private final SchedulePoolMapper schedulePoolMapper;
|
||||
private final RefundLogMapper refundLogMapper;
|
||||
|
||||
public AppointmentServiceImpl(AppointmentMapper appointmentMapper,
|
||||
ScheduleSlotMapper scheduleSlotMapper,
|
||||
OrderMainMapper orderMainMapper,
|
||||
SchedulePoolMapper schedulePoolMapper,
|
||||
RefundLogMapper refundLogMapper) {
|
||||
this.appointmentMapper = appointmentMapper;
|
||||
this.scheduleSlotMapper = scheduleSlotMapper;
|
||||
this.orderMainMapper = orderMainMapper;
|
||||
this.schedulePoolMapper = schedulePoolMapper;
|
||||
this.refundLogMapper = refundLogMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean createAppointment(AppointmentParam param) {
|
||||
Appointment appointment = new Appointment();
|
||||
appointment.setPatientId(param.getPatientId());
|
||||
appointment.setScheduleId(param.getScheduleId());
|
||||
appointment.setDoctorId(param.getDoctorId());
|
||||
appointment.setDeptId(param.getDeptId());
|
||||
appointment.setVisitDate(param.getVisitDate());
|
||||
appointment.setCreateTime(LocalDateTime.now());
|
||||
|
||||
// 1. 保存预约记录
|
||||
appointmentMapper.insert(appointment);
|
||||
|
||||
// 2. 累加号源池已预约数(已实现的原子操作)
|
||||
schedulePoolMapper.incrementBookedNum(param.getScheduleId());
|
||||
|
||||
// 3. 创建订单并完成支付(简化示例,实际业务已在后续代码中实现)
|
||||
Long orderId = orderMainMapper.insertOrder(appointment.getId(),
|
||||
param.getAmount(), LocalDateTime.now());
|
||||
return orderId != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bug #574 Fix: 预约签到缴费成功后,更新号源时段状态为“已取号”(status=3)
|
||||
* 修复原流程中遗漏调用 scheduleSlotMapper.updateStatusToTaken 导致状态滞留为 1 的问题
|
||||
*
|
||||
* @param orderId 订单ID
|
||||
* @param slotId 号源时段ID
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean checkInAndPay(Long orderId, Long slotId) {
|
||||
if (orderId == null || slotId == null) {
|
||||
throw new IllegalArgumentException("订单ID或号源时段ID不能为空");
|
||||
}
|
||||
|
||||
// 核心修复:显式调用 Mapper 将 adm_schedule_slot.status 更新为 3(已取号/签到)
|
||||
int rows = scheduleSlotMapper.updateStatusToTaken(slotId);
|
||||
if (rows <= 0) {
|
||||
throw new RuntimeException("更新号源时段状态失败,未找到对应记录或状态已变更");
|
||||
}
|
||||
|
||||
// 此处可补充订单状态流转逻辑(如 orderMainMapper.updateOrderStatus(orderId, 2))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,7 @@ import com.openhis.web.outpatientmanage.mapper.OutpatientTreatmentAppMapper;
|
||||
import com.openhis.workflow.domain.DeviceDispense;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
import java.math.BigDecimal;
|
||||
import com.openhis.workflow.service.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -228,6 +229,66 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
if (e.getBirthDate() != null) {
|
||||
e.setAge(AgeCalculatorUtil.getAge(e.getBirthDate()));
|
||||
}
|
||||
// Bug #595: 医嘱校对新增字段
|
||||
// 单次剂量(前端兼容)
|
||||
e.setSingleDose(e.getDose());
|
||||
// 总金额(前端兼容)
|
||||
e.setTotalCost(e.getTotalPrice());
|
||||
// 医嘱号(前端兼容)
|
||||
e.setOrderNo(String.valueOf(e.getRequestId()));
|
||||
// 床号(前端兼容)
|
||||
e.setBedNo(e.getBedName());
|
||||
// 医嘱项目名称(前端兼容)
|
||||
e.setItemName(e.getAdviceName());
|
||||
// 总量(前端兼容)
|
||||
if (e.getDose() != null && e.getQuantity() != null) {
|
||||
e.setTotalAmount(e.getDose().multiply(BigDecimal.valueOf(e.getQuantity())));
|
||||
e.setTotalQuantity(e.getTotalAmount());
|
||||
} else if (e.getQuantity() != null) {
|
||||
BigDecimal qty = BigDecimal.valueOf(e.getQuantity());
|
||||
e.setTotalAmount(qty);
|
||||
e.setTotalQuantity(qty);
|
||||
}
|
||||
// 停嘱时间(前端兼容)
|
||||
e.setStopTime(e.getEndTime());
|
||||
// 诊断(前端兼容)
|
||||
e.setDiagnosis(e.getConditionNames());
|
||||
// 医嘱内容(前端兼容)
|
||||
e.setOrderContent(e.getAdviceName());
|
||||
// 开嘱医生(前端兼容)
|
||||
if (e.getRequesterId_dictText() != null) {
|
||||
e.setOrderingDoctor(e.getRequesterId_dictText());
|
||||
} else if (e.getAdmittingDoctorName() != null) {
|
||||
e.setOrderingDoctor(e.getAdmittingDoctorName());
|
||||
}
|
||||
// 频次/用法组合显示
|
||||
StringBuilder freqUsage = new StringBuilder();
|
||||
if (e.getRateCode_dictText() != null) {
|
||||
freqUsage.append(e.getRateCode_dictText());
|
||||
} else if (e.getRateCode() != null) {
|
||||
freqUsage.append(e.getRateCode());
|
||||
}
|
||||
if (e.getMethodCode_dictText() != null) {
|
||||
if (freqUsage.length() > 0) freqUsage.append(" ");
|
||||
freqUsage.append(e.getMethodCode_dictText());
|
||||
} else if (e.getMethodCode() != null) {
|
||||
if (freqUsage.length() > 0) freqUsage.append(" ");
|
||||
freqUsage.append(e.getMethodCode());
|
||||
}
|
||||
e.setFrequencyUsage(freqUsage.length() > 0 ? freqUsage.toString() : null);
|
||||
// 是否注射药物
|
||||
e.setIsInjection(e.getInjectFlag() != null && e.getInjectFlag() == 1);
|
||||
// 皮试状态
|
||||
if (e.getSkinTestFlag() != null && e.getSkinTestFlag() == 1) {
|
||||
e.setSkinTestStatus(e.getSkinTestFlag_enumText());
|
||||
e.setSkinTestHighlight(true);
|
||||
} else if (e.getSkinTestFlag() != null && e.getSkinTestFlag() == 2) {
|
||||
e.setSkinTestStatus("皮试通过");
|
||||
e.setSkinTestHighlight(false);
|
||||
} else {
|
||||
e.setSkinTestStatus("无需");
|
||||
e.setSkinTestHighlight(false);
|
||||
}
|
||||
});
|
||||
|
||||
// 获取医嘱列表
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.web.common.dto.PerformInfoDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.AdviceExecuteParam;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inhospitalnursestation.appservice.IAdviceProcessAppService;
|
||||
import com.openhis.web.inhospitalnursestation.dto.AdmissionPageParam;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientAdviceParam;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 护士站医嘱处理 controller
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-08-07
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/nurse-station/advice-process")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class AdviceProcessController {
|
||||
|
||||
@Resource
|
||||
private IAdviceProcessAppService adviceProcessAppService;
|
||||
|
||||
/**
|
||||
* 住院患者分页列表
|
||||
*
|
||||
* @param admissionPageParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param request 请求数据
|
||||
* @return 住院患者分页列表
|
||||
*/
|
||||
@GetMapping(value = "/inpatient")
|
||||
public R<?> getInpatientPage(AdmissionPageParam admissionPageParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) {
|
||||
return adviceProcessAppService.getInpatientPage(admissionPageParam, pageNo, pageSize, searchKey, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 住院患者医嘱查询
|
||||
*
|
||||
* @param inpatientAdviceParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @return 住院患者医
|
||||
*/
|
||||
@GetMapping(value = "/inpatient-advice")
|
||||
public R<?> getInpatientAdvicePage(InpatientAdviceParam inpatientAdviceParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
return adviceProcessAppService.getInpatientAdvicePage(inpatientAdviceParam, pageNo, pageSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱校对通过
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping(value = "/advice-verify")
|
||||
public R<?> adviceVerify(@RequestBody List<PerformInfoDto> performInfoList) {
|
||||
return adviceProcessAppService.adviceVerify(performInfoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱退回
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping(value = "/advice-reject")
|
||||
public R<?> adviceReject(@RequestBody List<PerformInfoDto> performInfoList) {
|
||||
return adviceProcessAppService.adviceReject(performInfoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱执行
|
||||
*
|
||||
* @param adviceExecuteParam 医嘱执行参数
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping(value = "/advice-execute")
|
||||
public R<?> adviceExecute(@RequestBody AdviceExecuteParam adviceExecuteParam) {
|
||||
return adviceProcessAppService.adviceExecute(adviceExecuteParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱取消执行
|
||||
*
|
||||
* @param adviceExecuteParam 取消执行参数
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping(value = "/advice-cancel")
|
||||
public R<?> adviceCancel(@RequestBody AdviceExecuteParam adviceExecuteParam) {
|
||||
return adviceProcessAppService.adviceCancel(adviceExecuteParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱不执行
|
||||
*
|
||||
* @param adviceExecuteParam 不执行参数
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping(value = "/advice-void")
|
||||
public R<?> adviceVoid(@RequestBody AdviceExecuteParam adviceExecuteParam) {
|
||||
return adviceProcessAppService.adviceVoid(adviceExecuteParam);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 入出转管理页面初始化dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-07-30
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ATDManageInitDto {
|
||||
|
||||
/**
|
||||
* 住院状态
|
||||
*/
|
||||
private List<ATDManageInitDto.encounterStatusOption> encounterStatusOptions;
|
||||
|
||||
/**
|
||||
* 床位状态
|
||||
*/
|
||||
private List<ATDManageInitDto.bedStatusOption> bedStatusOptions;
|
||||
|
||||
/**
|
||||
* 患者病情
|
||||
*/
|
||||
private List<ATDManageInitDto.priorityOption> priorityOptions;
|
||||
|
||||
/**
|
||||
* 住院状态
|
||||
*/
|
||||
@Data
|
||||
public static class encounterStatusOption {
|
||||
private Integer value;
|
||||
private String label;
|
||||
|
||||
public encounterStatusOption(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 床位状态
|
||||
*/
|
||||
@Data
|
||||
public static class bedStatusOption {
|
||||
private Integer value;
|
||||
private String label;
|
||||
|
||||
public bedStatusOption(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 患者病情
|
||||
*/
|
||||
@Data
|
||||
public static class priorityOption {
|
||||
private Integer value;
|
||||
private String label;
|
||||
|
||||
public priorityOption(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 入院床位 Dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025/7/29
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdmissionBedPageDto {
|
||||
|
||||
/**
|
||||
* 入院ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 住院号
|
||||
*/
|
||||
private String busNo;
|
||||
|
||||
/**
|
||||
* 住院状态
|
||||
*/
|
||||
private Integer encounterStatus;
|
||||
private String encounterStatus_enumText;
|
||||
|
||||
/**
|
||||
* 入院科室
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
|
||||
/** 患者姓名 */
|
||||
private String patientName;
|
||||
|
||||
/** 病区ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long wardId;
|
||||
|
||||
/**
|
||||
* 病区名称
|
||||
*/
|
||||
private String wardName;
|
||||
|
||||
/** 病房ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long houseId;
|
||||
|
||||
/**
|
||||
* 病房名称
|
||||
*/
|
||||
private String houseName;
|
||||
|
||||
/** 病床ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long bedId;
|
||||
|
||||
/**
|
||||
* 病床名称
|
||||
*/
|
||||
private String bedName;
|
||||
|
||||
/** 床位状态 */
|
||||
private Integer bedStatus;
|
||||
private String bedStatus_enumText;
|
||||
|
||||
/** 余额 */
|
||||
private BigDecimal balanceAmount;
|
||||
|
||||
/** 总额 */
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/** 性别编码 */
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 生日 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date birthDate;
|
||||
|
||||
/** 病人年龄 */
|
||||
private String age;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 入院分页查询条件
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdmissionPageParam {
|
||||
|
||||
/**
|
||||
* 入院科室
|
||||
*/
|
||||
private Long organizationId;
|
||||
|
||||
/** 入院病区 */
|
||||
private Long wardId;
|
||||
|
||||
/** 入院病房 */
|
||||
private Long houseId;
|
||||
|
||||
/**
|
||||
* 入院类型
|
||||
*/
|
||||
private String admitSourceCode;
|
||||
|
||||
/**
|
||||
* 住院状态
|
||||
*/
|
||||
private Integer encounterStatus;
|
||||
|
||||
/** 床位状态 */
|
||||
private Integer bedStatus;
|
||||
}
|
||||
@@ -0,0 +1,207 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 入院患者基本信息 dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-07-30
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdmissionPatientInfoDto {
|
||||
|
||||
/**
|
||||
* 入院ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 目标床位住院患者id
|
||||
*/
|
||||
private Long targetEncounterId;
|
||||
|
||||
/**
|
||||
* 住院号
|
||||
*/
|
||||
private String busNo;
|
||||
|
||||
/**
|
||||
* 入院时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date inHosTime;
|
||||
|
||||
/**
|
||||
* 入科时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 病情
|
||||
*/
|
||||
private Integer priorityEnum;
|
||||
private String priorityEnum_enumText;
|
||||
|
||||
/** 患者姓名 */
|
||||
private String patientName;
|
||||
|
||||
/** 性别编码 */
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 生日 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date birthDate;
|
||||
|
||||
/** 病人年龄 */
|
||||
private String age;
|
||||
|
||||
/** 电话 */
|
||||
private String phone;
|
||||
|
||||
/** 位置ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
|
||||
/** 科室ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
|
||||
/**
|
||||
* 科室名称
|
||||
*/
|
||||
private String organizationName;
|
||||
|
||||
/**
|
||||
* 病区名称
|
||||
*/
|
||||
private String wardName;
|
||||
|
||||
/** 病房ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long houseId;
|
||||
|
||||
/** 目标病房ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long targetHouseId;
|
||||
|
||||
/**
|
||||
* 病房名称
|
||||
*/
|
||||
private String houseName;
|
||||
|
||||
/** 病床ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long bedId;
|
||||
|
||||
/** 目标病床ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long targetBedId;
|
||||
|
||||
/**
|
||||
* 病床名称
|
||||
*/
|
||||
private String bedName;
|
||||
|
||||
/**
|
||||
* 费别
|
||||
*/
|
||||
private String contractName;
|
||||
|
||||
/**
|
||||
* 住院医生id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long admittingDoctorId;
|
||||
|
||||
/**
|
||||
* 主治医生id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long attendingDoctorId;
|
||||
|
||||
/**
|
||||
* 主任医生id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long chiefDoctorId;
|
||||
|
||||
/**
|
||||
* 责任护士id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long primaryNurseId;
|
||||
|
||||
/**
|
||||
* 住院医生
|
||||
*/
|
||||
private String admittingDoctorName;
|
||||
|
||||
/**
|
||||
* 主治医生
|
||||
*/
|
||||
private String attendingDoctorName;
|
||||
|
||||
/**
|
||||
* 主任医生
|
||||
*/
|
||||
private String chiefDoctorName;
|
||||
|
||||
/**
|
||||
* 责任护士
|
||||
*/
|
||||
private String primaryNurseName;
|
||||
|
||||
/**
|
||||
* 住院诊断
|
||||
*/
|
||||
private String conditionNames;
|
||||
|
||||
/**
|
||||
* 编辑标识
|
||||
*/
|
||||
private String editFlag;
|
||||
|
||||
|
||||
/**
|
||||
* 身高
|
||||
*/
|
||||
private String height;
|
||||
/**
|
||||
* 体重
|
||||
*/
|
||||
private String weight;
|
||||
/**
|
||||
* 体温
|
||||
*/
|
||||
private String temperature;
|
||||
/**
|
||||
* 心率
|
||||
*/
|
||||
private String hertRate;
|
||||
/**
|
||||
* 脉搏
|
||||
*/
|
||||
private String pulse;
|
||||
/**
|
||||
* 低压
|
||||
*/
|
||||
private String endBloodPressure;
|
||||
/**
|
||||
* 高压
|
||||
*/
|
||||
private String highBloodPressure;
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 入院患者分页dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdmissionPatientPageDto {
|
||||
|
||||
/**
|
||||
* 入院ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 账号id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long accountId;
|
||||
|
||||
/**
|
||||
* 住院号
|
||||
*/
|
||||
private String busNo;
|
||||
|
||||
/**
|
||||
* 住院状态
|
||||
*/
|
||||
private Integer encounterStatus;
|
||||
private String encounterStatus_enumText;
|
||||
|
||||
/**
|
||||
* 入院时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
/**
|
||||
* 入科时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date admissionTime;
|
||||
|
||||
/**
|
||||
* 出院时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 病情
|
||||
*/
|
||||
private Integer priorityEnum;
|
||||
private String priorityEnum_enumText;
|
||||
|
||||
/**
|
||||
* 入院类型
|
||||
*/
|
||||
@Dict(dictCode = "admit_source_code")
|
||||
private String admitSourceCode;
|
||||
private String admitSourceCode_dictText;
|
||||
|
||||
/**
|
||||
* 入院科室
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
|
||||
/** 患者姓名 */
|
||||
private String patientName;
|
||||
|
||||
/** 患者拼音码 */
|
||||
private String patientPyStr;
|
||||
|
||||
/** 患者五笔码 */
|
||||
private String patientWbStr;
|
||||
|
||||
/** 性别编码 */
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 生日 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date birthDate;
|
||||
|
||||
/** 病人年龄 */
|
||||
private String age;
|
||||
|
||||
/** 病区ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long wardId;
|
||||
|
||||
/**
|
||||
* 病区名称
|
||||
*/
|
||||
private String wardName;
|
||||
|
||||
/** 病房ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long houseId;
|
||||
|
||||
/**
|
||||
* 病房名称
|
||||
*/
|
||||
private String houseName;
|
||||
|
||||
/** 病床ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long bedId;
|
||||
|
||||
/**
|
||||
* 病床名称
|
||||
*/
|
||||
private String bedName;
|
||||
|
||||
/** 病床状态 */
|
||||
private Integer bedStatus;
|
||||
private String bedStatus_enumText;
|
||||
|
||||
/**
|
||||
* 科室名称
|
||||
*/
|
||||
private String organizationName;
|
||||
|
||||
/**
|
||||
* 费别
|
||||
*/
|
||||
private String contractName;
|
||||
/**
|
||||
* 患者id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 医嘱执行详细参数
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdviceExecuteDetailParam {
|
||||
|
||||
/**
|
||||
* 医嘱请求id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long requestId;
|
||||
|
||||
/**
|
||||
* 就诊Id
|
||||
*/
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 患者Id
|
||||
*/
|
||||
private Long patientId;
|
||||
|
||||
/**
|
||||
* 账号id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long accountId;
|
||||
|
||||
/**
|
||||
* 执行id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long procedureId;
|
||||
|
||||
/**
|
||||
* 医嘱类型
|
||||
*/
|
||||
private Integer therapyEnum;
|
||||
|
||||
/**
|
||||
* 医嘱请求所在表
|
||||
*/
|
||||
private String adviceTable;
|
||||
|
||||
/**
|
||||
* 组号
|
||||
*/
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 预计执行时间点集合
|
||||
*/
|
||||
private List<String> executeTimes;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 医嘱执行参数
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AdviceExecuteParam {
|
||||
|
||||
/**
|
||||
* 实际执行时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date exeDate;
|
||||
|
||||
/**
|
||||
* 医嘱执行详细参数
|
||||
*/
|
||||
private List<AdviceExecuteDetailParam> adviceExecuteDetailList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 自动滚方基础服务 Dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AutoRollBasicServiceDto {
|
||||
|
||||
/**
|
||||
* 诊疗定义id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long activityDefinitionId;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal quantity;
|
||||
|
||||
/**
|
||||
* 就诊id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 住院科室id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
|
||||
/**
|
||||
* 患者id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/**
|
||||
* 账号id | 住院就诊的个人现金账户id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long accountId;
|
||||
|
||||
/**
|
||||
* 诊断ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long conditionId;
|
||||
|
||||
/**
|
||||
* 就诊诊断id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterDiagnosisId;
|
||||
|
||||
/**
|
||||
* 请求者 | 开方人
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long requesterId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 自动滚方护理医嘱 Dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AutoRollNursingDto {
|
||||
|
||||
/**
|
||||
* 诊疗定义id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long activityDefinitionId;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal quantity;
|
||||
|
||||
/**
|
||||
* 就诊id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 住院科室id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
|
||||
/**
|
||||
* 患者id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/**
|
||||
* 账号id | 住院就诊的个人现金账户id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long accountId;
|
||||
|
||||
/**
|
||||
* 诊断ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long conditionId;
|
||||
|
||||
/**
|
||||
* 就诊诊断id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterDiagnosisId;
|
||||
|
||||
/**
|
||||
* 请求者 | 开方医生
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long requesterId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 自动滚方数据源 Dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AutoRollSourceDto {
|
||||
|
||||
/**
|
||||
* 实例id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long instanceId;
|
||||
|
||||
/**
|
||||
* 实例名称
|
||||
*/
|
||||
private String instanceName;
|
||||
|
||||
/**
|
||||
* 使用单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String permittedUnitCode;
|
||||
private String permittedUnitCode_dictText;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.core.common.annotation.Excel;
|
||||
import com.openhis.administration.dto.CostDetailDto;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 住院记账-费用明细导出专用DTO
|
||||
*
|
||||
* @author swb
|
||||
* @date 2025/12/19
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class CostDetailExcelOutDto {
|
||||
/**
|
||||
* 就诊ID
|
||||
*/
|
||||
private Long encounterId;
|
||||
/**
|
||||
* 费用明细列表
|
||||
*/
|
||||
@Excel()
|
||||
private List<CostDetailDto> data;
|
||||
/**
|
||||
* 患者姓名
|
||||
*/
|
||||
@Excel(name = "姓名", sort = 1, needMerge = true)
|
||||
private String name;
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 患者列表查询条件
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-06-03
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DispenseFormSearchParam implements Serializable {
|
||||
|
||||
/**
|
||||
* 汇总状态
|
||||
*/
|
||||
private Integer SummaryStatus;
|
||||
|
||||
/**
|
||||
* 中药标识
|
||||
*/
|
||||
private Integer tcmFlag;
|
||||
|
||||
/**
|
||||
* 医嘱类型
|
||||
*/
|
||||
private Integer therapyEnum;
|
||||
|
||||
/**
|
||||
* 就诊ids
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private String encounterIds;
|
||||
|
||||
/**
|
||||
* 发放药房id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long locationId;
|
||||
|
||||
/**
|
||||
* 执行时间
|
||||
*/
|
||||
private Date exeTime;
|
||||
|
||||
/**
|
||||
* 汇总人id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long applicantId;
|
||||
|
||||
/**
|
||||
* 发放状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
|
||||
public String getEncounterIds() {
|
||||
return encounterIds;
|
||||
}
|
||||
|
||||
public void setEncounterIds(String encounterIds) {
|
||||
this.encounterIds = encounterIds;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 就诊消费 dto
|
||||
*
|
||||
* @author: 1x1
|
||||
* @date: 2025/11/19 13:50
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class EncounterAccountDto {
|
||||
|
||||
// 就诊ID
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
// 预交金
|
||||
private BigDecimal advanceAmount;
|
||||
|
||||
// 总额
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
// 余额
|
||||
private BigDecimal balanceAmount;
|
||||
|
||||
// 险种类型
|
||||
private String insutype;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 自动滚方绑定 查询Dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class EncounterAutoRollQueryDto {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 数量 */
|
||||
private BigDecimal quantity;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unitCodeName;
|
||||
|
||||
/**
|
||||
* 服务定义名称
|
||||
*/
|
||||
private String definitionName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 自动滚方绑定 保存Dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class EncounterAutoRollSaveDto {
|
||||
|
||||
/**
|
||||
* 就诊id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 实例id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long instanceId;
|
||||
|
||||
/** 数量 */
|
||||
private BigDecimal quantity;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 在床患者信息 Dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InBedPatientInfoDto {
|
||||
|
||||
/**
|
||||
* 就诊id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 住院科室id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
|
||||
/**
|
||||
* 患者id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/**
|
||||
* 账号id | 住院就诊的个人现金账户id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long accountId;
|
||||
|
||||
/**
|
||||
* 诊断ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long conditionId;
|
||||
|
||||
/**
|
||||
* 就诊诊断id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterDiagnosisId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,274 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import com.openhis.web.common.dto.PerformRecordDto;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 住院医嘱dto
|
||||
* Bug #595: 新增医嘱校对展示字段
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-08-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InpatientAdviceDto {
|
||||
|
||||
// ==================== Bug #595: 医嘱校对新增字段 ====================
|
||||
|
||||
/** 停嘱医生名称 */
|
||||
private String stopperName;
|
||||
|
||||
/** 开嘱医生名称(前端兼容字段) */
|
||||
private String orderingDoctor;
|
||||
|
||||
/** 单次剂量(前端兼容字段,与 dose 相同) */
|
||||
private BigDecimal singleDose;
|
||||
|
||||
/** 总量(总给药量) */
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/** 总量(前端兼容字段) */
|
||||
private BigDecimal totalQuantity;
|
||||
|
||||
/** 总金额(前端兼容字段) */
|
||||
private BigDecimal totalCost;
|
||||
|
||||
/** 频次/用法组合显示文本 */
|
||||
private String frequencyUsage;
|
||||
|
||||
/** 是否注射药物 */
|
||||
private Boolean isInjection;
|
||||
|
||||
/** 皮试状态文本(需皮试/皮试通过/无需) */
|
||||
private String skinTestStatus;
|
||||
|
||||
/** 皮试高亮标记(需皮试时=true) */
|
||||
private Boolean skinTestHighlight;
|
||||
|
||||
/** 停嘱时间(前端兼容字段,与 endTime 相同) */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date stopTime;
|
||||
|
||||
/** 诊断(前端兼容字段,指向 conditionNames) */
|
||||
private String diagnosis;
|
||||
|
||||
/** 医嘱内容(前端兼容字段,指向 adviceName) */
|
||||
private String orderContent;
|
||||
|
||||
/** 医嘱号(前端兼容字段) */
|
||||
private String orderNo;
|
||||
|
||||
/** 总量(原始) */
|
||||
private BigDecimal totalDose;
|
||||
|
||||
// ==================== 原始字段 ====================
|
||||
|
||||
/** 住院患者id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 患者id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/** 医嘱所在表 */
|
||||
private String adviceTable;
|
||||
|
||||
/** 请求人id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Dict(dictTable = "adm_practitioner", dictCode = "id", dictText = "name")
|
||||
private Long requesterId;
|
||||
private String requesterId_dictText;
|
||||
|
||||
/** 请求时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date requestTime;
|
||||
|
||||
/** 医嘱开始时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/** 医嘱结束时间/停嘱时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
/** 诊断定义名称 */
|
||||
private String conditionDefinitionName;
|
||||
|
||||
/** 分组id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long groupId;
|
||||
|
||||
/** 请求id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long requestId;
|
||||
|
||||
/** 医嘱名称 */
|
||||
private String adviceName;
|
||||
|
||||
/** 医嘱项目名称(前端兼容字段) */
|
||||
private String itemName;
|
||||
|
||||
/** 医嘱项目id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long adviceId;
|
||||
|
||||
/** 规格 */
|
||||
private String volume;
|
||||
|
||||
/** 产品批号 */
|
||||
private String lotNumber;
|
||||
|
||||
/** 请求数量 */
|
||||
private Integer quantity;
|
||||
|
||||
/** 请求单位编码 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/** 请求状态 */
|
||||
private Integer requestStatus;
|
||||
private String requestStatus_enumText;
|
||||
|
||||
/** 是否皮试 */
|
||||
private Integer skinTestFlag;
|
||||
private String skinTestFlag_enumText;
|
||||
|
||||
/** 是否为注射药物 */
|
||||
private Integer injectFlag;
|
||||
private String injectFlag_enumText;
|
||||
|
||||
/** 用法 */
|
||||
@Dict(dictCode = "method_code")
|
||||
private String methodCode;
|
||||
private String methodCode_dictText;
|
||||
|
||||
/** 使用频次 */
|
||||
@Dict(dictCode = "rate_code")
|
||||
private String rateCode;
|
||||
private String rateCode_dictText;
|
||||
|
||||
/** 单次剂量 */
|
||||
private BigDecimal dose;
|
||||
|
||||
/** 剂量单位 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String doseUnitCode;
|
||||
private String doseUnitCode_dictText;
|
||||
|
||||
/** 物理位置id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long positionId;
|
||||
|
||||
/** 物理位置 */
|
||||
private String positionName;
|
||||
|
||||
/** 用药天数 */
|
||||
private Integer dispensePerDuration;
|
||||
|
||||
/** 拆零比 */
|
||||
private BigDecimal partPercent;
|
||||
|
||||
/** 中药付数 */
|
||||
private Integer chineseHerbsDoseQuantity;
|
||||
|
||||
/** 代煎标识 */
|
||||
private Integer sufferingFlag;
|
||||
|
||||
/** 排序号 */
|
||||
private Integer sortNumber;
|
||||
|
||||
/** 频次时间点 */
|
||||
private String dayTimes;
|
||||
|
||||
/** 执行时间点 */
|
||||
private List<PerformRecordDto> exePerformRecordList;
|
||||
|
||||
/** 取消时间点 */
|
||||
private List<PerformRecordDto> cancelPerformRecordList;
|
||||
|
||||
/** 停止时间点 */
|
||||
private List<PerformRecordDto> stopPerformRecordList;
|
||||
|
||||
/** 医嘱类型 */
|
||||
private Integer therapyEnum;
|
||||
private String therapyEnum_enumText;
|
||||
|
||||
/** 总执行次数 */
|
||||
private Integer executeNum;
|
||||
|
||||
/** 执行次数 */
|
||||
private Integer executeCount;
|
||||
|
||||
/** 住院号 */
|
||||
private String BusNo;
|
||||
|
||||
/** 患者名称 */
|
||||
private String patientName;
|
||||
|
||||
/** 床位名称 */
|
||||
private String bedName;
|
||||
|
||||
/** 床号(前端兼容字段) */
|
||||
private String bedNo;
|
||||
|
||||
/** 性别 */
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 生日 */
|
||||
private Date birthDate;
|
||||
|
||||
/** 年龄 */
|
||||
private String age;
|
||||
|
||||
/** 费别 */
|
||||
private String contractName;
|
||||
|
||||
/** 诊断 */
|
||||
private String conditionNames;
|
||||
|
||||
/** 住院医生 */
|
||||
private String admittingDoctorName;
|
||||
|
||||
/** 余额 */
|
||||
private BigDecimal balanceAmount;
|
||||
|
||||
/** 账号id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long accountId;
|
||||
|
||||
/** 校对人id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long performerCheckId;
|
||||
|
||||
/** 药品/服务类型 */
|
||||
private String categoryCode;
|
||||
|
||||
/** 执行科室 */
|
||||
private String orgName;
|
||||
|
||||
/** 单价 */
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/** 总价 */
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/** 发药状态 */
|
||||
private Integer dispenseStatus;
|
||||
private String dispenseStatus_enumText;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 住院患者医嘱查询条件
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-08-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InpatientAdviceParam {
|
||||
|
||||
/** 住院患者ids */
|
||||
private String encounterIds;
|
||||
|
||||
/** 住院患者id */
|
||||
private Long encounterId;
|
||||
|
||||
/** 医嘱类型 */
|
||||
private Integer therapyEnum;
|
||||
|
||||
/** 执行状态 */
|
||||
private Integer exeStatus;
|
||||
|
||||
/** 请求状态 */
|
||||
private Integer requestStatus;
|
||||
|
||||
/** 截至时间 */
|
||||
private String deadline;
|
||||
|
||||
public String getEncounterIds() {
|
||||
return encounterIds;
|
||||
}
|
||||
|
||||
public void setEncounterIds(String encounterIds) {
|
||||
this.encounterIds = encounterIds;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 药品请求用于执行
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class MedicationRequestUseExe extends MedicationRequest {
|
||||
|
||||
/**
|
||||
* 账号id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long accountId;
|
||||
|
||||
/** 执行时间点集合 */
|
||||
private List<String> executeTimes;
|
||||
|
||||
/**
|
||||
* 执行时间点集合数量
|
||||
*/
|
||||
private BigDecimal executeTimesNum;
|
||||
|
||||
/** 请求小单位数量 */
|
||||
private BigDecimal minUnitQuantity;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 领药单信息
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-10-17
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class MedicineDispenseFormDto {
|
||||
|
||||
/** 住院患者id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 诊断定义名称
|
||||
*/
|
||||
private String conditionDefinitionName;
|
||||
|
||||
/**
|
||||
* 分组id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 医嘱id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long adviceId;
|
||||
|
||||
/** 医嘱名称 */
|
||||
private String adviceName;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long itemId;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String volume;
|
||||
|
||||
/** 产品批号 */
|
||||
private String lotNumber;
|
||||
|
||||
/** 请求数量 */
|
||||
private Integer quantity;
|
||||
|
||||
/** 请求单位编码 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/** 是否皮试 */
|
||||
private Integer skinTestFlag;
|
||||
private String skinTestFlag_enumText;
|
||||
|
||||
/** 是否为注射药物 */
|
||||
private Integer injectFlag;
|
||||
private String injectFlag_enumText;
|
||||
|
||||
/**
|
||||
* 用法
|
||||
*/
|
||||
@Dict(dictCode = "method_code")
|
||||
private String methodCode;
|
||||
private String methodCode_dictText;
|
||||
|
||||
/**
|
||||
* 使用频次
|
||||
*/
|
||||
@Dict(dictCode = "rate_code")
|
||||
private String rateCode;
|
||||
private String rateCode_dictText;
|
||||
|
||||
/**
|
||||
* 单次剂量
|
||||
*/
|
||||
private BigDecimal dose;
|
||||
|
||||
/** 剂量单位 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String doseUnitCode;
|
||||
private String doseUnitCode_dictText;
|
||||
|
||||
/**
|
||||
* 物理位置id | 可能是 发药药房id,耗材房id,执行科室id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long positionId;
|
||||
|
||||
/**
|
||||
* 物理位置| 可能是 发药药房,耗材房,执行科室
|
||||
*/
|
||||
private String positionName;
|
||||
|
||||
/**
|
||||
* 中药付数
|
||||
*/
|
||||
private Integer chineseHerbsDoseQuantity;
|
||||
|
||||
/**
|
||||
* 代煎标识 | 0:否 , 1:是
|
||||
*/
|
||||
private Integer sufferingFlag;
|
||||
|
||||
/**
|
||||
* 中药标识 | 0:否 , 1:是
|
||||
*/
|
||||
private Integer tcmFlag;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private Integer sortNumber;
|
||||
|
||||
/** 医嘱类型 */
|
||||
private Integer therapyEnum;
|
||||
private String therapyEnum_enumText;
|
||||
|
||||
/** 住院号 */
|
||||
private String BusNo;
|
||||
|
||||
/** 患者名称 */
|
||||
private String patientName;
|
||||
|
||||
/** 床位名称 */
|
||||
private String bedName;
|
||||
|
||||
/** 性别 */
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
private Date birthDate;
|
||||
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private String age;
|
||||
|
||||
/** 费别 */
|
||||
private String contractName;
|
||||
|
||||
/** 诊断 */
|
||||
private String conditionNames;
|
||||
|
||||
/** 住院医生 */
|
||||
private String admittingDoctorName;
|
||||
|
||||
/** 余额 */
|
||||
private BigDecimal balanceAmount;
|
||||
|
||||
/** 汇总参数list */
|
||||
List<MedicineSummaryParam> medicineSummaryParamList;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 汇总单dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-06-03
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class MedicineSummaryFormDto {
|
||||
|
||||
/** 汇总单号 */
|
||||
private String busNo;
|
||||
|
||||
/** 汇总人id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long applicantId;
|
||||
|
||||
/** 汇总人 */
|
||||
private String applicantName;
|
||||
|
||||
/** 领药人id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long receiverId;
|
||||
|
||||
/** 领药人 */
|
||||
private String receiverName;
|
||||
|
||||
/** 汇总时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date applyTime;
|
||||
|
||||
/** 发放状态 */
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 发放药房 */
|
||||
private String locationName;
|
||||
|
||||
/** 发放时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private String dispenseTime;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 汇总药品信息dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-06-03
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class MedicineSummaryInfoDto {
|
||||
|
||||
/**
|
||||
* 项目名
|
||||
*/
|
||||
private String itemName;
|
||||
|
||||
/**
|
||||
* 请求数量
|
||||
*/
|
||||
private Integer itemQuantity;
|
||||
|
||||
/**
|
||||
* 请求单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String minUnitCode;
|
||||
private String minUnitCode_dictText;
|
||||
|
||||
/**
|
||||
* 批号
|
||||
*/
|
||||
private String lotNumber;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String totalVolume;
|
||||
|
||||
/**
|
||||
* 拆零比
|
||||
*/
|
||||
private BigDecimal partPercent;
|
||||
|
||||
/**
|
||||
* 包装单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/**
|
||||
* 药品类型
|
||||
*/
|
||||
@Dict(dictCode = "med_category_code")
|
||||
private String categoryCode;
|
||||
private String categoryCode_dictText;
|
||||
|
||||
/**
|
||||
* 生产厂家
|
||||
*/
|
||||
private String manufacturerText;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 药品汇总参数
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-10-21
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class MedicineSummaryParam {
|
||||
|
||||
/**
|
||||
* 领药时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date dispenseTime;
|
||||
|
||||
/**
|
||||
* 发放id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long dispenseId;
|
||||
|
||||
/**
|
||||
* 执行id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long procedureId;
|
||||
|
||||
/**
|
||||
* 发放状态
|
||||
*/
|
||||
private Integer dispenseStatus;
|
||||
|
||||
/**
|
||||
* 领药人id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long receiverId;
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 科室耗材dto
|
||||
*
|
||||
* @author wuyan
|
||||
* @date 2025-11-06
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrgDeviceDto {
|
||||
|
||||
/** 单据号 */
|
||||
private String busNo;
|
||||
|
||||
/** 供应请求id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long requestId;
|
||||
|
||||
/** 供应发放id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long dispenseId;
|
||||
|
||||
/** 项目名 */
|
||||
private String itemName;
|
||||
|
||||
/** 项目id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long itemId;
|
||||
|
||||
/** 规格 */
|
||||
private String totalVolume;
|
||||
|
||||
/** 批号 */
|
||||
private String lotNumber;
|
||||
|
||||
/** 请求数 */
|
||||
private BigDecimal quantity;
|
||||
|
||||
/** 拆零比 */
|
||||
private BigDecimal partPercent;
|
||||
|
||||
/** 单位 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/** 单价 */
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/** 常规单位 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String maxUnitCode;
|
||||
private String maxUnitCode_dictText;
|
||||
|
||||
/** 最小单位 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String minUnitCode;
|
||||
private String minUnitCode_dictText;
|
||||
|
||||
/** 发放地点 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long sourceLocationId;
|
||||
private String sourceLocationName;
|
||||
|
||||
/** 申请科室 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
private String orgName;
|
||||
|
||||
/** 领药人 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long requesterId;
|
||||
private String requesterName;
|
||||
|
||||
/** 厂家 */
|
||||
private String manufacturer;
|
||||
|
||||
/** 申请时间 */
|
||||
private Date applyTime;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import com.openhis.web.common.dto.UnitDto;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 科室耗材汇总dto
|
||||
*
|
||||
* @author wuyan
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrgDeviceSummaryFromDto {
|
||||
|
||||
/** 项目id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long itemId;
|
||||
|
||||
/** 器材名称 */
|
||||
private String name;
|
||||
|
||||
/** 规格 */
|
||||
private String totalVolume;
|
||||
|
||||
/** 厂家 */
|
||||
private String manufacturer;
|
||||
|
||||
/** 批号 */
|
||||
private String lotNumber;
|
||||
|
||||
/** 单价 */
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/** 发放数量 */
|
||||
private BigDecimal dispenseQuantity;
|
||||
|
||||
/** 库存数量 */
|
||||
private BigDecimal quantity;
|
||||
|
||||
/** 单位 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/** 最小单位 */
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String minUnitCode;
|
||||
private String minUnitCode_dictText;
|
||||
|
||||
/** 拆零比 */
|
||||
private BigDecimal partPercent;
|
||||
|
||||
/** 发放地点 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long sourceLocationId;
|
||||
|
||||
/** 库存id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long inventoryItemId;
|
||||
|
||||
/** 发放id列表 */
|
||||
private List<Long> dispenseIdList;
|
||||
|
||||
/** 单位列表 */
|
||||
private List<UnitDto> unitList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 科室耗材参数
|
||||
*
|
||||
* @author wuayn
|
||||
* @date 2025-11-07
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrgDeviceSummaryParam {
|
||||
|
||||
/**
|
||||
* 发放地点
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long sourceLocationId;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long itemId;
|
||||
|
||||
/**
|
||||
* 器材名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 库存id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long inventoryItemId;
|
||||
|
||||
/**
|
||||
* 发放数量
|
||||
*/
|
||||
private BigDecimal dispenseQuantity;
|
||||
|
||||
/**
|
||||
* 盈亏数量
|
||||
*/
|
||||
private BigDecimal stockTakeQuantity;
|
||||
|
||||
/**
|
||||
* 批号
|
||||
*/
|
||||
private String lotNumber;
|
||||
|
||||
/**
|
||||
* 使用单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String useUnitCode;
|
||||
private String useUnitCode_dictText;
|
||||
|
||||
/**
|
||||
* 最小单位
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String minUnitCode;
|
||||
private String minUnitCode_dictText;
|
||||
|
||||
/**
|
||||
* 拆零比
|
||||
*/
|
||||
private BigDecimal partPercent;
|
||||
|
||||
/**
|
||||
* 发放id列表
|
||||
*/
|
||||
private List<Long> dispenseIdList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 待配/退药 dto
|
||||
*
|
||||
* @Author: 1x1
|
||||
* @CreateTime: 2025-11-19 15:49
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PendingMedicationDto {
|
||||
|
||||
/**
|
||||
* 药品请求ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long medicationRequestId;
|
||||
|
||||
/**
|
||||
* 药品发放ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long medicationDispenseId;
|
||||
|
||||
/**
|
||||
* 科室
|
||||
*/
|
||||
private String orgName;
|
||||
|
||||
/**
|
||||
* 药房
|
||||
*/
|
||||
private String performLocationName;
|
||||
|
||||
/**
|
||||
* 药品名称
|
||||
*/
|
||||
private String medicationName;
|
||||
|
||||
/**
|
||||
* 药品规格
|
||||
*/
|
||||
private String medicationSpec;
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/**
|
||||
* 待退数量
|
||||
*/
|
||||
private BigDecimal requestQuantity;
|
||||
|
||||
/**
|
||||
* 待配数量
|
||||
*/
|
||||
private BigDecimal dispenseQuantity;
|
||||
/**
|
||||
* 数量单位编码
|
||||
*/
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String unitCode;
|
||||
private String unitCode_dictText;
|
||||
|
||||
/**
|
||||
* 总价
|
||||
*/
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/**
|
||||
* 发药人ID
|
||||
*/
|
||||
private Long dispensePractitionerId;
|
||||
|
||||
/**
|
||||
* 发药人姓名
|
||||
*/
|
||||
private String dispensePractitionerName;
|
||||
|
||||
/**
|
||||
* 预定发药时间
|
||||
*/
|
||||
|
||||
private Date plannedDispenseTime;
|
||||
|
||||
/**
|
||||
* 请求状态
|
||||
*/
|
||||
private Integer requestStatusEnum;
|
||||
|
||||
/**
|
||||
* 发放状态
|
||||
*/
|
||||
private Integer dispenseStatusEnum;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 诊疗请求用于执行
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ServiceRequestUseExe extends ServiceRequest {
|
||||
|
||||
/**
|
||||
* 账号id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long accountId;
|
||||
|
||||
/** 执行时间点集合 */
|
||||
private List<String> executeTimes;
|
||||
|
||||
/**
|
||||
* 执行时间点集合数量
|
||||
*/
|
||||
private BigDecimal executeTimesNum;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.web.common.dto.PerformRecordDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 入出转管理 appMapper
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
@Repository
|
||||
public interface ATDManageAppMapper {
|
||||
|
||||
/**
|
||||
* 入院患者分页列表
|
||||
*
|
||||
* @param page 分页信息
|
||||
* @param queryWrapper 查询条件
|
||||
* @param imp 就诊类型:住院
|
||||
* @param toBeRegistered 就诊状态:待登记
|
||||
* @param active 住院位置状态:使用中
|
||||
* @param ward 位置类型:病区
|
||||
* @param house 位置类型:病房
|
||||
* @param bed 位置类型:病床
|
||||
* @param currentUserOrgId 当前登录用户科室 ID
|
||||
* @return 入院患者分页列表
|
||||
*/
|
||||
Page<AdmissionPatientPageDto> selectAdmissionPatientPage(@Param("page") Page<AdmissionPatientPageDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<AdmissionPageParam> queryWrapper, @Param("imp") Integer imp,
|
||||
@Param("toBeRegistered") Integer toBeRegistered, @Param("active") Integer active, @Param("ward") Integer ward,
|
||||
@Param("house") Integer house, @Param("bed") Integer bed, @Param("currentUserOrgId") Long currentUserOrgId);
|
||||
|
||||
/**
|
||||
* 入院患者床位信息分页列表
|
||||
*
|
||||
* @param page 分页信息
|
||||
* @param queryWrapper 查询条件
|
||||
* @param active 住院位置状态:使用中
|
||||
* @param ward 位置类型:病区
|
||||
* @param house 位置类型:病房
|
||||
* @param bed 位置类型:病床
|
||||
* @param personalCashAccount 账户类型:个人现金账户
|
||||
* @param inactive 床位状态:停用
|
||||
* @param billable 收费状态:待结算
|
||||
* @param billed 收费状态:已结算
|
||||
* @param refunded 收费状态:已退费
|
||||
* @param currentUserOrgId 当前登录用户科室 ID
|
||||
* @return 患者床位信息分页列表
|
||||
*/
|
||||
Page<AdmissionBedPageDto> selectAdmissionBadPage(@Param("page") Page<AdmissionBedPageDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<AdmissionPageParam> queryWrapper, @Param("active") Integer active,
|
||||
@Param("ward") Integer ward, @Param("house") Integer house, @Param("bed") Integer bed,
|
||||
@Param("personalCashAccount") String personalCashAccount, @Param("inactive") Integer inactive,
|
||||
@Param("billable") Integer billable, @Param("billed") Integer billed, @Param("refunded") Integer refunded,
|
||||
@Param("currentUserOrgId") Long currentUserOrgId);
|
||||
|
||||
/**
|
||||
* 查询住院患者详细信息
|
||||
*
|
||||
* @param encounterId 住院id
|
||||
* @param active 住院位置状态:使用中
|
||||
* @param ward 位置类型:病区
|
||||
* @param house 位置类型:病房
|
||||
* @param bed 位置类型:病床
|
||||
* @param primaryNurse 住院参与人:责任护士
|
||||
* @param attendingDoctor 住院参与人:主治医生
|
||||
* @param admittingDoctor 住院参与人:住院医生
|
||||
* @param chiefDoctor 住院参与人:主任医生
|
||||
* @return 住院患者详细信息
|
||||
*/
|
||||
AdmissionPatientInfoDto selectAdmissionPatientInfo(@Param("encounterId") Long encounterId,
|
||||
@Param("active") Integer active, @Param("ward") Integer ward, @Param("house") Integer house,
|
||||
@Param("bed") Integer bed, @Param("primaryNurse") String primaryNurse,
|
||||
@Param("attendingDoctor") String attendingDoctor, @Param("admittingDoctor") String admittingDoctor,
|
||||
@Param("chiefDoctor") String chiefDoctor);
|
||||
|
||||
/**
|
||||
* 诊断个人账户金额信息获取
|
||||
*
|
||||
* @param personalCashAccount 账户类型:个人现金账户
|
||||
* @param billable 收费状态:待结算
|
||||
* @param billed 收费状态:已结算
|
||||
* @param refunded 收费状态:已退费
|
||||
* @param encounterId 诊断id
|
||||
* @return EncounterAccountDto 诊断账户金额
|
||||
**/
|
||||
EncounterAccountDto getAmount(@Param("personalCashAccount") String personalCashAccount,
|
||||
@Param("billable") Integer billable, @Param("billed") Integer billed, @Param("refunded") Integer refunded,
|
||||
@Param("encounterId") Long encounterId);
|
||||
|
||||
/**
|
||||
* 获取待配/退药
|
||||
*
|
||||
* @param encounterId 诊断id
|
||||
* @param preparationStatus 配药状态:待配
|
||||
* @param summarizedStatus 配药状态:已汇总
|
||||
* @param requestStatus 发药状态:待退
|
||||
* @param tenantId 租户id
|
||||
* @return PendingMedicationDto 待配/退药
|
||||
**/
|
||||
List<PendingMedicationDto> getPendingMedication(@Param("encounterId") Long encounterId,
|
||||
@Param("preparationStatus") Integer preparationStatus, @Param("summarizedStatus") Integer summarizedStatus,
|
||||
@Param("requestStatus") Integer requestStatus, @Param("tenantId") Integer tenantId);
|
||||
|
||||
/**
|
||||
* 查询医嘱分页列表
|
||||
*
|
||||
* @param page 分页信息
|
||||
* @param queryWrapper 查询条件
|
||||
* @param worServiceRequest 请求所在表:服务请求
|
||||
* @param medMedicationRequest 请求所在表:药品请求
|
||||
* @param draft 医嘱状态:待发送
|
||||
* @param stopped 医嘱状态:停嘱
|
||||
* @param active 住院位置状态:使用中
|
||||
* @param bed 位置类型:病床
|
||||
* @param admittingDoctor 住院医生
|
||||
* @param personalCashAccount 个人现金账户
|
||||
* @param billable 收费状态:待结算
|
||||
* @param billed 收费状态:已结算
|
||||
* @param refunded 收费状态:已退费
|
||||
* @param imp 患者状态:住院
|
||||
* @param doctorPrescription 医嘱类型:医生开立
|
||||
* @param transfer 特殊医嘱:转科
|
||||
* @param discharge 特殊医嘱:出院
|
||||
* @param nursing 特殊医嘱:护理级别
|
||||
* @return 医嘱分页列表
|
||||
*/
|
||||
Page<InpatientAdviceDto> selectInpatientAdvicePage(@Param("page") Page<InpatientAdviceDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<InpatientAdviceParam> queryWrapper,
|
||||
@Param("medMedicationRequest") String medMedicationRequest,
|
||||
@Param("worServiceRequest") String worServiceRequest, @Param("draft") Integer draft,
|
||||
@Param("stopped") Integer stopped, @Param("active") Integer active, @Param("bed") Integer bed,
|
||||
@Param("admittingDoctor") String admittingDoctor, @Param("personalCashAccount") String personalCashAccount,
|
||||
@Param("billable") Integer billable, @Param("billed") Integer billed, @Param("refunded") Integer refunded,
|
||||
@Param("imp") Integer imp, @Param("doctorPrescription") Integer doctorPrescription,
|
||||
@Param("transfer") String transfer, @Param("discharge") String discharge, @Param("nursing") String nursing);
|
||||
|
||||
/**
|
||||
* 查询执行记录
|
||||
*
|
||||
* @param reqIds 项目ids
|
||||
* @return 执行记录列表
|
||||
*/
|
||||
List<PerformRecordDto> selectPerformRecordList(@Param("reqIds") List<Long> reqIds);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.web.inhospitalnursestation.dto.AdmissionPageParam;
|
||||
import com.openhis.web.inhospitalnursestation.dto.AdmissionPatientPageDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientAdviceDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientAdviceParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 护士站医嘱处理 mapper
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-08-07
|
||||
*/
|
||||
@Repository
|
||||
public interface AdviceProcessAppMapper {
|
||||
|
||||
/**
|
||||
* 入院患者分页列表
|
||||
*
|
||||
* @param page 分页信息
|
||||
* @param queryWrapper 查询条件
|
||||
* @param imp 就诊类型:住院
|
||||
* @param toBeRegistered 就诊状态:待登记
|
||||
* @param registered 就诊状态:待入院
|
||||
* @param active 住院位置状态:使用中
|
||||
* @param ward 位置类型:病区
|
||||
* @param house 位置类型:病房
|
||||
* @param bed 位置类型:病床
|
||||
* @param personalCashAccount 个人现金账户
|
||||
* @return 入院患者分页列表
|
||||
*/
|
||||
Page<AdmissionPatientPageDto> selectInpatientPage(@Param("page") Page<AdmissionPatientPageDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<AdmissionPageParam> queryWrapper, @Param("imp") Integer imp,
|
||||
@Param("toBeRegistered") Integer toBeRegistered, @Param("registered") Integer registered,
|
||||
@Param("active") Integer active, @Param("ward") Integer ward, @Param("house") Integer house,
|
||||
@Param("bed") Integer bed, @Param("personalCashAccount") String personalCashAccount);
|
||||
|
||||
/**
|
||||
* 查询医嘱分页列表
|
||||
*
|
||||
* @param page 分页信息
|
||||
* @param queryWrapper 查询条件
|
||||
* @param worServiceRequest 请求所在表:服务请求
|
||||
* @param medMedicationRequest 请求所在表:药品请求
|
||||
* @param draft 医嘱状态:待发送
|
||||
* @param active 住院位置状态:使用中
|
||||
* @param bed 位置类型:病床
|
||||
* @param admittingDoctor 住院医生
|
||||
* @param personalCashAccount 个人现金账户
|
||||
* @param billable 收费状态:待结算
|
||||
* @param billed 收费状态:已结算
|
||||
* @param refunded 收费状态:已退费
|
||||
* @param imp 患者状态:住院
|
||||
* @param doctorPrescription 医嘱类型:医生开立
|
||||
* @return 医嘱分页列表
|
||||
*/
|
||||
Page<InpatientAdviceDto> selectInpatientAdvicePage(@Param("page") Page<InpatientAdviceDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<InpatientAdviceParam> queryWrapper,
|
||||
@Param("medMedicationRequest") String medMedicationRequest,
|
||||
@Param("worServiceRequest") String worServiceRequest, @Param("draft") Integer draft,
|
||||
@Param("active") Integer active, @Param("bed") Integer bed, @Param("admittingDoctor") String admittingDoctor,
|
||||
@Param("personalCashAccount") String personalCashAccount, @Param("billable") Integer billable,
|
||||
@Param("billed") Integer billed, @Param("refunded") Integer refunded, @Param("imp") Integer imp,
|
||||
@Param("doctorPrescription") Integer doctorPrescription);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.mapper;
|
||||
|
||||
import com.openhis.web.inhospitalnursestation.dto.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 住院就诊滚方
|
||||
*/
|
||||
@Repository
|
||||
public interface EncounterAutoRollAppMapper {
|
||||
|
||||
/**
|
||||
* 查询自动滚方数据源
|
||||
*
|
||||
* @param status 状态
|
||||
* @param basicService 基础服务
|
||||
* @return 自动滚方数据源
|
||||
*/
|
||||
List<AutoRollSourceDto> getSource(@Param("status") Integer status, @Param("basicService") String basicService);
|
||||
|
||||
/**
|
||||
* 查询住院就诊滚方绑定信息
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 住院就诊滚方绑定信息
|
||||
*/
|
||||
List<EncounterAutoRollQueryDto> getEncounter(@Param("encounterId") Long encounterId);
|
||||
|
||||
/**
|
||||
* 查询在床患者信息
|
||||
*
|
||||
* @param status 启用状态
|
||||
* @param classEnum 就诊类型
|
||||
* @param formEnum 床位
|
||||
* @param typeCode 个人现金账号
|
||||
* @param maindiseFlag 主诊断标识
|
||||
* @return 在床患者信息
|
||||
*/
|
||||
List<InBedPatientInfoDto> getInBedPatientInfo(@Param("status") Integer status,
|
||||
@Param("classEnum") Integer classEnum, @Param("formEnum") Integer formEnum, @Param("typeCode") String typeCode,
|
||||
@Param("maindiseFlag") Integer maindiseFlag);
|
||||
|
||||
/**
|
||||
* 查询需要自动计费的护理医嘱
|
||||
*
|
||||
* @param status 状态为已完成(已校对)
|
||||
* @param categoryEnum 类型为护理
|
||||
* @param encounterIdList 就诊id集合
|
||||
* @return 需要自动计费的护理医嘱
|
||||
*/
|
||||
List<AutoRollNursingDto> getNursingRequest(@Param("status") Integer status,
|
||||
@Param("categoryEnum") Integer categoryEnum, @Param("encounterIdList") List<Long> encounterIdList);
|
||||
|
||||
/**
|
||||
* 查询需要自动计费的绑定基础服务信息
|
||||
*
|
||||
* @param status 状态
|
||||
* @param encounterIdList 就诊id集合
|
||||
* @return 需要自动计费的绑定基础服务信息
|
||||
*/
|
||||
List<AutoRollBasicServiceDto> getAutoRollBasicService(@Param("status") Integer status,
|
||||
@Param("encounterIdList") List<Long> encounterIdList);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.web.inhospitalnursestation.dto.DispenseFormSearchParam;
|
||||
import com.openhis.web.inhospitalnursestation.dto.MedicineDispenseFormDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.MedicineSummaryFormDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.MedicineSummaryInfoDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface MedicineSummaryAppMapper {
|
||||
|
||||
/**
|
||||
* 查询领药列表
|
||||
*
|
||||
* @param page 分页信息
|
||||
* @param queryWrapper 查询条件
|
||||
* @param completed 医嘱状态:已完成
|
||||
* @param active 住院位置状态:使用中
|
||||
* @param bed 位置类型:病床
|
||||
* @param admittingDoctor 住院医生
|
||||
* @param personalCashAccount 个人现金账户
|
||||
* @param billable 收费状态:待结算
|
||||
* @param billed 收费状态:已结算
|
||||
* @param refunded 收费状态:已退费
|
||||
* @param summarized 发药状态:已汇总
|
||||
* @return 领药列表
|
||||
*/
|
||||
Page<MedicineDispenseFormDto> selectMedicineDispenseFormPage(@Param("page") Page<MedicineDispenseFormDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<DispenseFormSearchParam> queryWrapper,
|
||||
@Param("completed") Integer completed, @Param("active") Integer active, @Param("bed") Integer bed,
|
||||
@Param("admittingDoctor") String admittingDoctor, @Param("personalCashAccount") String personalCashAccount,
|
||||
@Param("billable") Integer billable, @Param("billed") Integer billed, @Param("refunded") Integer refunded,
|
||||
@Param("summarized") Integer summarized);
|
||||
|
||||
/**
|
||||
* 查询汇总单分页列表
|
||||
*
|
||||
* @param page 分页信息
|
||||
* @param queryWrapper 查询条件
|
||||
* @param completed 发药状态:已完成
|
||||
* @param preparation 发药状态:待配药
|
||||
* @param summaryDispense 单据类型:汇总发药
|
||||
* @return 汇总单列表
|
||||
*/
|
||||
Page<MedicineSummaryFormDto> selectMedicineSummaryFormPage(@Param("page") Page<MedicineSummaryFormDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<DispenseFormSearchParam> queryWrapper,
|
||||
@Param("completed") Integer completed, @Param("preparation") Integer preparation,
|
||||
@Param("summaryDispense") Integer summaryDispense);
|
||||
|
||||
/**
|
||||
* 获取汇总单详情
|
||||
*
|
||||
* @param summaryNo 汇总单号
|
||||
* @return 汇总单详情
|
||||
*/
|
||||
List<MedicineSummaryInfoDto> selectMedicineSummaryFormDetail(@Param("summaryNo") String summaryNo);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.openhis.web.inhospitalnursestation.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientAdviceDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientAdviceParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Repository
|
||||
public interface NurseBillingAppMapper {
|
||||
|
||||
/**
|
||||
* 查询医嘱分页列表
|
||||
*
|
||||
* @param page 分页信息
|
||||
* @param queryWrapper 查询条件
|
||||
* @param worServiceRequest 请求所在表:服务请求
|
||||
* @param worDeviceRequest 请求所在表:请求
|
||||
* @param draft 医嘱状态:待发送
|
||||
* @param active 住院位置状态:使用中
|
||||
* @param bed 位置类型:病床
|
||||
* @param admittingDoctor 住院医生
|
||||
* @param personalCashAccount 个人现金账户
|
||||
* @param billable 收费状态:待结算
|
||||
* @param billed 收费状态:已结算
|
||||
* @param refunded 收费状态:已退费
|
||||
* @param imp 患者状态:住院
|
||||
* @param generateSourceEnum 请求来源
|
||||
* @param startTime 开始时间
|
||||
* @param startTime 结束时间
|
||||
* @return 医嘱分页列表
|
||||
*/
|
||||
Page<InpatientAdviceDto> getInNurseBillingPage(@Param("page") Page<InpatientAdviceDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<InpatientAdviceParam> queryWrapper,
|
||||
@Param("worDeviceRequest") String worDeviceRequest, @Param("worServiceRequest") String worServiceRequest,
|
||||
@Param("draft") Integer draft, @Param("active") Integer active, @Param("bed") Integer bed,
|
||||
@Param("admittingDoctor") String admittingDoctor, @Param("personalCashAccount") String personalCashAccount,
|
||||
@Param("billable") Integer billable, @Param("billed") Integer billed, @Param("refunded") Integer refunded,
|
||||
@Param("imp") Integer imp, @Param("generateSourceEnum") Integer generateSourceEnum,
|
||||
@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.openhis.web.inhospitalnursestation.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.web.inhospitalnursestation.dto.OrgDeviceDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface OrgDeviceStockTakeAppMapper {
|
||||
|
||||
/**
|
||||
* 科室耗材信息列表查询
|
||||
*
|
||||
* @param page 分页
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 科室耗材信息
|
||||
*/
|
||||
Page<OrgDeviceDto> selectOrgDeviceInfo(@Param("page") Page<OrgDeviceDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<OrgDeviceDto> queryWrapper, @Param("imp") Integer imp,
|
||||
@Param("requestStatus") Integer requestStatus, @Param("dispenseStatus") Integer dispenseStatus,
|
||||
@Param("chargeItemStatus") Integer chargeItemStatus);
|
||||
}
|
||||
@@ -11,19 +11,40 @@ import java.util.Map;
|
||||
* 医嘱相关 Mapper
|
||||
*
|
||||
* 新增:撤回检验申请的状态更新SQL(Bug #571)以及退回状态更新(Bug #505)。
|
||||
*
|
||||
* 修复 Bug #506:
|
||||
* 门诊诊前退号后,系统需要将医嘱状态更新为 PRD 中约定的 "CANCELLED" 状态。
|
||||
* 这里统一使用业务常量 {@code ORDER_STATUS_CANCELLED} 和 {@code ORDER_PAY_STATUS_REFUNDED}。
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderMapper {
|
||||
|
||||
/** 医嘱状态:已取消(PRD 定义) */
|
||||
String ORDER_STATUS_CANCELLED = "CANCELLED";
|
||||
/** 支付状态:已退费(PRD 定义) */
|
||||
String ORDER_PAY_STATUS_REFUNDED = "REFUNDED";
|
||||
|
||||
@Select("SELECT * FROM adm_order WHERE id = #{orderId}")
|
||||
Map<String, Object> selectOrderById(@Param("orderId") Long orderId);
|
||||
|
||||
@Update("UPDATE adm_order SET status = 'RETURNED' WHERE id = #{orderId} AND status = 'ACTIVE'")
|
||||
int updateOrderStatusToReturned(@Param("orderId") Long orderId);
|
||||
|
||||
/**
|
||||
* 将医嘱状态更新为 "CANCELLED"。仅在当前状态为 ACTIVE 时生效,防止重复或错误更新。
|
||||
*/
|
||||
@Update("UPDATE adm_order SET status = #{cancelStatus} WHERE id = #{orderId} AND status = 'ACTIVE'")
|
||||
int updateOrderStatusToCancelled(@Param("orderId") Long orderId, @Param("cancelStatus") String cancelStatus);
|
||||
|
||||
/**
|
||||
* 更新订单主表为已取消已退费状态
|
||||
*/
|
||||
@Update("UPDATE order_main SET status = 0, pay_status = 3, cancel_time = NOW(), cancel_reason = '诊前退号' WHERE id = #{orderId}")
|
||||
int updateOrderMainForCancellation(@Param("orderId") Long orderId);
|
||||
|
||||
/**
|
||||
* 将检验医嘱状态置为已撤回(STATUS_WITHDRAWN)。
|
||||
* 仅在当前状态为“未执行、未报告、未计费”时生效,防止并发冲突。
|
||||
* 仅在当前状态为"未执行、未报告、未计费"时生效,防止并发冲突。
|
||||
*/
|
||||
@Update("UPDATE adm_order " +
|
||||
"SET status = 'WITHDRAWN', update_time = NOW() " +
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.openhis.web.outpatient.controller;
|
||||
|
||||
import com.openhis.web.outpatient.service.RegistrationService;
|
||||
import com.openhis.web.outpatient.service.RegistrationCancelService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
public class RegistrationController {
|
||||
|
||||
@Autowired
|
||||
private RegistrationService registrationService;
|
||||
private RegistrationCancelService registrationCancelService;
|
||||
|
||||
/**
|
||||
* 诊前退号接口
|
||||
@@ -19,7 +19,7 @@ public class RegistrationController {
|
||||
*/
|
||||
@PostMapping("/refund")
|
||||
public String refund(@RequestParam Long registrationId) {
|
||||
registrationService.refundRegistration(registrationId);
|
||||
registrationCancelService.refundRegistration(registrationId);
|
||||
return "退号成功";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,9 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* 门诊号源预约 Mapper
|
||||
* 修复 Bug #570:规范号源状态流转,移除“已锁定”状态,确保预约成功后状态正确落库为 2(已预约)
|
||||
* 修复 Bug #570:规范号源状态流转,移除"已锁定"状态,确保预约成功后状态正确落库为 2(已预约)
|
||||
* 新增:状态流转至已取号(3) 的接口,解决预约签到缴费成功后状态未及时流转的问题(Bug #574)
|
||||
* 修复 Bug #575:新增 selectPoolIdBySlotId 方法,用于预约时获取 pool_id 以累加 booked_num
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppointmentSlotMapper {
|
||||
@@ -33,9 +34,18 @@ public interface AppointmentSlotMapper {
|
||||
"WHERE id = #{slotId} AND status = 2")
|
||||
int updateSlotToTaken(@Param("slotId") Long slotId);
|
||||
|
||||
/**
|
||||
* 根据号源ID查询关联的号源池ID(用于预约时累加 booked_num)
|
||||
*
|
||||
* @param slotId 号源主键
|
||||
* @return 关联的号源池ID
|
||||
*/
|
||||
@Select("SELECT pool_id FROM adm_schedule_slot WHERE id = #{slotId}")
|
||||
Long selectPoolIdBySlotId(@Param("slotId") Long slotId);
|
||||
|
||||
/**
|
||||
* 根据状态查询号源列表
|
||||
* 修复点:支持按 status=2 精确查询,兼容前端“已预约”筛选条件
|
||||
* 修复点:支持按 status=2 精确查询,兼容前端"已预约"筛选条件
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT id, slot_no, doctor_name, dept_name, schedule_date, status, order_id " +
|
||||
|
||||
@@ -16,6 +16,12 @@ import java.util.Map;
|
||||
@Mapper
|
||||
public interface RegistrationCancelMapper {
|
||||
|
||||
/**
|
||||
* 根据挂号ID查询订单关联信息(order_id, pay_amount 等)
|
||||
*/
|
||||
@Select("SELECT id AS reg_id, order_id, slot_id, pool_id, pay_amount, status FROM his_outpatient_registration WHERE id = #{registrationId}")
|
||||
Map<String, Object> selectRegistrationById(@Param("registrationId") Long registrationId);
|
||||
|
||||
/**
|
||||
* 查询号源关联的排班池ID
|
||||
*/
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
package com.openhis.web.outpatient.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
/**
|
||||
* 门诊挂号数据访问层
|
||||
*
|
||||
* 修复 Bug #506:
|
||||
* 退号需严格遵循 PRD 定义同步更新多表状态。
|
||||
* 1. order_main: status=0(已取消), pay_status=3(已退费), cancel_time=当前时间, cancel_reason='诊前退号'
|
||||
* 2. adm_schedule_slot: status=0(待约), order_id=NULL(释放号源)
|
||||
* 3. adm_schedule_pool: version=version+1, booked_num=booked_num-1(修正此前版本与预约数搞反的问题)
|
||||
* 4. refund_log: 正确关联 order_main.id
|
||||
* 使用 PostgreSQL 原生 NOW() 确保 cancel_time 时分秒精准,避免旧版时间截取错误。
|
||||
*
|
||||
* 新增:
|
||||
* 预约挂号缴费成功后,需要将对应的排班槽状态更新为 “3”(已取号)。
|
||||
* 该方法在支付成功的业务流程中调用,确保状态及时流转。
|
||||
*/
|
||||
@Mapper
|
||||
public interface RegistrationMapper {
|
||||
|
||||
/**
|
||||
* 统一退号(诊前退号)SQL。
|
||||
*
|
||||
* @param orderId 挂号订单主键 ID (order_main.id)
|
||||
* @param poolId 排班池主键 ID (adm_schedule_pool.id)
|
||||
* @return 受影响的行数
|
||||
*/
|
||||
@Update({
|
||||
"<script>",
|
||||
"UPDATE order_main SET status = 0, pay_status = 3, cancel_time = NOW(), cancel_reason = '诊前退号' WHERE id = #{orderId};",
|
||||
"UPDATE adm_schedule_slot SET status = 0, order_id = NULL WHERE order_id = #{orderId};",
|
||||
"UPDATE adm_schedule_pool SET version = version + 1, booked_num = booked_num - 1 WHERE id = #{poolId};",
|
||||
"INSERT INTO refund_log (order_id, refund_time, status) VALUES (#{orderId}, NOW(), 1) ON CONFLICT (order_id) DO UPDATE SET order_id = EXCLUDED.order_id;",
|
||||
"</script>"
|
||||
})
|
||||
int cancelRegistration(@Param("orderId") Long orderId, @Param("poolId") Long poolId);
|
||||
|
||||
/**
|
||||
* 旧的单表状态更新(已废弃,仅为兼容历史代码)。
|
||||
*
|
||||
* @param registrationId 挂号主键 ID
|
||||
* @param status 新状态值
|
||||
* @return 受影响行数
|
||||
*/
|
||||
@Update("UPDATE his_outpatient_registration SET status = #{status} WHERE id = #{registrationId}")
|
||||
int updateStatus(@Param("registrationId") Long registrationId, @Param("status") Integer status);
|
||||
|
||||
/**
|
||||
* 预约挂号缴费成功后,更新对应排班槽状态为 “3”(已取号)。
|
||||
*
|
||||
* @param orderId 挂号订单主键 ID (order_main.id)
|
||||
* @return 受影响的行数
|
||||
*/
|
||||
@Update("UPDATE adm_schedule_slot SET status = 3 WHERE order_id = #{orderId}")
|
||||
int updateSlotStatusToTaken(@Param("orderId") Long orderId);
|
||||
}
|
||||
@@ -1,59 +1,27 @@
|
||||
package com.openhis.web.outpatient.service;
|
||||
|
||||
import com.openhis.web.outpatient.mapper.AppointmentMapper;
|
||||
import com.openhis.web.outpatient.mapper.ScheduleSlotMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 门诊预约业务服务
|
||||
*
|
||||
* 修复 Bug #574:
|
||||
* 预约签到缴费成功后,数据库表 adm_schedule_slot.status 未及时流转为 “3”(已取号)。
|
||||
* 原因是缴费成功后仅更新了 his_appointment 表的状态,而没有同步更新对应的排班槽状态。
|
||||
* 现在在缴费成功的业务流程中,统一使用事务并显式调用 ScheduleSlotMapper.updateSlotStatus
|
||||
* 将对应的 slot 状态更新为 3,确保前端排班显示与实际业务保持一致。
|
||||
* 门诊预约业务接口
|
||||
*
|
||||
* 修复 Bug #574:定义 confirmPaymentAndTake 接口方法,
|
||||
* 预约签到缴费成功后通过 AppointmentServiceImpl 将号源状态流转为已取号(3)。
|
||||
*/
|
||||
@Service
|
||||
public class AppointmentService {
|
||||
|
||||
@Autowired
|
||||
private AppointmentMapper appointmentMapper;
|
||||
|
||||
@Autowired
|
||||
private ScheduleSlotMapper scheduleSlotMapper;
|
||||
public interface AppointmentService {
|
||||
|
||||
/**
|
||||
* 预约签到并完成缴费
|
||||
* 预约号源
|
||||
*
|
||||
* @param appointmentId 预约主键ID
|
||||
* @param payAmount 实际缴费金额
|
||||
* @return true 表示缴费成功并完成状态流转
|
||||
* @param slotId 号源ID
|
||||
* @param orderId 预约订单ID
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean signInAndPay(Long appointmentId, Double payAmount) {
|
||||
// 1. 校验预约是否存在且未缴费
|
||||
Integer count = appointmentMapper.checkCanPay(appointmentId);
|
||||
if (count == null || count == 0) {
|
||||
return false;
|
||||
}
|
||||
void bookSlot(Long slotId, Long orderId);
|
||||
|
||||
// 2. 更新预约表的缴费状态、缴费时间、实际金额
|
||||
int upd = appointmentMapper.updatePaymentInfo(appointmentId, payAmount);
|
||||
if (upd <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 3. 获取对应的排班槽ID(adm_schedule_slot.id)
|
||||
Long slotId = appointmentMapper.selectSlotIdByAppointmentId(appointmentId);
|
||||
if (slotId != null) {
|
||||
// 4. 将排班槽状态更新为 “3”(已取号)
|
||||
scheduleSlotMapper.updateSlotStatus(slotId, 3);
|
||||
}
|
||||
|
||||
// 5. 若还有后续业务(如生成取号记录),在同一事务内完成
|
||||
// 这里预留扩展点,当前仅返回成功标识
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* 预约签到缴费成功后,将号源状态更新为已取号(3)
|
||||
*
|
||||
* @param slotId 号源ID
|
||||
*/
|
||||
void confirmPaymentAndTake(Long slotId);
|
||||
}
|
||||
|
||||
@@ -1,21 +1,30 @@
|
||||
package com.openhis.web.outpatient.service;
|
||||
|
||||
import com.openhis.web.outpatient.mapper.AppointmentSlotMapper;
|
||||
import com.openhis.web.appointment.mapper.SchedulePoolMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 门诊预约服务实现
|
||||
* 修复 Bug #570:简化预约状态流转,确保事务内直接落库为“已预约”状态
|
||||
* 新增:预约签到缴费成功后状态流转为“已取号”(3) 的业务(Bug #574)
|
||||
* 修复 Bug #570:简化预约状态流转,确保事务内直接落库为"已预约"状态
|
||||
* 新增:预约签到缴费成功后状态流转为"已取号"(3) 的业务(Bug #574)
|
||||
* 修复 Bug #575:预约成功后实时原子累加 adm_schedule_pool.booked_num
|
||||
*/
|
||||
@Service
|
||||
public class AppointmentServiceImpl implements AppointmentService {
|
||||
|
||||
private final AppointmentSlotMapper slotMapper;
|
||||
private static final Logger logger = LoggerFactory.getLogger(AppointmentServiceImpl.class);
|
||||
|
||||
public AppointmentServiceImpl(AppointmentSlotMapper slotMapper) {
|
||||
private final AppointmentSlotMapper slotMapper;
|
||||
private final SchedulePoolMapper schedulePoolMapper;
|
||||
|
||||
public AppointmentServiceImpl(AppointmentSlotMapper slotMapper,
|
||||
SchedulePoolMapper schedulePoolMapper) {
|
||||
this.slotMapper = slotMapper;
|
||||
this.schedulePoolMapper = schedulePoolMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -30,6 +39,19 @@ public class AppointmentServiceImpl implements AppointmentService {
|
||||
if (updated == 0) {
|
||||
throw new RuntimeException("号源状态异常或已被他人预约,请刷新后重试");
|
||||
}
|
||||
|
||||
// 修复 Bug #575:实时原子累加号源池已预约数
|
||||
Long poolId = slotMapper.selectPoolIdBySlotId(slotId);
|
||||
if (poolId != null) {
|
||||
int poolUpdated = schedulePoolMapper.incrementBookedNum(poolId);
|
||||
if (poolUpdated > 0) {
|
||||
logger.info("预约成功,号源池 booked_num 已实时累加: slotId={}, poolId={}", slotId, poolId);
|
||||
} else {
|
||||
logger.warn("号源池 booked_num 累加失败,可能号源池已被删除: slotId={}, poolId={}", slotId, poolId);
|
||||
}
|
||||
} else {
|
||||
logger.warn("号源未关联号源池,跳过 booked_num 更新: slotId={}", slotId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,6 +8,13 @@ import java.math.BigDecimal;
|
||||
*/
|
||||
public interface RegistrationCancelService {
|
||||
|
||||
/**
|
||||
* 执行门诊诊前退号操作(通过挂号ID查找关联订单后进行完整退号流程)
|
||||
*
|
||||
* @param registrationId 挂号主键 ID (his_outpatient_registration.id)
|
||||
*/
|
||||
void refundRegistration(Long registrationId);
|
||||
|
||||
/**
|
||||
* 执行门诊诊前退号操作
|
||||
*
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.openhis.web.outpatient.service;
|
||||
|
||||
import com.openhis.web.outpatient.mapper.RegistrationCancelMapper;
|
||||
import com.openhis.web.inpatient.mapper.OrderMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 门诊挂号退号服务实现
|
||||
@@ -13,28 +16,83 @@ import java.math.BigDecimal;
|
||||
public class RegistrationCancelServiceImpl implements RegistrationCancelService {
|
||||
|
||||
private final RegistrationCancelMapper cancelMapper;
|
||||
private final OrderMapper orderMapper;
|
||||
|
||||
public RegistrationCancelServiceImpl(RegistrationCancelMapper cancelMapper) {
|
||||
public RegistrationCancelServiceImpl(RegistrationCancelMapper cancelMapper,
|
||||
OrderMapper orderMapper) {
|
||||
this.cancelMapper = cancelMapper;
|
||||
this.orderMapper = orderMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void cancelRegistration(Long orderId, Long slotId, Long poolId, BigDecimal refundAmount, String operator) {
|
||||
if (orderId == null || slotId == null || poolId == null) {
|
||||
throw new IllegalArgumentException("退号核心参数缺失:orderId, slotId, poolId 均不可为空");
|
||||
public void refundRegistration(Long registrationId) {
|
||||
// 1. 查询挂号记录,获取 order_id 和 pay_amount
|
||||
Map<String, Object> reg = cancelMapper.selectRegistrationById(registrationId);
|
||||
if (reg == null) {
|
||||
throw new IllegalArgumentException("挂号记录不存在");
|
||||
}
|
||||
|
||||
// 1. 更新订单主表:状态置为已取消(2),支付状态置为已退费(2),记录精准取消时间与标准原因
|
||||
cancelMapper.updateOrderStatus(orderId);
|
||||
Object orderIdObj = reg.get("order_id");
|
||||
if (orderIdObj == null) {
|
||||
throw new IllegalArgumentException("挂号记录未关联订单");
|
||||
}
|
||||
Long orderId = Long.valueOf(orderIdObj.toString());
|
||||
BigDecimal payAmount = reg.get("pay_amount") != null
|
||||
? new BigDecimal(reg.get("pay_amount").toString())
|
||||
: BigDecimal.ZERO;
|
||||
|
||||
// 2. 记录退费日志:强制关联 order_main.id,打通财务对账数据链
|
||||
cancelMapper.insertRefundLog(orderId, refundAmount, operator);
|
||||
// 2. 执行完整退号流程
|
||||
cancelRegistration(orderId, payAmount);
|
||||
}
|
||||
|
||||
// 3. 释放号源:状态回滚至待约(1),清空关联订单ID,允许号源重新进入预约池
|
||||
cancelMapper.rollbackSlotStatus(slotId);
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void cancelRegistration(Long orderId, BigDecimal refundAmount) {
|
||||
if (orderId == null) {
|
||||
throw new IllegalArgumentException("订单ID不能为空");
|
||||
}
|
||||
|
||||
// 4. 更新号源池:已约数减1,乐观锁版本号加1,防止并发超卖并修正历史版本字段错位问题
|
||||
cancelMapper.updatePoolVersionAndBookedNum(poolId);
|
||||
// 1. 更新 order_main 状态:status=0(已取消), pay_status=3(已退费), cancel_time=当前时间, cancel_reason='诊前退号'
|
||||
int orderUpdated = cancelMapper.updateOrderStatus(orderId);
|
||||
if (orderUpdated == 0) {
|
||||
throw new RuntimeException("订单状态更新失败,请检查订单是否存在或已退号");
|
||||
}
|
||||
|
||||
// 2. 将关联的医嘱状态更新为 PRD 定义的 "CANCELLED"
|
||||
int orderStatusUpdated = orderMapper.updateOrderStatusToCancelled(orderId, OrderMapper.ORDER_STATUS_CANCELLED);
|
||||
if (orderStatusUpdated == 0) {
|
||||
throw new RuntimeException("医嘱状态更新为 CANCELLED 失败,请检查医嘱是否存在或已被处理");
|
||||
}
|
||||
|
||||
// 3. 先查询号源信息(获取 pool_id),必须在回滚 slot 之前执行
|
||||
// 因为 rollbackSlotStatus 会将 order_id 置为 NULL,后续无法再通过 order_id 查到
|
||||
Map<String, Object> slotInfo = cancelMapper.selectSlotByOrderId(orderId);
|
||||
Long poolId = null;
|
||||
if (slotInfo != null && slotInfo.get("pool_id") != null) {
|
||||
poolId = Long.valueOf(slotInfo.get("pool_id").toString());
|
||||
}
|
||||
|
||||
// 4. 回滚 adm_schedule_slot 状态:status=0(待约), order_id=NULL
|
||||
int slotUpdated = cancelMapper.rollbackSlotStatus(orderId);
|
||||
if (slotUpdated == 0) {
|
||||
throw new RuntimeException("号源状态回滚失败");
|
||||
}
|
||||
|
||||
// 5. 更新 adm_schedule_pool:version=version+1, booked_num=booked_num-1
|
||||
if (poolId != null) {
|
||||
int poolUpdated = cancelMapper.updatePoolVersion(poolId);
|
||||
if (poolUpdated == 0) {
|
||||
throw new RuntimeException("排班池版本与已约数更新失败");
|
||||
}
|
||||
}
|
||||
|
||||
// 6. 记录退款日志,order_id 严格关联 order_main.id
|
||||
if (refundAmount != null && refundAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||
int logInserted = cancelMapper.insertRefundLog(orderId, refundAmount);
|
||||
if (logInserted == 0) {
|
||||
throw new RuntimeException("退费日志插入失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
package com.openhis.web.outpatient.service;
|
||||
|
||||
import com.openhis.web.outpatient.mapper.RegistrationMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 门诊挂号业务服务
|
||||
*
|
||||
* 修复 Bug #506:
|
||||
* 之前的退号实现仅调用 {@link RegistrationMapper#updateRegStatus}
|
||||
* 导致费用表、排队表状态未同步,数据库状态与 PRD 定义不符。
|
||||
*
|
||||
* 现在改为使用 {@link RegistrationMapper#cancelRegistration},并在
|
||||
* 方法上加上 {@code @Transactional},确保在同一事务内完成三表更新。
|
||||
*/
|
||||
@Service
|
||||
public class RegistrationService {
|
||||
|
||||
@Autowired
|
||||
private RegistrationMapper registrationMapper;
|
||||
|
||||
/**
|
||||
* 诊前退号(统一更新挂号、费用、排队三张表的状态)。
|
||||
*
|
||||
* @param registrationId 挂号主键 ID
|
||||
* @return true 表示全部三表均成功更新,false 表示更新失败(受影响行数 < 3)
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean preCancel(Long registrationId) {
|
||||
// 调用统一的多表更新 SQL
|
||||
int affected = registrationMapper.cancelRegistration(registrationId);
|
||||
// 期望受影响行数为 3(每张表各 1 行),否则视为失败
|
||||
return affected == 3;
|
||||
}
|
||||
|
||||
/**
|
||||
* 旧接口保留(兼容旧前端),内部已转为调用统一退号方法。
|
||||
*
|
||||
* @param registrationId 挂号主键 ID
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean cancelLegacy(Long registrationId) {
|
||||
// 直接使用统一方法,保持业务一致性
|
||||
return preCancel(registrationId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询挂号详情(供前端展示)。
|
||||
*/
|
||||
public Map<String, Object> getDetail(Long registrationId) {
|
||||
return registrationMapper.selectRegistrationDetail(registrationId);
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
package com.openhis.web.outpatient.service.impl;
|
||||
|
||||
import com.openhis.web.outpatient.mapper.AppointmentMapper;
|
||||
import com.openhis.web.outpatient.mapper.OrderMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 预约挂号业务实现
|
||||
*
|
||||
* 修复 Bug #506:
|
||||
* 门诊诊前退号后,涉及的多表状态未按 PRD 定义同步更新,导致前端显示异常。
|
||||
* 现在在取消预约的业务路径中统一处理:
|
||||
* 1. 将订单状态置为 “已取消”(4)。
|
||||
* 2. 将对应的 adm_schedule_slot.status 设回 “1”(可预约)。
|
||||
* 3. 将对应的 adm_schedule_pool.booked_num 递减 1。
|
||||
*
|
||||
* 同时保持原有支付成功后的状态同步逻辑不变。
|
||||
*/
|
||||
@Service
|
||||
public class AppointmentServiceImpl {
|
||||
|
||||
@Autowired
|
||||
private OrderMapper orderMapper;
|
||||
|
||||
@Autowired
|
||||
private AppointmentMapper appointmentMapper;
|
||||
|
||||
/**
|
||||
* 预约缴费成功后调用。
|
||||
*
|
||||
* @param orderId 预约订单ID
|
||||
* @param slotId 对应的排班时段ID
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void handlePaymentSuccess(Long orderId, Long slotId) {
|
||||
// 1. 更新订单支付状态为 “已缴费”(2)
|
||||
int orderUpdated = orderMapper.updatePayStatus(orderId, 2);
|
||||
if (orderUpdated != 1) {
|
||||
throw new IllegalStateException("Failed to update payment status for orderId: " + orderId);
|
||||
}
|
||||
|
||||
// 2. 将排班时段状态更新为已取号(3)
|
||||
int slotUpdated = appointmentMapper.updateSlotStatus(slotId, 3);
|
||||
if (slotUpdated != 1) {
|
||||
throw new IllegalStateException("Failed to update slot status for slotId: " + slotId);
|
||||
}
|
||||
|
||||
// 3. 累加排班池已预约人数(已在支付成功时递增)
|
||||
// 此处假设 slot 与 pool 已经关联,业务层可自行获取 poolId 并调用
|
||||
// appointmentMapper.updateBookedNum(poolId, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 门诊诊前退号(取消预约)处理。
|
||||
*
|
||||
* @param orderId 预约订单ID
|
||||
* @param slotId 对应的排班时段ID
|
||||
* @param poolId 对应的排班池ID(用于 booked_num 调整)
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void cancelPreRegistration(Long orderId, Long slotId, Long poolId) {
|
||||
// 1. 将订单状态更新为 “已取消”(4)
|
||||
int orderUpdated = orderMapper.updateOrderStatus(orderId, 4);
|
||||
if (orderUpdated != 1) {
|
||||
throw new IllegalStateException("Failed to cancel orderId: " + orderId);
|
||||
}
|
||||
|
||||
// 2. 将排班时段状态恢复为 “可预约”(1)
|
||||
int slotUpdated = appointmentMapper.updateSlotStatus(slotId, 1);
|
||||
if (slotUpdated != 1) {
|
||||
throw new IllegalStateException("Failed to reset slot status for slotId: " + slotId);
|
||||
}
|
||||
|
||||
// 3. 已预约人数递减 1,防止 booked_num 超出实际可用数
|
||||
int poolUpdated = appointmentMapper.updateBookedNum(poolId, -1);
|
||||
if (poolUpdated != 1) {
|
||||
throw new IllegalStateException("Failed to decrement booked_num for poolId: " + poolId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
package com.openhis.web.outpatient.service.impl;
|
||||
|
||||
import com.openhis.web.outpatient.mapper.RegistrationCancelMapper;
|
||||
import com.openhis.web.outpatient.service.RegistrationCancelService;
|
||||
import com.openhis.web.inpatient.mapper.OrderMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 门诊挂号退号业务实现
|
||||
* 修复 Bug #506:确保退号后 order_main、adm_schedule_slot、adm_schedule_pool、refund_log 状态与 PRD 严格一致
|
||||
* 以及在退号后统一调用 {@link OrderMapper#updateOrderStatusToCancelled} 将医嘱状态置为 PRD 定义的 “CANCELLED”。
|
||||
*/
|
||||
@Service
|
||||
public class RegistrationCancelServiceImpl implements RegistrationCancelService {
|
||||
|
||||
private final RegistrationCancelMapper cancelMapper;
|
||||
private final OrderMapper orderMapper;
|
||||
|
||||
public RegistrationCancelServiceImpl(RegistrationCancelMapper cancelMapper,
|
||||
OrderMapper orderMapper) {
|
||||
this.cancelMapper = cancelMapper;
|
||||
this.orderMapper = orderMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void cancelRegistration(Long orderId, BigDecimal refundAmount) {
|
||||
if (orderId == null) {
|
||||
throw new IllegalArgumentException("订单ID不能为空");
|
||||
}
|
||||
|
||||
// 1. 更新 order_main 状态:status=0(已取消), pay_status=3(已退费), cancel_time=当前时间, cancel_reason='诊前退号'
|
||||
int orderUpdated = cancelMapper.updateOrderStatus(orderId);
|
||||
if (orderUpdated == 0) {
|
||||
throw new RuntimeException("订单状态更新失败,请检查订单是否存在或已退号");
|
||||
}
|
||||
|
||||
// 2. 将关联的医嘱状态更新为 PRD 定义的 “CANCELLED”
|
||||
int orderStatusUpdated = orderMapper.updateOrderStatusToCancelled(orderId, OrderMapper.ORDER_STATUS_CANCELLED);
|
||||
if (orderStatusUpdated == 0) {
|
||||
// 若医嘱状态未更新,回滚事务并抛异常,保持数据一致性
|
||||
throw new RuntimeException("医嘱状态更新为 CANCELLED 失败,请检查医嘱是否存在或已被处理");
|
||||
}
|
||||
|
||||
// 3. 回滚 adm_schedule_slot 状态:status=0(待约), order_id=NULL
|
||||
int slotUpdated = cancelMapper.rollbackSlotStatus(orderId);
|
||||
if (slotUpdated == 0) {
|
||||
throw new RuntimeException("号源状态回滚失败");
|
||||
}
|
||||
|
||||
// 4. 更新 adm_schedule_pool:version=version+1, booked_num=booked_num-1
|
||||
Map<String, Object> slotInfo = cancelMapper.selectSlotByOrderId(orderId);
|
||||
if (slotInfo != null && slotInfo.get("pool_id") != null) {
|
||||
Long poolId = Long.valueOf(slotInfo.get("pool_id").toString());
|
||||
int poolUpdated = cancelMapper.updatePoolVersion(poolId);
|
||||
if (poolUpdated == 0) {
|
||||
throw new RuntimeException("排班池版本与已约数更新失败");
|
||||
}
|
||||
}
|
||||
|
||||
// 5. 记录退款日志(如有需要,此处可调用相应的 RefundLogMapper)
|
||||
// 省略实现细节,保持业务完整性
|
||||
}
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
package com.openhis.web.outpatient.service.impl;
|
||||
|
||||
import com.openhis.web.outpatient.mapper.OrderMapper;
|
||||
import com.openhis.web.outpatient.mapper.RegistrationMapper;
|
||||
import com.openhis.web.outpatient.service.RegistrationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 门诊挂号业务实现
|
||||
*
|
||||
* 修复说明 (Bug #506):
|
||||
* 诊前退号后,原逻辑未同步更新 order_main、adm_schedule_slot、adm_schedule_pool 及 refund_log 表,
|
||||
* 导致状态值与 PRD 定义不符、号源无法复用、退费日志断链。
|
||||
* 本次修复:
|
||||
* 1. 在单一事务内串行执行多表更新,确保数据强一致性。
|
||||
* 2. 严格使用 PRD 定义的状态码与字段值(status=0, pay_status=3, cancel_reason='诊前退号')。
|
||||
* 3. 使用 NOW() 写入准确的取消时间,避免时分秒丢失。
|
||||
* 4. 号源池 version 累加 1,booked_num 扣减 1,slot 状态回滚至 0 并清空 order_id。
|
||||
* 5. refund_log 显式关联 order_main.id。
|
||||
*
|
||||
* 新增说明 (Bug #574):
|
||||
* 预约签到缴费成功后,需要将对应的号源 slot 状态更新为 “3”(已取)。
|
||||
* 为此在支付成功的业务路径中调用 `registrationMapper.updateSlotStatusToTaken`。
|
||||
*/
|
||||
@Service
|
||||
public class RegistrationServiceImpl implements RegistrationService {
|
||||
|
||||
@Autowired
|
||||
private RegistrationMapper registrationMapper;
|
||||
|
||||
@Autowired
|
||||
private OrderMapper orderMapper;
|
||||
|
||||
/**
|
||||
* 诊前退号
|
||||
*
|
||||
* @param registrationId 挂号主键
|
||||
* @param operator 操作人姓名
|
||||
* @return true 表示退号成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean cancelRegistrationBeforeVisit(Long registrationId, String operator) {
|
||||
// 1. 查询挂号信息,确保处于可退号状态
|
||||
Map<String, Object> reg = registrationMapper.selectRegistrationById(registrationId);
|
||||
if (reg == null) {
|
||||
throw new IllegalArgumentException("挂号记录不存在");
|
||||
}
|
||||
|
||||
String status = (String) reg.get("status");
|
||||
// PRD 中可退号状态一般为 “0”(已预约) 或 “1”(已支付) 等,这里假设 0 为可退
|
||||
if (!"0".equals(status) && !"1".equals(status)) {
|
||||
throw new IllegalStateException("当前挂号状态不可退号");
|
||||
}
|
||||
|
||||
Long orderId = (Long) reg.get("order_id");
|
||||
Long slotId = (Long) reg.get("slot_id");
|
||||
Long poolId = (Long) reg.get("pool_id");
|
||||
BigDecimal payAmount = (BigDecimal) reg.get("pay_amount");
|
||||
|
||||
// 2. 更新医嘱主表状态为已取消、已退费
|
||||
orderMapper.updateOrderMainForCancellation(
|
||||
orderId,
|
||||
OrderMapper.ORDER_STATUS_CANCELLED,
|
||||
OrderMapper.ORDER_PAY_STATUS_REFUNDED,
|
||||
"诊前退号"
|
||||
);
|
||||
|
||||
// 3. 回滚号源 slot 为待约 (status=0) 并清空 order_id
|
||||
registrationMapper.rollbackScheduleSlot(slotId);
|
||||
|
||||
// 4. 更新号源池 version 与 booked_num
|
||||
registrationMapper.updateSchedulePoolOnCancel(poolId);
|
||||
|
||||
// 5. 插入退费日志,关联到 order_main
|
||||
if (payAmount != null && payAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||
registrationMapper.insertRefundLog(orderId, payAmount, operator);
|
||||
}
|
||||
|
||||
// 6. 最后更新挂号主表状态为已退号(status=0)
|
||||
registrationMapper.updateRegistrationStatus(registrationId, "0", operator);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
package com.openhis.web.outpatient.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 门诊挂号数据访问层
|
||||
*
|
||||
* 修复 Bug #506:
|
||||
* 门诊诊前退号后,系统只更新了挂号表的状态,而未同步更新
|
||||
* 关联的费用表(his_registration_fee)以及患者排队表(his_registration_queue)的状态,
|
||||
* 导致数据库中多表状态与 PRD(“退号后挂号状态=3、费用状态=2、排队状态=0”)不一致。
|
||||
*
|
||||
* 解决方案:
|
||||
* 1. 在退号操作中统一使用 {@link #cancelRegistration(Long)} 方法,
|
||||
* 该方法一次性完成三张表的状态更新,确保事务一致性。
|
||||
* 2. 采用 MySQL 多表 UPDATE 语法,一次提交完成所有状态变更,避免因分散
|
||||
* 多次调用导致的中间状态不一致。
|
||||
* 3. 为兼容历史代码,保留原来的单表更新方法 {@code updateRegStatus},但
|
||||
* 在业务层已改为调用新的统一方法。
|
||||
*/
|
||||
@Mapper
|
||||
public interface RegistrationMapper {
|
||||
|
||||
/**
|
||||
* 旧版:仅更新挂号表状态(已废弃,仅为兼容历史调用)。
|
||||
*/
|
||||
@Update("UPDATE his_registration SET status = #{status} WHERE id = #{regId}")
|
||||
int updateRegStatus(@Param("regId") Long regId, @Param("status") Integer status);
|
||||
|
||||
/**
|
||||
* 统一退号:一次性更新挂号表、费用表、排队表的状态。
|
||||
*
|
||||
* PRD 约定的状态值:
|
||||
* - 挂号表 status = 3 (已退号)
|
||||
* - 费用表 fee_status = 2 (已退款)
|
||||
* - 排队表 queue_status = 0 (未排队/已移除)
|
||||
*
|
||||
* @param regId 挂号主键 ID
|
||||
* @return 受影响的行数(3 表均成功更新返回 3,否则返回 <3)
|
||||
*/
|
||||
@Update({
|
||||
"<script>",
|
||||
"UPDATE his_registration r",
|
||||
"JOIN his_registration_fee f ON f.registration_id = r.id",
|
||||
"JOIN his_registration_queue q ON q.registration_id = r.id",
|
||||
"SET r.status = 3,",
|
||||
" f.fee_status = 2,",
|
||||
" q.queue_status = 0",
|
||||
"WHERE r.id = #{regId}",
|
||||
"</script>"
|
||||
})
|
||||
int cancelRegistration(@Param("regId") Long regId);
|
||||
|
||||
/**
|
||||
* 查询挂号详情(用于前端展示)。
|
||||
*/
|
||||
@Select("SELECT r.id, r.patient_id, r.doctor_id, r.status, r.register_time, " +
|
||||
"f.amount, f.fee_status, q.queue_status " +
|
||||
"FROM his_registration r " +
|
||||
"LEFT JOIN his_registration_fee f ON f.registration_id = r.id " +
|
||||
"LEFT JOIN his_registration_queue q ON q.registration_id = r.id " +
|
||||
"WHERE r.id = #{regId}")
|
||||
Map<String, Object> selectRegistrationDetail(@Param("regId") Long regId);
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package com.openhis.web.inpatient.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 医嘱相关 Mapper
|
||||
*
|
||||
* 新增:撤回检验申请的状态更新SQL(Bug #571)以及退回状态更新(Bug #505)。
|
||||
*
|
||||
* 修复 Bug #506:
|
||||
* 门诊诊前退号后,系统需要将医嘱状态更新为 PRD 中约定的 “CANCELLED” 状态。
|
||||
* 之前的实现直接将 status 设置为硬编码的 'RETURNED',与生产环境定义不符,导致后续业务查询异常。
|
||||
* 这里统一使用业务常量 {@code ORDER_STATUS_CANCELLED},并在 SQL 中使用占位符,以便后续统一维护。
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderMapper {
|
||||
|
||||
// 业务常量,保持与 PRD 定义同步
|
||||
String ORDER_STATUS_CANCELLED = "CANCELLED";
|
||||
|
||||
@Select("SELECT * FROM adm_order WHERE id = #{orderId}")
|
||||
Map<String, Object> selectOrderById(@Param("orderId") Long orderId);
|
||||
|
||||
/**
|
||||
* 将医嘱状态更新为 “CANCELLED”。仅在当前状态为 ACTIVE 时生效,防止重复或错误更新。
|
||||
*/
|
||||
@Update("UPDATE adm_order SET status = #{cancelStatus} WHERE id = #{orderId} AND status = 'ACTIVE'")
|
||||
int updateOrderStatusToCancelled(@Param("orderId") Long orderId, @Param("cancelStatus") String cancelStatus);
|
||||
|
||||
@Update("UPDATE adm_order SET status = 'RETURNED' WHERE id = #{orderId} AND status = 'ACTIVE'")
|
||||
int updateOrderStatusToReturned(@Param("orderId") Long orderId);
|
||||
|
||||
/**
|
||||
* 将检验医嘱状态置为已撤回(STATUS_WITHDRAWN)。
|
||||
* 仅在当前状态为“未执行、未报告、未计费”时生效,防止并发冲突。
|
||||
*/
|
||||
@Update("UPDATE adm_order " +
|
||||
"SET status = 'WITHDRAWN', update_time = NOW() " +
|
||||
"WHERE id = #{orderId} " +
|
||||
" AND (exec_status IS NULL OR exec_status = '未执行' OR exec_status = 'NOT_EXECUTED') " +
|
||||
" AND (report_status IS NULL OR report_status = '未报告' OR report_status = 'NOT_REPORTED') " +
|
||||
" AND (charge_status IS NULL OR charge_status = '未计费' OR charge_status = 'NOT_CHARGED')")
|
||||
int updateOrderStatusToWithdrawn(@Param("orderId") Long orderId);
|
||||
}
|
||||
@@ -154,7 +154,11 @@
|
||||
ii.account_id AS account_id,
|
||||
ii.performer_check_id,
|
||||
ii.category_code,
|
||||
ii.dispense_status
|
||||
ii.dispense_status,
|
||||
ii.unit_price,
|
||||
ii.total_price,
|
||||
ii.stopper_id,
|
||||
ii.stopper_name
|
||||
FROM (( SELECT DISTINCT T1.encounter_id,
|
||||
T1.tenant_id,
|
||||
#{medMedicationRequest} AS advice_table,
|
||||
@@ -199,7 +203,11 @@
|
||||
personal_account.balance_amount,
|
||||
personal_account.id AS account_id,
|
||||
T2.category_code,
|
||||
mmd.status_enum AS dispense_status
|
||||
mmd.status_enum AS dispense_status,
|
||||
NULL::numeric AS unit_price,
|
||||
NULL::numeric AS total_price,
|
||||
NULL::bigint AS stopper_id,
|
||||
NULL::varchar AS stopper_name
|
||||
FROM med_medication_request AS T1
|
||||
LEFT JOIN med_medication_definition AS T2
|
||||
ON T2.id = T1.medication_id
|
||||
@@ -341,7 +349,11 @@
|
||||
personal_account.balance_amount,
|
||||
personal_account.id AS account_id,
|
||||
T2.category_code,
|
||||
NULL::integer AS dispense_status
|
||||
NULL::integer AS dispense_status,
|
||||
NULL::numeric AS unit_price,
|
||||
NULL::numeric AS total_price,
|
||||
NULL::bigint AS stopper_id,
|
||||
NULL::varchar AS stopper_name
|
||||
FROM wor_service_request AS T1
|
||||
LEFT JOIN wor_activity_definition AS T2
|
||||
ON T2.id = T1.activity_id
|
||||
|
||||
97
openhis-ui-vue3/src/api/inpatient/nurse.js
Normal file
97
openhis-ui-vue3/src/api/inpatient/nurse.js
Normal file
@@ -0,0 +1,97 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 获取医嘱校对列表
|
||||
* 对应后端: GET /nurse-station/advice-process/inpatient-advice
|
||||
* @param {Object} params 查询参数
|
||||
* @param {string} params.encounterIds 住院患者ID集合(逗号分隔)
|
||||
* @param {number} params.therapyEnum 医嘱类型
|
||||
* @param {number} params.requestStatus 请求状态
|
||||
* @param {number} pageNo 页码
|
||||
* @param {number} pageSize 每页条数
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getVerificationList(encounterIds, params = {}) {
|
||||
return request({
|
||||
url: '/nurse-station/advice-process/inpatient-advice',
|
||||
method: 'get',
|
||||
params: {
|
||||
encounterIds,
|
||||
pageNo: params.pageNo || 1,
|
||||
pageSize: params.pageSize || 20,
|
||||
requestStatus: params.requestStatus,
|
||||
therapyEnum: params.therapyEnum
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医嘱校对列表(兼容 OrderVerify.vue 调用)
|
||||
* @param {number} patientId 患者ID
|
||||
* @param {Object} params 查询参数
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getVerifyOrderList(patientId, params = {}) {
|
||||
return request({
|
||||
url: '/nurse-station/advice-process/inpatient-advice',
|
||||
method: 'get',
|
||||
params: {
|
||||
encounterIds: patientId,
|
||||
pageNo: params.pageNo || 1,
|
||||
pageSize: params.pageSize || 20,
|
||||
requestStatus: params.requestStatus
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱校对通过
|
||||
* @param {Object|Array} data 医嘱信息集合
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function verifyOrder(data) {
|
||||
return request({
|
||||
url: '/nurse-station/advice-process/advice-verify',
|
||||
method: 'put',
|
||||
data: Array.isArray(data) ? data : [data]
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱退回
|
||||
* @param {Array} data 医嘱信息集合
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function rejectOrder(data) {
|
||||
return request({
|
||||
url: '/nurse-station/advice-process/advice-reject',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱执行
|
||||
* @param {Object} data 执行参数
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function executeOrder(data) {
|
||||
return request({
|
||||
url: '/nurse-station/advice-process/advice-execute',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱取消执行
|
||||
* @param {Object} data 取消执行参数
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function cancelOrder(data) {
|
||||
return request({
|
||||
url: '/nurse-station/advice-process/advice-cancel',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
21
openhis-ui-vue3/src/api/inpatient/nurse/order.js
Normal file
21
openhis-ui-vue3/src/api/inpatient/nurse/order.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 获取医嘱校对列表(分页)
|
||||
* 对应后端: GET /nurse-station/advice-process/inpatient-advice
|
||||
* @param {Object} params 查询参数
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getVerifyOrderList(params = {}) {
|
||||
return request({
|
||||
url: '/nurse-station/advice-process/inpatient-advice',
|
||||
method: 'get',
|
||||
params: {
|
||||
encounterIds: params.patientId,
|
||||
pageNo: params.pageNum || 1,
|
||||
pageSize: params.pageSize || 20,
|
||||
requestStatus: params.requestStatus,
|
||||
therapyEnum: params.therapyEnum
|
||||
}
|
||||
})
|
||||
}
|
||||
28
openhis-ui-vue3/src/api/inpatient/order.js
Normal file
28
openhis-ui-vue3/src/api/inpatient/order.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 获取已校对医嘱列表
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getVerifiedOrdersApi() {
|
||||
return request({
|
||||
url: '/nurse-station/advice-process/inpatient-advice',
|
||||
method: 'get',
|
||||
params: {
|
||||
requestStatus: 10 // CHECK_VERIFIED
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 退回医嘱
|
||||
* @param {number} orderId 医嘱ID
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function returnOrderApi(orderId) {
|
||||
return request({
|
||||
url: '/nurse-station/advice-process/advice-reject',
|
||||
method: 'put',
|
||||
data: [{ requestId: orderId }]
|
||||
})
|
||||
}
|
||||
27
openhis-ui-vue3/src/utils/request.js
Normal file
27
openhis-ui-vue3/src/utils/request.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import axios from 'axios'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
// 创建 axios 实例
|
||||
const service = axios.create({
|
||||
baseURL: import.meta.env.VITE_APP_BASE_API || '',
|
||||
timeout: 30000
|
||||
})
|
||||
|
||||
// 响应拦截器
|
||||
service.interceptors.response.use(
|
||||
response => {
|
||||
const res = response.data
|
||||
// 如果响应中有 data 属性,直接返回 res
|
||||
if (res.code === 200 || res.code === undefined) {
|
||||
return res
|
||||
}
|
||||
ElMessage.error(res.msg || '请求失败')
|
||||
return Promise.reject(new Error(res.msg || '请求失败'))
|
||||
},
|
||||
error => {
|
||||
ElMessage.error(error.message || '网络异常')
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
export default service
|
||||
@@ -296,6 +296,14 @@
|
||||
<span v-if="!scope.row.isEdit">
|
||||
{{ scope.row.skinTestFlag_enumText || '-' }}
|
||||
</span>
|
||||
<el-checkbox
|
||||
v-else
|
||||
v-model="scope.row.skinTestFlag"
|
||||
:true-label="1"
|
||||
:false-label="0"
|
||||
>
|
||||
是
|
||||
</el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="诊断" align="center" prop="diagnosisName" width="150">
|
||||
@@ -632,6 +640,13 @@ function getListInfo(addNewRow) {
|
||||
// 确保 therapyEnum 被正确设置,优先使用 contentJson 中的值
|
||||
therapyEnum: String(parsedContent?.therapyEnum ?? item.therapyEnum ?? '1'),
|
||||
// 🔧 修复:确保 orgId 为 String 类型,与 organization 树的 id 类型一致
|
||||
// 确保 skinTestFlag 是数字类型(1 或 0),从 contentJson 恢复
|
||||
skinTestFlag: parsedContent?.skinTestFlag !== undefined && parsedContent?.skinTestFlag !== null
|
||||
? (typeof parsedContent.skinTestFlag === 'number' ? parsedContent.skinTestFlag : (parsedContent.skinTestFlag ? 1 : 0))
|
||||
: 0,
|
||||
skinTestFlag_enumText: parsedContent?.skinTestFlag !== undefined && parsedContent?.skinTestFlag !== null
|
||||
? (parsedContent.skinTestFlag == 1 ? '是' : '否')
|
||||
: '否',
|
||||
// 关键:优先使用 item.positionId(后端 @JsonSerialize 保证精度),
|
||||
// 而非 parsedContent.orgId(来自 JSON.parse,大 Long 可能精度丢失)
|
||||
// 使用 resolveOrgId 从组织树中匹配正确的 String id
|
||||
@@ -963,15 +978,55 @@ function selectAdviceBase(key, row) {
|
||||
setValue(row);
|
||||
// 确保 uniqueKey 不被覆盖
|
||||
prescriptionList.value[rowIndex.value].uniqueKey = currentUniqueKey;
|
||||
// 先清空展开状态,然后在 nextTick 中设置,确保数据更新后再展开
|
||||
|
||||
// 检查是否是皮试药品,如果是则弹出确认提示
|
||||
// 只对药品类型(adviceType=1 药品, adviceType=2 耗材)进行皮试提示
|
||||
const isSkinTestDrug = row.skinTestFlag !== undefined && row.skinTestFlag !== null
|
||||
? (typeof row.skinTestFlag === 'number' ? row.skinTestFlag == 1 : (row.skinTestFlag ? true : false))
|
||||
: false;
|
||||
|
||||
if ((row.adviceType == 1 || row.adviceType == 2) && isSkinTestDrug) {
|
||||
// 弹出皮试确认弹窗
|
||||
ElMessageBox.confirm(
|
||||
`【皮试确认】当前药品是皮试药品,是否皮试?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '是(Y)',
|
||||
cancelButtonText: '否(N)',
|
||||
type: 'warning',
|
||||
closeOnClickModal: false,
|
||||
closeOnPressEscape: false,
|
||||
distinguishCancelAndClose: true,
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
// 用户点击"是",设置皮试标志为"是"
|
||||
prescriptionList.value[rowIndex.value].skinTestFlag = 1;
|
||||
prescriptionList.value[rowIndex.value].skinTestFlag_enumText = '是';
|
||||
expandOrderAndFocus(currentUniqueKey, row);
|
||||
})
|
||||
.catch((action) => {
|
||||
// 用户点击"否",设置皮试标志为"否"
|
||||
prescriptionList.value[rowIndex.value].skinTestFlag = 0;
|
||||
prescriptionList.value[rowIndex.value].skinTestFlag_enumText = '否';
|
||||
expandOrderAndFocus(currentUniqueKey, row);
|
||||
});
|
||||
} else {
|
||||
// 不是皮试药品,直接展开订单
|
||||
expandOrderAndFocus(currentUniqueKey, row);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 展开订单并聚焦输入框
|
||||
*/
|
||||
function expandOrderAndFocus(key, row) {
|
||||
expandOrder.value = [];
|
||||
nextTick(() => {
|
||||
// 使用双重 nextTick 确保 filterPrescriptionList 已更新
|
||||
nextTick(() => {
|
||||
expandOrder.value = [currentUniqueKey];
|
||||
// 如果 expand-row-keys 不生效,使用 toggleRowExpansion 强制展开
|
||||
expandOrder.value = [key];
|
||||
const tableData = filterPrescriptionList.value;
|
||||
const targetRow = tableData.find((item) => item.uniqueKey === currentUniqueKey);
|
||||
const targetRow = tableData.find((item) => item.uniqueKey === key);
|
||||
if (targetRow && prescriptionRef.value) {
|
||||
prescriptionRef.value.toggleRowExpansion(targetRow, true);
|
||||
}
|
||||
@@ -988,6 +1043,7 @@ function selectAdviceBase(key, row) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getOrgList() {
|
||||
getOrgTree().then((res) => {
|
||||
organization.value = res?.data?.records ?? res?.data ?? [];
|
||||
@@ -1389,6 +1445,11 @@ function handleSaveSign(row, index) {
|
||||
if (row.injectFlag == 1) {
|
||||
row.sortNumber = row.sortNumber ? row.sortNumber : prescriptionList.value.length;
|
||||
}
|
||||
// 确保 skinTestFlag 是数字类型(1 或 0)
|
||||
row.skinTestFlag = row.skinTestFlag !== undefined && row.skinTestFlag !== null
|
||||
? (typeof row.skinTestFlag === 'number' ? row.skinTestFlag : (row.skinTestFlag ? 1 : 0))
|
||||
: 0;
|
||||
row.skinTestFlag_enumText = row.skinTestFlag == 1 ? '是' : '否';
|
||||
row.contentJson = JSON.stringify(row);
|
||||
if (row.requestId) {
|
||||
row.dbOpType = '2';
|
||||
@@ -1433,6 +1494,11 @@ function handleSaveBatch() {
|
||||
...item,
|
||||
therapyEnum: therapyEnum,
|
||||
dbOpType: item.requestId ? '2' : '1',
|
||||
// 确保 skinTestFlag 是数字类型(1 或 0)
|
||||
skinTestFlag: item.skinTestFlag !== undefined && item.skinTestFlag !== null
|
||||
? (typeof item.skinTestFlag === "number" ? item.skinTestFlag : (item.skinTestFlag ? 1 : 0))
|
||||
: 0,
|
||||
skinTestFlag_enumText: item.skinTestFlag == 1 ? '是' : '否',
|
||||
};
|
||||
});
|
||||
if (saveList.length == 0) {
|
||||
@@ -1538,6 +1604,13 @@ function setValue(row) {
|
||||
minUnitCode: String(row.minUnitCode),
|
||||
unitCode: row.partAttributeEnum == 1 ? String(row.minUnitCode) : String(row.unitCode),
|
||||
categoryEnum: row.categoryCode,
|
||||
// 确保 skinTestFlag 是数字类型(1 或 0),如果未定义则默认为 0
|
||||
skinTestFlag: row.skinTestFlag !== undefined && row.skinTestFlag !== null
|
||||
? (typeof row.skinTestFlag === 'number' ? row.skinTestFlag : (row.skinTestFlag ? 1 : 0))
|
||||
: 0,
|
||||
skinTestFlag_enumText: (row.skinTestFlag !== undefined && row.skinTestFlag !== null
|
||||
? (typeof row.skinTestFlag === 'number' ? (row.skinTestFlag == 1 ? '是' : '否') : (row.skinTestFlag ? '是' : '否'))
|
||||
: '否'),
|
||||
definitionId: row.chargeItemDefinitionId,
|
||||
executeNum: 1,
|
||||
...(row.adviceType != 3
|
||||
|
||||
Reference in New Issue
Block a user