浏览代码

电子病历解析和检查结果v2

xiaochan 1 年之前
父节点
当前提交
7f771986cd

+ 4 - 0
.env.production

@@ -6,4 +6,8 @@ VITE_EMR_CONTROL_URL = '172.16.32.160:9227'
 VITE_DATA_BASE = 'http://172.16.32.160:9205'
 VITE_EMR_SOCKET = 'http://172.16.32.160:8707/socketApi'
 
+VITE_HOSPITAL_NAME = '长沙泰和'
+VITE_SYSTEM_NAME = '工作集成平台'
+VITE_HOSPITAL_CODE = 'H43010500370'
+
 VITE_UPLOAD_TEMPLATE_THUMB = 'http://staticweb.hnthyy.cn/wxserver/wxApplet/updateTemplateThumb'

+ 17 - 0
src/api/zhu-yuan-yi-sheng/jian-yan-jian-cha-shen-qing.js

@@ -191,3 +191,20 @@ export function applicationOpRecord(data) {
         data
     })
 }
+
+
+export function getJcIdByPatNo(patNo) {
+    return request({
+        url: url + 'getJcIdByPatNo',
+        method: 'get',
+        params: {patNo}
+    })
+}
+
+export function getExamineDetail(jcId) {
+    return request({
+        url: url + 'getExamineDetail',
+        method: 'get',
+        params: {jcId}
+    })
+}

+ 18 - 0
src/components/cy/auto-size/cy-auto-size.vue

@@ -0,0 +1,18 @@
+<script setup lang="ts">
+import {ref} from 'vue'
+import {useElementSize} from '@vueuse/core'
+
+const divRef = ref<HTMLDivElement>();
+const {width, height} = useElementSize(divRef)
+
+</script>
+
+<template>
+  <div style="width: 100%; height: 100%" ref="divRef">
+    <slot :width="width" :height="height"/>
+  </div>
+</template>
+
+<style scoped lang="scss">
+
+</style>

+ 3 - 2
src/components/hui-zhen-da-ying/PrintTheConsultationForm.vue

@@ -6,7 +6,7 @@
   <div style="width: 595.275pt;  height: 841.89pt;  font-size: 6.75pt;
    border: 0.75pt solid" ref="divRef">
     <div style="margin-left: 20mm; ">
-      <h1 style="text-align: center; font-size: 22.5pt;  margin-bottom: 3.75pt">长沙泰和医院</h1>
+      <h1 style="text-align: center; font-size: 22.5pt;  margin-bottom: 3.75pt">{{SYSTEM_CONFIG.HOSPITAL_NAME}}</h1>
       <h4 style="text-align: center; font-size: 12.75pt; margin-top: 0">会 诊 记 录 单</h4>
       <table style="width: 100%;border-bottom: 0.75pt solid #000">
         <tr>
@@ -127,7 +127,8 @@ import {onMounted} from "vue";
 import {getLodop, initLodop} from "@/utils/c-lodop";
 import {cptSex} from "@/utils/computed";
 import store from '@/store'
-import {getServerDateApi} from "@/api/public-api";
+import {getServerDateApi  } from "@/api/public-api";
+import {SYSTEM_CONFIG} from '@/utils/public'
 
 const props = defineProps({
   laiYuan: {

+ 2 - 1
src/components/zhu-yuan-yi-sheng/jian-cha-shen-qing/da-ying/JianChaJieGuo.vue

@@ -8,7 +8,7 @@
                font-size: 13px"
        ref="printRef">
     <div style="text-align: center;line-height: 40px;font-size: 20px;">
-      泰和医院住院检查报告单
+      {{ SYSTEM_CONFIG.HOSPITAL_NAME}}住院检查报告单
     </div>
     <div>
       <table style="width: 100%;">
@@ -75,6 +75,7 @@
 
 <script setup name='JianChaJieGuo'>
 import {getLodop} from "@/utils/c-lodop";
+import {SYSTEM_CONFIG} from "@/utils/public";
 
 const props = defineProps({
   patInfo: {

+ 2 - 1
src/components/zhu-yuan-yi-sheng/shou-shu-shen-qing/DaYingShouShuShengQingDan.vue

@@ -10,7 +10,7 @@
         <table style="width: 100%;table-layout: fixed;">
           <thead style="text-align: center;">
           <tr>
-            <th colspan="3">长沙泰和医院</th>
+            <th colspan="3">{{SYSTEM_CONFIG.HOSPITAL_NAME}}</th>
           </tr>
           <tr>
             <th style="font-size: 10.5pt" colspan="3">
@@ -111,6 +111,7 @@ import {ElMessage} from "element-plus";
 import XEUtils from "xe-utils";
 import findValueByListCode from "@/utils/find-name-by-list-code";
 import {surgicalSituation} from "@/data/operation";
+import {SYSTEM_CONFIG} from "../../../utils/public";
 
 const props = defineProps({
   width: {

+ 4 - 2
src/layout/HeaderV2/Logo.vue

@@ -5,7 +5,7 @@
       <h1>
         {{ systemTitle }}
         <br/>
-        <span style="font-size: 12px">编码:H43010500370 </span>
+        <span style="font-size: 12px">编码:{{ SYSTEM_CONFIG.HOSPITAL_CODE }} </span>
       </h1>
     </div>
     <!-- 收缩按钮 -->
@@ -22,6 +22,7 @@
 import {computed, defineComponent} from 'vue'
 import {useStore} from 'vuex'
 import {systemTitle} from '@/config'
+import {SYSTEM_CONFIG} from "@/utils/public";
 
 export default defineComponent({
   setup() {
@@ -35,7 +36,8 @@ export default defineComponent({
     return {
       isCollapse,
       systemTitle,
-      opendStateChange
+      opendStateChange,
+      SYSTEM_CONFIG
     }
   },
 })

+ 6 - 0
src/utils/public.ts

@@ -107,3 +107,9 @@ export function isContain(element: HTMLElement) {
     elementIsVisible = rect.top <= (window.innerHeight || document.documentElement.clientHeight) && rect.left <= (window.innerWidth || document.documentElement.clientWidth) && rect.bottom >= 0 && rect.right >= 0;
     return elementIsVisible
 }
+
+export const SYSTEM_CONFIG = {
+    HOSPITAL_NAME: import.meta.env.VITE_HOSPITAL_NAME,
+    SYSTEM_NAME: import.meta.env.VITE_SYSTEM_NAME,
+    HOSPITAL_CODE: import.meta.env.VITE_HOSPITAL_CODE,
+}

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

@@ -303,7 +303,7 @@ import {
   delEmrCopy,
   emrConfig,
   emrMitt, EmrParam,
-  getEmrCopy, loadingTime, patientInfo,
+  getEmrCopy, loadingTime, parsingDataElements, patientInfo,
   query
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
 import {ElInput, ElMessage, ElMessageBox} from "element-plus";
@@ -1201,17 +1201,6 @@ const courseSegmentLocking = async () => {
   }
   let courseTitles = [];
 
-  function editorGetData(value, dataSource, code) {
-    if (value === null) return ''
-    if (value[dataSource] === null) return ''
-    if (value[dataSource].value === null) return ''
-    try {
-      return value[dataSource]?.value[0][code]
-    } catch {
-      return ''
-    }
-  }
-
   循环病程返回数据元((value, node) => {
     let fragment = node.getAttribute('fragment')
     let pushData = {
@@ -1221,9 +1210,9 @@ const courseSegmentLocking = async () => {
       emrDocumentId: getId(),
       emrCategoryCode: categoryCode.value,
       jump: true,
-      createName: editorGetData(value, '编辑者', 'name'), //value['编辑者']?.value[0].name,
+      createName: parsingDataElements(value, '编辑者', 'name'),
       createDate: value['查房时间']?.value,
-      createId: editorGetData(value, '编辑者', 'code') || fragment.createId, // value['编辑者']?.value[0].code || fragment.createId,
+      createId: parsingDataElements(value, '编辑者', 'code') || fragment.createId,
       type: 'category',
       trueCreationTime: '',
     }
@@ -1233,7 +1222,7 @@ const courseSegmentLocking = async () => {
     }
     courseTitles.push(pushData);
     if (emrConfig.value.editor) {
-      let editorCode = pushData.createId
+      const editorCode = pushData.createId
       // 如果这个为空的话,就让她删了重新写,只能删除不能写
       if (stringIsBlank(editorCode)) {
         node.view.setReadonly(true);

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

@@ -434,3 +434,32 @@ export const patientInfo = ref<EmrPatient>({
 })
 
 export const loadingTime = ref<Date>(null)
+
+
+export function parsingDataElements(data: any, name: string, codeName: string | 'code' | 'name' = 'code'): null | string {
+    function isNullAndUndefined(value: any) {
+        return value === null || typeof value === 'undefined';
+    }
+    if (isNullAndUndefined(data)) return null;
+    if (isNullAndUndefined(data[name])) return null;
+    if (isNullAndUndefined(data[name].value)) return null;
+    const value = data[name].value
+    if (value instanceof Array) {
+        try {
+            return value[0][codeName]
+        } catch {
+            return null;
+        }
+    }
+
+    if (value instanceof Object) {
+        try {
+            return value[codeName]
+        } catch {
+            return null;
+        }
+    }
+
+    return null
+}
+

+ 11 - 0
src/views/hospitalization/zhu-yuan-yi-sheng/jian-cha-jian-yan-shen-qing/JianChaShenQing.vue

@@ -48,6 +48,11 @@
                 <jian-cha-jie-guo ref="jianChaJieGuoRef" :pat-info="huanZheXinXi"/>
               </div>
             </el-tab-pane>
+            <el-tab-pane :name="4" label="结果V2">
+              <div :style="{height: yzSize.h / 1.1 + 'px'}">
+                <JianChaJieGuoV2 :pat-no="huanZheXinXi.inpatientNo" ref="jieGuoRefV2"/>
+              </div>
+            </el-tab-pane>
             <el-tab-pane :name="3" label="编辑数据">
               <div :style="{width: getWindowSize.w - (170 + 440)  + 'px'}">
                 <jian-cha-jian-yan-table is-check :data="addCheckList"
@@ -100,6 +105,8 @@ import {getWindowSize} from "@/utils/window-size";
 import JianChaJianYanTable
   from "@/views/hospitalization/zhu-yuan-yi-sheng/jian-cha-jian-yan-shen-qing/components/public/JianChaJianYanTable.vue";
 import PrintCheckTable from "@/components/zhu-yuan-yi-sheng/jian-cha-shen-qing/da-ying/PrintCheckTable.vue";
+import JianChaJieGuoV2
+  from "@/views/hospitalization/zhu-yuan-yi-sheng/jian-cha-jian-yan-shen-qing/components/jiancha/JianChaJieGuoV2.vue";
 
 const windowSize = computed(() => {
   return store.state.app.windowSize
@@ -114,6 +121,7 @@ const mainTabs = ref(3)
 const daYingJianChaRef = ref()
 // 检查结果
 const jianChaJieGuoRef = ref()
+const jieGuoRefV2 = ref()
 
 /**
  * 点击查询患者检查
@@ -131,6 +139,9 @@ const dianJiChaXunHuanZheJianCha = () => {
   huoQuJianChaShenQing(param).then((res) => {
     jianChaShuJu.value = res
   })
+
+  jieGuoRefV2.value.queryData()
+
 }
 
 

+ 111 - 0
src/views/hospitalization/zhu-yuan-yi-sheng/jian-cha-jian-yan-shen-qing/components/jiancha/JianChaJieGuoV2.vue

@@ -0,0 +1,111 @@
+<script setup lang="ts">
+import {onMounted, ref} from "vue";
+import {getJcIdByPatNo, getExamineDetail} from '@/api/zhu-yuan-yi-sheng/jian-yan-jian-cha-shen-qing'
+import CyAutoSize from "@/components/cy/auto-size/cy-auto-size.vue";
+import XcOption from "@/components/xiao-chan/select/XcOption.vue";
+import XcElOption from "@/components/xiao-chan/xc-el-option/XcElOption.vue";
+import {dateBr} from "@/utils/moment-utils";
+import XcTable from "@/components/xiao-chan/xc-table/XcTable.vue";
+
+const props = defineProps({
+  patNo: String,
+  times: Number
+})
+
+const jcIdList = ref<string[]>([])
+const currentId = ref('')
+
+const orderData = ref([])
+const details = ref({})
+
+function queryDetails() {
+  getExamineDetail(currentId.value).then(res => {
+    orderData.value = res
+  })
+}
+
+const formItems = [
+  {prop: 'applyDate', label: '时间'},
+  {prop: 'applyDoctorName', label: '医生'},
+  {prop: 'textJc', label: '所见'},
+  {prop: 'textZd', label: '诊断'}
+]
+
+function rowClick(row) {
+  details.value = row
+}
+
+async function queryData() {
+  if (!props.patNo) {
+    return
+  }
+  const res = await getJcIdByPatNo(props.patNo).catch(err => {
+    return []
+  })
+  const temp: string[] = res
+  if (temp.length > 0) {
+    currentId.value = temp[0]
+    const tempData = []
+    temp.forEach(item => {
+      tempData.push({
+        code: item,
+        name: item
+      })
+    })
+    jcIdList.value = tempData
+  } else {
+    jcIdList.value = []
+  }
+  queryDetails()
+}
+
+onMounted(() => {
+  queryData()
+})
+
+defineExpose({
+  queryData
+})
+</script>
+
+<template>
+  <div style="width: 100%; height: 100%; display: flex ">
+    <div style="width: 300px; height: 100%">
+      <cy-auto-size>
+        <template #default="{width, height}">
+          <xc-table :local-data="orderData"
+                    @rowClick="rowClick"
+                    layout="total,  prev, pager, next"
+                    :final-height="height - 40" small>
+            <el-table-column prop="orderName" label="检查名"/>
+            <el-table-column prop="applyDate" label="时间">
+              <template #header>
+                <el-select v-model="currentId">
+                  <xc-el-option :data="jcIdList"/>
+                </el-select>
+              </template>
+              <template #default="{row}">
+                <span v-html="dateBr(row.applyDate)"></span>
+              </template>
+            </el-table-column>
+          </xc-table>
+        </template>
+      </cy-auto-size>
+    </div>
+    <div class="details_main">
+      <el-form>
+        <el-form-item v-for="item in formItems" :label="item.label + ':'">
+          {{ details[item.prop] }}
+        </el-form-item>
+      </el-form>
+    </div>
+  </div>
+</template>
+
+<style scoped lang="scss">
+.details_main {
+  flex: 1;
+  overflow: auto;
+  padding: 10px;
+}
+</style>

+ 3 - 1
src/views/system/login.vue

@@ -27,7 +27,8 @@
         </el-input>
         <el-button size="large" style="width: 100%" type="primary" @click="submit">登录</el-button>
       </el-form>
-      <div class="hospital-name">长沙泰和医院<i>·</i><span>H43010500370</span></div>
+      <div class="hospital-name">{{ SYSTEM_CONFIG.HOSPITAL_NAME }}<i>·</i><span>{{ SYSTEM_CONFIG.HOSPITAL_CODE }}</span>
+      </div>
     </div>
   </div>
 </template>
@@ -40,6 +41,7 @@ import {useRoute, useRouter} from 'vue-router'
 import {addRoutes} from '@/router'
 import {ElMessage} from 'element-plus'
 import {closeWebSocket} from '@/utils/websocket'
+import {SYSTEM_CONFIG} from '@/utils/public'
 
 const store = useStore()
 const router = useRouter()