feat(mrhomepage): 病案首页质量校验

- 新增 IMrHomepageQualityAppService + impl,实现 checkQuality/getQualityResults
- 新增 MrHomepageQualityController (POST /quality/check, GET /quality/results/{id})
- 增强 MrHomepageQualityCheckServiceImpl:必填项+逻辑校验+ICD编码+费用一致性
- 新增 MrHomepageQualityCheck.vue 校验结果展示页面
- 更新前端 API 文件添加 checkQuality/getQualityResults 接口
This commit is contained in:
2026-06-17 14:02:42 +08:00
parent 09e43e4b8c
commit 00604b2d01
8 changed files with 420 additions and 36 deletions

View File

@@ -0,0 +1,13 @@
package com.healthlink.his.web.mrhomepage.appservice;
import com.healthlink.his.mrhomepage.domain.MrHomepageQualityCheck;
import java.util.List;
import java.util.Map;
public interface IMrHomepageQualityAppService {
List<MrHomepageQualityCheck> checkQuality(Long homepageId);
Map<String, Object> getQualityResults(Long homepageId);
}

View File

@@ -0,0 +1,54 @@
package com.healthlink.his.web.mrhomepage.appservice.impl;
import com.healthlink.his.mrhomepage.domain.MrHomepage;
import com.healthlink.his.mrhomepage.domain.MrHomepageQualityCheck;
import com.healthlink.his.mrhomepage.service.IMrHomepageQualityCheckService;
import com.healthlink.his.mrhomepage.service.IMrHomepageService;
import com.healthlink.his.web.mrhomepage.appservice.IMrHomepageQualityAppService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class MrHomepageQualityAppServiceImpl implements IMrHomepageQualityAppService {
@Resource
private IMrHomepageService mrHomepageService;
@Resource
private IMrHomepageQualityCheckService mrHomepageQualityCheckService;
@Override
@Transactional
public List<MrHomepageQualityCheck> checkQuality(Long homepageId) {
mrHomepageQualityCheckService.clearByHomepageId(homepageId);
return mrHomepageQualityCheckService.executeAutoCheck(homepageId);
}
@Override
public Map<String, Object> getQualityResults(Long homepageId) {
MrHomepage homepage = mrHomepageService.getById(homepageId);
List<MrHomepageQualityCheck> checks = mrHomepageQualityCheckService.selectByHomepageId(homepageId);
long totalChecks = checks.size();
long passedChecks = checks.stream()
.filter(c -> "PASS".equals(c.getCheckResult()))
.count();
long failedChecks = totalChecks - passedChecks;
double score = totalChecks > 0 ? (double) passedChecks / totalChecks * 100 : 0;
Map<String, Object> results = new HashMap<>();
results.put("homepageId", homepageId);
results.put("qualityStatus", homepage != null ? homepage.getQualityStatus() : null);
results.put("totalChecks", totalChecks);
results.put("passedChecks", passedChecks);
results.put("failedChecks", failedChecks);
results.put("score", Math.round(score * 10.0) / 10.0);
results.put("checks", checks);
return results;
}
}

View File

@@ -0,0 +1,36 @@
package com.healthlink.his.web.mrhomepage.controller;
import com.core.common.core.domain.R;
import com.healthlink.his.mrhomepage.domain.MrHomepageQualityCheck;
import com.healthlink.his.web.mrhomepage.appservice.IMrHomepageQualityAppService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/api/v1/mr-homepage/quality")
@Tag(name = "病案首页质量校验")
public class MrHomepageQualityController {
@Resource
private IMrHomepageQualityAppService mrHomepageQualityAppService;
@PostMapping("/check")
@PreAuthorize("hasAuthority('inpatient:mrhomepage:edit')")
@Operation(summary = "执行质量校验")
public R<List<MrHomepageQualityCheck>> checkQuality(@RequestParam Long homepageId) {
return R.ok(mrHomepageQualityAppService.checkQuality(homepageId));
}
@GetMapping("/results/{homepageId}")
@PreAuthorize("hasAuthority('inpatient:mrhomepage:list')")
@Operation(summary = "获取质量校验结果")
public R<Map<String, Object>> getQualityResults(@PathVariable Long homepageId) {
return R.ok(mrHomepageQualityAppService.getQualityResults(homepageId));
}
}