diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/epidemic/appservice/IEpidemicAppService.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/epidemic/appservice/IEpidemicAppService.java index 73a38a627..07b56dc7b 100644 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/epidemic/appservice/IEpidemicAppService.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/epidemic/appservice/IEpidemicAppService.java @@ -7,4 +7,7 @@ public interface IEpidemicAppService { void confirmReport(Long id, String cdcNo); List getReports(String status); Map getStatistics(String startDate, String endDate); + EpidemicReport autoScreen(EpidemicReport r); + EpidemicReport saveReport(EpidemicReport r); + Map getReportStats(String startDate, String endDate); } diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/epidemic/appservice/impl/EpidemicAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/epidemic/appservice/impl/EpidemicAppServiceImpl.java index 28eaf7a58..fe14c256f 100644 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/epidemic/appservice/impl/EpidemicAppServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/epidemic/appservice/impl/EpidemicAppServiceImpl.java @@ -9,6 +9,18 @@ import java.util.*; @Service public class EpidemicAppServiceImpl implements IEpidemicAppService { @Autowired private IEpidemicReportService reportService; + + private static final Set NOTIFIABLE_DISEASES = Set.of( + "鼠疫", "霍乱", "传染性非典型肺炎", "艾滋病", "病毒性肝炎", "脊髓灰质炎", + "人感染高致病性禽流感", "麻疹", "流行性出血热", "狂犬病", "流行性乙型脑炎", + "登革热", "炭疽", "细菌性和阿米巴性痢疾", "肺结核", "伤寒和副伤寒", + "流行性脑脊髓膜炎", "百日咳", "白喉", "新生儿破伤风", "猩红热", + "布鲁氏菌病", "淋病", "梅毒", "钩端螺旋体病", "血吸虫病", "疟疾", + "手足口病", "流行性感冒", "流行性腮腺炎", "风疹", "急性出血性结膜炎", + "麻风病", "流行性和地方性斑疹伤寒", "黑热病", "包虫病", "丝虫病", + "感染性腹泻", "甲型H1N1流感", "新型冠状病毒肺炎" + ); + @Override public EpidemicReport report(EpidemicReport r) { r.setStatus("PENDING"); r.setDelFlag("0"); r.setReportDate(new Date()); reportService.save(r); return r; } @Override @@ -27,4 +39,40 @@ public class EpidemicAppServiceImpl implements IEpidemicAppService { r.put("confirmed", reportService.count(new LambdaQueryWrapper().eq(EpidemicReport::getStatus, "CONFIRMED"))); return r; } + @Override + public EpidemicReport autoScreen(EpidemicReport r) { + boolean match = r.getDiseaseName() != null && NOTIFIABLE_DISEASES.stream() + .anyMatch(d -> r.getDiseaseName().contains(d)); + r.setScreenResult(match ? "MATCHED" : "NOT_MATCHED"); + r.setScreenLevel(match ? "LEVEL_A" : "NORMAL"); + r.setScreenTime(new Date()); + if (match && (r.getStatus() == null || "DRAFT".equals(r.getStatus()))) { + r.setStatus("PENDING"); + } + r.setDelFlag("0"); + r.setReportDate(new Date()); + reportService.save(r); + return r; + } + @Override + public EpidemicReport saveReport(EpidemicReport r) { + if (r.getId() == null) { + r.setStatus("DRAFT"); r.setDelFlag("0"); r.setReportDate(new Date()); + reportService.save(r); + } else { + reportService.updateById(r); + } + return r; + } + @Override + public Map getReportStats(String startDate, String endDate) { + Map r = new HashMap<>(); + LambdaQueryWrapper base = new LambdaQueryWrapper().eq(EpidemicReport::getDelFlag, "0"); + r.put("total", reportService.count(base)); + r.put("pending", reportService.count(new LambdaQueryWrapper().eq(EpidemicReport::getStatus, "PENDING").eq(EpidemicReport::getDelFlag, "0"))); + r.put("confirmed", reportService.count(new LambdaQueryWrapper().eq(EpidemicReport::getStatus, "CONFIRMED").eq(EpidemicReport::getDelFlag, "0"))); + r.put("screenMatched", reportService.count(new LambdaQueryWrapper().eq(EpidemicReport::getScreenResult, "MATCHED").eq(EpidemicReport::getDelFlag, "0"))); + r.put("screenNormal", reportService.count(new LambdaQueryWrapper().eq(EpidemicReport::getScreenResult, "NOT_MATCHED").eq(EpidemicReport::getDelFlag, "0"))); + return r; + } } diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/epidemic/controller/EpidemicController.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/epidemic/controller/EpidemicController.java index dda3e923e..701305a2b 100644 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/epidemic/controller/EpidemicController.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/epidemic/controller/EpidemicController.java @@ -5,16 +5,32 @@ import com.healthlink.his.web.epidemic.appservice.IEpidemicAppService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; @Tag(name = "传染病直报") @RestController @RequestMapping("/api/v1/epidemic") public class EpidemicController { @Autowired private IEpidemicAppService epidemicAppService; + @Operation(summary = "上报") @PostMapping("/report") + @PreAuthorize("hasAuthority('epidemic:edit')") public AjaxResult report(@RequestBody EpidemicReport r) { return AjaxResult.success(epidemicAppService.report(r)); } @Operation(summary = "确认") @PutMapping("/confirm/{id}") + @PreAuthorize("hasAuthority('epidemic:edit')") public AjaxResult confirm(@PathVariable Long id, @RequestParam String cdcNo) { epidemicAppService.confirmReport(id, cdcNo); return AjaxResult.success(); } @Operation(summary = "列表") @GetMapping("/list") + @PreAuthorize("hasAuthority('epidemic:list')") public AjaxResult list(@RequestParam(required = false) String status) { return AjaxResult.success(epidemicAppService.getReports(status)); } @Operation(summary = "统计") @GetMapping("/statistics") + @PreAuthorize("hasAuthority('epidemic:list')") public AjaxResult statistics(@RequestParam(required = false) String s, @RequestParam(required = false) String e) { return AjaxResult.success(epidemicAppService.getStatistics(s, e)); } + + @Operation(summary = "自动筛查") @PostMapping("/auto-screen") + @PreAuthorize("hasAuthority('epidemic:edit')") + public AjaxResult autoScreen(@RequestBody EpidemicReport r) { return AjaxResult.success(epidemicAppService.autoScreen(r)); } + @Operation(summary = "保存报告") @PostMapping("/save") + @PreAuthorize("hasAuthority('epidemic:edit')") + public AjaxResult saveReport(@RequestBody EpidemicReport r) { return AjaxResult.success(epidemicAppService.saveReport(r)); } + @Operation(summary = "报告统计") @GetMapping("/report-stats") + @PreAuthorize("hasAuthority('epidemic:list')") + public AjaxResult reportStats(@RequestParam(required = false) String s, @RequestParam(required = false) String e) { return AjaxResult.success(epidemicAppService.getReportStats(s, e)); } } diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V69__epidemic_report_enhance.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V69__epidemic_report_enhance.sql new file mode 100644 index 000000000..0901c3def --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V69__epidemic_report_enhance.sql @@ -0,0 +1,6 @@ +-- Add auto-screen fields to epidemic_report +ALTER TABLE healthlink_his.epidemic_report ADD COLUMN IF NOT EXISTS screen_result TEXT; +ALTER TABLE healthlink_his.epidemic_report ADD COLUMN IF NOT EXISTS screen_time TIMESTAMP; +ALTER TABLE healthlink_his.epidemic_report ADD COLUMN IF NOT EXISTS screen_level VARCHAR(20); +ALTER TABLE healthlink_his.epidemic_report ADD COLUMN IF NOT EXISTS address VARCHAR(500); +ALTER TABLE healthlink_his.epidemic_report ADD COLUMN IF NOT EXISTS contact_phone VARCHAR(50); diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/epidemic/domain/EpidemicReport.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/epidemic/domain/EpidemicReport.java index 656298cf9..dfd1339d7 100644 --- a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/epidemic/domain/EpidemicReport.java +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/epidemic/domain/EpidemicReport.java @@ -13,4 +13,6 @@ public class EpidemicReport extends HisBaseEntity { private String reporterId; private String reporterName; private Date reportDate; private String status; private String cdcConfirmNo; private String delFlag; + private String screenResult; private Date screenTime; private String screenLevel; + private String address; private String contactPhone; } diff --git a/healthlink-his-ui/src/views/epidemic/EpidemicReport.vue b/healthlink-his-ui/src/views/epidemic/EpidemicReport.vue new file mode 100644 index 000000000..f2c1dcbf5 --- /dev/null +++ b/healthlink-his-ui/src/views/epidemic/EpidemicReport.vue @@ -0,0 +1,225 @@ + + +