123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304 |
- <template>
- <div class="layout_display_flex_y">
- <div class="m-b_8px round-header">
- <el-select v-model="search.current" style="width: 70px">
- <el-option v-for="item in search.methods" :key="item.code" :value="item.code"
- :label="item.name"></el-option>
- </el-select>
- <span v-if="permission < 10" style="margin-left: 8px">
- <el-input v-model="search.zyh" style="width: 100px" clearable @keyup.enter="searchPatient"
- placeholder="住院号"></el-input>
- <el-button type="primary" icon="Search" @click="searchPatient">检索</el-button>
- </span>
- <el-button type="primary" icon="Postcard" @click="checkIdCard" style="margin-left: 8px">身份信息</el-button>
- <el-button type="success" icon="Document" @click="getRegInfo">登记信息</el-button>
- <el-button type="primary" icon="Tickets" @click="beforeGetTreatinfo">待遇检查</el-button>
- <el-button icon="Document" @click="openEmr">电子病历</el-button>
- <el-button @click="printWristStrap">打印腕带</el-button>
- <BloodSugar :pat-no="patient.inpatientNo" :times="patient.admissTimes" :old-button="false"/>
- </div>
- <div class="layout_flex_1-y layout_display_flex">
- <div style="width: max-content;margin-right: 8px">
- <Overview ref="overview" :showSelection="isUploadPage"/>
- </div>
- <div class="layout_flex_1-x">
- <LayoutRouterView/>
- <Registinfo v-if="showRegisterInfo" :params="patient" @close="showRegisterInfo = false"></Registinfo>
- <IdentifyImage v-if="showIdCardImg" :pat-no="patient.inpatientNo" :times="patient.admissTimes"
- @close="showIdCardImg = false"></IdentifyImage>
- <Insuinfo v-if="showPsnInsuinfo" :params="checkTreatmentParams" @close="showPsnInsuinfo = false"
- @row-click="checkTreatmentinfos"/>
- <Treatmentinfo v-if="showTreatmentinfos" :params="checkTreatmentParams" @close="showTreatmentinfos = false"/>
- </div>
- </div>
- </div>
- </template>
- <script setup>
- import {computed, reactive, ref} from 'vue'
- import {getPatientInfo} from '@/api/inpatient/patient'
- import {nullPatient} from '@/utils/validate'
- import {getGreatestRole} from '@/utils/permission'
- import { baseinfo, getReadCardData, setBaseinfo } from "@/data/inpatient";
- import Overview from '../../../components/medical-insurance/patient-overview/Index.vue'
- import IdentifyImage from '../../../components/inpatient/IdentifyImage.vue'
- import Registinfo from '../../../components/medical-insurance/registinfo/Index.vue'
- import {
- emrStateEnum,
- getEmrUrl
- } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
- import Treatmentinfo from "@/components/medical-insurance/treatmentinfo/Index.vue";
- import Insuinfo from "@/components/medical-insurance/insuinfo/Index.vue";
- import {ElMessage} from "element-plus";
- import {getDatetime} from "@/utils/date";
- import {getLodop, initLodop} from "@/utils/c-lodop";
- import {useMedinsStore} from "@/pinia/medins-store";
- import BloodSugar from "@/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/components/BloodSugar.vue";
- import {useCompRef} from "@/utils/useCompRef";
- import LayoutRouterView from "@/layout/LayoutRouterView.vue";
- const search = initSearchParam()
- const permission = getGreatestRole()
- const patient = computed(() => {
- return baseinfo()
- })
- const medinsStore = useMedinsStore()
- const injuryMode = computed(() => {
- return medinsStore.isInjuryMode
- })
- const isUploadPage = computed(() => {
- return medinsStore.currentPageName === 'inHospFeeUpload' && !injuryMode.value
- })
- const overview = useCompRef(Overview)
- const searchPatient = () => {
- if (!search.zyh) {
- overview.value.fetchOverviews()
- setBaseinfo({})
- } else {
- if (permission < 10) {
- setBaseinfo({
- totalCharge: '0.00',
- chargeYb: '0.00'
- })
- getPatientInfo(search.zyh).then((res) => {
- medinsStore.setCurrentWard(res.admissWard)
- medinsStore.setCurrentMedType(res.medType)
- setBaseinfo(res)
- overview.value.makeOverview(res)
- // overview.value.currentWard = res.admissWard
- // overview.value.overviews.push(makeOverview(res))
- })
- }
- }
- }
- const showRegisterInfo = ref(false)
- const getRegInfo = () => {
- if (nullPatient()) return
- showRegisterInfo.value = true
- }
- const showIdCardImg = ref(false)
- const checkIdCard = () => {
- if (nullPatient()) return
- showIdCardImg.value = true
- }
- function initSearchParam() {
- return reactive({
- current: 'alpha',
- methods: [
- {code: 'alpha', name: '拼音'},
- {code: 'code', name: '编码'},
- {code: 'name', name: '名称'},
- ],
- zyh: '',
- })
- }
- const openEmr = () => {
- if (nullPatient()) return
- window.open(getEmrUrl(patient.value.inpatientNo, patient.value.admissTimes, emrStateEnum.在院只读), '_blank')
- }
- const showPsnInsuinfo = ref(false)
- const showTreatmentinfos = ref(false)
- const checkTreatmentParams = ref({})
- const beforeGetTreatinfo = async () => {
- if (nullPatient()) return
- if (!patient.value.medType) {
- ElMessage({
- message: '医疗类别不能为空!',
- type: 'warning',
- duration: 2600,
- showClose: true,
- })
- return true
- }else {
- medinsStore.setInjuryMode((patient.value.medType === "gs21") || (patient.value.medType === "gs22") || (patient.value.medType === "gs23"));
- }
- if(injuryMode.value) {
- let inpatient_no = patient.value.patNo
- let admiss_times = patient.value.admissTimes
- // 调用工伤患者关系列表接口
- const loading = ElMessage({
- message: '正在获取工伤患者信息,请稍候...',
- type: 'info',
- duration: 0,
- showClose: true,
- grouping: true,
- });
-
- try {
- //const response = await fetch(`http://localhost:9205/thyy/api/public/injury/getWorkInjuryPatientRelationList?inpatient_no=${inpatient_no}&admiss_times=${admiss_times}`, {
- const response = await fetch(`http://localhost:9205/thyy/api/public/injury/getWorkInjuryPatientRelationList?inpatient_no=${inpatient_no}&admiss_times=${admiss_times}`, {
- method: 'GET',
- headers: {
- 'Content-Type': 'application/json',
- },
- });
- const result = await response.json();
-
- if (result && result.code === 1 && result.data && Array.isArray(result.data) && result.data.length > 0) {
- // 取数组的第一个值
- const firstItem = result.data[0];
- checkTreatmentParams.value = {
- medType: patient.value.medType,
- patNo: patient.value.patNo,
- times: patient.value.admissTimes,
- ledgerSn: patient.value.ledgerSn,
- socialNo: patient.value.socialNo,
- name: patient.value.name,
- admdvs: patient.value.admdvs,
- readCardResult: {
- data:{
- output: {
- inpatient_no: firstItem.inpatientNo,
- admiss_times: firstItem.admissTimes,
- psn_no: firstItem.psnNo,
- emp_no: firstItem.empNo,
- emp_name: firstItem.empName,
- certno: firstItem.certno,
- psn_name: firstItem.psnName,
- gend: firstItem.gend,
- age: firstItem.age,
- psn_type: firstItem.psnType,
- insu_admdvs: firstItem.insuAdmdvs,
- inhosp_stas: firstItem.inhospStas,
- certificate_type: firstItem.certificateType,
- birthday: firstItem.birthday,
- QualificationId: firstItem.QualificationId,
- injury_part_desc: firstItem.injuryPartDesc,
- visit_type: firstItem.visitType,
- exam_ccls: firstItem.examCcls
- }
- }
- },
- mdtrtCertType: 'injurySicard',
- };
- showPsnInsuinfo.value = true;
- } else {
- ElMessage({
- message: '未找到工伤患者关系信息',
- type: 'warning',
- duration: 2500,
- showClose: true,
- });
- }
- } catch (error) {
- ElMessage({
- message: '获取工伤患者信息失败',
- type: 'error',
- duration: 2500,
- showClose: true,
- });
- } finally {
- loading.close && loading.close();
- }
- } else {
- let cd = getReadCardData()
- checkTreatmentParams.value = {
- medType: patient.value.medType,
- patNo: patient.value.patNo,
- times: patient.value.admissTimes,
- ledgerSn: patient.value.ledgerSn,
- socialNo: patient.value.socialNo,
- name: patient.value.name,
- admdvs: patient.value.admdvs,
- readCardResult: cd.readCardResult,
- mdtrtCertType: cd.mdtrtCertType,
- busCardInfo: cd.busCardInfo,
- }
- showPsnInsuinfo.value = true
- }
- }
- const checkTreatmentinfos = (row) => {
- if (injuryMode.value) {
- }else {
- checkTreatmentParams.value.psnNo = row.psnNo
- checkTreatmentParams.value.begntime = getDatetime()
- checkTreatmentParams.value.insutype = row.insutype
- showPsnInsuinfo.value = false
- showTreatmentinfos.value = true
- }
- }
- const childrenDepts = ['1040000', '1040100', '1700015']
- function printWristStrap() {
- if (nullPatient()) return
- if (childrenDepts.indexOf(patient.value.smallDept) !== -1) {
- printChildWristStrap()
- } else {
- printNormalWristStrap()
- }
- }
- let LODOP;
- function printNormalWristStrap() {
- LODOP = getLodop();
- LODOP.PRINT_INIT('inpatient_info2')
- // LODOP.SET_PRINTER_INDEX('DASCOM DL-520Z')
- LODOP.SET_PRINT_PAGESIZE(2, 0, 0, '')
- LODOP.SET_PRINT_STYLE('FontSize', 9)
- LODOP.SET_PRINT_STYLE('Bold', 1)
- LODOP.ADD_PRINT_BARCODE('7mm', '27mm', '18.5mm', '18.5mm', 'QRCode', patient.value.inpatientNo)
- LODOP.SET_PRINT_STYLE('Angle', 90)
- LODOP.ADD_PRINT_TEXT('22mm', '44.5mm', '20mm', '7mm', patient.value.inpatientNo)
- LODOP.SET_PRINT_STYLE('Angle', 0)
- LODOP.ADD_PRINT_TEXT('8mm', '49mm', '220mm', '7mm',
- `姓名:${patient.value.name} / 性别:${patient.value.sexName} / 年龄:${patient.value.age}`)
- LODOP.ADD_PRINT_TEXT('14mm', '49mm', '220mm', '7mm', `入院科室:${patient.value.smallDeptName}`)
- LODOP.ADD_PRINT_TEXT('20mm', '49mm', '220mm', '7mm', `紧急联系人:${patient.value.contactPhone}`)
- LODOP.PREVIEW()
- }
- function printChildWristStrap() {
- LODOP = getLodop()
- LODOP.PRINT_INIT('inpatient_info3')
- // LODOP.SET_PRINTER_INDEX('DASCOM DL-520Z')
- LODOP.SET_PRINT_PAGESIZE(2, 0, 0, '')
- LODOP.SET_PRINT_STYLE('FontSize', 6)
- LODOP.SET_PRINT_STYLE('Bold', 1)
- LODOP.ADD_PRINT_BARCODE('10mm', '32mm', '15mm', '15mm', 'QRCode', patient.value.inpatientNo)
- LODOP.SET_PRINT_STYLE('Angle', 90)
- LODOP.ADD_PRINT_TEXT('20mm', '43.7mm', '20mm', '7mm', patient.value.inpatientNo)
- LODOP.SET_PRINT_STYLE('Angle', 0)
- LODOP.ADD_PRINT_TEXT('11mm', '46.2mm', '50mm', '3mm',
- `姓名:${patient.value.name} / 性别:${patient.value.sexName} / 年龄:${patient.value.age}`)
- LODOP.ADD_PRINT_TEXT('14.75mm', '46.2mm', '50mm', '3mm', `入院科室:${patient.value.smallDeptName}`)
- LODOP.ADD_PRINT_TEXT('18.5mm', '46.2mm', '50mm', '3mm', `紧急联系人:${patient.value.contactPhone}`)
- LODOP.PREVIEW()
- }
- onMounted(() => {
- initLodop()
- })
- </script>
|