Parcourir la source

一键停止医嘱,和数据优化

xiaochan il y a 2 ans
Parent
commit
741223d0d7

+ 7 - 0
src/api/zhu-yuan-yi-sheng/connotation-quality-control.js

@@ -0,0 +1,7 @@
+import axios from "axios";
+
+let url = 'http://172.16.30.61:9227/'
+
+export function save(data) {
+    return axios.post(url + 'save', data)
+}

+ 1 - 2
src/api/zhu-yuan-yi-sheng/emr-patient.js

@@ -1,4 +1,5 @@
 import request from "@/utils/request";
+import axios from "axios";
 
 let url = 'Emr/'
 
@@ -306,5 +307,3 @@ export function electronicMedicalRecordSequencing(data) {
 
 
 
-
-

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

@@ -262,3 +262,11 @@ export function queryFeeByOrderNoApi(actOrderNo) {
         params: {actOrderNo}
     })
 }
+
+export function oneClickStopOrder(data) {
+    return request({
+        url: url + '/oneClickStopOrder',
+        method: 'post',
+        data
+    })
+}

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

@@ -20,6 +20,7 @@
       <button @click="openTheOrderPopUpWindow" title="打开医嘱弹窗,如转科,抗菌药物信息,处置医嘱等">打开医嘱弹窗
       </button>
       <outpatient-appointments/>
+      <one-click-stop/>
     </div>
     <div class="editing_area"
          :style="{color: isEdit ? '#0014fc' : ''}">
@@ -301,6 +302,7 @@ import {shortcutTrigger, xcEvent} from "@/utils/xckeydown";
 import {xcMessage} from "@/utils/xiaochan-element-plus";
 import OutpatientAppointments
   from "@/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/components/OutpatientAppointments.vue";
+import OneClickStop from "@/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/components/OneClickStop.vue";
 
 
 const props = defineProps({

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

@@ -453,6 +453,7 @@ import EmrAudit
   from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/components/EmrAudit.vue";
 import EmrConnotation
   from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/components/EmrConnotation.vue";
+import {save} from "@/api/zhu-yuan-yi-sheng/connotation-quality-control";
 
 
 const props = defineProps({
@@ -782,12 +783,23 @@ const clickSaveData = async () => {
     fragment: [],
     parent: parent
   }
-  objectValuesCannotBeNull(data)
+
+  objectValuesCannotBeNull(data);
   data.emrDataElement = editor.getDataElements('business')
   if (categoryCode === emrCodeEnum.courseRecord) {
     templateName = '病程记录'
   }
+
+  if (isDev) {
+    save(data).then(res => {
+      console.log(res.data.data)
+      ElMessage.warning(res.data.data)
+    })
+    return
+  }
+
   saveDialog.dialog = true
+
   data.fragment = 解析病程记录()
   saveDialog.prompt(templateName, async (value) => {
     data.name = value
@@ -1069,7 +1081,7 @@ const getCurrentPersonnelInformation = (data) => {
   patientData.user_token = userData.token
 }
 
-
+const 入院病历 = 'ruyuanjiluzhuanyong'
 // 设置编辑器的模式
 const setEditorModeFun = () => {
   // 判断是不是编辑模式
@@ -1078,31 +1090,39 @@ const setEditorModeFun = () => {
     currentEmr.value.callMethod('setEditorMode', 'free')
     // 如果不是首次病程记录就需要执行下面的代码
     if (!isCourse()) {
-      // 如果创建人是空的就说明是第一次创建
-      if (createId === null) {
-        return currentEmr.value.callMethod('setEditorMode', 'free');
-      }
-      if (createId == userData.code) {
-        return currentEmr.value.callMethod('setEditorMode', 'free');
-      }
-      // 创建人不是自己就只能看
-      if (doctorLevel === 1 && createId !== userData.code) {
-        currentEmr.value.callMethod('setEditorMode', 'readonly');
-      }
-      if (doctorLevel === 2) {
-        // 不能修改三级医生写的病历
-        if (createId === extractFields('主任医生编码')) {
+      // 入院病历有点特殊,任何人都可以写补充诊断
+      if (categoryCode === 入院病历 && isDev) {
+        let EMR = editor.getScriptRuntime().EMR
+        let emrDoc = EMR.getDocument()
+        let areas = emrDoc.getNodesByCode(null, 'area')
+        console.log(areas)
+      } else {
+        // 如果创建人是空的就说明是第一次创建
+        if (createId === null) {
+          return currentEmr.value.callMethod('setEditorMode', 'free');
+        }
+        if (createId == userData.code) {
+          return currentEmr.value.callMethod('setEditorMode', 'free');
+        }
+        // 创建人不是自己就只能看
+        if (doctorLevel === 1 && createId !== userData.code) {
           currentEmr.value.callMethod('setEditorMode', 'readonly');
-        } else {
+        }
+        if (doctorLevel === 2) {
+          // 不能修改三级医生写的病历
+          if (createId === extractFields('主任医生编码')) {
+            currentEmr.value.callMethod('setEditorMode', 'readonly');
+          } else {
+            currentEmr.value.callMethod('setEditorMode', 'free');
+          }
+        }
+        // 医生等级 3 没有限制
+        if (doctorLevel === 3) {
           currentEmr.value.callMethod('setEditorMode', 'free');
         }
+        // 如果创建人不是自己就要开启审阅
+        openTheTraceByUser(createId)
       }
-      // 医生等级 3 没有限制
-      if (doctorLevel === 3) {
-        currentEmr.value.callMethod('setEditorMode', 'free');
-      }
-      // 如果创建人不是自己就要开启审阅
-      openTheTraceByUser(createId)
     }
   } else {
     currentEmr.value.callMethod('setEditorMode', 'readonly')

+ 8 - 7
src/views/hospitalization/zhu-yuan-yi-sheng/jian-cha-jian-yan-shen-qing/components/public/JianChaJianYanTable.vue

@@ -74,14 +74,15 @@ const needPublicData = computed(() => {
 
   if (isCheck) {
     return true
-  }
-
-  for (let i = 0; i < data.length; i++) {
-    let item = data[i];
-    if (item.classes === PATHOLOGY) {
-      return true
+  } else {
+    for (let i = 0; i < data.length; i++) {
+      let item = data[i];
+      if (item.classes === PATHOLOGY) {
+        return true
+      }
     }
   }
+
 })
 
 const enterPadding = (val) => {
@@ -96,7 +97,7 @@ const enterPadding = (val) => {
 
 <template>
   <div ref="divRef">
-    <el-row :gutter="5" v-if="needPublicData">
+    <el-row :gutter="5" v-show="needPublicData">
       <el-col :span="12">
         病史摘要:
         <el-input v-model="publicData.reqComment"

+ 106 - 0
src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/components/OneClickStop.vue

@@ -0,0 +1,106 @@
+<script setup name='OneClickStop'>
+import {
+  huanZheXinXi,
+  youWuXuanZheHuanZhe,
+  yzMitt
+} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
+import XcDialogV2 from "@/components/xiao-chan/dialog/XcDialogV2.vue";
+import {stringIsBlank} from "@/utils/blank-utils";
+import {xcMessage} from "@/utils/xiaochan-element-plus";
+import {getServerDateApi} from "@/api/public-api";
+import {ElMessageBox} from "element-plus";
+import {oneClickStopOrder} from "@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
+
+const dialog = ref(false)
+
+const param = ref({
+  date: '',
+  name: '',
+  patNo: '',
+  times: 0,
+})
+
+const openDialog = async () => {
+  if (youWuXuanZheHuanZhe()) {
+    return
+  }
+  param.value.date = await getServerDateApi();
+  dialog.value = true;
+}
+
+const cancel = () => {
+  param.value = {
+    date: '',
+    name: '',
+    patNo: '',
+    times: 0,
+  }
+  dialog.value = false;
+}
+
+const confirm = () => {
+  if (stringIsBlank(param.value.date) || stringIsBlank(param.value.name)) {
+    return xcMessage.error('日期和名称不能为空')
+  }
+  param.value.patNo = huanZheXinXi.value.inpatientNo
+  param.value.times = huanZheXinXi.value.admissTimes
+  ElMessageBox.confirm('', '提示', {
+    message: `是否要把 <span style="color: #0a84fd">正在执行的长期医嘱</span>停到<span style="color: red">${param.value.date}。</span>`,
+    dangerouslyUseHTMLString: true,
+    type: 'warning'
+  }).then((res) => {
+    oneClickStopOrder(param.value)
+    yzMitt.emit('queryYz')
+    cancel()
+  }).catch(() => {
+
+  })
+
+}
+
+</script>
+
+<template>
+  <button @click="openDialog">一键停止</button>
+
+  <xc-dialog-v2 @cancel="cancel" @confirm="confirm" v-model="dialog" show-button title="一键停止医嘱" @closed="cancel">
+
+        <span style="color: red">
+          此功能会把长期且正在执行的医嘱,设置停止时间,(生成一条医嘱),就算把这个医嘱撤销了,此功能不可逆转。
+        </span>
+
+    <el-form label-position="right" label-width="120px">
+
+      <el-space fill>
+        <el-alert type="info" show-icon :closable="false">
+          <p>正在执行的长期医嘱将会停止到您选择的时间</p>
+        </el-alert>
+        <el-form-item label="停止时间:">
+          <el-date-picker v-model="param.date"
+                          format="YYYY-MM-DD HH:mm:ss"
+                          value-format="YYYY-MM-DD HH:mm:ss"
+                          type="datetime"/>
+        </el-form-item>
+      </el-space>
+
+
+      <el-space fill>
+        <el-alert type="info" show-icon :closable="false">
+          <p>生成医嘱的名称</p>
+        </el-alert>
+        <el-form-item label="医嘱名称:">
+          <el-input v-model="param.name" maxlength="50" show-word-limit type="textarea" :rows="3"/>
+        </el-form-item>
+      </el-space>
+
+    </el-form>
+
+
+  </xc-dialog-v2>
+
+
+</template>
+
+<style scoped lang="scss">
+
+</style>