Bläddra i källkod

把患者信息提取出去

xiaochan 3 år sedan
förälder
incheckning
adf81f2bbd

+ 45 - 0
src/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru.js

@@ -1,8 +1,28 @@
 import request from '@/utils/request'
+import {ElMessage} from "element-plus";
+import {ref} from "vue";
 
 
 const url = '/yiZhuLuRu'
 
+// 判断是否选择了患者
+export const xuanZheHuanZhe = ref(false)
+// 获取患者的频率数据
+export const huanZhePinLvData = ref([])
+// 患者信息
+export const gongYongHuanZheXinXi = ref('')
+
+export function youWuXuanZheHuanZhe() {
+    if (!xuanZheHuanZhe.value) {
+        ElMessage({
+            message: '请先选择患者',
+            showClose: true,
+            type: 'error'
+        })
+        return !xuanZheHuanZhe.value
+    }
+}
+
 export function huoQuHuanZheLieBiao(wardCode) {
     return request({
         url: url + '/huoQuHuanZheLieBiao',
@@ -18,3 +38,28 @@ export function huoQuHuanZheXinXi(inpatientNo) {
         params: {inpatientNo},
     })
 }
+
+export function huoQuYiZhuMingCheng(inpatientNo, admissTimes, orderName) {
+    return request({
+        url: url + '/huoQuYiZhuMingCheng',
+        method: 'get',
+        params: {inpatientNo, admissTimes, orderName},
+    })
+}
+
+export function huoQuGeRenPinLv(patNo, times) {
+    return request({
+        url: url + '/huoQuGeRenPinLv',
+        method: 'get',
+        params: {patNo, times}
+    })
+}
+
+
+export function huoQuYiZhuShuJu(data) {
+    return request({
+        url: url + '/huoQuYiZhuShuJu',
+        method: 'post',
+        data,
+    })
+}

+ 82 - 15
src/components/zhu-yuan-yi-sheng/HuanZheLieBiao.vue

@@ -1,10 +1,17 @@
 <template>
   <el-container>
     <el-aside style="width: 190px;">
-      <el-checkbox style="margin-left: 10px" v-model="woDeBingRen">我的病人</el-checkbox>
+      <el-select v-model="currentWard" @change="huoQuHuanZheLieBiaoClick" style="width: 120px" filterable>
+        <el-option v-for="item in userWards" :key="item.code" :value="item.code" :label="item.name"></el-option>
+      </el-select>
+      <el-select v-model="inpatientNo" style="width: 120px;" filterable :filter-method="filterMethod" clearable>
+        <el-option v-for="item in cptHuanZheLieBiaoData" :key="item.inpatientNo" :value="item.inpatientNo"
+                   :label="item.name"></el-option>
+      </el-select>
+      <el-checkbox style="margin-left: 10px" v-model="woDeBingRen" @change="woDeBingRenClick">我的病人</el-checkbox>
       <el-table
           :data="cptHuanZheLieBiaoData.slice((huanZheLieBiaoCurrentPage - 1) * 20,huanZheLieBiaoCurrentPage * 20 )"
-          :height="tableHeight / 1.15" stripe highlight-current-row @row-click="huanZheXinXi">
+          :height="tableHeight / 1.15" @row-click="huanZheXinXi" :row-style="tableBackColor">
         <el-table-column label="床位" prop="bedNo" width="40"></el-table-column>
         <el-table-column label="姓名" prop="name">
           <template #default="scope">
@@ -19,7 +26,6 @@
         <el-table-column label="小科室" prop="zkWardName"></el-table-column>
       </el-table>
       <el-pagination
-          :page-sizes="[10, 20, 30, 40]"
           :page-size="20"
           small
           layout="prev,pager,next,total"
@@ -33,29 +39,46 @@
 
 <script>
 
-import {computed, ref} from "vue";
+import {computed, onMounted, ref, watch} from "vue";
 import store from "../../store";
-import {huoQuHuanZheLieBiao, huoQuHuanZheXinXi} from "../../api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
+import {
+  gongYongHuanZheXinXi,
+  huanZhePinLvData,
+  huoQuHuanZheLieBiao,
+  huoQuHuanZheXinXi, huoQuGeRenPinLv, xuanZheHuanZhe
+} from "../../api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
 import maleIcon from '../../assets/male-icon.png'
 import femaleIcon from '../../assets/female-icon.png'
+import {getUserWards} from "../../api/case-front-sheet";
+import {listNotBlank, stringIsBlank} from "../../utils/blank-utils";
+import {clone} from "../../utils/clone";
 
 export default {
   name: "HuanZheLieBiao",
+  props: ['inpatientNo'],
   setup(props, cxt) {
     const tableHeight = computed(() => {
       return store.state.app.windowSize.h
     })
+    // 选择的病房
+    const currentWard = ref('')
+    // 用户可以选择的 病房信息
+    const userWards = ref([])
+    // 住院号
+    const inpatientNo = ref('')
+
+    const cptHuanZheLieBiaoData = ref([])
     const huanZheLieBiaoData = ref([])
     const huanZheLieBiaoCurrentPage = ref(1)
     const woDeBingRen = ref(false)
 
-    const userCode = store.state.user.info.code
-
-    const huoQuHuanZheLieBiaoClick = (val) => {
-      huoQuHuanZheLieBiao(val).then((res) => {
+    const huoQuHuanZheLieBiaoClick = () => {
+      huoQuHuanZheLieBiao(currentWard.value).then((res) => {
         huanZheLieBiaoData.value = res
+        cptHuanZheLieBiaoData.value = clone(res)
       }).catch((e) => {
         huanZheLieBiaoData.value = []
+        cptHuanZheLieBiaoData.value = []
       })
     }
 
@@ -64,21 +87,61 @@ export default {
     }
 
     const huanZheXinXi = (val) => {
-      huoQuHuanZheXinXi(val.inpatientNo).then((res) => {
-        cxt.emit('clickHuanZheXinXi', {res})
+      inpatientNo.value = val.inpatientNo
+    }
+
+    watch(() => inpatientNo.value, () => {
+      woDeBingRen.value = false
+      if (stringIsBlank(inpatientNo.value)) {
+        cptHuanZheLieBiaoData.value = huanZheLieBiaoData.value
+      } else {
+        huoQuHuanZheXinXi(inpatientNo.value).then((res) => {
+          gongYongHuanZheXinXi.value = res
+          cxt.emit('clickHuanZheXinXi', {res})
+          xuanZheHuanZhe.value = true
+          // 加载患者的频率
+          huoQuGeRenPinLv(res.inpatientNo, res.admissTimes).then((res) => {
+            huanZhePinLvData.value = res
+          })
+        })
+      }
+    })
+
+    const woDeBingRenClick = () => {
+      woDeBingRen.value ? filterMethod(store.state.user.info.code) : cptHuanZheLieBiaoData.value = huanZheLieBiaoData.value
+    }
+
+
+    const filterMethod = (val) => {
+      cptHuanZheLieBiaoData.value = huanZheLieBiaoData.value.filter(item => {
+        return item.inpatientNo.indexOf(val) > -1 || item.name.indexOf(val) > -1
+            || item.consultPhysician.indexOf(val) > -1 || item.referPhysician.indexOf(val) > -1
       })
+    }
 
+    const tableBackColor = ({row, column, rowIndex, columnIndex}) => {
+      if (row.inpatientNo === inpatientNo.value) {
+        return {
+          backgroundColor: '#a7d3ff!important'
+        }
+      }
     }
 
-    const cptHuanZheLieBiaoData = computed(() => {
-      return huanZheLieBiaoData.value.filter(item => {
-        return item.consultPhysician.indexOf(woDeBingRen.value ? userCode : '') > -1 || item.referPhysician.indexOf(woDeBingRen.value ? userCode : '') > -1
+    onMounted(() => {
+      getUserWards().then((res) => {
+        userWards.value = res
+        if (listNotBlank(userWards.value)) {
+          currentWard.value = userWards.value[0].code
+          huoQuHuanZheLieBiaoClick()
+        }
       })
     })
 
 
     return {
       tableHeight,
+      currentWard,
+      userWards,
       huanZheLieBiaoData,
       huoQuHuanZheLieBiaoClick,
       huanZheLieBiaoCurrentPage,
@@ -87,7 +150,11 @@ export default {
       femaleIcon,
       woDeBingRen,
       cptHuanZheLieBiaoData,
-      huanZheXinXi
+      huanZheXinXi,
+      inpatientNo,
+      filterMethod,
+      tableBackColor,
+      woDeBingRenClick
     }
   }
 }

+ 30 - 25
src/components/zhu-yuan-yi-sheng/HuanZheXinXi.vue

@@ -3,58 +3,63 @@
     <el-main>
       <el-row>
         <el-col :span="2" style="text-align: right">住院号:</el-col>
-        <el-col :span="4"> {{ huanZheXinXi.inpatientNo }}</el-col>
+        <el-col :span="4">
+          {{ gongYongHuanZheXinXi.inpatientNo }}
+        </el-col>
         <el-col :span="2" style="text-align: right">住院次数:</el-col>
-        <el-col :span="4"> {{ huanZheXinXi.bedNo }}</el-col>
+        <el-col :span="4"> {{ gongYongHuanZheXinXi.bedNo }}</el-col>
         <el-col :span="2" style="text-align: right">身份证号:</el-col>
-        <el-col :span="4">{{ huanZheXinXi.socialNo }}</el-col>
+        <el-col :span="4">{{ gongYongHuanZheXinXi.socialNo }}</el-col>
         <el-col :span="2" style="text-align: right">出生日期:</el-col>
         <el-col :span="4">
-          <span>{{ huanZheXinXi.birthDate }}</span> &nbsp;&nbsp;
-          <span>{{ huanZheXinXi.age }} 岁</span></el-col>
+          <span>{{ gongYongHuanZheXinXi.birthDate }}</span> &nbsp;&nbsp;
+          <span>{{ gongYongHuanZheXinXi.age }} 岁</span></el-col>
       </el-row>
       <el-row>
         <el-col :span="2" style="text-align: right">姓名:</el-col>
-        <el-col :span="4"> {{ huanZheXinXi.name }}</el-col>
+        <el-col :span="4"> {{ gongYongHuanZheXinXi.name }}</el-col>
         <el-col :span="2" style="text-align: right">性别:</el-col>
-        <el-col :span="4"> {{ huanZheXinXi.sexName }}</el-col>
+        <el-col :span="4"> {{ gongYongHuanZheXinXi.sexName }}</el-col>
         <el-col :span="2" style="text-align: right">联系电话:</el-col>
-        <el-col :span="4"> {{ huanZheXinXi.homeTel }}</el-col>
+        <el-col :span="4"> {{ gongYongHuanZheXinXi.homeTel }}</el-col>
         <el-col :span="2" style="text-align: right">入院日期:</el-col>
-        <el-col :span="4"> {{ huanZheXinXi.admissDate }}</el-col>
+        <el-col :span="4">
+          <span>{{ gongYongHuanZheXinXi.admissDate }}</span> &nbsp;
+          <span>{{ gongYongHuanZheXinXi.actIptDays }}天</span>
+        </el-col>
       </el-row>
       <el-row>
         <el-col :span="2" style="text-align: right">管床医生:</el-col>
-        <el-col :span="4"> {{ huanZheXinXi.referPhysicianName }}</el-col>
+        <el-col :span="4"> {{ gongYongHuanZheXinXi.referPhysicianName }}</el-col>
         <el-col :span="2" style="text-align: right">病区:</el-col>
-        <el-col :span="4"> {{ huanZheXinXi.admissWardName }}</el-col>
+        <el-col :span="4"> {{ gongYongHuanZheXinXi.admissWardName }}</el-col>
         <el-col :span="2" style="text-align: right">入院医生:</el-col>
-        <el-col :span="4"> {{ huanZheXinXi.admissPhysicianName }}</el-col>
+        <el-col :span="4"> {{ gongYongHuanZheXinXi.admissPhysicianName }}</el-col>
         <el-col :span="2" style="text-align: right">入院诊断:</el-col>
-        <el-col :span="4"> {{ huanZheXinXi.admissDiagStr }}</el-col>
+        <el-col :span="4"> {{ gongYongHuanZheXinXi.admissDiagStr }}</el-col>
       </el-row>
       <el-row>
         <el-col :span="2" style="text-align: right">小科室:</el-col>
-        <el-col :span="4"> {{ huanZheXinXi.smallDeptName }}</el-col>
+        <el-col :span="4"> {{ gongYongHuanZheXinXi.smallDeptName }}</el-col>
         <el-col :span="2" style="text-align: right">登记日期:</el-col>
-        <el-col :span="4"> {{ huanZheXinXi.ybRegisterDate }}</el-col>
+        <el-col :span="4"> {{ gongYongHuanZheXinXi.ybRegisterDate }}</el-col>
         <el-col :span="2" style="text-align: right">身份:</el-col>
-        <el-col :span="4"> {{ huanZheXinXi.responceTypeName }}</el-col>
+        <el-col :span="4"> {{ gongYongHuanZheXinXi.responceTypeName }}</el-col>
         <el-col :span="2" style="text-align: right">总费用:</el-col>
         <el-col :span="4">
-          <span>{{ huanZheXinXi.totalCharge }}</span> &nbsp;&nbsp;
-          <span style="color: red">{{ huanZheXinXi.balance }}</span>
+          <span>{{ gongYongHuanZheXinXi.totalCharge }}</span> &nbsp;&nbsp;
+          <span style="color: red">{{ gongYongHuanZheXinXi.balance }}</span>
         </el-col>
       </el-row>
       <el-row>
         <el-col :span="2" style="text-align: right">药品占比:</el-col>
-        <el-col :span="4"> {{ huanZheXinXi.yp }}</el-col>
+        <el-col :span="4"> {{ gongYongHuanZheXinXi.yp }}</el-col>
         <el-col :span="2" style="text-align: right">检验检查:</el-col>
-        <el-col :span="4"> {{ huanZheXinXi.jyjc }}</el-col>
+        <el-col :span="4"> {{ gongYongHuanZheXinXi.jyjc }}</el-col>
         <el-col :span="2" style="text-align: right">医保:</el-col>
         <el-col :span="4">
-          <span>{{ huanZheXinXi.chargeYb }}</span> &nbsp;&nbsp;
-          <span>{{ huanZheXinXi.yb }}</span>
+          <span>{{ gongYongHuanZheXinXi.chargeYb }}</span> &nbsp;&nbsp;
+          <span>{{ gongYongHuanZheXinXi.yb }}</span>
         </el-col>
       </el-row>
     </el-main>
@@ -62,13 +67,13 @@
 </template>
 
 <script>
-import {ref, watch} from "vue";
+import {gongYongHuanZheXinXi} from "../../api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
 
 export default {
   name: "HuanZheXinXi",
-  props: ['huanZheXinXi'],
   setup(props, cxt) {
-    return {}
+
+    return {gongYongHuanZheXinXi}
   }
 }
 </script>

+ 110 - 0
src/components/zhu-yuan-yi-sheng/YiZhuLuRuZhuJian.vue

@@ -0,0 +1,110 @@
+<template>
+  <el-container>
+    <el-header style="height: 40px">
+      <el-date-picker
+          type="daterange"
+          v-model="dateRange"
+          placeholder="选择日期"
+          size="mini"
+          style="width: 220px"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          :shortcuts="shortcuts"
+      ></el-date-picker>
+      医嘱名称:
+      <el-select style="width: 120px" v-model="yiZhuMingZi" remote filterable clearable
+                 :remote-method="remoteMethodChargeCode">
+        <el-option v-for="item in yiZhuMingZiData" :key="item.code" :label="item.name" :value="item.code">
+          <span>{{ item.name }}</span>
+        </el-option>
+      </el-select>
+      频率:
+      <el-select v-model="pinLv" size="mini" filterable clearable style="width: 120px">
+        <el-option v-for="item in huanZhePinLvData" :key="item.code" :label="item.name" :value="item.code">
+          <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
+          <el-divider direction="vertical"></el-divider>
+          <span>{{ item.name }}</span>
+        </el-option>
+      </el-select>
+      <el-divider direction="vertical"></el-divider>
+      <el-button type="primary" icon="el-icon-search" @click="chaXunYiZhuClick">查询</el-button>
+    </el-header>
+  </el-container>
+</template>
+
+<script>
+import {ref} from "vue";
+import {shortcuts} from '../../data/shortcuts'
+import {
+  gongYongHuanZheXinXi,
+  huanZhePinLvData,
+  huoQuYiZhuMingCheng,
+  huoQuYiZhuShuJu,
+  youWuXuanZheHuanZhe
+} from "../../api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
+import {getDateRangeFormatDate} from "../../utils/date";
+
+export default {
+  name: "YiZhuLuRuZhuJian",
+  setup(props, cxt) {
+    const dateRange = ref('')
+    // 根据医嘱的名字来进行搜索
+    const yiZhuMingZi = ref('')
+    const yiZhuMingZiData = ref([])
+    // 获取频率
+    const pinLv = ref('')
+    // 分页
+    const yiZhuPage = ref({
+      currentPage: 1,
+      pageSize: 30,
+      total: 0,
+      data: []
+    })
+
+    const remoteMethodChargeCode = (val) => {
+      if (youWuXuanZheHuanZhe()) return
+      if (val.length > 1) {
+        huoQuYiZhuMingCheng(gongYongHuanZheXinXi.value.inpatientNo, gongYongHuanZheXinXi.value.admissTimes, val).then((res) => {
+          yiZhuMingZiData.value = res
+        })
+      }
+    }
+    // 根据医嘱的名字来进行搜索 结束
+
+
+    const chaXunYiZhuClick = () => {
+      if (youWuXuanZheHuanZhe()) return
+      const dateS = getDateRangeFormatDate(dateRange.value)
+      let data = {
+        currentPage: yiZhuPage.value.currentPage,
+        pageSize: yiZhuPage.value.pageSize,
+        total: 0,
+        patNo: gongYongHuanZheXinXi.value.inpatientNo,
+        times: gongYongHuanZheXinXi.value.admissTimes,
+        startTime: dateS.startTime,
+        endTime: dateS.endTime,
+        frequCode: pinLv.value
+      }
+      huoQuYiZhuShuJu(data).then((res) => {
+        console.log(res)
+      })
+    }
+
+    return {
+      dateRange,
+      shortcuts,
+      yiZhuMingZi,
+      yiZhuMingZiData,
+      remoteMethodChargeCode,
+      chaXunYiZhuClick,
+      pinLv,
+      huanZhePinLvData,
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 12 - 37
src/views/hospitalization/zhu-yuan-yi-sheng/YiZhuLuRu.vue

@@ -1,20 +1,21 @@
 <template>
   <el-container>
-    <el-header height="36px" style="margin-top: 8px">
-      <el-select v-model="currentWard" @change="huanZheLieBiaoChange" style="width: 120px" filterable>
-        <el-option v-for="item in userWards" :key="item.code" :value="item.code" :label="item.name"></el-option>
-      </el-select>
-    </el-header>
     <el-container>
       <el-aside style="width:auto !important;">
-        <huan-zhe-lie-biao ref="huanZheLieBiaoRef" @clickHuanZheXinXi="clickHuanZheXinXi"></huan-zhe-lie-biao>
+        <huan-zhe-lie-biao @clickHuanZheXinXi="clickHuanZheXinXi"></huan-zhe-lie-biao>
       </el-aside>
       <el-main>
         <el-collapse v-model="activeNames">
           <el-collapse-item title="患者信息" class="collapse-item-height" name="1">
-            <huan-zhe-xin-xi :huanZheXinXi="huanZhe"></huan-zhe-xin-xi>
+            <huan-zhe-xin-xi></huan-zhe-xin-xi>
           </el-collapse-item>
         </el-collapse>
+        <el-tabs>
+          <el-tab-pane label="医嘱录入">
+            <yi-zhu-lu-ru-zhu-jian></yi-zhu-lu-ru-zhu-jian>
+          </el-tab-pane>
+          <el-tab-pane label="检查申请"></el-tab-pane>
+        </el-tabs>
       </el-main>
     </el-container>
   </el-container>
@@ -22,58 +23,32 @@
 
 <script>
 import store from '../../../store'
-import {getUserWards} from '../../../api/case-front-sheet'
-import {computed, onMounted, ref} from "vue";
-import {huoQuHuanZheLieBiao} from "../../../api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
-import {listNotBlank} from "../../../utils/blank-utils";
+import {computed, ref} from "vue";
 import HuanZheLieBiao from "../../../components/zhu-yuan-yi-sheng/HuanZheLieBiao.vue";
 import HuanZheXinXi from "../../../components/zhu-yuan-yi-sheng/HuanZheXinXi.vue";
 import {clone} from "../../../utils/clone";
+import YiZhuLuRuZhuJian from "../../../components/zhu-yuan-yi-sheng/YiZhuLuRuZhuJian.vue";
 
 export default {
   name: "YiZhuLuRu",
-  components: {HuanZheXinXi, HuanZheLieBiao},
+  components: {YiZhuLuRuZhuJian, HuanZheXinXi, HuanZheLieBiao},
   setup() {
-    // 用户可以选择的 病房信息
-    const userWards = ref([])
-    // 选择的病房
-    const currentWard = ref('')
-    // 患者列表组件
-    const huanZheLieBiaoRef = ref(null)
     // 手风琴
     const activeNames = ref(['1'])
     // 选中的患者
     const huanZhe = ref('')
 
-
     const tableHeight = computed(() => {
       return store.state.app.windowSize.h
     })
 
-    const huanZheLieBiaoChange = () => {
-      huanZheLieBiaoRef.value.huoQuHuanZheLieBiaoClick(currentWard.value)
-    }
-
     const clickHuanZheXinXi = (val) => {
       huanZhe.value = clone(val.res)
-      console.log(huanZhe.value)
     }
 
-    onMounted(() => {
-      getUserWards().then((res) => {
-        userWards.value = res
-        if (listNotBlank(userWards.value)) {
-          currentWard.value = userWards.value[0].code
-          huanZheLieBiaoChange()
-        }
-      })
-    })
+
     return {
-      currentWard,
-      userWards,
       tableHeight,
-      huanZheLieBiaoRef,
-      huanZheLieBiaoChange,
       activeNames,
       clickHuanZheXinXi,
       huanZhe,