Browse Source

电子病历添加复制会诊的结果。

DESKTOP-0GD05B0\Administrator 2 years ago
parent
commit
b96c304efb

+ 31 - 8
src/components/hui-zhen-da-ying/DaYingHuiZhen.vue

@@ -1,5 +1,6 @@
 <template>
   <el-button @click="daYing">打印</el-button>
+  <el-button @click="copyClick" v-if="props.laiYuan===2">复制会诊结果</el-button>
   <div class="main-info-parent" style="padding: 0 20px; overflow: hidden">
     <div id="huiZhenXinXiDaYin">
       <h1 style="text-align: center; font-size: 30px">长沙泰和医院</h1>
@@ -17,7 +18,7 @@
         <div>
           <div>
-            <div class="reqDept">{{ huanZheXinXi.reqDept1 }}</div>
+            <div class="reqDept">{{ huanZheXinXi.reqDept1Name }}</div>
             会诊
             <div class="huiZhenJiBie">会诊类别:{{ hzLeiBie(huanZheXinXi.hzType) }}</div>
           </div>
@@ -64,7 +65,7 @@
             </textarea>
         </div>
         <div class="qingQiuHuiZhenXinXi">
-          <div class="div1">会诊科室:{{ huanZheXinXi.reqDept1 }}</div>
+          <div class="div1">会诊科室:{{ huanZheXinXi.reqDept1Name }}</div>
           <div class="div2">
             医师:{{ props.laiYuan === 2 ? huanZheXinXi.hzDoctor2Name : store.state.user.info.name }}
           </div>
@@ -83,6 +84,13 @@ import {computed, onMounted} from 'vue'
 import {getLodop, initLodop} from '@/utils/c-lodop'
 import {huiZhenJiLvDanCss} from '@/data/css-for-print'
 import {getServerDateApi} from '@/api/public-api'
+import {BizException, ExceptionEnum} from "@/utils/BizException";
+import {
+  copyEnum, delEmrCopy,
+  getEmrCopy,
+  setEmrCopy
+} from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-init";
+import {xcMessage} from "@/utils/xiaochan-element-plus";
 
 const props = defineProps({
   laiYuan: {
@@ -116,12 +124,6 @@ const huiZhenXinXiXiangQing = (val) => {
   huanZheXinXi.value = val
 }
 
-const mainInfo = {
-  padding: '0 20px',
-  overflowY: 'scroll',
-  scrollbarWidth: 'none',
-}
-
 const daYing = () => {
   shiJian()
   setTimeout(() => {
@@ -148,6 +150,27 @@ const daYing = () => {
   }, 100)
 }
 
+const copyClick = () => {
+  if (!huanZheXinXi.value.inpatientNo) {
+    BizException(ExceptionEnum.MESSAGE_ERROR, "请先获取患者信息。")
+  }
+  let temp = huanZheXinXi.value
+  let data = {
+    '会诊科室': [
+      {code: temp.reqDept1, name: temp.reqDept1Name}
+    ],
+    '会诊医生': [
+      {code: temp.hzDoctor2, name: temp.hzDoctor2Name}
+    ],
+    '会诊意见': temp.hzComment,
+    '编辑者': [
+      {code: store.state.user.info.code, name: store.state.user.info.name}
+    ]
+  }
+  setEmrCopy(copyEnum.会诊, data)
+  xcMessage.success('复制成功。')
+}
+
 const fanHuiXinXi = () => {
   emit('fanHuiXinXi', {huanZheXinXi})
 }

+ 14 - 5
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/EmrMain.vue

@@ -255,7 +255,7 @@ import EmrSidebar from "@/components/zhu-yuan-yi-sheng/emr/EmrSidebar.vue";
 import {
   EMRInteractive,
   emrConfig,
-  fontSizes, availableFonts
+  fontSizes, availableFonts, copyEnum, getEmrCopy, delEmrCopy
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-init";
 import {ElMessage, ElMessageBox} from "element-plus";
 import {BizException, ExceptionEnum} from "@/utils/BizException";
@@ -594,7 +594,7 @@ const positioningTime = (val, code) => {
 const monitorPageRefresh = (event) => {
   if (isEditorChange) {
     event.preventDefault();
-    return event.returnValue = "是否确实要退出?还有未保存的数据";
+    return event.returnValue = "是否确实要退出?还有未保存的数据";
   }
 }
 
@@ -602,11 +602,21 @@ const monitorPageRefresh = (event) => {
  * 点击插入片段
  * @param content
  * @param styles
+ * @param code 片段编码
  */
-const clickSnippet = ({content, styles}) => {
+const clickSnippet = ({content, styles, code}) => {
+  let temp = copyEnum[code]
+  let data = patientData
+  if (temp) {
+    let value = getEmrCopy(temp)
+    if (value) {
+      data = value
+      delEmrCopy(temp)
+    }
+  }
   if (!readonlyPattern()) {
     currentEmr.value.callMethod('setCursor', 'AREA_END')
-    currentEmr.value.insertSnippet(content, styles, patientData)
+    currentEmr.value.insertSnippet(content, styles, data)
   }
 }
 
@@ -1041,7 +1051,6 @@ const textStyleFunc = ref({
   indent: (val) => {
     emrStyle.paragraphStyle.specialIndent.value += val
     editor.execute('paragraphStyle', {value: emrStyle.paragraphStyle})
-    console.log({value: emrStyle.paragraphStyle})
   }
 })
 

+ 34 - 0
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-init.js

@@ -152,6 +152,40 @@ export function getInEmrUrl(patNo, times) {
     }).href
 }
 
+let EMR_COPY = 'emrCopy'
+export const setEmrCopy = (name, value) => {
+    if (localStorage.getItem(EMR_COPY) === null) {
+        localStorage.setItem(EMR_COPY, '{}')
+    }
+    let temp = JSON.parse(localStorage.getItem(EMR_COPY))
+    temp[name] = value
+    localStorage.setItem(EMR_COPY, JSON.stringify(temp))
+}
+export const getEmrCopy = (name) => {
+    if (localStorage.getItem(EMR_COPY) === null) {
+        return null;
+    }
+    let temp = JSON.parse(localStorage.getItem(EMR_COPY))
+    let value = temp[name]
+    if (value === null) {
+        return null
+    }
+    return value
+}
+
+export const delEmrCopy = (name) => {
+    if (localStorage.getItem(EMR_COPY) === null) {
+        return
+    }
+    let temp = JSON.parse(localStorage.getItem(EMR_COPY))
+    delete temp[name]
+    localStorage.setItem(EMR_COPY, JSON.stringify(temp))
+}
+
+export const copyEnum = {
+    "会诊": 'huizhenjilv'
+}
+
 export const fontSizes = [
     {
         "code": "42pt",