feat(nursing): T6.1 管道滑脱风险评估功能
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
package com.healthlink.his.web.nursing.appservice;
|
||||
|
||||
import com.healthlink.his.nursing.domain.NursingAssessmentIntervention;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IPipeRiskAppService {
|
||||
NursingAssessmentIntervention assessPipeRisk(NursingAssessmentIntervention intervention);
|
||||
List<NursingAssessmentIntervention> getPipeRiskRecords(Long encounterId);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.healthlink.his.web.nursing.appservice.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.healthlink.his.nursing.domain.NursingAssessmentIntervention;
|
||||
import com.healthlink.his.nursing.service.INursingAssessmentInterventionService;
|
||||
import com.healthlink.his.web.nursing.appservice.IPipeRiskAppService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class PipeRiskAppServiceImpl implements IPipeRiskAppService {
|
||||
|
||||
@Autowired
|
||||
private INursingAssessmentInterventionService interventionService;
|
||||
|
||||
@Override
|
||||
public NursingAssessmentIntervention assessPipeRisk(NursingAssessmentIntervention intervention) {
|
||||
intervention.setRiskLevel(calculatePipeRiskLevel(intervention));
|
||||
intervention.setInterventionType("TUBE");
|
||||
intervention.setStatus("PENDING");
|
||||
intervention.setDeleteFlag("0");
|
||||
interventionService.save(intervention);
|
||||
return intervention;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NursingAssessmentIntervention> getPipeRiskRecords(Long encounterId) {
|
||||
return interventionService.list(new LambdaQueryWrapper<NursingAssessmentIntervention>()
|
||||
.eq(NursingAssessmentIntervention::getEncounterId, encounterId)
|
||||
.eq(NursingAssessmentIntervention::getInterventionType, "TUBE")
|
||||
.orderByDesc(NursingAssessmentIntervention::getCreateTime));
|
||||
}
|
||||
|
||||
private String calculatePipeRiskLevel(NursingAssessmentIntervention intervention) {
|
||||
String content = intervention.getInterventionContent();
|
||||
if (content == null) return "LOW";
|
||||
int score = 0;
|
||||
if (content.contains("高风险")) score += 3;
|
||||
else if (content.contains("中风险")) score += 2;
|
||||
else if (content.contains("低风险")) score += 1;
|
||||
if (content.contains("活动")) score += 2;
|
||||
if (content.contains("固定")) score += 1;
|
||||
if (score >= 4) return "HIGH";
|
||||
if (score >= 2) return "MEDIUM";
|
||||
return "LOW";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.healthlink.his.web.nursing.controller;
|
||||
|
||||
import com.core.common.core.domain.AjaxResult;
|
||||
import com.healthlink.his.nursing.domain.NursingAssessmentIntervention;
|
||||
import com.healthlink.his.web.nursing.appservice.IPipeRiskAppService;
|
||||
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.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "管道滑脱风险评估")
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/nursing/pipe-risk")
|
||||
public class PipeRiskController {
|
||||
|
||||
@Autowired
|
||||
private IPipeRiskAppService pipeRiskAppService;
|
||||
|
||||
@Operation(summary = "管道滑脱风险评估")
|
||||
@PostMapping("/assess")
|
||||
@PreAuthorize("hasAuthority('nursing:nursing:edit')")
|
||||
public AjaxResult assessPipeRisk(@RequestBody NursingAssessmentIntervention intervention) {
|
||||
return AjaxResult.success(pipeRiskAppService.assessPipeRisk(intervention));
|
||||
}
|
||||
|
||||
@Operation(summary = "获取管道滑脱风险评估记录")
|
||||
@GetMapping("/list/{encounterId}")
|
||||
@PreAuthorize("hasAuthority('nursing:nursing:list')")
|
||||
public AjaxResult getPipeRiskRecords(@PathVariable Long encounterId) {
|
||||
List<NursingAssessmentIntervention> records = pipeRiskAppService.getPipeRiskRecords(encounterId);
|
||||
return AjaxResult.success(records);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="box-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>管道滑脱风险评估</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="就诊号" prop="encounterId">
|
||||
<el-input v-model="form.encounterId" placeholder="请输入就诊号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="患者ID" prop="patientId">
|
||||
<el-input v-model="form.patientId" placeholder="请输入患者ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="干预内容" prop="interventionContent">
|
||||
<el-input v-model="form.interventionContent" type="textarea" :rows="4" placeholder="请输入评估内容,如:高风险、中风险、低风险、活动、固定等关键词" />
|
||||
</el-form-item>
|
||||
<el-form-item label="护士姓名" prop="nurseName">
|
||||
<el-input v-model="form.nurseName" placeholder="请输入护士姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitAssess">提交评估</el-button>
|
||||
<el-button @click="resetForm">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card" style="margin-top: 20px;">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>评估记录</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="records" style="width: 100%">
|
||||
<el-table-column label="风险等级" prop="riskLevel" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag :type="getRiskType(scope.row.riskLevel)">
|
||||
{{ scope.row.riskLevel }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="干预内容" prop="interventionContent" />
|
||||
<el-table-column label="护士" prop="nurseName" width="100" />
|
||||
<el-table-column label="状态" prop="status" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag :type="getStatusType(scope.row.status)">
|
||||
{{ scope.row.status }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime" width="170" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import request from '@/utils/request'
|
||||
|
||||
const formRef = ref(null)
|
||||
const loading = ref(false)
|
||||
const records = ref([])
|
||||
|
||||
const form = reactive({
|
||||
encounterId: '',
|
||||
patientId: '',
|
||||
interventionContent: '',
|
||||
nurseName: ''
|
||||
})
|
||||
|
||||
const rules = {
|
||||
encounterId: [{ required: true, message: '请输入就诊号', trigger: 'blur' }],
|
||||
patientId: [{ required: true, message: '请输入患者ID', trigger: 'blur' }],
|
||||
interventionContent: [{ required: true, message: '请输入评估内容', trigger: 'blur' }],
|
||||
nurseName: [{ required: true, message: '请输入护士姓名', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
const getRiskType = (level) => {
|
||||
const map = { HIGH: 'danger', MEDIUM: 'warning', LOW: 'success' }
|
||||
return map[level] || 'info'
|
||||
}
|
||||
|
||||
const getStatusType = (status) => {
|
||||
const map = { PENDING: 'warning', EXECUTED: 'success', CANCELLED: 'info' }
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
const submitAssess = async () => {
|
||||
try {
|
||||
await formRef.value.validate()
|
||||
loading.value = true
|
||||
await request({
|
||||
url: '/api/v1/nursing/pipe-risk/assess',
|
||||
method: 'post',
|
||||
data: form
|
||||
})
|
||||
ElMessage.success('评估提交成功')
|
||||
getRecords()
|
||||
resetForm()
|
||||
} catch (error) {
|
||||
ElMessage.error('提交失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const getRecords = async () => {
|
||||
if (!form.encounterId) return
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await request({
|
||||
url: `/api/v1/nursing/pipe-risk/list/${form.encounterId}`,
|
||||
method: 'get'
|
||||
})
|
||||
records.value = res.data || []
|
||||
} catch (error) {
|
||||
ElMessage.error('获取记录失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const resetForm = () => {
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (form.encounterId) {
|
||||
getRecords()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user