Browse Source

完成患者信息查询中

xiaochan 2 years ago
parent
commit
d62abfde5a

+ 14 - 6
src/components/pat-info-list/ElectronicMedicalRecord.vue

@@ -9,14 +9,17 @@
                highlight-current
                default-expand-all/>
     </div>
-    <div style="height: 100%;width:calc(100% - 150px) ">
-      <iframe :src="saveDocumentId" width="100%" height="100%"/>
-    </div>
+    <div style="height: 100%;width:calc(100% - 150px)" ref="divRef"/>
   </div>
 </template>
 
-<script setup name='ElectronicMedicalRecord'>
+<script setup lang="ts">
 import {getPatientDataTree} from "@/api/zhu-yuan-yi-sheng/emr-patient";
+import {ref, onMounted} from "vue";
+import {
+  useEmrInit,
+  UseEmrInitReturn
+} from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init-v2";
 
 const props = defineProps({
   patNo: String,
@@ -29,16 +32,21 @@ const defaultProps = {
 }
 
 const tree = ref([])
-const saveDocumentId = ref('')
+const divRef = ref<HTMLDivElement>()
+let edit: UseEmrInitReturn = null
+
 
 const handleNodeClick = (data) => {
-  saveDocumentId.value = `/emr/runtime/?documentId=${data.emrDocumentId}#/`
+  edit.loadAndSetDocument({documentId: data.emrDocumentId})
 }
 
 onMounted(() => {
   getPatientDataTree(props.patNo, props.times).then((res) => {
     tree.value = res
   })
+  useEmrInit(divRef.value).then(res => {
+    edit = res
+  })
 })
 </script>
 

+ 2 - 5
src/components/pat-info-list/PatInfomationDialog.vue

@@ -27,9 +27,7 @@
                             :times="props.times"/>
       </el-tab-pane>
       <el-tab-pane label="检验">
-        <emr-test :pat-no="props.patNo"
-                  @close="emits('closed')"
-                  :is-emr="false"/>
+        <EmrTestV2 :pat-no="props.patNo" @close="emits('closed')"/>
       </el-tab-pane>
       <el-tab-pane label="检查">
         <emr-inspect :pat-no="props.patNo"
@@ -64,9 +62,8 @@ import ChargeList from '@/components/medical-insurance/charge-list/Index.vue'
 import {getDisPatient, getPatientInfo} from "@/api/inpatient/patient";
 import HuanZheXinXi from "@/components/zhu-yuan-yi-sheng/HuanZheXinXi.vue";
 import EmrYzTemperature from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrYzTemperature.vue";
-import EmrTest from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrTest.vue";
 import EmrOperation from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrOperation.vue";
-
+import EmrTestV2 from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrTestV2/EmrTestV2.vue";
 
 const props = defineProps({
   patNo: String,

+ 10 - 2
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrAuxiliaryTools.vue

@@ -29,13 +29,13 @@
   <el-drawer v-model="drawer"
              direction="btt"
              append-to-body
+             @opened="handleDrawerOpened"
              modal-class="change_padding"
              destroy-on-close
              size="100%"
              :with-header="false">
     <el-button class="close_but"
                type="danger"
-               style="z-index: 99999;"
                icon="Close"
                @click="drawer =false">
       关闭
@@ -63,6 +63,7 @@
                    @to-fill-in-data="toFillInData"/>
     <EmrTestV2 :pat-no="patInfo.inpatientNo"
                v-if="index === 6"
+               is-emr
                @close="close"/>
     <emr-herbs v-if="index === 7"
                @close="close"
@@ -83,7 +84,7 @@
 
 <script setup name='EmrAuxiliaryTools'>
 import EmrOrderList from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrOrderList.vue";
-import {defineProps, onMounted, ref} from 'vue'
+import {defineProps, onMounted, ref, h} from 'vue'
 import EmrYzTemperature from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrYzTemperature.vue";
 import {patInfo} from './emr-tools-store'
 import EmrInspect from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrInspect.vue";
@@ -107,6 +108,7 @@ import {
   emrTutorialGetId
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-tutorial";
 import EmrTestV2 from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrTestV2/EmrTestV2.vue";
+import {useZIndex} from "element-plus";
 
 const props = defineProps({
   patInfo: {
@@ -157,6 +159,11 @@ const emrChannelClick = (name) => {
   }
 }
 
+const zIndex = ref(useZIndex().nextZIndex())
+const handleDrawerOpened = () => {
+  zIndex.value = useZIndex().nextZIndex()
+}
+
 onMounted(async () => {
   patInfo.value = props.patInfo
   end.value = formatDate(await getServerDateApi())
@@ -176,6 +183,7 @@ onMounted(async () => {
 }
 
 .close_but {
+  z-index: v-bind(zIndex);
   position: absolute;
   top: 0.13rem;
   right: 0.07rem;

+ 20 - 2
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrTestV2/BacterialCultureTable.vue

@@ -53,7 +53,6 @@ const antiSelectChange = (row, index) => {
 
 const getSubtableSelectData = (key) => {
   let data = ''
-  if (!withResults.value) return data
   const t = table[key]
   const temp = t.getSelectionRows() as any[];
   if (!temp) return data
@@ -97,9 +96,28 @@ const setTableRef = (el, index) => {
   table['table' + index] = el
 }
 
+const getSelectedStr = (): string => {
+  let data = ''
+  const temp = tableRef.value.getSelectionRows() as any[];
+  if (temp) {
+    temp.forEach(item => {
+      data += `${item.itm_name}:${item.rslt_strs}${item.bac_name_cn || ''}`
+    })
+  }
+
+  if (withResults.value) {
+    antiMap.forEach((value, key) => {
+      data += getSubtableSelectData(key);
+    })
+  }
+  return data
+}
+
+
 defineExpose({
   selectedData,
-  setData
+  setData,
+  getSelectedStr
 })
 </script>
 

+ 31 - 16
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrTestV2/EmrTestV2.vue

@@ -18,14 +18,19 @@ import ResultTable from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrT
 import BacterialCultureTable
   from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrTestV2/BacterialCultureTable.vue";
 import {xcMessage} from "@/utils/xiaochan-element-plus";
+import {copyStrFunc} from "@/utils/public";
 
-const props = defineProps<{
-  patNo: string,
-  dateRange?: string[]
-}>()
+const props = withDefaults(
+    defineProps<{
+      patNo: string,
+      dateRange?: string[],
+      isEmr?: boolean
+    }>(), {
+      isEmr: false
+    }
+)
 
 const emits = defineEmits(['close'])
-
 const dateRange = ref<string[]>([])
 const sidebarData = ref<SidebarData[]>([])
 const inspectionHeader = ref<InspectionHeader>({
@@ -139,28 +144,38 @@ const currentReportForm = ref<SidebarData>({
 const resultRef = ref<{
   selectedData?: () => {} | [];
   setData: (val: any) => void
+  getSelectedStr: () => string
 }>()
 
 let copyData = []
+let copyDataStr = ''
 const appendCopy = () => {
-  if (XEUtils.isArray(resultRef.value.selectedData())) {
-    copyData.push(...resultRef.value.selectedData())
+  if (props.isEmr) {
+    if (XEUtils.isArray(resultRef.value.selectedData())) {
+      copyData.push(...resultRef.value.selectedData())
+    } else {
+      copyData.push(resultRef.value.selectedData())
+    }
   } else {
-    copyData.push(resultRef.value.selectedData())
+    copyDataStr += resultRef.value.getSelectedStr()
+    console.log(resultRef.value.getSelectedStr())
   }
 }
 
 const copyClick = () => {
-  const temp = {
-    content: copyData,
-    plainText: '检验粘贴不要使用(文本粘贴)。'
+  if (props.isEmr) {
+    const temp = {
+      content: copyData,
+      plainText: '检验粘贴不要使用(文本粘贴)。'
+    }
+    window.localStorage.setItem("clipBoardData", JSON.stringify(temp))
+    xcMessage.success('复制成功,不要使用(文本粘贴)。')
+  } else {
+    copyStrFunc(copyDataStr)
   }
-  window.localStorage.setItem(
-      "clipBoardData",
-      JSON.stringify(temp)
-  )
+  copyData = []
+  copyDataStr = ''
   emits('close')
-  xcMessage.success('复制成功,不要使用(文本粘贴)。')
 }
 
 onMounted(async () => {

+ 19 - 8
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrTestV2/ResultTable.vue

@@ -51,15 +51,14 @@ function getItemStr(val, strValue, value) {
   return '正常'
 }
 
-const selectedData = () => {
-
-  function danger(item: Measurement): string {
-    if (item.critical_exec_flag === 1) {
-      return '危'
-    }
-    return ''
+function danger(item: Measurement): string {
+  if (item.critical_exec_flag === 1) {
+    return '危'
   }
+  return ''
+}
 
+const selectedData = () => {
   const temp = mainTableRef.value.getSelectionRows() as Measurement[];
   let data = ''
   if (temp) {
@@ -73,13 +72,25 @@ const selectedData = () => {
   }
 }
 
+const getSelectedStr = () => {
+  const temp = mainTableRef.value.getSelectionRows() as Measurement[];
+  let data = ''
+  if (temp) {
+    XEUtils.arrayEach(temp, (item: Measurement) => {
+      data += `${item.itm_name}${danger(item)}:${result(item)} ${item.itm_unit} ${getItemStr(item.itm_alert, item.itm_str_value, item.itm_value)},`
+    })
+  }
+  return data
+}
+
 const setData = (value) => {
   data.value = value.items
 }
 
 defineExpose({
   selectedData,
-  setData
+  setData,
+  getSelectedStr
 })
 </script>
 

+ 3 - 3
src/components/zhu-yuan-yi-sheng/emr/web-socket/EmrWebSocket.vue

@@ -159,7 +159,7 @@ function initWebSocket(patNo, times) {
     webSocket = 'unsupport';
   }
 
-  webSocket.onopen = async () => {
+  webSocket.onopen = () => {
     errDialog.value = false
   }
 
@@ -215,7 +215,7 @@ const initDocumentSocket = () => {
     console.log('连接成功')
   }
 
-  documentSocket.onmessage = async function (e) {
+  documentSocket.onmessage = function (e) {
     let data = JSON.parse(e.data)
     for (let key in data) {
       onmessageFunc[key](data[key])
@@ -223,7 +223,7 @@ const initDocumentSocket = () => {
   }
 
   documentSocket.onclose = (e) => {
-    console.error(`断开连接编码:【${e.code}】,消息:【${e.reason}】'`)
+    console.error(`断开连接编码:【${e.code}】,消息:【${e}】'`)
     if (e.code === 1000 && e.reason === '服务器主动断开连接') {
       documentSocket = null
       emrMitt.emit('setEditorReadonly');

+ 1 - 1
src/views/hospitalization/zhu-yuan-yi-sheng/hui-zhen/HuiZhenShenQing.vue

@@ -11,7 +11,7 @@
             :final-height="tableHeight"
             :local-data="chaKanHuiZhenList"
             @rowClick="chaKanHuiZhenDan"
-            layout='total, prev,  next'>
+            layout='total,  prev, pager, next'>
           <el-table-column label="申请时间" prop="inputDate">
             <template #default="scope">
               <div v-html=" dateBr(scope.row.inputDate) + '_' + scope.row.reqTimes"></div>