Browse Source

添加审核以及聊天室,和优化审阅模式

xiaochan 1 year ago
parent
commit
1089e086dd

+ 6 - 7
src/components/zhu-yuan-yi-sheng/emr/EmrPatientList.vue

@@ -46,6 +46,7 @@ import {CloseBold} from "@element-plus/icons-vue";
 import {ClosingMethod, compList} from "@/components/js-dialog-comp/useDialogToJs";
 import {windowBtoaAndAtob} from "@/utils/public";
 import router from "@/router";
+import {emrStateEnum} from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
 
 const divRef = ref<HTMLDivElement | null>(null)
 const currentWard = ref('')
@@ -60,17 +61,15 @@ const fetchOverviews = () => {
   })
 }
 
-const rowClick = (val) => {
+const rowClick = async (val) => {
   const data = windowBtoaAndAtob.btoa({
     patNo: val.inpatientNo,
-    times: val.admissTimes
+    times: val.admissTimes,
+    state: emrStateEnum.在院只读
   })
 
-  router.replace({
-    path: '/myEmrEditor',
-    query: {
-      pat: data,
-    }
+  await router.replace({
+    path: '/myEmrEditor/' + data,
   })
   window.location.reload()
 }

+ 5 - 2
src/components/zhu-yuan-yi-sheng/emr/web-socket/EmrChatBox.vue

@@ -1,5 +1,7 @@
 <template>
-  <el-dialog v-model="dialog" title="病历人数" width="70%"
+  <el-dialog v-model="dialog"
+             :title="`聊天室 ${userSize} 人`"
+             width="70%"
              @closed="emits('closed')">
     <div class="chat_room_dialog">
       <div class="left">
@@ -91,7 +93,8 @@ const props = defineProps<{
   sid: string | null,
   currentEditorUser: {
     name: string
-  } | null
+  } | null,
+  userSize: number
 }>()
 
 const emits = defineEmits(['closed'])

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

@@ -1,14 +1,7 @@
 <template>
-  <div class="chat_room"
-       ref="roomRef"
-       @click="dialog = true">
-    <div class="count">
-      {{ userSize }}
-    </div>
-  </div>
-
   <EmrChatBox
       v-if="dialog"
+      :userSize
       ref="dialogRef"
       :current-editor-user="props.currentEditorUser"
       @closed="dialog = false"
@@ -22,7 +15,6 @@
     <div v-loading="errDialog"
          element-loading-text="正在尝试重新连接..."
          style="width: 100%;height: 400px"/>
-
   </el-dialog>
 
 </template>
@@ -259,6 +251,9 @@ onMounted(async () => {
   emrMitt.on('getDocumentSocket', () => {
     return documentSocket;
   })
+  emrMitt.on('openChatRoom', () => {
+    dialog.value = true
+  })
 })
 
 onBeforeUnmount(() => {
@@ -274,32 +269,3 @@ defineExpose({
 })
 
 </script>
-
-<style scoped lang="scss">
-.chat_room {
-  bottom: 0;
-  right: 0;
-  position: absolute;
-  width: 40px;
-  height: 40px;
-  color: white;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  z-index: 999;
-  background-color: rgb(0 0 0 / 63%);
-  border-radius: 9px;
-  cursor: all-scroll;
-
-  .count {
-    width: 25px;
-    text-align: center;
-    line-height: 25px;
-    background-color: rgba(255, 255, 255, 0.48);
-    border-radius: 12px;
-    position: relative;
-  }
-
-}
-
-</style>

+ 3 - 0
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/yz-edit/YzEditor.vue

@@ -596,6 +596,9 @@ const pingLvRef = ref()
 /*计算领量*/
 const jiSuanLingLiang = async (val) => {
   await nextTick()
+  if (yiZhuData.value.statusFlag !== '1') {
+    return
+  }
   // 出院带药
   if (yiZhuData.value.selfBuy === '4') {
     return;

+ 2 - 0
src/utils/emr/edit.ts

@@ -63,6 +63,8 @@ export declare type EditType = {
 
     ModelService: any,
 
+    isRevisionMode: boolean;
+
     documentData: {
         _id: string
     }

+ 14 - 6
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/EmrHeader.vue

@@ -3,12 +3,13 @@ import {useUserStore} from "@/pinia/user-store";
 import {
   emrMitt,
   patientInfo,
-  useLiftingRestrictions, usePatientList
+  useLiftingRestrictions,
+  usePatientList
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
 
 const userInfo = useUserStore().userInfo
 
-const buttonList = ref<{ name: string, click: Function }[]>([])
+const buttonList = ref<{ name: string, click: Function, disabled?: boolean }[]>([])
 
 emrMitt.on('setHeaderFunction', (value) => {
   buttonList.value = value
@@ -18,13 +19,17 @@ emrMitt.on('setHeaderFunction', (value) => {
 <template>
   <div class="mac_header">
     <div class="mac_left">
-      <div class="mac_item" v-for="item in buttonList">
-        <button @click="item.click">
+      <div class="mac_item"
+           v-for="item in buttonList">
+        <button @click="item.click"
+                :disabled="item.disabled ?? false">
           {{ item.name }}
         </button>
       </div>
       <div class="mac_item">
-        <button @click="useLiftingRestrictions">解锁限制</button>
+        <button @click="useLiftingRestrictions">
+          解锁限制
+        </button>
       </div>
       <div class="mac_item">
         <button @click="usePatientList">患者列表</button>
@@ -54,7 +59,6 @@ emrMitt.on('setHeaderFunction', (value) => {
 .mac_header {
   --system-color-light-hsl: 240, 24%, 100%;
   --system-color-dark-hsl: 240, 3%, 11%;
-
   display: flex;
   align-items: center;
   width: 100%;
@@ -90,6 +94,10 @@ emrMitt.on('setHeaderFunction', (value) => {
     user-select: none;
     background: transparent;
 
+    button[disabled] {
+      cursor: not-allowed;
+    }
+
     button {
       height: 100%;
       color: inherit;

+ 8 - 32
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/EmrMain.vue

@@ -52,18 +52,14 @@
               </div>
             </template>
           </el-tooltip>
-
-
         </div>
         <!--  电子病历中的样式条    -->
         <EmrStyleBar ref="styleBarRef"
                      v-show="showIframeIsList(IframeTabs.正在编辑 , IframeTabs.同时打开, IframeTabs.审核)"
         />
         <div class="layout_main layout_container layout-horizontal">
-
           <div class="layout_h-w_max"
-               v-show="showIframeIsList(IframeTabs.患者信息)"
-          >
+               v-show="showIframeIsList(IframeTabs.患者信息)">
             <PatientInfoView :patientInfo="patientInfo"/>
           </div>
 
@@ -71,6 +67,7 @@
                v-show="showIframeIsList(IframeTabs.正在编辑 , IframeTabs.同时打开, IframeTabs.审核)">
             <div class="layout_container layout-horizontal">
               <EmrFunctionList
+                  v-model:reviewMode="reviewMode"
                   v-model:isOpenPage="isOpenPage"
                   :openRecovery="openRecovery"
               />
@@ -129,13 +126,11 @@ import {
   emrMitt,
   EmrParam,
   EmrRightTabs,
-  emrTitle,
   getEmrCopy,
   IframeTabs,
   patientInfo,
-  query,
   showIframe,
-  showIframeIsList, useRecoveryEmr
+  showIframeIsList
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
 import {ElMessage, ElMessageBox, ElButton} from "element-plus";
 import {BizException, ExceptionEnum} from "@/utils/BizException";
@@ -249,7 +244,6 @@ const patientData = ref({})
 let copy = true
 // 侧边栏
 const emrSidebarRef = ref<InstanceType<typeof EmrSidebar> | null>(null)
-
 // 是否加载完成了
 const loaded = ref(false)
 // 是否 改变了数据
@@ -325,7 +319,6 @@ const emrEvent = {
     setTheProgressAnchor()
     maleDeleteDataElement()
     // 是否开启审阅模式
-    reviewMode.value = 2
     isRevisionMode()
     // 判断是否只读
     readonlyPattern()
@@ -719,7 +712,7 @@ function replaceDataElement(data) {
 // 添加片段
 const clickToFillInData = (value) => {
   if (!readonlyPattern()) {
-    editor.setValues(value)
+    editor!.setValues(value)
   }
 }
 
@@ -741,18 +734,6 @@ const objectValuesCannotBeNull = (object) => {
   }
 }
 
-// 前端打印
-const frontEndPrinting = async () => {
-  waitForLoadingToComplete()
-  editMain?.print()
-}
-
-// 服务打印
-const servicePrint = () => {
-  waitForLoadingToComplete()
-  editMain?.print('server')
-}
-
 /**
  * 点击删除数据
  */
@@ -989,9 +970,9 @@ const openTheTraceByUser = (editorCode) => {
     return
   }
   if (editorCode === userInfo.code) {
-    editor.setRevisionMode('off')
+    editor!.setRevisionMode('off')
   } else {
-    editor.setRevisionMode('on')
+    editor!.setRevisionMode('on')
     xcMessage.warning('当前病历创建人不是您,你的操作将会留痕。')
   }
 }
@@ -1107,12 +1088,6 @@ function syncDisabled() {
   }
 }
 
-/**
- *  撤销或者重做
- */
-const clickUndo = (val) => {
-  editor!.execute(val)
-}
 
 /**
  * 单击“提交病历”
@@ -1174,7 +1149,7 @@ const extractFields = (val) => {
 // 是否开启审阅模式
 const isRevisionMode = () => {
   try {
-    editor.setRevisionShowMode(reviewMode.value);
+    editor!.setRevisionShowMode(reviewMode.value);
   } catch (e) {
     console.error(e)
   }
@@ -1526,6 +1501,7 @@ const emrMittInit = () => {
   emrMitt.on('diseaseCourseSequencing', diseaseCourseSequencing)
   emrMitt.on('syncEmrPatientData', syncEmrPatientData)
   emrMitt.on('selectFill', selectFill)
+  emrMitt.on('auditClick', auditClick)
 }
 
 const initEdit = () => {

+ 4 - 5
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/Home.vue

@@ -23,10 +23,10 @@
         </el-button-group>
         <el-divider direction="vertical"/>
         {{ patientInfo.name }}
-        性别:{{ cptSex(patientInfo.sex) }}
-        年龄:{{ XEUtils.addUnit(patientInfo.age, '岁') }}
-        住院天数:{{ XEUtils.addUnit(patientInfo.actIptDays, '天') }}
-        入院时间:{{ patientInfo.admissDate }}
+        性别:<span style="color:red;">{{ cptSex(patientInfo.sex) }}</span>
+        年龄:<span style="color:red;">{{ XEUtils.addUnit(patientInfo.age, '岁') }}</span>
+        住院天数:<span style="color:red;">{{ XEUtils.addUnit(patientInfo.actIptDays, '天') }}</span>
+        入院时间:<span style="color:red;">{{ patientInfo.admissDate }}</span>
         <el-divider direction="vertical"/>
         <el-button-group>
           <el-button type="primary" @click="clickPatientNext">上一位</el-button>
@@ -103,7 +103,6 @@ const disPatients = async () => {
   let te = JSON.stringify(query.value)
   await router.push('/myEmrEditor/' + window.btoa(te))
   location.reload()
-  await routerFunc()
 }
 
 const noPatient = () => {

+ 63 - 3
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/components/emr-function/EmrFunctionList.vue

@@ -7,9 +7,11 @@ import {
   RefreshLeft,
   RefreshRight,
   SortDown,
+  Avatar
 } from "@element-plus/icons-vue";
 
 import {
+  emrConfig,
   emrMitt, query,
   useRecoveryEmr
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
@@ -18,20 +20,29 @@ import {
   Button,
   PopoverButton,
 } from "./useEmrFunction";
+import {xcMessage} from "@/utils/xiaochan-element-plus";
 
 const props = defineProps<{
   openRecovery: () => void,
-  isOpenPage: boolean
+  isOpenPage: boolean,
+  reviewMode: number;
 }>()
 let zoom = 1;
 
-const emits = defineEmits(['update:isOpenPage'])
+const emits = defineEmits(['update:isOpenPage', 'update:reviewMode'])
+
+
+function setRevisionShowMode(value: number) {
+  emits('update:reviewMode', 2)
+  emrMitt.emit('editor')?.setRevisionShowMode(2);
+}
 
 const businessFunctions = [
   {
     iconfontName: 'baocun',
     title: '保存正在编写的电子病历',
     name: '保存',
+    disabled: !emrConfig.value.editor,
     click() {
       emrMitt.emit('clickSaveData')
     }
@@ -40,14 +51,25 @@ const businessFunctions = [
     iconfontName: 'tijiao',
     title: '标识病历为提交,提交不是保存,该功能只是在病历的前面加上一个🔒的样式',
     name: '提交',
+    disabled: !emrConfig.value.editor,
     click() {
       emrMitt.emit('clickToSubmitTheMedicalRecord')
     },
   },
+  {
+    iconfontName: 'huizhenshenqing',
+    title: "由上级医生点击,上级医生审核完成病历后需要点击该按钮。",
+    name: '审核',
+    disabled: !emrConfig.value.editor,
+    click() {
+      emrMitt.emit('auditClick')
+    }
+  },
   {
     iconfontName: <Delete/>,
     title: '删除当前病历,可在回收站恢复,出院患者无法删除,需要把出院患者召回才行',
     name: '删除',
+    disabled: !emrConfig.value.editor,
     click() {
       emrMitt.emit('clickDelete')
     },
@@ -56,6 +78,7 @@ const businessFunctions = [
     iconfontName: 'huanyuan',
     title: '还原当前病历上一次保存的状态',
     name: '还原',
+    disabled: !emrConfig.value.editor,
     click: props.openRecovery,
   },
   {
@@ -75,6 +98,7 @@ const functionList = ref<FunctionList[][]>([
       name: '数据同步',
       title: "数据同步,患者基本信息只会在空的时候填充,从病历提取的数据会强制替换,如入院诊断,鼠标右键可选择性填充数据",
       iconfontName: 'tongbu',
+      disabled: !emrConfig.value.editor,
       click() {
         emrMitt.emit('syncEmrPatientData')
       },
@@ -101,6 +125,33 @@ const functionList = ref<FunctionList[][]>([
     }
   ],
   [
+    {
+      title: "",
+      iconfontName: 'shenyue',
+      dropdown: [
+        {
+          name: '嵌入模式',
+          title: '开启后会在病历中会有其他医生的修改痕迹,默认开启',
+          click() {
+            setRevisionShowMode(2)
+          }
+        },
+        {
+          name: '卡片模式',
+          title: '病历右侧会以列表的形式显示 添加,删除,更新的记录,可以通过该模式消除痕迹,选择 √ 或 X即可。',
+          click() {
+            const editor = emrMitt.emit('editor');
+            if (editor!.isRevisionMode) {
+              setRevisionShowMode(2)
+              xcMessage.warning('您不是该病历或片段的创建人无法使用卡片模式')
+            } else {
+              setRevisionShowMode(1)
+            }
+
+          }
+        }
+      ]
+    },
     {
       iconfontName: <Printer/>,
       title: "",
@@ -164,6 +215,15 @@ const functionList = ref<FunctionList[][]>([
         emrMitt.emit('editor')!.setPaginate(value.activation)
       }
     }
+  ],
+  [
+    {
+      title: "点击可以打开聊天室",
+      iconfontName: <Avatar/>,
+      click() {
+        emrMitt.emit('openChatRoom')
+      }
+    }
   ]
 ]);
 
@@ -204,7 +264,7 @@ emrMitt.emit('setHeaderFunction', [...businessFunctions, ...functionList.value[0
   padding: 4px;
 
   .emr_function-action-group {
-    margin: 5px 0;
+    margin: 8px 0;
 
     .el-button:hover {
       background-color: #f5f7fa;

+ 4 - 2
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init.ts

@@ -5,7 +5,7 @@ import {defineAsyncComponent, Ref, ref} from 'vue'
 import {EditType} from "@/utils/emr/edit";
 import {LoadParams, UseEmrInitReturn} from "@/utils/emr/emr-init-v2";
 import Patient from "../../../../../ts-type/patient";
-import {isDev} from "@/utils/public";
+import {isDev, windowBtoaAndAtob} from "@/utils/public";
 import useDialogToJs from "@/components/js-dialog-comp/useDialogToJs";
 import {getServerDateApi} from "@/api/public-api";
 import UseDialogToJs from "@/components/js-dialog-comp/useDialogToJs";
@@ -32,7 +32,7 @@ export const emrStateEnum = {
 
 
 export function resolveRoute(val) {
-    query.value = JSON.parse(window.atob(val))
+    query.value = windowBtoaAndAtob.atob(val)
 }
 
 export const emrConfig = ref({
@@ -422,6 +422,8 @@ export interface EmrMitt {
     setHeaderFunction: (value: any[]) => void
     syncEmrPatientData: () => void
     selectFill: () => void
+    openChatRoom: () => void
+    auditClick: () => void
 }
 
 //@ts-ignore