123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335 |
- <template>
- <div style="height: 10%;display: flex">
- <div>
- <el-date-picker v-model="dateRange"
- style="width: 220px"
- :clearable="false"
- type="daterange"/>
- <br>
- <hr>
- <el-button @click="query" type="primary">查询</el-button>
- <el-button @click="appendCopy" type="success">复制 / 追加</el-button>
- <el-button @click="copyClick" type="success">确认复制</el-button>
- </div>
- <div class="describe">
- <div class="pat-info">
- <div>
- <test-describe front="姓名"
- :text="inspectionHeader?.ptnt_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>
- <div class="container">
- <el-auto-resizer>
- <template #default="{ height, width }">
- <div style="display: flex">
- <div class="sidebar">
- <xc-table-v3 :height="height"
- @row-click="sidebarRow"
- :data="sidebarList"
- :columns="sidebarColums"/>
- </div>
- <div class="main">
- <el-table :data="mainList"
- :height="height"
- row-key="itm_ORDR"
- ref="tableRef"
- @row-click="testRowClick"
- :expand-row-keys="expands">
- <el-table-column label="选择" type="selection"/>
- <el-table-column type="expand" width="20">
- <template #default="{row}">
- <el-table :data="row.bacteriaResults[0].antibioticResults"
- ref="drugSensitivityRef"
- @row-click="drugTable"
- v-if="row.bacteriaResults.length > 0">
- <el-table-column label="选择" type="selection"/>
- <el-table-column label="抗菌药物" prop="anti_NAME_CN"/>
- <el-table-column label="抗菌药物编码" prop="anti_ABB"/>
- <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"/>
- <el-table-column label="结果">
- <template #default="{row}">
- {{ result(row) }}
- </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>
- </template>
- </el-auto-resizer>
- </div>
- </template>
- <script setup name='EmrTest' lang="tsx">
- // 查询检验
- import {getServerDateApi} from "@/api/public-api";
- import {queryInspectionDetail, queryInspectionsIndex} from '@/api/inspections'
- import {patInfo} from './emr-tools-store'
- import {onMounted, ref} from "vue";
- import XcTableV3 from "@/components/xiao-chan/xc-table-v3/XcTableV3.vue";
- import {XcColumn} from "@/components/xiao-chan/xc-table-v3/XcColumn";
- import {xcMessage} from '@/utils/xiaochan-element-plus'
- import TestDescribe from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/TestDescribe.vue";
- import {getDateRangeFormatDate} from '@/utils/date'
- import {emrCopyFunc} from '@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init'
- const emits = defineEmits(['close'])
- const sidebarList = ref()
- const mainList = ref()
- const tableRef = ref()
- const drugSensitivityRef = ref()
- const inspectionHeader = ref({
- aply_CNTN: ''
- })
- const dateRange = ref([])
- const query = async () => {
- let {startTime, endTime} = getDateRangeFormatDate(dateRange.value)
- const param = {
- type: 1,
- content: patInfo.value.inpatientNo,
- start: startTime,
- end: endTime,
- }
- queryInspectionsIndex(param).then((res) => {
- sidebarList.value = res
- console.log(res)
- })
- }
- const sidebarColums: XcColumn<any>[] = [
- {title: '名称', key: 'aply_CTNT'},
- {title: '时间', key: 'ordr_CREATE_DATE', width: 180}
- ]
- const expands = ref([])
- let currentReportForm = {}
- const sidebarRow = (row) => {
- currentReportForm = row
- queryInspectionDetail(row.ordr_ID).then((res) => {
- mainList.value = res['inspectionItems']
- inspectionHeader.value = res['inspectionHeader']
- mainList.value.forEach(item => {
- if (item.bacteriaResults.length > 0) {
- expands.value.push(item.itm_ORDR)
- }
- })
- })
- }
- const testRowClick = (row) => {
- let temp = tableRef.value.getSelectionRows()
- tableRef.value.toggleRowSelection(row, !temp.includes(row))
- }
- const drugTable = (row) => {
- let temp = drugSensitivityRef.value.getSelectionRows()
- drugSensitivityRef.value.toggleRowSelection(row, !temp.includes(row))
- }
- let copyStr = ''
- const appendCopy = () => {
- let temp = tableRef.value.getSelectionRows()
- let drugSensitivity = []
- try {
- drugSensitivity = drugSensitivityRef.value.getSelectionRows()
- } catch (e) {
- }
- if (temp.length === 0 && drugSensitivity.length === 0) {
- xcMessage.error('请先选选择数据')
- }
- let data = currentReportForm.aply_CTNT + ":"
- temp.forEach(item => {
- data += `${item.itm_NAME}${result(item)}${item.itm_UNIT}${getItemStr(item.itm_ALERT, item.itm_STR_VALUE, item.itm_VALUE)},`
- })
- drugSensitivity.forEach(item => {
- data += `${item.anti_NAME_CN}${item.anti_ABB}${item.anti_MIC}${item.anti_VALUE},`
- })
- copyStr += ' ' + data
- xcMessage.success('追加成功。')
- }
- const copyClick = () => {
- emrCopyFunc(copyStr)
- emits('close')
- }
- const result = (row) => {
- if (row.bacteriaResults.length > 0) {
- return row.bacteriaResults[0].bac_NAME_CN
- }
- return `${row.itm_VALUE} ${row.itm_STR_VALUE}`
- }
- 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>'
- }
- function getItemStr(val, strValue, value) {
- if (strValue !== '' || value === '') return ''
- switch (val) {
- case 'L':
- return '↓'
- case 'H':
- return '↑'
- }
- return '正常'
- }
- onMounted(async () => {
- dateRange.value.push(patInfo.value.admissDate)
- dateRange.value.push(await getServerDateApi())
- await query()
- // todo 检验接口没有返回危急值。
- // let res = await getCriticalValueByPatInfo(patInfo.value.inpatientNo, patInfo.value.admissTimes)
- })
- </script>
- <style scoped lang="scss">
- .container {
- width: 100%;
- height: 90%;
- }
- .sidebar {
- width: 420px;
- }
- .main {
- width: 100%;
- height: 100%;
- }
- .describe {
- width: 100%;
- margin-left: 20px;
- font-size: 12px;
- .pat-info {
- display: flex;
- div {
- padding: 5px;
- }
- }
- .test-date {
- display: flex;
- div {
- padding: 5px;
- }
- }
- }
- </style>
|