Browse Source

静态知识映射 测试功能

Morphone0429 4 years ago
parent
commit
dce052ed33

+ 2 - 2
src/api/cdss.js

@@ -537,7 +537,7 @@ export default {
   getStaticPage(param) {
     return axios.post(urls.getStaticPage, param);
   },
-  LisStaticTest(param) {
-    return axios.post(urls.LisStaticTest, param, { timeout: 30 * 60 * 1000 });
+  staticKnowledgeTest(param) {
+    return axios.post(urls.staticKnowledgeTest, param, { timeout: 30 * 60 * 1000 });
   },
 };

+ 1 - 1
src/api/config.js

@@ -514,7 +514,7 @@ export default {
     'exportStaticLisStaticExcel': '/api/cdssman/test/staticKnowledge/exportLisStaticExcel',   //检验缺少静态知识测试结果导出
     'getStaticCaseResultList': '/api/cdssman/test/staticKnowledge/getCaseResultList',   //静态知识测试总览列表
     'getStaticPage': '/api/cdssman/test/staticKnowledge/getPage',   //静态知识测试结果明细列表
-    'LisStaticTest': '/api/cdssman/test/staticKnowledge/lisTest',   //化验静态知识测试
+    'staticKnowledgeTest': '/api/cdssman/test/staticKnowledge/staticKnowledgeTest',   //静态知识测试
 
   },
   menuIconList: { //菜单对应图标

src/components/testManager/staticKnowledgeMap/LessStaticDisease.vue → src/components/testManager/staticKnowledgeMap/LessStaticOrNoMap.vue


+ 87 - 14
src/components/testManager/staticKnowledgeMap/StaticKnowledgeMapTest.vue

@@ -21,12 +21,6 @@
             ></el-option>
           </el-select>
         </el-form-item>
-
-        <el-form-item style="marginbottom: 0px">
-          <el-button size="mini" @click="handleAllTest"
-            >所有术语类型映射测试</el-button
-          >
-        </el-form-item>
       </el-form>
     </crumbs>
     <div style="margin: 60px 20px 0">
@@ -61,7 +55,7 @@
             <el-button
               type="text"
               size="small"
-              @click="goToInnerPage(scope.row,'noMap')"
+              @click="goToInnerPage(scope.row, 'noMap')"
               >{{ scope.row.unMappingNum }}</el-button
             >
           </template>
@@ -71,13 +65,19 @@
             <el-button
               type="text"
               size="small"
-              @click="goToInnerPage(scope.row,'lessStatic')"
+              @click="goToInnerPage(scope.row, 'lessStatic')"
               >{{ scope.row.withoutKnowledgeNum }}</el-button
             >
           </template>
         </el-table-column>
         <el-table-column label="操作">
           <template slot-scope="scope">
+            <input
+              type="file"
+              name="uploadfile "
+              id="upFile"
+              @change="uploadFile($event)"
+            />
             <el-button type="text" size="small" @click="handleTest(scope.row)"
               >执行测试</el-button
             >
@@ -99,6 +99,8 @@ export default {
       list: [],
       hospitalData: [],
       hospitalId: '', //选中医院
+      type: '',
+      caseId: '',
     };
   },
   created() {
@@ -123,24 +125,92 @@ export default {
         }
       });
     },
+    handleType(caseName) {
+      switch (caseName) {
+        case '诊断':
+          return 1;
+        case '检验':
+          return 2;
+        case '检查':
+          return 3;
+        case '药品':
+          return 4;
+        case '手术/操作':
+          return 5;
+        default:
+          return null;
+      }
+    },
     // 执行测试
-    handleTest() {},
-    // 所有规则测试
-    handleAllTest() {},
+    handleTest(row) {
+      let inp = document.getElementById('upFile');
+      inp.click();
+      const { caseName, caseId } = row;
+      this.type = this.handleType(caseName); //术语类型(1:诊断、2:检验、3:检查、4:药品、5:手术/操作)
+      this.caseId = caseId; //测试用例id
+    },
+
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('hospitalId', this.hospitalId);
+      formData.append('type', this.type);
+      formData.append('caseId', this.caseId);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data',
+        },
+      };
+      api.staticKnowledgeTest(formData, header).then((res) => {
+        if (res.data.code === '00000001') {
+          this.$alert(`数据存在异常,测试失败,请修改后再试`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning',
+          })
+            .then(() => {})
+            .catch(() => {});
+          this.getDataList(this.hospitalId); // 重新获取列表
+        } else if (res.data === '' && res.status === 200) {
+          this.$alert(`测试成功`, '提示', {
+            confirmButtonText: '确定',
+            type: 'success',
+          })
+            .then(() => {})
+            .catch(() => {});
+          this.getDataList(this.hospitalId); // 重新获取列表
+          // setTimeout(() => {
+          //   this.uploadInfo = '导入';
+          // }, 300);
+        } else {
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning',
+          })
+            .then(() => {})
+            .catch(() => {});
+        }
+      });
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
 
     // 跳转至未映射到标准术语条数页面 / 缺少静态知识术语条数
-    goToInnerPage(row,type) {
+    goToInnerPage(row, type) {
       let hospital = this.hospitalData.find(
         (item) => item.id === this.hospitalId
       );
       let hospitalName = hospital.name;
       this.$router.push({
-        name: 'LessStaticDisease',
+        name: 'LessStaticOrNoMap',
         params: {
           data: { ...row },
           hospitalId: this.hospitalId,
           hospitalName,
-          type
+          type,
         },
       });
     },
@@ -176,4 +246,7 @@ export default {
 
 <style lang="less" scored>
 @import '../../../less/admin.less';
+#upFile {
+  display: none !important;
+}
 </style>

+ 5 - 57
src/routes.js

@@ -194,16 +194,8 @@ import HighRiskOperationTest from '@components/testManager/knowledgeMapRule/High
 import OtherAssayRuleTest from '@components/testManager/knowledgeMapRule/OtherAssayRuleTest.vue';
 import OtherAuxRuleTest from '@components/testManager/knowledgeMapRule/OtherAuxRuleTest.vue';
 import OtherFusionRuleTest from '@components/testManager/knowledgeMapRule/OtherFusionRuleTest.vue';
-import LessStaticDisease from '@components/testManager/staticKnowledgeMap/LessStaticDisease.vue';
-import LessStaticDrug from '@components/testManager/staticKnowledgeMap/LessStaticDrug.vue';
-import LessStaticLis from '@components/testManager/staticKnowledgeMap/LessStaticLis.vue';
-import LessStaticOperation from '@components/testManager/staticKnowledgeMap/LessStaticOperation.vue';
-import LessStaticPacs from '@components/testManager/staticKnowledgeMap/LessStaticPacs.vue';
-import NoMapDisease from '@components/testManager/staticKnowledgeMap/NoMapDisease.vue';
-import NoMapDrug from '@components/testManager/staticKnowledgeMap/NoMapDrug.vue';
-import NoMapLis from '@components/testManager/staticKnowledgeMap/NoMapLis.vue';
-import NoMapOperation from '@components/testManager/staticKnowledgeMap/NoMapOperation.vue';
-import NoMapPacs from '@components/testManager/staticKnowledgeMap/NoMapPacs.vue';
+import LessStaticOrNoMap from '@components/testManager/staticKnowledgeMap/LessStaticOrNoMap.vue';
+
 
 export default [
   {
@@ -568,54 +560,10 @@ export default [
       },
       {
         path: 'LT-YYSYZDHCS-JTZSYSCS-WYSZD',
-        component: NoMapDisease,
-        name: 'NoMapDisease',
-      },
-      {
-        path: 'LT-YYSYZDHCS-JTZSYSCS-WYSJY',
-        component: NoMapLis,
-        name: 'NoMapLis',
-      },
-      {
-        path: 'LT-YYSYZDHCS-JTZSYSCS-WYSJC',
-        component: NoMapPacs,
-        name: 'NoMapPacs',
-      },
-      {
-        path: 'LT-YYSYZDHCS-JTZSYSCS-WYSYP',
-        component: NoMapDrug,
-        name: 'NoMapDrug',
-      },
-      {
-        path: 'LT-YYSYZDHCS-JTZSYSCS-WYSSSCZ',
-        component: NoMapOperation,
-        name: 'NoMapOperation',
-      },
-      {
-        path: 'LT-YYSYZDHCS-JTZSYSCS-QSZD',
-        component: LessStaticDisease,
-        name: 'LessStaticDisease',
-      },
-      {
-        path: 'LT-YYSYZDHCS-JTZSYSCS-QSJY',
-        component: LessStaticLis,
-        name: 'LessStaticLis',
-      },
-      {
-        path: 'LT-YYSYZDHCS-JTZSYSCS-QSJC',
-        component: LessStaticPacs,
-        name: 'LessStaticPacs',
-      },
-      {
-        path: 'LT-YYSYZDHCS-JTZSYSCS-QSYP',
-        component: LessStaticDrug,
-        name: 'LessStaticDrug',
-      },
-      {
-        path: 'LT-YYSYZDHCS-JTZSYSCS-QSSSCZ',
-        component: LessStaticOperation,
-        name: 'LessStaticOperation',
+        component: LessStaticOrNoMap,
+        name: 'LessStaticOrNoMap',
       },
+      
     ],
   },
 ];