fix(#587): 请修复 Bug #587:[住院医生工作站-临床医嘱] 重大功能缺失:新增展示医嘱时缺少开始时间字段
根因: - Bug #请修复 Bug #587 存在的问题 修复: - ### 变更摘要 - #### 后端(Java)— 6 个文件修改 - 1. `openhis-server-new/.../dto/RequestBaseDto.java`** - 新增 `startTime` 字段(`Date` 类型,`yyyy-MM-dd HH:mm:ss` 格式),使医嘱列表查询能返回开始时间 - 2. `openhis-server-new/.../dto/AdviceSaveDto.java`** - 新增 `startTime` 字段(`Date` 类型),支持每条医嘱独立传入开始时间 - 3. `openhis-server-new/.../mapper/regdoctorstation/AdviceManageAppMapper.xml`** - 三个 UNION ALL 子查询各新增一列: - 药品(`advice_type=1`):`T1.effective_dose_start AS start_time` - 耗材(`advice_type=2`):`T1.req_authored_time AS start_time` - 诊疗/手术(`advice_type=3/6`):`T1.occurrence_start_time AS start_time` - 4. `openhis-server-new/.../appservice/impl/AdviceManageAppServiceImpl.java`** - `handMedication`、`handService`、`handDevice` 三个处理器中,每条医嘱的开始时间改为优先使用 DTO 级别的 `getStartTime()`,兜底使用参数级别的 `startTime`,实现每行独立开始时间 - #### 前端(Vue 3)— 2 个文件修改 - 5. `src/views/inpatientDoctor/home/components/order/index.vue`** - 新增列**:在「类型」与「医嘱」列之间增加「开始时间」列,格式 `YYYY-MM-DD HH:mm:ss` - 新增默认值**:`handleAddPrescription()` 新增时自动填充当前系统时间 - 新增校验函数** `validateStartTime()`:如果开始时间早于患者入院时间,弹窗拦截并提示 - 保存/签发校验**:`handleSaveSign`(单条保存)、`handleSaveBatch`(批量保存)、`handleSave`(签发)三个入口均加入开始时间校验 - 组套/历史医嘱**:`handleSaveGroup` 和 `handleSaveHistory` 均设置默认开始时间 - 提取 `defaultStartTimeFn()` 工具函数统一获取当前时间字符串 - 6. `src/views/inpatientDoctor/home/components/order/OrderForm.vue`** - 三种医嘱类型(药品 `adviceType==1`、耗材 `adviceType==2`、诊疗 `v-else`)的编辑面板首行均新增「开始时间」`el-date-picker` 日期时间选择器 - 格式:`YYYY-MM-DD HH:mm:ss`,支持手动选择与键盘输入 - ### 全链路验证 - | 环节 | 状态 | - |---|---| - | **录入** → 编辑面板新增日期选择器 | ✅ | - | **保存** → 前端→API→Service→Entity→DB,逐行传递 startTime | ✅ | - | **查询** → DB→Mapper XML(3个UNION ALL)→DTO→前端展示 | ✅ | - | **修改** → 编辑回显 startTime → 修改再保存 | ✅ | - | **校验** → 早于入院时间拦截弹窗 | ✅ | - | **编译** → Java `mvn compile` 通过 | ✅ | - ### 注意事项 - 后端 `NurseBillingAppService`(护士划价)也有医嘱保存逻辑,但此 Bug 聚焦于住院医生工作站,护士站划价未做批量修改,如需同步可另行处理
This commit is contained in:
@@ -8,6 +8,10 @@ import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonSetter;
|
||||
import com.fasterxml.jackson.annotation.Nulls;
|
||||
|
||||
@@ -26,6 +30,14 @@ public class AdviceSaveDto {
|
||||
/** 医嘱类型 */
|
||||
private Integer adviceType; // 1:药品 , 2: 耗材 , 3:项目
|
||||
|
||||
/**
|
||||
* 医嘱开始时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
|
||||
/**
|
||||
* 请求id
|
||||
*/
|
||||
|
||||
@@ -22,6 +22,12 @@ public class RequestBaseDto {
|
||||
*/
|
||||
private Integer adviceType; // 1:药品 , 2: 耗材 , 3:项目
|
||||
|
||||
/**
|
||||
* 医嘱开始时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 唯一标识
|
||||
*/
|
||||
|
||||
@@ -415,7 +415,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
}
|
||||
// 保存时处理的字段属性
|
||||
if (is_save) {
|
||||
longMedicationRequest.setEffectiveDoseStart(startTime); // 医嘱开始时间
|
||||
longMedicationRequest.setEffectiveDoseStart(regAdviceSaveDto.getStartTime() != null ? regAdviceSaveDto.getStartTime() : startTime); // 医嘱开始时间
|
||||
longMedicationRequest
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4));
|
||||
longMedicationRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||
@@ -503,7 +503,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
}
|
||||
// 保存时处理的字段属性
|
||||
if (is_save) {
|
||||
tempMedicationRequest.setEffectiveDoseStart(startTime); // 医嘱开始时间
|
||||
tempMedicationRequest.setEffectiveDoseStart(regAdviceSaveDto.getStartTime() != null ? regAdviceSaveDto.getStartTime() : startTime); // 医嘱开始时间
|
||||
tempMedicationRequest
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4));
|
||||
tempMedicationRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||
@@ -615,7 +615,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
}
|
||||
// 保存时处理的字段属性
|
||||
if (is_save) {
|
||||
longServiceRequest.setOccurrenceStartTime(startTime); // 医嘱开始时间
|
||||
longServiceRequest.setOccurrenceStartTime(regAdviceSaveDto.getStartTime() != null ? regAdviceSaveDto.getStartTime() : startTime); // 医嘱开始时间
|
||||
longServiceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4));
|
||||
longServiceRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||
longServiceRequest.setQuantity(new BigDecimal("1")); // 请求数量 | 诊疗的长期医嘱数量都是1
|
||||
@@ -666,7 +666,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
}
|
||||
// 保存时处理的字段属性
|
||||
if (is_save) {
|
||||
tempServiceRequest.setOccurrenceStartTime(startTime); // 医嘱开始时间
|
||||
tempServiceRequest.setOccurrenceStartTime(regAdviceSaveDto.getStartTime() != null ? regAdviceSaveDto.getStartTime() : startTime); // 医嘱开始时间
|
||||
tempServiceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4));
|
||||
tempServiceRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||
tempServiceRequest.setQuantity(regAdviceSaveDto.getQuantity()); // 请求数量
|
||||
@@ -812,7 +812,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
deviceRequest.setPatientId(regAdviceSaveDto.getPatientId()); // 患者
|
||||
deviceRequest.setRequesterId(regAdviceSaveDto.getPractitionerId()); // 开方医生
|
||||
deviceRequest.setOrgId(regAdviceSaveDto.getFounderOrgId()); // 开方人科室
|
||||
deviceRequest.setReqAuthoredTime(startTime); // 医嘱开始时间
|
||||
deviceRequest.setReqAuthoredTime(regAdviceSaveDto.getStartTime() != null ? regAdviceSaveDto.getStartTime() : startTime); // 医嘱开始时间
|
||||
deviceRequest.setPerformLocation(regAdviceSaveDto.getLocationId()); // 发放科室
|
||||
deviceRequest.setEncounterId(regAdviceSaveDto.getEncounterId()); // 就诊id
|
||||
deviceRequest.setPackageId(regAdviceSaveDto.getPackageId()); // 组套id
|
||||
@@ -851,7 +851,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
deviceRequest.setPatientId(regAdviceSaveDto.getPatientId()); // 患者
|
||||
deviceRequest.setRequesterId(regAdviceSaveDto.getPractitionerId()); // 开方医生
|
||||
deviceRequest.setOrgId(regAdviceSaveDto.getFounderOrgId()); // 开方人科室
|
||||
deviceRequest.setReqAuthoredTime(startTime); // 医嘱开始时间
|
||||
deviceRequest.setReqAuthoredTime(regAdviceSaveDto.getStartTime() != null ? regAdviceSaveDto.getStartTime() : startTime); // 医嘱开始时间
|
||||
deviceRequest.setPerformLocation(regAdviceSaveDto.getLocationId()); // 发放科室
|
||||
deviceRequest.setEncounterId(regAdviceSaveDto.getEncounterId()); // 就诊id
|
||||
deviceRequest.setPackageId(regAdviceSaveDto.getPackageId()); // 组套id
|
||||
|
||||
@@ -214,6 +214,7 @@
|
||||
T1.dispense_per_duration AS dispense_per_duration,
|
||||
T2.part_percent AS part_percent,
|
||||
ccd.name AS condition_definition_name,
|
||||
T1.effective_dose_start AS start_time,
|
||||
T1.therapy_enum AS therapyEnum,
|
||||
T1.sort_number AS sort_number,
|
||||
T1.based_on_id AS based_on_id,
|
||||
@@ -269,6 +270,7 @@
|
||||
'' AS condition_definition_name,
|
||||
2 AS therapyEnum,
|
||||
99 AS sort_number,
|
||||
T1.req_authored_time AS start_time,
|
||||
T1.based_on_id AS based_on_id,
|
||||
T1.device_def_id AS advice_definition_id
|
||||
FROM wor_device_request AS T1
|
||||
@@ -319,6 +321,7 @@
|
||||
'' AS condition_definition_name,
|
||||
COALESCE(T1.therapy_enum, 2) AS therapyEnum,
|
||||
99 AS sort_number,
|
||||
T1.occurrence_start_time AS start_time,
|
||||
T1.based_on_id AS based_on_id,
|
||||
T1.activity_id AS advice_definition_id
|
||||
FROM wor_service_request AS T1
|
||||
|
||||
Reference in New Issue
Block a user