浏览代码

Merge remote-tracking branch 'upstream/master'

hsh 3 年之前
父节点
当前提交
2a57fc6923

+ 8 - 0
src/api/case-front-sheet/index.js

@@ -219,3 +219,11 @@ export function fetchSheets(month) {
     params: { month },
   })
 }
+
+export function analyzeQualityControl(data) {
+  return request({
+    url: '/caseFrontSheet/analyzeQualityControl',
+    method: 'post',
+    data,
+  })
+}

+ 119 - 0
src/components/inpatient/CaseFrontSheetQuality.vue

@@ -0,0 +1,119 @@
+<template>
+  <el-container>
+    <el-header>
+      <span>统计时间:</span>
+      <el-select v-model="dateRangeType" style="width: 80px">
+        <el-option value="month" label="按月份"></el-option>
+        <el-option value="year" label="按年度"></el-option>
+      </el-select>
+      <el-date-picker v-model="dateRange" :type="dateRangeType" style="width: 100px"> </el-date-picker>
+      <el-divider direction="vertical"></el-divider>
+      <span>统计方式:</span>
+      <el-select v-model="statisticsType" style="width: 100px">
+        <el-option :value="1" label="按入院科室"></el-option>
+        <el-option :value="2" label="按出院科室"></el-option>
+      </el-select>
+      <el-divider direction="vertical"></el-divider>
+      <el-button type="primary" icon="Search" @click="excuteQuery">查询</el-button>
+      <el-button type="primary" icon="Download" @click="exportExcel">导出Excel</el-button>
+    </el-header>
+    <el-main>
+      <el-table :data="statistics" stripe height="360px">
+        <el-table-column prop="departmentName" label="科室"></el-table-column>
+        <el-table-column prop="diagConformInAdmAndDischarge" label="入院诊断与出院诊断符合率"></el-table-column>
+        <el-table-column prop="diagConformInPreAndAfterOperation" label="术前与术后诊断符合率"></el-table-column>
+        <el-table-column prop="diagConformInMainDiagAndPathology" label=" 临床主要诊断与病理符合率"></el-table-column>
+        <el-table-column prop="rescueSuccessRate" label="抢救成功率"></el-table-column>
+        <el-table-column prop="surgicalIncisionBestHealingRate" label="手术切口甲级愈合率"></el-table-column>
+        <el-table-column prop="medicalRecordRateAboveGradeFour" label="三级及以上病历率"></el-table-column>
+        <el-table-column prop="levelFiveMedicalRecordRate" label="五级病案率"></el-table-column>
+        <el-table-column prop="averageLengthOfStay" label="平均住院日"></el-table-column>
+        <el-table-column prop="bedTurnoverTimes" label="病床周转次数"></el-table-column>
+      </el-table>
+    </el-main>
+  </el-container>
+</template>
+
+<script>
+import { ref, onMounted } from 'vue'
+import { getLastMonth, formatMonth, formatYear } from '@/utils/date'
+import { analyzeQualityControl } from '@/api/case-front-sheet/index'
+import { Export } from '@/utils/ExportExcel'
+import { ElMessage } from 'element-plus'
+export default {
+  setup() {
+    const dateRangeType = ref('month')
+    const dateRange = ref(null)
+    const statisticsType = ref(1)
+    const statistics = ref([])
+
+    const excuteQuery = () => {
+      const params = {
+        type: statisticsType.value,
+      }
+      if (dateRangeType.value === 'month') {
+        params.month = formatMonth(dateRange.value)
+      } else {
+        params.year = formatYear(dateRange.value)
+      }
+      analyzeQualityControl(params).then((res) => {
+        statistics.value = res
+      })
+    }
+
+    const exportExcel = () => {
+      if (statistics.value.length === 0) {
+        ElMessage({
+          message: '没有可以导出的数据。',
+          type: 'warning',
+          duration: 2500,
+          showClose: true,
+        })
+        return
+      }
+
+      const title = {
+        departmentCode: '科室编码',
+        departmentName: '科室名称',
+        diagConformInAdmAndDischarge: '入院诊断与出院诊断符合率',
+        diagConformInPreAndAfterOperation: '术前与术后诊断符合率',
+        diagConformInMainDiagAndPathology: '临床主要诊断与病理符合率',
+        rescueSuccessRate: '病房危重病人抢救成功率',
+        surgicalIncisionBestHealingRate: '手术切口甲级愈合率',
+        medicalRecordRateAboveGradeFour: '三级及以上病历率',
+        levelFiveMedicalRecordRate: '五级病案率',
+        averageLengthOfStay: '平均住院日',
+        bedTurnoverTimes: '病床周转次数',
+      }
+
+      const preffix = dateRangeType.value === 'month' ? formatMonth(dateRange.value) : formatYear(dateRange.value)
+      Export(statistics.value, title, `【${preffix}】各科室质控数据`)
+    }
+
+    onMounted(() => {
+      dateRange.value = getLastMonth()
+    })
+
+    return {
+      dateRangeType,
+      dateRange,
+      statisticsType,
+      statistics,
+      excuteQuery,
+      exportExcel,
+    }
+  },
+}
+
+// 入院诊断与出院诊断符合率≥95 %;
+// 术前与术后诊断符合率≥90 %;
+// 临床主要诊断与病理符合率≥50 % (以上三项每低于1个百分点扣1分)﹔
+// 病房危重病人抢救成功率≥84 %;
+// 无菌手术切口甲级愈合率≥97 %;
+// 三级及以上病历率≥90 %,
+// 无五级病案(低于1个百分点扣1分,出现1份v级病历扣3分);
+// 平均住院日s12天;
+// 病床周转次数≥18次 / 年;(床位周转次数=出院人数/平均开放床位数)
+
+// 771张床
+</script>

+ 131 - 114
src/utils/date.js

@@ -1,139 +1,145 @@
-import {stringIsBlank} from "@/utils/blank-utils";
-import moment from "moment";
+import { stringIsBlank } from '@/utils/blank-utils'
+import moment from 'moment'
 
 export function getDate() {
-    const date = new Date()
-    const year = date.getFullYear()
-    let month = date.getMonth() + 1
-    let day = date.getDate()
-    return year + '-' + ('0' + month).slice(-2) + '-' + ('0' + day).slice(-2)
+  const date = new Date()
+  const year = date.getFullYear()
+  let month = date.getMonth() + 1
+  let day = date.getDate()
+  return year + '-' + ('0' + month).slice(-2) + '-' + ('0' + day).slice(-2)
 }
 
 export function getDatetime() {
-    const now = new Date()
-    const year = now.getFullYear()
-    const month = now.getMonth() + 1
-    const day = now.getDate()
-    const hh = now.getHours()
-    const mm = now.getMinutes()
-    const ss = now.getSeconds()
-    let clock = year + '-'
-    if (month < 10) clock += '0'
-    clock += month + '-'
-    if (day < 10) clock += '0'
-    clock += day + ' '
-    if (hh < 10) clock += '0'
-    clock += hh + ':'
-    if (mm < 10) clock += '0'
-    clock += mm + ':'
-    if (ss < 10) clock += '0'
-    clock += ss
-    return clock
+  const now = new Date()
+  const year = now.getFullYear()
+  const month = now.getMonth() + 1
+  const day = now.getDate()
+  const hh = now.getHours()
+  const mm = now.getMinutes()
+  const ss = now.getSeconds()
+  let clock = year + '-'
+  if (month < 10) clock += '0'
+  clock += month + '-'
+  if (day < 10) clock += '0'
+  clock += day + ' '
+  if (hh < 10) clock += '0'
+  clock += hh + ':'
+  if (mm < 10) clock += '0'
+  clock += mm + ':'
+  if (ss < 10) clock += '0'
+  clock += ss
+  return clock
 }
 
-
 export function compareDate(date1, date2) {
-    const oDate1 = new Date(date1);
-    const oDate2 = new Date(date2);
-    return oDate1.getTime() > oDate2.getTime();
+  const oDate1 = new Date(date1)
+  const oDate2 = new Date(date2)
+  return oDate1.getTime() > oDate2.getTime()
 }
 
 export function huanHangXianShi(date) {
-    let clock = date.split(" ")
-    return clock[0] + '<br />' + clock[1]
+  let clock = date.split(' ')
+  return clock[0] + '<br />' + clock[1]
 }
 
-
 export function formatDatetime(date) {
-    if (typeof date === 'undefined') return null
-    if (date === '' || date === null) return null
-    if (typeof date === 'string') return date
-    const year = date.getFullYear()
-    const month = date.getMonth() + 1
-    const day = date.getDate()
-    const hh = date.getHours()
-    const mm = date.getMinutes()
-    const ss = date.getSeconds()
-    let clock = year + '-'
-    if (month < 10) clock += '0'
-    clock += month + '-'
-    if (day < 10) clock += '0'
-    clock += day + ' '
-    if (hh < 10) clock += '0'
-    clock += hh + ':'
-    if (mm < 10) clock += '0'
-    clock += mm + ':'
-    if (ss < 10) clock += '0'
-    clock += ss
-    return clock
+  if (typeof date === 'undefined') return null
+  if (date === '' || date === null) return null
+  if (typeof date === 'string') return date
+  const year = date.getFullYear()
+  const month = date.getMonth() + 1
+  const day = date.getDate()
+  const hh = date.getHours()
+  const mm = date.getMinutes()
+  const ss = date.getSeconds()
+  let clock = year + '-'
+  if (month < 10) clock += '0'
+  clock += month + '-'
+  if (day < 10) clock += '0'
+  clock += day + ' '
+  if (hh < 10) clock += '0'
+  clock += hh + ':'
+  if (mm < 10) clock += '0'
+  clock += mm + ':'
+  if (ss < 10) clock += '0'
+  clock += ss
+  return clock
 }
 
 export function formatDate(date) {
-    if (typeof date === 'undefined') return null
-    if (date === '' || date === null) return null
-    if (typeof date === 'string') return date
-    const year = date.getFullYear()
-    const month = date.getMonth() + 1
-    const day = date.getDate()
-    return year + '-' + ('0' + month).slice(-2) + '-' + ('0' + day).slice(-2)
+  if (typeof date === 'undefined') return null
+  if (date === '' || date === null) return null
+  if (typeof date === 'string') return date
+  const year = date.getFullYear()
+  const month = date.getMonth() + 1
+  const day = date.getDate()
+  return year + '-' + ('0' + month).slice(-2) + '-' + ('0' + day).slice(-2)
 }
 
 export function getOneMonthOffset() {
-    const myDate = new Date()
-    let year = myDate.getFullYear()
-    let month = myDate.getMonth()
-    let date = myDate.getDate()
-    let end = year + '-' + ('0' + (month + 1)).slice(-2) + '-' + ('0' + date).slice(-2)
-    if (month === 0) {
-        year -= 1
-        month = 12
-    } else if (month === 2) {
-        date = date > 28 ? 28 : date
-    } else {
-        date = date > 30 ? 30 : date
-    }
-    let start = year + '-' + ('0' + month).slice(-2) + '-' + ('0' + date).slice(-2)
-    return {start, end}
+  const myDate = new Date()
+  let year = myDate.getFullYear()
+  let month = myDate.getMonth()
+  let date = myDate.getDate()
+  let end = year + '-' + ('0' + (month + 1)).slice(-2) + '-' + ('0' + date).slice(-2)
+  if (month === 0) {
+    year -= 1
+    month = 12
+  } else if (month === 2) {
+    date = date > 28 ? 28 : date
+  } else {
+    date = date > 30 ? 30 : date
+  }
+  let start = year + '-' + ('0' + month).slice(-2) + '-' + ('0' + date).slice(-2)
+  return { start, end }
 }
 
 export function getDateRangeFormatDate(data) {
-    let startTime = ''
-    let endTime = ''
-    //用户手动输入了日期 并且没有按下大键盘上面的回车
-    if (data === null || data.length === 0) return {startTime, endTime}
-    if (typeof data[0].$d !== 'undefined') {
-        startTime = formatDate(data[0].$d) + ' 00:00:00'
-        endTime = formatDate(data[1].$d) + ' 23:59:59'
-    } else if (data !== null) {
-        startTime = formatDate(data[0]) + ' 00:00:00'
-        endTime = formatDate(data[1]) + ' 23:59:59'
-    }
-    return {startTime, endTime}
+  let startTime = ''
+  let endTime = ''
+  //用户手动输入了日期 并且没有按下大键盘上面的回车
+  if (data === null || data.length === 0) return { startTime, endTime }
+  if (typeof data[0].$d !== 'undefined') {
+    startTime = formatDate(data[0].$d) + ' 00:00:00'
+    endTime = formatDate(data[1].$d) + ' 23:59:59'
+  } else if (data !== null) {
+    startTime = formatDate(data[0]) + ' 00:00:00'
+    endTime = formatDate(data[1]) + ' 23:59:59'
+  }
+  return { startTime, endTime }
 }
 
 export function getDateRangeFormatDateTime(date) {
-    let startTime = ''
-    let endTime = ''
-    if (!date) return {startTime, endTime}
-    if (!date[0] || !date[1]) return {startTime, endTime}
-    //用户手动输入了日期 并且没有按下大键盘上面的回车
-    if (date[0].$d) {
-        startTime = getFormatDatetime(date[0].$d)
-        endTime = getFormatDatetime(date[1].$d)
-    } else {
-        startTime = getFormatDatetime(date[0])
-        endTime = getFormatDatetime(date[1])
-    }
-    return {startTime, endTime}
+  let startTime = ''
+  let endTime = ''
+  if (!date) return { startTime, endTime }
+  if (!date[0] || !date[1]) return { startTime, endTime }
+  //用户手动输入了日期 并且没有按下大键盘上面的回车
+  if (date[0].$d) {
+    startTime = getFormatDatetime(date[0].$d)
+    endTime = getFormatDatetime(date[1].$d)
+  } else {
+    startTime = getFormatDatetime(date[0])
+    endTime = getFormatDatetime(date[1])
+  }
+  return { startTime, endTime }
+}
+
+export function formatYear(date) {
+  if (typeof date === 'undefined') return null
+  if (date === '' || date === null) return null
+  if (typeof date === 'string') return date
+  const year = date.getFullYear()
+  return year
 }
 
 export function formatMonth(date) {
-    if (typeof date === 'undefined') return null
-    if (date === '' || date === null) return null
-    if (typeof date === 'string') return date
-    const year = date.getFullYear()
-    const month = date.getMonth() + 1
-    return year + '-' + ('0' + month).slice(-2)
+  if (typeof date === 'undefined') return null
+  if (date === '' || date === null) return null
+  if (typeof date === 'string') return date
+  const year = date.getFullYear()
+  const month = date.getMonth() + 1
+  return year + '-' + ('0' + month).slice(-2)
 }
 
 /**
@@ -143,11 +149,22 @@ export function formatMonth(date) {
  * @returns {string} 返回格式好的日期
  */
 export function getFormatDatetime(date, pattern) {
-    if (stringIsBlank(pattern)) {
-        pattern = "YYYY-MM-DD HH:mm:ss"
-    }
-    if (stringIsBlank(date)) {
-        return ""
-    }
-    return moment(date).format(pattern)
+  if (stringIsBlank(pattern)) {
+    pattern = 'YYYY-MM-DD HH:mm:ss'
+  }
+  if (stringIsBlank(date)) {
+    return ''
+  }
+  return moment(date).format(pattern)
+}
+
+export function getLastMonth() {
+  const myDate = new Date()
+  let year = myDate.getFullYear()
+  let month = myDate.getMonth()
+  if (month === 0) {
+    year -= 1
+    month = 12
+  }
+  return year + '-' + ('0' + month).slice(-2)
 }

+ 5 - 0
src/views/hospitalization/case-front-sheet/AllCaseFrontSheet.vue

@@ -205,6 +205,9 @@
         </el-pagination>
       </div>
     </el-dialog>
+    <el-dialog v-model="showSheetQuality" title="病案质控" width="70%">
+      <SheetQuality />
+    </el-dialog>
   </el-container>
 </template>
 
@@ -234,7 +237,9 @@ import { getLodop, initLodop } from '@/utils/c-lodop'
 import HeadPage from '../../../components/inpatient/frontsheet-printpage/HeadPage.vue'
 import TailPage from '../../../components/inpatient/frontsheet-printpage/TailPage.vue'
 import { Export } from '../../../utils/ExportExcel'
+import SheetQuality from '@/components/inpatient/CaseFrontSheetQuality.vue'
 
+let showSheetQuality = $ref(true)
 let currentPage = $ref(1)
 const handleCurrentPageChange = (val) => {
   currentPage = val

+ 32 - 2
src/views/hospitalization/case-front-sheet/FillCaseFrontSheet.vue

@@ -752,9 +752,15 @@
         <el-button type="primary" icon="ArrowRight" @click="nextPage" :disabled="showSurgeryRecommand || (currentSRPage > 1 && searchResults.length < 10)">下一页 </el-button>
       </div>
     </el-dialog>
-    <el-dialog v-model="showSurgeryDatetime" title="请选择手术时间" width="300px" draggable>
+    <el-dialog v-model="showSurgeryDatetime" title="请选择手术时间" width="330px" draggable>
       <div style="height: 12px"></div>
-      <el-date-picker v-model="surgeryDatetime" type="datetime" placeholder="选择日期时间"></el-date-picker>
+      <el-date-picker v-model="surgeryDatetime" type="datetime" placeholder="手术开始时间"></el-date-picker>
+      <div style="height: 12px"></div>
+      <el-date-picker v-model="opEndDate" type="datetime" placeholder="手术结束时间"></el-date-picker>
+      <div style="height: 12px"></div>
+      <el-date-picker v-model="anstStartDate" type="datetime" placeholder="麻醉开始时间"></el-date-picker>
+      <div style="height: 12px"></div>
+      <el-date-picker v-model="anstEndDate" type="datetime" placeholder="麻醉结束时间"></el-date-picker>
       <template #footer>
         <div>
           <el-button type="primary" icon="Success" @click="confirmSurgeryDatetime">确定</el-button>
@@ -1064,13 +1070,37 @@ const showSearchData = (flag) => {
 
 const showSurgeryDatetime = ref(false)
 const surgeryDatetime = ref(null)
+const opEndDate = ref(null)
+const anstStartDate = ref(null)
+const anstEndDate = ref(null)
 const currentSurgeryDatetimeIndex = ref(null)
 const showPickSurgeryDatetime = (index) => {
   currentSurgeryDatetimeIndex.value = index
   showSurgeryDatetime.value = true
 }
 const confirmSurgeryDatetime = () => {
+  if (!surgeryDatetime.value) {
+    ElMessage({
+      message: '手术开始时间不能为空!',
+      type: 'warning',
+      duration: 2500,
+      showClose: true,
+    })
+    return
+  }
+  if (!opEndDate.value) {
+    ElMessage({
+      message: '手术结束时间不能为空!',
+      type: 'warning',
+      duration: 2500,
+      showClose: true,
+    })
+    return
+  }
   patient.value.surgeryList[currentSurgeryDatetimeIndex.value].date = formatDatetime(surgeryDatetime.value)
+  patient.value.surgeryList[currentSurgeryDatetimeIndex.value].opEndDate = formatDatetime(opEndDate.value)
+  patient.value.surgeryList[currentSurgeryDatetimeIndex.value].anstStartDate = formatDatetime(anstStartDate.value)
+  patient.value.surgeryList[currentSurgeryDatetimeIndex.value].anstEndDate = formatDatetime(anstEndDate.value)
   showSurgeryDatetime.value = false
 }