bug 362 428 436
This commit is contained in:
@@ -59,6 +59,16 @@ public interface IDoctorStationAdviceAppService {
|
||||
*/
|
||||
R<?> getRequestBaseInfo(Long encounterId);
|
||||
|
||||
/**
|
||||
* 查询医嘱请求数据(支持按生成来源和来源单据号过滤)
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param generateSourceEnum 生成来源(可选,如手术计费=6)
|
||||
* @param sourceBillNo 来源业务单据号(可选)
|
||||
* @return 医嘱请求数据
|
||||
*/
|
||||
R<?> getRequestBaseInfo(Long encounterId, Integer generateSourceEnum, String sourceBillNo);
|
||||
|
||||
/**
|
||||
* 门诊签退医嘱
|
||||
*
|
||||
|
||||
@@ -1987,13 +1987,25 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
*/
|
||||
@Override
|
||||
public R<?> getRequestBaseInfo(Long encounterId) {
|
||||
return this.getRequestBaseInfo(encounterId, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> getRequestBaseInfo(Long encounterId, Integer generateSourceEnum, String sourceBillNo) {
|
||||
// 当前账号的参与者id
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
// 未指定generateSourceEnum时,默认只查询医生开立的医嘱
|
||||
int sourceEnum = (generateSourceEnum != null) ? generateSourceEnum : GenerateSource.DOCTOR_PRESCRIPTION.getValue();
|
||||
// 医嘱请求数据
|
||||
List<RequestBaseDto> requestBaseInfo = doctorStationAdviceAppMapper.getRequestBaseInfo(encounterId, null,
|
||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.NO.getCode(),
|
||||
GenerateSource.DOCTOR_PRESCRIPTION.getValue());
|
||||
sourceEnum, sourceBillNo);
|
||||
// 手术计费场景:sourceBillNo 不为空时,只保留诊疗请求(3/6),过滤掉药品(1)和耗材(2)
|
||||
if (sourceBillNo != null && !sourceBillNo.isEmpty()) {
|
||||
requestBaseInfo.removeIf(dto -> dto.getAdviceType() != null
|
||||
&& (dto.getAdviceType() == 1 || dto.getAdviceType() == 2));
|
||||
}
|
||||
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
|
||||
// 请求状态
|
||||
requestBaseDto
|
||||
@@ -2114,7 +2126,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
List<RequestBaseDto> requestBaseInfo = doctorStationAdviceAppMapper.getRequestBaseInfo(encounterId, patientId,
|
||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.YES.getCode(),
|
||||
GenerateSource.DOCTOR_PRESCRIPTION.getValue());
|
||||
GenerateSource.DOCTOR_PRESCRIPTION.getValue(), null);
|
||||
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
|
||||
// 请求状态
|
||||
requestBaseDto
|
||||
|
||||
@@ -112,11 +112,16 @@ public class DoctorStationAdviceController {
|
||||
* 查询医嘱请求数据
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param generateSourceEnum 生成来源(可选,用于按来源过滤,如手术计费=6)
|
||||
* @param sourceBillNo 来源业务单据号(可选,用于按来源单据过滤)
|
||||
* @return 医嘱请求数据
|
||||
*/
|
||||
@GetMapping(value = "/request-base-info")
|
||||
public R<?> getRequestBaseInfo(@RequestParam(required = false) Long encounterId) {
|
||||
return iDoctorStationAdviceAppService.getRequestBaseInfo(encounterId);
|
||||
public R<?> getRequestBaseInfo(
|
||||
@RequestParam(required = false) Long encounterId,
|
||||
@RequestParam(required = false) Integer generateSourceEnum,
|
||||
@RequestParam(required = false) String sourceBillNo) {
|
||||
return iDoctorStationAdviceAppService.getRequestBaseInfo(encounterId, generateSourceEnum, sourceBillNo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -122,7 +122,8 @@ public interface DoctorStationAdviceAppMapper {
|
||||
@Param("MED_MEDICATION_REQUEST") String MED_MEDICATION_REQUEST,
|
||||
@Param("WOR_DEVICE_REQUEST") String WOR_DEVICE_REQUEST,
|
||||
@Param("WOR_SERVICE_REQUEST") String WOR_SERVICE_REQUEST, @Param("practitionerId") Long practitionerId,
|
||||
@Param("historyFlag") String historyFlag, @Param("generateSourceEnum") Integer generateSourceEnum);
|
||||
@Param("historyFlag") String historyFlag, @Param("generateSourceEnum") Integer generateSourceEnum,
|
||||
@Param("sourceBillNo") String sourceBillNo);
|
||||
|
||||
/**
|
||||
* 查询就诊费用性质
|
||||
|
||||
@@ -16,6 +16,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -142,6 +143,32 @@ public class RequestFormManageController {
|
||||
return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.PROCEDURE.getCode()));
|
||||
}
|
||||
/**
|
||||
* 分页查询手术申请单(全局,不需要encounterId,用于门诊手术安排查找弹窗)
|
||||
*
|
||||
* @param surgeryNo 手术单号(模糊查询,可选)
|
||||
* @param applyTimeStart 申请时间起始(可选)
|
||||
* @param applyTimeEnd 申请时间截止(可选)
|
||||
* @param mainDoctorId 主刀医生ID(可选)
|
||||
* @param applyDeptId 申请科室ID(可选)
|
||||
* @param pageNo 页码,默认1
|
||||
* @param pageSize 每页数量,默认10
|
||||
* @return 分页手术申请单列表
|
||||
*/
|
||||
@GetMapping(value = "/get-surgery-page")
|
||||
public R<IPage<RequestFormPageDto>> getSurgeryRequestFormPage(
|
||||
@RequestParam(required = false) String surgeryNo,
|
||||
@RequestParam(required = false) LocalDate applyTimeStart,
|
||||
@RequestParam(required = false) LocalDate applyTimeEnd,
|
||||
@RequestParam(required = false) Long mainDoctorId,
|
||||
@RequestParam(required = false) Long applyDeptId,
|
||||
@RequestParam(defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(defaultValue = "10") Integer pageSize) {
|
||||
RequestFormDto dto = new RequestFormDto(surgeryNo, null, applyTimeStart, applyTimeEnd,
|
||||
mainDoctorId, applyDeptId, pageNo, pageSize);
|
||||
return R.ok(iRequestFormManageAppService.getRequestFormPage(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询申请单
|
||||
* @return 申请单
|
||||
*/
|
||||
|
||||
@@ -527,6 +527,9 @@
|
||||
LEFT JOIN cli_condition AS cc ON cc.id = T1.condition_id AND cc.delete_flag = '0'
|
||||
LEFT JOIN cli_condition_definition AS ccd ON ccd.id = cc.definition_id
|
||||
WHERE T1.delete_flag = '0' AND T1.tcm_flag = 0
|
||||
<if test="generateSourceEnum != null">
|
||||
AND T1.generate_source_enum = #{generateSourceEnum}
|
||||
</if>
|
||||
<if test="historyFlag == '0'.toString()">
|
||||
AND T1.encounter_id = #{encounterId}
|
||||
</if>
|
||||
@@ -695,6 +698,9 @@
|
||||
-- based_on_table='med_medication_request' → 输液/皮试执行记录,应排除
|
||||
-- based_on_table='exam_apply'/'lab_apply' → 申请单原始医嘱,应保留
|
||||
AND (T1.based_on_id IS NULL OR T1.based_on_table IS NULL OR T1.based_on_table NOT IN ('med_medication_request', 'med_medication_dispense'))
|
||||
<if test="sourceBillNo != null and sourceBillNo != ''">
|
||||
AND T1.prescription_no = #{sourceBillNo}
|
||||
</if>
|
||||
<if test="historyFlag == '0'.toString()">
|
||||
AND T1.encounter_id = #{encounterId}
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user