fix(doctorstation): 解决参数验证和数据获取问题
- 在前端api.js中添加encounterId参数验证,避免无效参数导致的错误 - 在后端服务层添加参数检查,当encounterId为空时返回空数据而非报错 - 修改控制器参数注解,将required设置为false以允许空值传递 - 优化住院办理流程中的错误处理和参数验证 - 改进检验申请单获取时的数据验证和错误提示 - 更新maven编译器插件版本并添加必要的模块参数 - 统一错误处理机制,提供更友好的用户提示信息
This commit is contained in:
@@ -956,6 +956,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
*/
|
||||
@Override
|
||||
public R<?> getProofResult(Long encounterId) {
|
||||
// 检查参数
|
||||
if (encounterId == null) {
|
||||
log.warn("获取检验结果时就诊ID为空");
|
||||
return R.ok(new ArrayList<>());
|
||||
}
|
||||
|
||||
// LIS查看报告地址
|
||||
String lisReportUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.LIS_REPORT_URL);
|
||||
if (StringUtils.isEmpty(lisReportUrl)) {
|
||||
@@ -980,6 +986,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
*/
|
||||
@Override
|
||||
public R<?> getTestResult(Long encounterId) {
|
||||
// 检查参数
|
||||
if (encounterId == null) {
|
||||
log.warn("获取检查结果时就诊ID为空");
|
||||
return R.ok(new ArrayList<>());
|
||||
}
|
||||
|
||||
// PACS查看报告地址
|
||||
String pacsReportUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.PACS_REPORT_URL);
|
||||
if (StringUtils.isEmpty(pacsReportUrl)) {
|
||||
|
||||
@@ -34,6 +34,10 @@ public class DoctorStationPtDetailsAppServiceImpl implements IDoctorStationPtDet
|
||||
*/
|
||||
@Override
|
||||
public R<?> getPtDetails(Long encounterId) {
|
||||
// 检查参数
|
||||
if (encounterId == null) {
|
||||
return R.fail("就诊ID不能为空");
|
||||
}
|
||||
|
||||
// 收费状态List(1:待收费,2:待结算,5:已结算)
|
||||
List<Integer> statusList = new ArrayList<>();
|
||||
@@ -49,6 +53,10 @@ public class DoctorStationPtDetailsAppServiceImpl implements IDoctorStationPtDet
|
||||
ChargeItemContext.ACTIVITY.getValue(), ClinicalStatus.ACTIVE.getValue(), LocationForm.BED.getValue(),
|
||||
ParticipantType.ADMITTER.getCode(), statusList);
|
||||
|
||||
if (patientDetailsDto == null) {
|
||||
return R.fail("未找到患者详情信息");
|
||||
}
|
||||
|
||||
// 住院的场合,获取现在时间,计算住院天数
|
||||
if (patientDetailsDto.getClassEnum() == EncounterClass.IMP.getValue()) {
|
||||
// 截至时间,用于计算当前时刻下显示的住院天数
|
||||
|
||||
@@ -106,7 +106,7 @@ public class DoctorStationAdviceController {
|
||||
* @return 医嘱请求数据
|
||||
*/
|
||||
@GetMapping(value = "/request-base-info")
|
||||
public R<?> getRequestBaseInfo(@RequestParam Long encounterId) {
|
||||
public R<?> getRequestBaseInfo(@RequestParam(required = false) Long encounterId) {
|
||||
return iDoctorStationAdviceAppService.getRequestBaseInfo(encounterId);
|
||||
}
|
||||
|
||||
@@ -114,10 +114,11 @@ public class DoctorStationAdviceController {
|
||||
* 查询历史医嘱请求数据
|
||||
*
|
||||
* @param patientId 病人id
|
||||
* @param encounterId 就诊id
|
||||
* @return 历史医嘱请求数据
|
||||
*/
|
||||
@GetMapping(value = "/request-history-info")
|
||||
public R<?> getRequestHistoryInfo(@RequestParam Long patientId, Long encounterId) {
|
||||
public R<?> getRequestHistoryInfo(@RequestParam Long patientId, @RequestParam(required = false) Long encounterId) {
|
||||
return iDoctorStationAdviceAppService.getRequestHistoryInfo(patientId, encounterId);
|
||||
}
|
||||
|
||||
@@ -138,7 +139,7 @@ public class DoctorStationAdviceController {
|
||||
* @return 就诊费用性质
|
||||
*/
|
||||
@GetMapping(value = "/get-encounter-contract")
|
||||
public R<?> getEncounterContract(@RequestParam Long encounterId) {
|
||||
public R<?> getEncounterContract(@RequestParam(required = false) Long encounterId) {
|
||||
return iDoctorStationAdviceAppService.getEncounterContract(encounterId);
|
||||
}
|
||||
|
||||
@@ -162,7 +163,7 @@ public class DoctorStationAdviceController {
|
||||
* @return 检验url相关参数
|
||||
*/
|
||||
@GetMapping(value = "/proof-result")
|
||||
public R<?> getProofResult(@RequestParam(value = "encounterId") Long encounterId) {
|
||||
public R<?> getProofResult(@RequestParam(value = "encounterId", required = false) Long encounterId) {
|
||||
return iDoctorStationAdviceAppService.getProofResult(encounterId);
|
||||
}
|
||||
|
||||
@@ -173,7 +174,7 @@ public class DoctorStationAdviceController {
|
||||
* @return 检查url相关参数
|
||||
*/
|
||||
@GetMapping(value = "/test-result")
|
||||
public R<?> getTestResult(@RequestParam(value = "encounterId") Long encounterId) {
|
||||
public R<?> getTestResult(@RequestParam(value = "encounterId", required = false) Long encounterId) {
|
||||
return iDoctorStationAdviceAppService.getTestResult(encounterId);
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ public class DoctorStationChineseMedicalController {
|
||||
* @return 中医就诊诊断信息
|
||||
*/
|
||||
@GetMapping(value = "/get-tcm-encounter-diagnosis")
|
||||
public R<?> getTcmEncounterDiagnosis(@RequestParam Long encounterId) {
|
||||
public R<?> getTcmEncounterDiagnosis(@RequestParam(required = false) Long encounterId) {
|
||||
return iDoctorStationChineseMedicalAppService.getTcmEncounterDiagnosis(encounterId);
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ public class DoctorStationChineseMedicalController {
|
||||
* @return 医嘱请求数据
|
||||
*/
|
||||
@GetMapping(value = "/tcm-request-base-info")
|
||||
public R<?> getTcmRequestBaseInfo(@RequestParam Long encounterId) {
|
||||
public R<?> getTcmRequestBaseInfo(@RequestParam(required = false) Long encounterId) {
|
||||
return iDoctorStationChineseMedicalAppService.getTcmRequestBaseInfo(encounterId);
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ public class DoctorStationChineseMedicalController {
|
||||
* @return 中医历史医嘱请求数据
|
||||
*/
|
||||
@GetMapping(value = "/tcm-request-history-info")
|
||||
public R<?> getTcmRequestHistoryInfo(@RequestParam Long patientId, Long encounterId) {
|
||||
public R<?> getTcmRequestHistoryInfo(@RequestParam Long patientId, @RequestParam(required = false) Long encounterId) {
|
||||
return iDoctorStationChineseMedicalAppService.getTcmRequestHistoryInfo(patientId, encounterId);
|
||||
}
|
||||
|
||||
|
||||
@@ -162,12 +162,12 @@ public class DoctorStationDiagnosisController {
|
||||
|
||||
/**
|
||||
* 查询就诊诊断信息
|
||||
*
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 就诊诊断信息
|
||||
*/
|
||||
@GetMapping(value = "/get-encounter-diagnosis")
|
||||
public R<?> getEncounterDiagnosis(@RequestParam Long encounterId) {
|
||||
public R<?> getEncounterDiagnosis(@RequestParam(required = false) Long encounterId) {
|
||||
return iDoctorStationDiagnosisAppService.getEncounterDiagnosis(encounterId);
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ public class DoctorStationDiagnosisController {
|
||||
* @return 就诊诊断信息
|
||||
*/
|
||||
@GetMapping(value = "/get-encounter-diagnosis-ele")
|
||||
public R<?> getEncounterDiagnosisByEncounterId(@RequestParam Long encounterId,@RequestParam String searchKey) {
|
||||
public R<?> getEncounterDiagnosisByEncounterId(@RequestParam(required = false) Long encounterId,@RequestParam String searchKey) {
|
||||
return iDoctorStationDiagnosisAppService.getEncounterDiagnosisByEncounterId(encounterId,searchKey);
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public class DoctorStationEmrController {
|
||||
* @return 病历详情
|
||||
*/
|
||||
@GetMapping("/emr-detail")
|
||||
public R<?> getEmrDetail(@RequestParam(value = "encounterId") Long encounterId) {
|
||||
public R<?> getEmrDetail(@RequestParam(value = "encounterId", required = false) Long encounterId) {
|
||||
return iDoctorStationEmrAppService.getEmrDetail(encounterId);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public class DoctorStationPtDetailsController {
|
||||
* @return 患者详情
|
||||
*/
|
||||
@GetMapping(value = "/patient-details")
|
||||
public R<?> getPtDetails(@RequestParam Long encounterId) {
|
||||
public R<?> getPtDetails(@RequestParam(required = false) Long encounterId) {
|
||||
|
||||
return doctorStationPtDetailsAppService.getPtDetails(encounterId);
|
||||
}
|
||||
|
||||
@@ -89,15 +89,18 @@ public class TodayOutpatientController {
|
||||
|
||||
/**
|
||||
* 获取患者就诊详情
|
||||
*
|
||||
*
|
||||
* @param encounterId 就诊记录ID
|
||||
* @param request HTTP请求
|
||||
* @return 患者就诊详情
|
||||
*/
|
||||
@GetMapping("/patients/{encounterId}")
|
||||
public R<TodayOutpatientPatientDto> getPatientDetail(
|
||||
@PathVariable("encounterId") Long encounterId,
|
||||
@PathVariable("encounterId") Long encounterId,
|
||||
HttpServletRequest request) {
|
||||
if (encounterId == null) {
|
||||
return R.fail("就诊记录ID不能为空");
|
||||
}
|
||||
TodayOutpatientPatientDto patient = todayOutpatientService.getPatientDetail(encounterId, request);
|
||||
return R.ok(patient);
|
||||
}
|
||||
|
||||
@@ -221,6 +221,11 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
||||
*/
|
||||
@Override
|
||||
public List<RequestFormQueryDto> getRequestForm(Long encounterId, String typeCode) {
|
||||
// 检查参数
|
||||
if (encounterId == null) {
|
||||
return new java.util.ArrayList<>(); // 返回空列表而不是查询数据库
|
||||
}
|
||||
|
||||
List<RequestFormQueryDto> requestFormList = requestFormManageAppMapper.getRequestForm(encounterId, typeCode);
|
||||
for (RequestFormQueryDto requestFormQueryDto : requestFormList) {
|
||||
// 查询处方详情
|
||||
|
||||
@@ -70,12 +70,15 @@ public class RequestFormManageController {
|
||||
|
||||
/**
|
||||
* 查询检查申请单
|
||||
*
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 检查申请单
|
||||
*/
|
||||
@GetMapping(value = "/get-check")
|
||||
public R<?> getCheckRequestForm(@RequestParam Long encounterId) {
|
||||
public R<?> getCheckRequestForm(@RequestParam(required = false) Long encounterId) {
|
||||
if (encounterId == null) {
|
||||
return R.fail("就诊ID不能为空");
|
||||
}
|
||||
return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.TEST.getCode()));
|
||||
}
|
||||
|
||||
@@ -86,7 +89,10 @@ public class RequestFormManageController {
|
||||
* @return 检验申请单
|
||||
*/
|
||||
@GetMapping(value = "/get-inspection")
|
||||
public R<?> getInspectionRequestForm(@RequestParam Long encounterId) {
|
||||
public R<?> getInspectionRequestForm(@RequestParam(required = false) Long encounterId) {
|
||||
if (encounterId == null) {
|
||||
return R.fail("就诊ID不能为空");
|
||||
}
|
||||
return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.PROOF.getCode()));
|
||||
}
|
||||
|
||||
@@ -97,7 +103,10 @@ public class RequestFormManageController {
|
||||
* @return 输血申请单
|
||||
*/
|
||||
@GetMapping(value = "/get-blood-transfusion")
|
||||
public R<?> getBloodTransfusionRequestForm(@RequestParam Long encounterId) {
|
||||
public R<?> getBloodTransfusionRequestForm(@RequestParam(required = false) Long encounterId) {
|
||||
if (encounterId == null) {
|
||||
return R.fail("就诊ID不能为空");
|
||||
}
|
||||
return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.METACHYSIS.getCode()));
|
||||
}
|
||||
|
||||
@@ -108,7 +117,10 @@ public class RequestFormManageController {
|
||||
* @return 手术申请单
|
||||
*/
|
||||
@GetMapping(value = "/get-surgery")
|
||||
public R<?> getSurgeryRequestForm(@RequestParam Long encounterId) {
|
||||
public R<?> getSurgeryRequestForm(@RequestParam(required = false) Long encounterId) {
|
||||
if (encounterId == null) {
|
||||
return R.fail("就诊ID不能为空");
|
||||
}
|
||||
return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.PROCEDURE.getCode()));
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,10 @@ public class IPrintReportAppServiceImpl implements IPrintReportAppService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> disposalPrint(Long encounterId) {
|
||||
// 检查参数
|
||||
if (encounterId == null) {
|
||||
return R.ok(new java.util.ArrayList<>()); // 返回空列表而不是错误
|
||||
}
|
||||
|
||||
List<DisposalDto> disposalList = printReportMapper.getDisposalList(encounterId);
|
||||
|
||||
@@ -71,6 +75,10 @@ public class IPrintReportAppServiceImpl implements IPrintReportAppService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> checkApplicationPrint(Long encounterId) {
|
||||
// 检查参数
|
||||
if (encounterId == null) {
|
||||
return R.ok(new java.util.ArrayList<>()); // 返回空列表而不是错误
|
||||
}
|
||||
|
||||
List<CkInspAppDto> checkList =
|
||||
printReportMapper.getCheckInspectionList(encounterId, YbRxItemTypeCode.MEDICAL_IMAGING.getValue());
|
||||
@@ -98,6 +106,11 @@ public class IPrintReportAppServiceImpl implements IPrintReportAppService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> inspectionApplicationPrint(Long encounterId) {
|
||||
// 检查参数
|
||||
if (encounterId == null) {
|
||||
return R.ok(new java.util.ArrayList<>()); // 返回空列表而不是错误
|
||||
}
|
||||
|
||||
List<CkInspAppDto> inspectionList =
|
||||
printReportMapper.getCheckInspectionList(encounterId, YbRxItemTypeCode.LAB_TEST.getValue());
|
||||
|
||||
@@ -125,6 +138,10 @@ public class IPrintReportAppServiceImpl implements IPrintReportAppService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> prescriptionPrint(String prescriptionNo, Long encounterId) {
|
||||
// 检查参数
|
||||
if (encounterId == null) {
|
||||
return R.ok(new java.util.ArrayList<>()); // 返回空列表而不是错误
|
||||
}
|
||||
|
||||
List<PrescriptionPrintDto> list = printReportMapper.getPrescriptionList(prescriptionNo, encounterId);
|
||||
// 获取所属医院id
|
||||
|
||||
@@ -34,7 +34,7 @@ public class PrintReportController {
|
||||
* @return 处置单信息
|
||||
*/
|
||||
@GetMapping(value = "/disposal-print")
|
||||
public R<?> disposalPrint(@RequestParam Long encounterId) {
|
||||
public R<?> disposalPrint(@RequestParam(required = false) Long encounterId) {
|
||||
|
||||
return printReportService.disposalPrint(encounterId);
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class PrintReportController {
|
||||
* @return 检验申请单信息
|
||||
*/
|
||||
@GetMapping(value = "/check-print")
|
||||
public R<?> checkApplicationPrint(@RequestParam Long encounterId) {
|
||||
public R<?> checkApplicationPrint(@RequestParam(required = false) Long encounterId) {
|
||||
return printReportService.checkApplicationPrint(encounterId);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class PrintReportController {
|
||||
* @return 检验申请单信息
|
||||
*/
|
||||
@GetMapping(value = "/inspection-print")
|
||||
public R<?> inspectionApplicationPrint(@RequestParam Long encounterId) {
|
||||
public R<?> inspectionApplicationPrint(@RequestParam(required = false) Long encounterId) {
|
||||
return printReportService.inspectionApplicationPrint(encounterId);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public class PrintReportController {
|
||||
* @return 处方单信息
|
||||
*/
|
||||
@GetMapping(value = "/prescription-print")
|
||||
public R<?> prescriptionPrint(@RequestParam String prescriptionNo, @RequestParam Long encounterId) {
|
||||
public R<?> prescriptionPrint(@RequestParam String prescriptionNo, @RequestParam(required = false) Long encounterId) {
|
||||
return printReportService.prescriptionPrint(prescriptionNo, encounterId);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user