Ver Fonte

添加诊断和手术匹配

lighter há 3 anos atrás
pai
commit
c31f862818
2 ficheiros alterados com 60 adições e 15 exclusões
  1. 8 0
      src/api/dictionary/his-wjw-match.js
  2. 52 15
      src/views/dictionary/HisWjwMatch.vue

+ 8 - 0
src/api/dictionary/his-wjw-match.js

@@ -15,3 +15,11 @@ export function executeMatchAction(data) {
     data,
   })
 }
+
+export function fetchSimilarities(label, name, key) {
+  return request({
+    url: '/hisWjwMatch/fetchSimilarities',
+    method: 'get',
+    params: { label, name, key },
+  })
+}

+ 52 - 15
src/views/dictionary/HisWjwMatch.vue

@@ -5,6 +5,8 @@
       <el-radio-group v-model="hisWjwMatchEntity.label" @change="fetchDataByLabel">
         <el-radio label="department">科别</el-radio>
         <el-radio label="anaesthesia">麻醉方式</el-radio>
+        <el-radio label="diagnose">国临诊断</el-radio>
+        <el-radio label="surgery">国临手术操作</el-radio>
       </el-radio-group>
       <el-button style="margin-left: 50px" type="primary" icon="el-icon-refresh" @click="fetchDataByLabel">刷新数据</el-button>
     </el-header>
@@ -28,11 +30,11 @@
           <div class="match-info-box">
             <div>
               <div class="his">
-                <div>当前His编码:</div>
+                <div>{{ hisMatchTextNote }}:</div>
                 <div class="code">{{ hisWjwMatchEntity.code }}</div>
               </div>
               <div class="wjw">
-                <div>当前卫健委编码:</div>
+                <div>{{ wjwMatchTextNote }}:</div>
                 <div class="code">{{ hisWjwMatchEntity.wjwCode }}</div>
               </div>
               <el-button v-if="currentHisRow.wjwCode" icon="el-icon-close" type="danger" @click="revokeMatch">撤销匹配</el-button>
@@ -59,6 +61,7 @@
               <el-table-column type="index" label="序号"></el-table-column>
               <el-table-column prop="code" label="编码" width="90"></el-table-column>
               <el-table-column prop="name" label="名称"></el-table-column>
+              <el-table-column v-if="hisWjwMatchEntity.label === 'diagnose' || hisWjwMatchEntity.label === 'surgery'" prop="similarity" label="目标相似度"></el-table-column>
             </el-table>
           </div>
         </el-col>
@@ -69,7 +72,7 @@
 
 <script setup name="HisWjwMatch">
 import { reactive, computed, onMounted } from 'vue'
-import { selectMatchableDataByLabel, executeMatchAction } from '@/api/dictionary/his-wjw-match'
+import { selectMatchableDataByLabel, executeMatchAction, fetchSimilarities } from '@/api/dictionary/his-wjw-match'
 import { ElMessage } from 'element-plus'
 
 const wjwTableRef = $ref(null)
@@ -87,6 +90,14 @@ const hisWjwMatchEntity = reactive({
   label: 'department',
 })
 
+const hisLabel = ['department', 'anaesthesia']
+const hisMatchTextNote = computed(() => {
+  return hisLabel.indexOf(hisWjwMatchEntity.label) !== -1 ? '当前HIS编码' : '当前国临编码'
+})
+const wjwMatchTextNote = computed(() => {
+  return hisLabel.indexOf(hisWjwMatchEntity.label) !== -1 ? '当前卫健委编码' : '当前医保编码'
+})
+
 const disableWjwTable = computed(() => {
   return currentHisRow.wjwCode !== null && currentHisRow.wjwCode !== undefined
 })
@@ -108,33 +119,46 @@ const fetchDataByLabel = () => {
     hisList = res.hisList
     wjwList = res.wjwList
     currentHisRow = {}
+    currentSimilaratyKey = null
     hisWjwMatchEntity.code = null
     hisWjwMatchEntity.wjwCode = null
   })
 }
 
+const currentSimilaratyKey = $ref(null)
 const handleClickHisRow = (row) => {
   if (row.code !== currentHisRow.code) {
     hisWjwMatchEntity.wjwCode = null
-  }
-  currentHisRow = row
-  hisWjwMatchEntity.code = row.code
-  if (row.wjwCode) {
-    hisWjwMatchEntity.wjwCode = row.wjwCode
-    for (let i = 0; i < wjwList.length; i++) {
-      if (wjwList[i].code === row.wjwCode) {
-        wjwInput = wjwList[i].name
-        wjwTableRef.setCurrentRow(wjwList[i])
-        break
+    currentHisRow = row
+    hisWjwMatchEntity.code = row.code
+    if (row.wjwCode) {
+      hisWjwMatchEntity.wjwCode = row.wjwCode
+      for (let i = 0; i < wjwList.length; i++) {
+        if (wjwList[i].code === row.wjwCode) {
+          wjwInput = wjwList[i].name
+          wjwTableRef.setCurrentRow(wjwList[i])
+          break
+        }
+      }
+    } else {
+      if (hisWjwMatchEntity.label === 'department' || hisWjwMatchEntity.label === 'anaesthesia') {
+        wjwInput = row.name.length > 3 ? row.name.substring(0, 2) : row.name.substring(0, 1)
+      } else {
+        if (row.code !== currentSimilaratyKey) {
+          currentSimilaratyKey = row.code
+          const key = '%' + row.code.split('.')[0].replace('*', '') + '%'
+          fetchSimilarities(hisWjwMatchEntity.label, row.name, key).then((res) => {
+            wjwList = res
+          })
+        }
       }
     }
-  } else {
-    wjwInput = row.name.length > 3 ? row.name.substring(0, 2) : row.name.substring(0, 1)
   }
 }
 
 const handleClickWjwRow = (row) => {
   hisWjwMatchEntity.wjwCode = row.code
+  hisWjwMatchEntity.wjwName = row.name
 }
 
 const makeMatchStatus = (wjwCode) => {
@@ -146,6 +170,12 @@ const manageMatchState = computed(() => {
 })
 
 const executeMatch = () => {
+  if (hisWjwMatchEntity.label === 'department' || hisWjwMatchEntity.label === 'anaesthesia') {
+    hisWjwMatchEntity.targetCodeColumn = 'wjw_code'
+  } else {
+    hisWjwMatchEntity.targetCodeColumn = 'yb_code'
+    hisWjwMatchEntity.targetNameColumn = 'yb_name'
+  }
   executeMatchAction(hisWjwMatchEntity).then((res) => {
     currentHisRow.wjwCode = hisWjwMatchEntity.wjwCode
     ElMessage({
@@ -159,6 +189,13 @@ const executeMatch = () => {
 
 const revokeMatch = () => {
   hisWjwMatchEntity.wjwCode = null
+  hisWjwMatchEntity.wjwName = null
+  if (hisWjwMatchEntity.label === 'department' || hisWjwMatchEntity.label === 'anaesthesia') {
+    hisWjwMatchEntity.targetCodeColumn = 'wjw_code'
+  } else {
+    hisWjwMatchEntity.targetCodeColumn = 'yb_code'
+    hisWjwMatchEntity.targetNameColumn = 'yb_name'
+  }
   executeMatchAction(hisWjwMatchEntity).then((res) => {
     currentHisRow.wjwCode = null
     wjwTableRef.setCurrentRow(null)