|
@@ -0,0 +1,302 @@
|
|
|
+<script setup lang="ts">
|
|
|
+import {onMounted, ref} from "vue";
|
|
|
+import {currentAndAFewDaysAgo, getDateRange} from '@/utils/date'
|
|
|
+import {getDetail, getNormal} from "@/api/jian-yan-jie-kou/jian-yan-jie-kou";
|
|
|
+import XcTable from "@/components/xiao-chan/xc-table/XcTable.vue";
|
|
|
+import {shortcuts} from '@/data/shortcuts'
|
|
|
+import TestDescribe from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/TestDescribe.vue";
|
|
|
+import XEUtils from "xe-utils";
|
|
|
+
|
|
|
+const props = defineProps<{
|
|
|
+ patNo: string,
|
|
|
+}>()
|
|
|
+
|
|
|
+interface SidebarData {
|
|
|
+ reportId: string
|
|
|
+ examPurpose: string
|
|
|
+ trscDate: string
|
|
|
+}
|
|
|
+
|
|
|
+const dateRange = ref<string[]>([])
|
|
|
+const sidebarData = ref<SidebarData[]>([])
|
|
|
+
|
|
|
+const inspectionHeader = ref<{
|
|
|
+ ordr_usr_name: string;
|
|
|
+ ptnt_sex: string
|
|
|
+ ptnt_age: string
|
|
|
+ ptnt_age_unit: string
|
|
|
+ ptnt_no: string
|
|
|
+ dept_name: string
|
|
|
+ ptnt_bed_no: string
|
|
|
+ smpl_name: string
|
|
|
+ aply_cntn: string
|
|
|
+ aply_date: string
|
|
|
+ ordr_create_date: string
|
|
|
+ audt_time: string
|
|
|
+ test_usr_name: string
|
|
|
+ audt_usr_name: string
|
|
|
+}>({
|
|
|
+ aply_cntn: "",
|
|
|
+ aply_date: "",
|
|
|
+ audt_time: "",
|
|
|
+ audt_usr_name: "",
|
|
|
+ dept_name: "",
|
|
|
+ ordr_create_date: "",
|
|
|
+ ordr_usr_name: "",
|
|
|
+ ptnt_age: "",
|
|
|
+ ptnt_age_unit: "",
|
|
|
+ ptnt_bed_no: "",
|
|
|
+ ptnt_no: "",
|
|
|
+ ptnt_sex: "",
|
|
|
+ smpl_name: "",
|
|
|
+ test_usr_name: ""
|
|
|
+})
|
|
|
+
|
|
|
+const describeRef = ref<HTMLDivElement>()
|
|
|
+const detailData = ref([])
|
|
|
+
|
|
|
+const query = () => {
|
|
|
+ const {start, end} = getDateRange(dateRange.value)
|
|
|
+ const data = {
|
|
|
+ patientNum: props.patNo,
|
|
|
+ startDate: start,
|
|
|
+ endDate: end
|
|
|
+ }
|
|
|
+
|
|
|
+ getNormal(data).then(res => {
|
|
|
+ console.log('getNormal', res)
|
|
|
+ sidebarData.value = res
|
|
|
+ })
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+const sidebarRowClick = (row: SidebarData) => {
|
|
|
+ getDetail(row.reportId).then(res => {
|
|
|
+ if (XEUtils.isEmpty(res)) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ console.log(res)
|
|
|
+ inspectionHeader.value = res.order
|
|
|
+ detailData.value = res.items
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+function filterSex(val) {
|
|
|
+ switch (val) {
|
|
|
+ case '0':
|
|
|
+ return '未填'
|
|
|
+ case '1':
|
|
|
+ return '男'
|
|
|
+ case '2':
|
|
|
+ return '女'
|
|
|
+ case '3':
|
|
|
+ return '未知'
|
|
|
+ }
|
|
|
+ return ''
|
|
|
+}
|
|
|
+
|
|
|
+function filterAgeUnit(val) {
|
|
|
+ switch (val) {
|
|
|
+ case '0':
|
|
|
+ return '岁'
|
|
|
+ case '1':
|
|
|
+ return '月'
|
|
|
+ case '2':
|
|
|
+ return '天'
|
|
|
+ case '3':
|
|
|
+ return '时'
|
|
|
+ }
|
|
|
+ return ''
|
|
|
+}
|
|
|
+
|
|
|
+function getItemAlert(val, strValue, value) {
|
|
|
+ if (strValue !== '' || value === '') return ''
|
|
|
+ switch (val) {
|
|
|
+ case 'L':
|
|
|
+ return '<span style="color:#F56C6C;font-weight:bold">↓</span>'
|
|
|
+ case 'H':
|
|
|
+ return '<span style="color:#F56C6C;font-weight:bold">↑</span>'
|
|
|
+ }
|
|
|
+ return '<span style="color:#67C23A;font-weight:bold">正常</span>'
|
|
|
+}
|
|
|
+
|
|
|
+const result = (row) => {
|
|
|
+ if (row.anti_list && row.anti_list.length > 0) {
|
|
|
+ return row.bac_name_cn
|
|
|
+ }
|
|
|
+ return `${row.itm_value} ${row.itm_str_value}`
|
|
|
+}
|
|
|
+
|
|
|
+const mainTableHeight = (val: number) => {
|
|
|
+ if (describeRef.value?.clientHeight) {
|
|
|
+ return val - describeRef.value.clientHeight;
|
|
|
+ }
|
|
|
+ return val;
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(async () => {
|
|
|
+ dateRange.value = await currentAndAFewDaysAgo()
|
|
|
+ query()
|
|
|
+})
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <el-auto-resizer>
|
|
|
+ <template #default="{ height, width }">
|
|
|
+ <div style="display: flex ; height: 100%">
|
|
|
+ <div style="width: 220px">
|
|
|
+ <div style="height: 50px">
|
|
|
+ <el-date-picker v-model="dateRange"
|
|
|
+ :shortcuts="shortcuts"
|
|
|
+ style="width: 180px"
|
|
|
+ type="daterange"/>
|
|
|
+ <br>
|
|
|
+ <el-button @click="query">查询</el-button>
|
|
|
+ </div>
|
|
|
+ <xc-table :local-data="sidebarData"
|
|
|
+ @row-click="sidebarRowClick"
|
|
|
+ :final-height="height - 24 - 50"
|
|
|
+ layout="total, prev, pager, next"
|
|
|
+ small>
|
|
|
+ <el-table-column prop="examPurpose" label="项目名称" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="trscDate" label="检验时间" width="75"></el-table-column>
|
|
|
+ </xc-table>
|
|
|
+ </div>
|
|
|
+ <div style="flex: 1">
|
|
|
+ <div class="describe" ref="describeRef">
|
|
|
+ <div class="pat-info">
|
|
|
+ <div>
|
|
|
+ <test-describe front="姓名"
|
|
|
+ :text="inspectionHeader?.ordr_usr_name"/>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <test-describe front="性别"
|
|
|
+ :text="filterSex(inspectionHeader?.ptnt_sex)"/>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <test-describe front="年龄"
|
|
|
+ :text="inspectionHeader.ptnt_age + filterAgeUnit(inspectionHeader.ptnt_age_unit) "/>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <test-describe front="住院号"
|
|
|
+ :text="inspectionHeader.ptnt_no"/>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <test-describe front="科室"
|
|
|
+ :text="inspectionHeader.dept_name"/>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <test-describe front="床号"
|
|
|
+ :text="inspectionHeader.ptnt_bed_no"/>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <test-describe front="标本类型"
|
|
|
+ :text="inspectionHeader.smpl_name "/>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <test-describe front="申请项目"
|
|
|
+ :text="inspectionHeader?.aply_cntn"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="test-date">
|
|
|
+ <div>
|
|
|
+ <test-describe front="接收时间"
|
|
|
+ :text="inspectionHeader.aply_date"/>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <test-describe front="检验时间"
|
|
|
+ :text="inspectionHeader.ordr_create_date"/>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <test-describe front="报告时间"
|
|
|
+ :text="inspectionHeader.audt_time"/>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <test-describe front="送检医生"
|
|
|
+ :text="inspectionHeader.test_usr_name"/>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <test-describe front="检验人"
|
|
|
+ :text="inspectionHeader.ordr_usr_name"/>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <test-describe front="审核人"
|
|
|
+ :text="inspectionHeader.audt_usr_name"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-table :data="detailData"
|
|
|
+ row-key="itm_id"
|
|
|
+ :height="mainTableHeight(height)">
|
|
|
+ <el-table-column type="expand" width="20">
|
|
|
+ <template #default="{row,$index}">
|
|
|
+ <el-table :data="row.anti_list "
|
|
|
+ v-if="row.anti_list && row.anti_list.length > 0">
|
|
|
+ <el-table-column label="选择" type="selection"/>
|
|
|
+ <el-table-column label="抗菌药物" prop="anti_name_cn"/>
|
|
|
+ <el-table-column label="MIC值" prop="anti_mic"/>
|
|
|
+ <el-table-column label="敏感性" prop="anti_value"/>
|
|
|
+ </el-table>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="检验项目" prop="itm_name" width="450">
|
|
|
+ <template #default="{row}">
|
|
|
+ {{ row.itm_name }}
|
|
|
+ <span v-if="row.critical_exec_flag === 1" style="color: red">
|
|
|
+ 危
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="结果">
|
|
|
+ <template #default="{row}">
|
|
|
+ {{ result(row) }}
|
|
|
+ <template v-if="!XEUtils.isEmpty(row.critical_exec_info)">
|
|
|
+ <br>
|
|
|
+ <span style="color: red">
|
|
|
+ {{ row.critical_exec_info }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="单位" prop="itm_unit"/>
|
|
|
+ <el-table-column label="说明" prop="itm_alert">
|
|
|
+ <template #default="{row}">
|
|
|
+ <span v-html="getItemAlert(row.itm_alert, row.itm_str_value, row.itm_value)"></span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="参考值" prop="range"/>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-auto-resizer>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+.describe {
|
|
|
+ width: 100%;
|
|
|
+ margin-left: 20px;
|
|
|
+ font-size: 12px;
|
|
|
+
|
|
|
+ .pat-info {
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ div {
|
|
|
+ padding: 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .test-date {
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ div {
|
|
|
+ padding: 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+</style>
|