Ver Fonte

查询心电图和部分优化

lighter há 1 ano atrás
pai
commit
5812313186

+ 8 - 0
src/api/check-exam.js

@@ -38,4 +38,12 @@ export function checkPathologyIndex(data) {
     method: 'post',
     data,
   })
+}
+
+export function checkElectroIndex(data) {
+  return request({
+    url: '/inspections/checkElectroIndex',
+    method: 'post',
+    data,
+  })
 }

+ 11 - 1
src/router/index.js

@@ -150,7 +150,7 @@ export const constantRoutes = [
     meta: { title: '检查报告查询' },
   },
   {
-    path: '/checkTestDetail/:patientUid/:patientId',
+    path: '/checkTestDetail/:reportId/:patientId',
     component: () => import('../views/hospital-service/check-exam/test/CheckTestDetail.vue'),
     meta: { title: '检查报告详情' },
   },
@@ -164,6 +164,16 @@ export const constantRoutes = [
     component: () => import('../views/hospital-service/check-exam/pathology/CheckPathologyDetail.vue'),
     meta: { title: '病理报告详情' },
   },
+  {
+    path: '/checkElectroIndex/:patientId',
+    component: () => import('../views/hospital-service/check-exam/electrocardiogram/CheckElectroIndex.vue'),
+    meta: { title: '心电报告查询' },
+  },
+  {
+    path: '/checkElectroDetail/:patientId',
+    component: () => import('../views/hospital-service/check-exam/electrocardiogram/CheckElectroDetail.vue'),
+    meta: { title: '心电报告详情' },
+  },
   {
     path: '/selectPhysicalExamPatient',
     component: () => import('../views/hospital-service/physical-exam/PhysicalExamPatient.vue'),

+ 11 - 0
src/store/index.js

@@ -18,7 +18,9 @@ export default createStore({
     currentExamIndex: {},
     testIndexArray: [],
     pathologyIndexArray: [],
+    electroIndexArray: [],
     currentPathologyIndex: {},
+    currentElectroIndex: {},
     covidExamIdCard: null,
     covidExamIndexes: [],
     currentBook: {},
@@ -42,8 +44,10 @@ export default createStore({
     SET_EXAMINDEXARRAY: (state, payload) => (state.examIndexArray = payload),
     SET_CURRENTEXAMINDEX: (state, payload) => (state.currentExamIndex = payload),
     SET_CURRENTPATHOLOGYINDEX: (state, payload) => (state.currentPathologyIndex = payload),
+    SET_CURRENTELECTROINDEX: (state, payload) => (state.currentElectroIndex = payload),
     SET_TESTINDEXARRAY: (state, payload) => (state.testIndexArray = payload),
     SET_PATHOLOGYINDEXARRAY: (state, payload) => (state.pathologyIndexArray = payload),
+    SET_ELECTROINDEXARRAY: (state, payload) => (state.electroIndexArray = payload),
 
     SET_COVIDEXAMIDCARD: (state, payload) => (state.covidExamIdCard = payload),
     SET_COVIDEXAMINDEXES: (state, payload) => (state.covidExamIndexes = payload),
@@ -108,6 +112,10 @@ export default createStore({
 
     getCurrentPathologyIndex(state) {
       return state.currentPathologyIndex
+    },
+
+    getCurrentElectroIndex(state) {
+      return state.currentElectroIndex
     }
   },
 
@@ -157,5 +165,8 @@ export default createStore({
       commit('SET_CURRENTPATHOLOGYINDEX', payload['currentPathologyIndex'])
     },
 
+    storeCurrentElectroIndex({ commit }, payload) {
+      commit('SET_CURRENTELECTROINDEX', payload['currentElectroIndex'])
+    },
   },
 })

+ 1 - 0
src/views/hospital-service/check-exam/SelectExamBranch.vue

@@ -3,6 +3,7 @@
     <van-cell title="检验报告" is-link @click="go('/checkExamIndex')"></van-cell>
     <van-cell title="检查报告" is-link @click="go('/checkTestIndex')"></van-cell>
     <van-cell title="病理报告" is-link @click="go('/checkPathologyIndex')"></van-cell>
+    <van-cell title="心电报告" is-link @click="go('/checkElectroIndex')"></van-cell>
   </window-size>
 </template>
 <script setup>

+ 48 - 0
src/views/hospital-service/check-exam/electrocardiogram/CheckElectroDetail.vue

@@ -0,0 +1,48 @@
+<template>
+  <window-size>
+    <div class="img-wrapper">
+      <van-image
+          width="100%"
+          :src="imageSrc"
+          fit="cover"
+          class="img-rotate"
+      />
+    </div>
+  </window-size>
+</template>
+
+<script setup>
+import {useStore} from "vuex";
+import {onMounted, ref} from "vue";
+import router from "../../../../router";
+import {fetchInspectionReportImage} from "../../../../utils/request";
+
+const store = useStore()
+const electroIndex = store.getters.getCurrentElectroIndex
+const imageSrc = ref(null)
+
+onMounted(() => {
+  fetchInspectionReportImage({
+    patientId: router.currentRoute.value.params.patientId,
+    reportId: electroIndex.reqNo,
+    reportUrl: electroIndex.reportUrl
+  }).then(response => {
+    imageSrc.value = response
+  })
+})
+</script>
+
+<style scoped>
+.img-wrapper {
+  width: 100vw;
+  height: 80vh;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.img-rotate {
+  transform: rotate(90deg);
+  transform-origin: center center;
+}
+</style>

+ 163 - 0
src/views/hospital-service/check-exam/electrocardiogram/CheckElectroIndex.vue

@@ -0,0 +1,163 @@
+<template>
+  <window-size>
+    <van-cell title="选择日期区间" :value="date" @click="showDateShortcuts = true" />
+
+    <van-dialog v-model:show="showDateShortcuts" @confirm="onConfirmShortcuts">
+      <div style="display:flex; justify-content: center; padding: 30px 0 20px 0">
+        <van-radio-group v-model="chosenShortcut">
+          <van-radio name="oneWeek" style="margin-bottom: 12px">近一周</van-radio>
+          <van-radio name="threeMonths" style="margin-bottom: 12px">近三月</van-radio>
+          <van-radio name="halfYear" style="margin-bottom: 12px">近半年</van-radio>
+          <van-radio name="oneYear" style="margin-bottom: 12px">近一年</van-radio>
+          <van-radio name="diy">自定义</van-radio>
+        </van-radio-group>
+      </div>
+    </van-dialog>
+
+    <van-calendar
+        v-model:show="showDateRange"
+        :min-date="minDate"
+        :max-date="maxDate"
+        type="range"
+        @confirm="onConfirm"
+    />
+
+    <div v-show="electroIndex.length > 0">
+      <div style="height: 5px"></div>
+      <van-tag type="success" size="large" round plain>已发布报告</van-tag>
+      <div style="height: 5px"></div>
+      <div :style="scrollStyle">
+        <div v-for="item in electroIndex" :key="item.reqNo">
+          <van-cell
+              :title="item.diagnostic"
+              :label="item.applyDate"
+              is-link
+              center
+              @click="handleClickElectroIndex(item)"
+          >
+          </van-cell>
+          <div style="height: 5px"></div>
+        </div>
+      </div>
+    </div>
+    <van-empty :image="empty" description="您当前没有报告项目" v-show="electroIndex.length === 0" />
+  </window-size>
+</template>
+
+<script setup>
+import store from '../../../../store'
+import empty from '../../../../assets/empty.png'
+import { useRouter } from 'vue-router'
+import { computed, onMounted, ref } from 'vue'
+import {checkElectroIndex} from '../../../../api/check-exam'
+import {formatDate, getDateRangeByOffsetDays} from '../../../../utils/date'
+
+const router = useRouter()
+const patientId = router.currentRoute.value.params.patientId
+
+const scrollStyle = {
+  height: store.state.screenSize.h - 125 + 'px',
+  overflowY: 'auto',
+}
+const date = ref('')
+const minDate = ref(new Date(2012, 0, 1))
+const maxDate = ref(new Date())
+
+const showDateShortcuts = ref(false)
+const chosenShortcut = ref('oneWeek')
+
+const onConfirmShortcuts = () => {
+  switch (chosenShortcut.value) {
+    case 'oneWeek':
+      makeOffset(7).then((range) => {
+        queryElectroIndex(range[0], range[1])
+      })
+      return
+    case 'threeMonths':
+      makeOffset(90).then((range) => {
+        queryElectroIndex(range[0], range[1])
+      })
+      return;
+    case 'halfYear':
+      makeOffset(183).then((range) => {
+        queryElectroIndex(range[0], range[1])
+      })
+      return
+    case 'oneYear':
+      makeOffset(365).then((range) => {
+        queryElectroIndex(range[0], range[1])
+      })
+      return;
+    default:
+      showDateRange.value = true
+      return;
+  }
+}
+
+const makeOffset = (offsetDays) => {
+  return new Promise((resolve, reject) => {
+    const temp = getDateRangeByOffsetDays(offsetDays)
+    const dateRange = [temp.start, temp.end]
+    store.dispatch({
+      type: 'storeExamDateRange',
+      dateRange: dateRange
+    }).then(() => {
+      date.value = dateRange[0] + ' - ' + dateRange[1]
+      resolve(dateRange)
+    })
+  })
+}
+
+const showDateRange = ref(false)
+const electroIndex = computed(() => {
+  return store.state.electroIndexArray
+})
+
+const onConfirm = (values) => {
+  showDateRange.value = false
+  const start = formatDate(values[0])
+  const end = formatDate(values[1])
+  store.dispatch({
+    type: 'storeExamDateRange',
+    dateRange: [start, end]
+  }).then(() => {
+    date.value = `${start} - ${end}`
+    queryElectroIndex(start, end)
+  })
+}
+
+const queryElectroIndex = (start, end) => {
+  const param = {
+    patientId,
+    reqStartTime: start,
+    reqEndTime: end,
+  }
+  checkElectroIndex(param).then((res) => {
+    store.commit('SET_ELECTROINDEXARRAY', res)
+  })
+}
+
+function handleClickElectroIndex(item) {
+  store.dispatch({
+    type: 'storeCurrentElectroIndex',
+    currentElectroIndex: item
+  }).then(() => {
+    router.push('/checkElectroDetail/' + patientId);
+  })
+}
+
+onMounted(() => {
+  let storeRange = store.state.examDateRange
+  if (storeRange.length === 0) {
+    makeOffset(30).then((range) => {
+      date.value = range[0] + ' - ' + range[1]
+      queryElectroIndex(range[0], range[1])
+    })
+  } else {
+    date.value = storeRange[0] + ' - ' + storeRange[1]
+    if (electroIndex.value.length === 0) {
+      queryElectroIndex(storeRange[0], storeRange[1])
+    }
+  }
+})
+</script>

+ 2 - 2
src/views/hospital-service/check-exam/exam/CheckExamIndex.vue

@@ -125,8 +125,8 @@ const onConfirm = (values) => {
 const queryInspectionIndex = (start, end) => {
   const param = {
     patientId,
-    start: start,
-    end: end,
+    reqStartTime: start,
+    reqEndTime: end,
   }
   checkExamIndex(param).then((res) => {
     store.commit('SET_EXAMINDEXARRAY', res)

+ 2 - 2
src/views/hospital-service/check-exam/test/CheckTestIndex.vue

@@ -128,8 +128,8 @@ const onConfirm = (values) => {
 const queryInspectionIndex = (start, end) => {
   const param = {
     patientId,
-    start: start,
-    end: end,
+    reqStartTime: start,
+    reqEndTime: end,
   }
   checkTestIndex(param).then((res) => {
     store.commit('SET_TESTINDEXARRAY', res)