123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239 |
- <template>
- <div>
- <div>
- <CyDateRange v-model="queryParam" clearable />
- <el-button
- @click="queryYz"
- v-title="
- '医嘱过多导致查看医嘱困难,可选择时间范围来减少医嘱的条数,默认查询今天到90天前的数据,可通过选择日期后面的删除按钮,取消时间范围的查询'
- "
- >
- 查询
- </el-button>
- <el-divider direction="vertical" />
- <label>
- 显示范围:
- <select v-model="queryParam.displayRange" v-title="'显示范围'">
- <option :value="0" title="全部的医嘱">全部</option>
- <option :value="1" title="已经停止的医嘱">停止</option>
- <option :value="2" title="正在执行的长期医嘱">当前</option>
- <option :value="3" title="今天开的医嘱">今天</option>
- </select>
- </label>
- <label>
- 状态:
- <select v-model.number="queryParam.zhuangTai" v-title="`医嘱的状态`">
- <option :value="0">全部</option>
- <option :value="1">录入</option>
- <option :value="2">确认</option>
- <option :value="3">执行</option>
- <option :value="5">停止</option>
- </select>
- </label>
- <label>
- 药房:
- <YfGrouo
- v-model="queryParam.groupNo"
- style="width: 90px"
- v-title="'在新增医嘱的时候,去指定的药房查询药品。'"
- />
- </label>
- <label>
- 排序:
- <select v-model="queryParam.sort" @change="setYzOrderGroup">
- <option :value="OrderBy.asc">正序</option>
- <option :value="OrderBy.desc">反序</option>
- </select>
- </label>
- <el-divider direction="vertical" />
- <el-button-group>
- <el-button
- type="primary"
- @click="addYiZhuClick"
- v-title="'添加医嘱,快捷键 ALT+A'"
- >
- 添加
- </el-button>
- <el-button
- type="success"
- :loading="confirmLoading"
- @click="currentConfirmOrdersClick"
- v-title="'把录入状态的医嘱,变为确认状态。'"
- v-if="!isCydy()"
- >
- 确认
- </el-button>
- <el-button
- type="success"
- @click="confirmTheDoctorSOrderWithMedicineClick"
- v-else
- v-title="'把录入状态的医嘱,变为确认状态。'"
- >
- 确认带药
- </el-button>
- </el-button-group>
- <el-divider direction="vertical" />
- <el-dropdown
- split-button
- type="danger"
- @click="deleteAnOrderByOrderNo"
- v-title="
- '在表格中选中了一条医嘱后这个方法才能有效果,(这个医嘱需要在工作台显示),也可以在点击表格后面的删按钮<br /><span style=\'color:#fffe00\'>限制:</span>只能删除自己开的,只能删除(录入、确认)状态的医嘱。'
- "
- >
- 删除
- <template #dropdown>
- <el-dropdown-menu>
- <div
- v-title="
- '在表格中,点击前面的选择框,选中医嘱(多条或单挑),才能点击此按钮,限制:只能删除自己开的,只能删除(录入、确认)状态的医嘱。'
- "
- >
- <el-dropdown-item @click="batchDeleteOrdersClick">
- 批量删除
- </el-dropdown-item>
- </div>
- </el-dropdown-menu>
- </template>
- </el-dropdown>
- <el-divider direction="vertical" />
- <el-dropdown
- split-button
- @click="yzMitt.emit('clickOnTheOrderTemplate')"
- v-title="'获取医嘱的模板'"
- >
- 模板
- <template #dropdown>
- <el-dropdown-menu>
- <div v-title="'维护自己创建的模板'">
- <el-dropdown-item @click="orderTemplateClick">
- 维护模板
- </el-dropdown-item>
- </div>
- <div v-title="'选中表格中的医嘱作为模板'">
- <el-dropdown-item @click="orderTemplateClickCopy">
- 选中医嘱做模板
- </el-dropdown-item>
- </div>
- </el-dropdown-menu>
- </template>
- </el-dropdown>
- </div>
- <div style="border-top: 1px solid #000; margin: 5px 0" />
- <div>
- <el-dropdown
- split-button
- @click="clickToStopTheOrder"
- v-title="
- '批量停止医嘱,需要结束时间一栏的日期数据框变成红色则代表,是要停止这条医嘱。<br />' +
- '双击日期输入框,默认填充停止到当前时间,并选中医嘱,可点击输入框中的日历,去选择其他时间。<br />' +
- '鼠标右键数据框,可以取消停止。'
- "
- >
- 停止医嘱
- <template #dropdown>
- <el-dropdown-menu>
- <div v-title="'跳转到这个患者,修改医嘱时间的申请页面。'">
- <el-dropdown-item @click="clickToModifyTheDoctorSOrderTime">
- 修改医嘱时间
- </el-dropdown-item>
- </div>
- </el-dropdown-menu>
- </template>
- </el-dropdown>
- <el-dropdown split-button v-title="'跳转到指定患者的数据页面'">
- 页面跳转
- <template #dropdown>
- <el-dropdown-menu>
- <el-dropdown-item @click="jumpToMedicalRecord">
- 病案首页
- </el-dropdown-item>
- <el-dropdown-item @click="openRationalDrugUse">
- 合理用药
- </el-dropdown-item>
- <el-dropdown-item @click="routerBloodSugarClick">
- 血糖
- </el-dropdown-item>
- <el-dropdown-item @click="openNewNutrientPlus">
- 营养评估
- </el-dropdown-item>
- </el-dropdown-menu>
- </template>
- </el-dropdown>
- <el-dropdown
- split-button
- v-title="'设置选中医嘱成组。'"
- @click="confirmAssociationClick"
- >
- 关联
- <template #dropdown>
- <el-dropdown-menu>
- <el-dropdown-item @click="clearAssociate()"
- >取消关联
- </el-dropdown-item>
- </el-dropdown-menu>
- </template>
- </el-dropdown>
- <el-dropdown v-title="'患者数据维护,包含传染病、过敏源。'" split-button>
- 数据维护
- <template #dropdown>
- <el-dropdown-menu>
- <el-dropdown-item @click="yzMitt.emit('allergen')">
- 过敏源维护
- </el-dropdown-item>
- <el-dropdown-item @click="crbOpen"> 传染病上报</el-dropdown-item>
- <el-dropdown-item
- @click="
- router.push(
- `/outpatient/chronicDisease/chronicDiseaseRegister/${props.patientInfo.inpatientNo}`
- )
- "
- >
- 慢病登记
- </el-dropdown-item>
- </el-dropdown-menu>
- </template>
- </el-dropdown>
- <el-dropdown
- v-title="'工作台操作,录入、清空、医嘱弹窗、复制粘贴'"
- @click="yzMitt.emit('toAddAnOrder')"
- split-button
- >
- 录入医嘱
- <template #dropdown>
- <el-dropdown-menu>
- <div v-title="'清空,正在编辑的医嘱或者选中的医嘱。'">
- <el-dropdown-item @click="yzMitt.emit('emptyTheWorkbench')">
- 清空工作台
- </el-dropdown-item>
- </div>
- <div
- v-title="
- '打开医嘱弹窗,目前只有转科、抗菌药物信息、处置医嘱可以打开弹窗。'
- "
- >
- <el-dropdown-item @click="yzMitt.emit('openTheOrderPopUpWindow')">
- 医嘱弹窗
- </el-dropdown-item>
- </div>
- <div
- v-title="
- '复制并粘贴医嘱,如果想要分开,请在表格中鼠标右键一个医嘱,选择复制,然后在到表格中,选择粘贴医嘱。<br /><br />' +
- '<span style=\'color:#fffe00\'>注意:</span>如果你是在临时医嘱页面,那么长期医嘱会改为 ONCE 频率,如果在长期医嘱页面那么临时医嘱会改为 QD 频率,如果是成组的医嘱' +
- '复制父医嘱即可子医嘱会自动复制,目前不会提供批量复制医嘱的功能。'
- "
- >
- <el-dropdown-item @click="yzMitt.emit('duplicateAndPaste')">
- 复制并粘贴
- </el-dropdown-item>
- </div>
- <div
- v-title="
- '<span style=\'color:#fffe00\'>带有实验性质的功能,如果此方法出错频率高,后期可能会删除。</span>' +
- '<br />复制选中的医嘱并粘贴。'
- "
- >
- <el-dropdown-item @click="openCopyDialog">
- 复制选中的医嘱
- </el-dropdown-item>
- </div>
- </el-dropdown-menu>
- </template>
- </el-dropdown>
- <el-dropdown title="其他操作" split-button>
- 其他
- <template #dropdown>
- <el-dropdown-menu>
- <div
- v-title="
- '为即将出院的患者预约门诊,如果患者没有门诊号的话,需要先创建一个门诊号。'
- "
- >
- <el-dropdown-item @click="outPatientDialogOpen()">
- 门诊预约
- </el-dropdown-item>
- </div>
- <div
- v-title="
- '一键停止正在执行的医嘱,会生成一条医嘱,此医嘱是口头医嘱,有没任何效果。'
- "
- >
- <el-dropdown-item @click="oneClickStopOpen">
- 一键停止
- </el-dropdown-item>
- </div>
- <el-dropdown-item @click="clickTimeLimitReminder">
- 时限提示
- </el-dropdown-item>
- <el-dropdown-item @click="openSanCeDan"> 三测单</el-dropdown-item>
- <el-dropdown-item @click="nursingRecordForm">
- 护理记录单
- </el-dropdown-item>
- </el-dropdown-menu>
- </template>
- </el-dropdown>
- <el-button
- type="success"
- icon="RefreshRight"
- @click="rcvrcalcost"
- v-title="
- '如果患者费用存在问题或者有些费用看不到,<br />可以执行此操作。'
- "
- >
- 费用接收重算
- </el-button>
- <el-button
- type="primary"
- icon="Edit"
- @click="openYbDiag"
- v-title="'医保诊断录入'"
- >
- 出院诊断
- </el-button>
- </div>
- </div>
- <!-- 医保诊断对话框 -->
- <el-dialog
- v-model="showYbDiag"
- title="医保出院诊断"
- width="70%"
- top="30px"
- draggable
- >
- <div
- style="
- width: 100%;
- height: 30px;
- line-height: 30px;
- background: rgb(252, 160, 23);
- margin-bottom: 8px;
- border-radius: 8px;
- padding-left: 8px;
- color: white;
- "
- >
- <strong>主要诊断病种分值:{{ diseFamilyGrade }}</strong>
- </div>
- <el-tag type="info">医保诊断录入</el-tag>
- <el-tag style="margin-left: 12px"
- >患者:{{ props.patientInfo?.name }}</el-tag
- >
- <el-tag style="margin-left: 8px"
- >医疗类别:{{ props.patientInfo?.medTypeName }}
- </el-tag>
- <el-tag style="margin-left: 8px"
- >险种类型:{{ props.patientInfo?.insutype }}</el-tag
- >
- <div style="height: 5px"></div>
- <el-input
- v-model="ybDiag.name"
- placeholder="在此搜索诊断"
- readonly
- style="width: 160px"
- @click="showSearchData('ybDiag')"
- ></el-input>
- <el-input
- placeholder="诊断编码"
- disabled
- style="width: 100px"
- v-model="ybDiag.code"
- ></el-input>
- <el-select
- v-model="ybDiag.siDiagType"
- style="width: 100px"
- placeholder="诊断类别"
- >
- <el-option
- v-for="item in diagTypes"
- :key="item.code"
- :value="item.code"
- :label="item.name"
- ></el-option>
- </el-select>
- <el-select
- v-model="ybDiag.admissCond"
- style="width: 100px"
- placeholder="入院病情"
- >
- <el-option
- v-for="item in admissConds"
- :key="item.code"
- :value="item.code"
- :label="item.name"
- ></el-option>
- </el-select>
- <el-select
- v-model="ybDiag.cyzg"
- style="width: 120px"
- placeholder="出院转归"
- >
- <el-option
- v-for="item in cyzgs"
- :key="item.code"
- :value="item.code"
- :label="item.name"
- ></el-option>
- </el-select>
- <el-divider direction="vertical"></el-divider>
- <el-button type="primary" icon="Plus" @click="addToYbDiags">添加</el-button>
- <el-button type="success" icon="Upload" @click="saveYbDiags"
- >保存
- </el-button>
- <el-table :data="ybDiags" stripe :height="200">
- <el-table-column type="index" label="序号" width="45"></el-table-column>
- <el-table-column prop="code" label="诊断编码"></el-table-column>
- <el-table-column prop="name" label="诊断名称"></el-table-column>
- <el-table-column
- prop="siDiagType"
- label="诊断类别"
- width="80"
- ></el-table-column>
- <el-table-column
- prop="admissCond"
- label="入院病情"
- width="80"
- ></el-table-column>
- <el-table-column
- prop="cyzg"
- label="出院转归"
- width="80"
- ></el-table-column>
- <el-table-column
- prop="operId"
- label="录入人"
- width="70"
- ></el-table-column>
- <el-table-column prop="opDate" label="录入日期"></el-table-column>
- <el-table-column label="操作">
- <template #default="scope">
- <el-button
- type="danger"
- icon="Delete"
- @click="deleteYbDiag(scope.$index)"
- >删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <!-- <div style="height: 12px"></div>
- <el-tag type="info">病案首页诊断信息</el-tag>
- <el-table :data="filterDisDiagList" stripe :height="200">
- <el-table-column type="index" label="序号" width="45"></el-table-column>
- <el-table-column prop="code" label="诊断编码"></el-table-column>
- <el-table-column prop="name" label="诊断名称"></el-table-column>
- <el-table-column label="出院病情">
- <template #default="scope">
- {{ filterDismissStatus(scope.row.dismissStatus) }}
- </template>
- </el-table-column>
- <el-table-column label="操作">
- <template #default="scope">
- <el-button
- icon="Link"
- title="添加到医保诊断"
- circle
- @click="syncronizeWithSiDiagnose(scope.row.code)"
- ></el-button>
- </template>
- </el-table-column>
- </el-table> -->
- </el-dialog>
- <!-- 诊断搜索对话框 -->
- <el-dialog v-model="showSearch" title="数据搜索" width="730px" draggable>
- 检索依据:
- <el-select v-model="searchMethod" style="width: 100px">
- <el-option
- v-for="item in searchMethods"
- :key="item.code"
- :label="item.name"
- :value="item.code"
- ></el-option>
- </el-select>
- 搜索内容:
- <el-input
- ref="searchInput"
- v-model="searchContent"
- prefix-icon="Search"
- placeholder="请输入搜索内容"
- style="width: 160px"
- clearable
- @input="executeSearch"
- ></el-input>
- <el-table
- :data="searchResults"
- height="400"
- stripe
- highlight-current-row
- @row-click="handleSelectSearch"
- >
- <el-table-column prop="code" label="编码" width="130"></el-table-column>
- <el-table-column prop="name" label="名称"></el-table-column>
- </el-table>
- <div style="margin-top: 15px; width: 100%; text-align: right">
- <el-button
- type="primary"
- icon="ArrowLeft"
- @click="lastPage"
- :disabled="currentSRPage === 1"
- >
- 上一页
- </el-button>
- <el-button
- type="primary"
- icon="ArrowRight"
- @click="nextPage"
- :disabled="currentSRPage > 1 && searchResults.length < 10"
- >
- 下一页
- </el-button>
- </div>
- </el-dialog>
- <!-- 门诊预约 -->
- <OutpatientAppointments
- v-if="outPatientDialog"
- @closed="outPatientDialog = false"
- />
- <one-click-stop
- v-if="oneClickStopDialog"
- @closed="oneClickStopDialog = false"
- />
- <CopyTableDataOrder v-model="copyTableDialog" v-if="copyTableDialog" />
- </template>
- <script setup lang="jsx">
- import { MLRKON_CLIENT } from "@/api/heliyongyao/mlrkon.js";
- import {
- associateOrdersApi,
- confirmTheDoctorSOrderWithMedicine,
- stopOrder,
- } from "@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
- import {
- associateOrders,
- clearAssociate,
- clickTimeLimitReminder,
- confirmLoading,
- errorMsgFunc,
- huanZheXinXi,
- isCydy,
- jsQueryYzData,
- OrderBy,
- queryParam,
- setOrderDataAndTwinkle,
- setYzOrderGroup,
- yiZhuData,
- yiZhuDataInit,
- youWuXuanZheHuanZhe,
- yzMitt,
- } from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
- import { BizException, ExceptionEnum } from "@/utils/BizException";
- import router from "@/router";
- import { clone } from "@/utils/clone";
- import { listIsBlank, stringIsBlank } from "@/utils/blank-utils";
- import { xcMessage } from "@/utils/xiaochan-element-plus";
- import { getFormatDatetime } from "@/utils/date";
- import { ElMessageBox } from "element-plus";
- import ReportOfInfectiousDiseases from "@/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/report-of-infectious-diseases/ReportOfInfectiousDiseases.vue";
- 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";
- import {
- getPatientInfo,
- receiveAndRecalculateCost,
- } from "@/api/inpatient/patient";
- import CopyTableDataOrder from "@/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/components/table/CopyTableDataOrder.vue";
- import { CyMessageBox } from "@/utils/cy-message-box";
- import { useUserStore } from "@/pinia/user-store";
- import CyDateRange from "@/components/cy/date-range/CyDateRange.vue";
- import { useDialog } from "@/components/cy/CyDialog/index";
- import XEUtils from "xe-utils";
- import { useYfGroupStore } from "@/pinia/use-yf-group";
- import {
- rationalUseOfMedicine,
- getInfoRationalUseOfMedicine,
- } from "@/api/heliyongyao/rational-use";
- import { getPatientAllergens } from "@/api/public-api";
- import {
- doSaveYbDiags,
- fetchSsfz,
- getYbDiags,
- selectSiDiagByBaDiag,
- sheetSearch,
- } from "@/api/case-front-sheet";
- import { getDisDiag } from "@/api/inpatient/patient";
- import { getDatetime } from "@/utils/date";
- import { watchEffect } from "vue";
- import YfGrouo from "@/components/cy/yf-group/YfGrouo.vue";
- const props = defineProps({
- patientInfo: {
- type: Object,
- },
- returnData: {
- type: Function,
- },
- frequCodeChange: Function,
- confirmOrdersClick: Function,
- clickOnTheOrderTemplate: Function,
- });
- const userStore = useUserStore().userInfo;
- const emits = defineEmits(["batchDeleteOrdersClick"]);
- const copyTableDialog = ref(false);
- const openCopyDialog = () => {
- if (youWuXuanZheHuanZhe()) return;
- copyTableDialog.value = true;
- };
- // ========== 医保诊断相关变量和函数 ==========
- const showYbDiag = ref(false);
- const diseFamilyGrade = ref(null);
- const ybDiag = reactive({});
- const ybDiags = ref([]);
- const showSearch = ref(false);
- const searchInput = ref(null);
- const searchMethod = ref("alpha");
- const searchContent = ref("");
- const searchResults = ref([]);
- const currentSRPage = ref(1);
- const searchUrl = ref("");
- const searchTargetCode = ref("");
- const filterDisDiagList = ref([]);
- // 出院转归选项
- const cyzgs = [
- { code: 0, name: "好转/治愈" },
- { code: 1, name: "未愈" },
- { code: 2, name: "转院(医院要求)" },
- { code: 3, name: "转院(病人要求)" },
- { code: 4, name: "转科" },
- { code: 5, name: "无效" },
- { code: 6, name: "死亡" },
- { code: 7, name: "双向转诊" },
- { code: 9, name: "其他" },
- ];
- // 入院病情选项
- const admissConds = [
- { code: 1, name: "有" },
- { code: 2, name: "临床未确定" },
- { code: 3, name: "情况不明" },
- { code: 4, name: "无" },
- ];
- // 诊断类别选项
- const diagTypes = [
- { code: 1, name: "西医诊断" },
- { code: 2, name: "中医主病诊断" },
- { code: 3, name: "中医主症诊断" },
- ];
- // 搜索方式选项
- const searchMethods = [
- { code: "alpha", name: "首字母" },
- { code: "name", name: "名称" },
- { code: "code", name: "编码" },
- ];
- // 过滤出院病情状态
- const filterDismissStatus = status => {
- const statusMap = {
- 1: "治愈",
- 2: "好转",
- 3: "未愈",
- 4: "死亡",
- 9: "其他",
- };
- return statusMap[status] || "";
- };
- // 打开医保诊断对话框
- const openYbDiag = () => {
- if (!props.patientInfo?.inpatientNo) {
- xcMessage.error("请先选择患者!");
- return;
- }
- if (!props.patientInfo?.medType) {
- xcMessage.error("该病人没选择医疗类别,请先去医保入院登记页面填写医疗类别!");
- return;
- }
- // 获取医保诊断列表
- getYbDiags(props.patientInfo.inpatientNo, props.patientInfo.admissTimes).then(
- res => {
- ybDiags.value = res;
- showYbDiag.value = true;
- }
- );
- // 获取病案诊断信息
- //getDisDiag(props.patientInfo.inpatientNo, props.patientInfo.admissTimes).then(res => {
- // filterDisDiagList.value = res.filter(item => item.code && item.name);
- // });
- };
- // 显示搜索对话框
- const showSearchData = flag => {
- searchUrl.value = "diag";
- searchTargetCode.value = "ybDiagCode";
- showSearch.value = true;
- setTimeout(() => {
- searchInput.value?.focus();
- }, 300);
- };
- // 执行搜索
- const executeSearch = () => {
- if (searchContent.value.length < 2) return;
- currentSRPage.value = 1;
- fetchSearchData();
- };
- // 获取搜索数据
- const fetchSearchData = () => {
- const param = {
- patNo: props.patientInfo.inpatientNo,
- times: props.patientInfo.admissTimes,
- method: searchMethod.value,
- target: searchUrl.value,
- content: searchContent.value,
- medType: props.patientInfo.medType,
- page: currentSRPage.value,
- };
- sheetSearch(param).then(res => {
- searchResults.value = res;
- });
- };
- // 上一页
- const lastPage = () => {
- currentSRPage.value--;
- fetchSearchData();
- };
- // 下一页
- const nextPage = () => {
- currentSRPage.value++;
- fetchSearchData();
- };
- // 处理搜索选择
- const handleSelectSearch = item => {
- if (searchTargetCode.value === "ybDiagCode") {
- ybDiag.code = item.code;
- ybDiag.name = item.name;
- ybDiag.cyzg = 0;
- ybDiag.siDiagType = 1;
- if (!ybDiags.value || ybDiags.value.length === 0) {
- fetchSsfz(
- item.code,
- props.patientInfo.inpatientNo,
- props.patientInfo.admissTimes
- ).then(res => {
- diseFamilyGrade.value = res;
- });
- }
- }
- searchContent.value = "";
- showSearch.value = false;
- };
- // 添加到医保诊断列表
- const addToYbDiags = () => {
- if (!ybDiag.siDiagType) {
- xcMessage.error("请选择诊断类别!");
- return;
- }
- if (!ybDiag.admissCond) {
- xcMessage.error("请选择入院病情!");
- return;
- }
- const temp = clone(ybDiag);
- temp.diagType = 13;
- temp.operId = userStore.code;
- temp.opDate = getDatetime();
- temp.bzfx = "普通";
- ybDiags.value.push(temp);
- ybDiag.code = ybDiag.name = ybDiag.cyzg = "";
- };
- // 删除医保诊断
- const deleteYbDiag = index => {
- ybDiags.value.splice(index, 1);
- };
- // 保存医保诊断
- const saveYbDiags = () => {
- const param = {
- bah: props.patientInfo.inpatientNo,
- times: props.patientInfo.admissTimes,
- ybDiags: ybDiags.value,
- };
- doSaveYbDiags(param).then(() => {
- xcMessage.success("保存成功");
- });
- };
- // 同步病案诊断到医保诊断
- const syncronizeWithSiDiagnose = code => {
- selectSiDiagByBaDiag(code).then(res => {
- ybDiag.code = res.code;
- ybDiag.name = res.name;
- ybDiag.cyzg = 0;
- ybDiag.siDiagType = 1;
- if (!ybDiags.value || ybDiags.value.length === 0) {
- fetchSsfz(
- res.code,
- props.patientInfo.inpatientNo,
- props.patientInfo.admissTimes
- ).then(res2 => {
- diseFamilyGrade.value = res2;
- });
- }
- });
- };
- // 监听搜索对话框状态
- watchEffect(() => {
- if (showSearch.value) {
- searchResults.value = [];
- setTimeout(() => {
- searchInput.value?.focus();
- }, 300);
- }
- });
- // ========== 医保诊断相关函数结束 ==========
- const queryYz = async (tableScrollTop = true) => {
- if (!props.patientInfo.inpatientNo) {
- BizException(ExceptionEnum.MESSAGE_ERROR, "请先选择患者");
- }
- try {
- yiZhuDataInit();
- yzMitt.emit("clearSelected");
- if (tableScrollTop) {
- yzMitt.emit("tableScroll", 0);
- }
- await jsQueryYzData();
- } catch (e) {}
- };
- const addYiZhuClick = () => {
- yzMitt.emit("toAddAnOrder");
- };
- let yzList = ref([]);
- let patientAllergenData = ref([]);
- const currentConfirmOrdersClick = async () => {
- if (!props.patientInfo.inpatientNo) {
- BizException(ExceptionEnum.MESSAGE_ERROR, "请先选择患者");
- }
- // console.log("patientInfo",props.patientInfo)
- // console.log("huanZheXinXi",huanZheXinXi)
- // 获取患者药品医嘱
- await getInfoRationalUseOfMedicine(
- props.patientInfo.inpatientNo,
- props.patientInfo.admissTimes
- )
- .then(res => {
- if (res && res.list && res.list.length > 0) {
- let resultList = res.list;
- let currentGroupNo = 0;
- resultList.forEach(item => {
- if (item.parentNo) {
- let groupParent = resultList.find(
- citem => citem.actOrderNo === item.parentNo
- );
- if (groupParent) {
- if (groupParent.group) {
- item.group = groupParent.group;
- } else {
- item.group = currentGroupNo;
- groupParent.group = currentGroupNo;
- }
- }
- currentGroupNo++;
- } else if (!item.group) {
- item.group = currentGroupNo;
- currentGroupNo++;
- }
- });
- console.log("resultList", resultList);
- yzList.value = resultList.map(item => ({
- id: item.id,
- code: item.orderCode,
- route: item.supplyCodeName,
- dose: item.dose,
- doseUnit: item.doseUnitName,
- freq: item.frequCode,
- unit: item.miniUnitName,
- repeat: item.frequCode ? (item.frequCode == "ONCE" ? "0" : "1") : "",
- startDateTime: item.startTime,
- group: item.group + "",
- }));
- console.log(yzList.value, "yzList");
- }
- })
- .catch(err => {
- console.log("err", err);
- BizException(ExceptionEnum.MESSAGE_ERROR, "网络错误!");
- });
- // 获取患者诊断
- let admissDigArr = props.patientInfo.admissDiag.split(",");
- let admissDigNameArr = props.patientInfo.admissDiagStr.split(",");
- let patientDiag = ref([]);
- for (let i = 0; i < admissDigArr.length; i++) {
- patientDiag.value.push({
- code: admissDigArr[i],
- name: admissDigNameArr[i],
- });
- }
- // 获取患者过敏史
- await getPatientAllergens(props.patientInfo.inpatientNo).then(res => {
- patientAllergenData.value = res;
- console.log("patientAllergenData", patientAllergenData.value);
- });
- // console.log("yiZhuData",yiZhuData);
- let params = {
- station: {
- type: "1", //门诊2 住院1,工作站类型
- },
- doctor: {
- code: userStore.codeRs, //医生编码
- name: userStore.name, //医生姓名
- deptCode: userStore.deptCode, //科室编码
- },
- patient: {
- id: props.patientInfo.inpatientNo,
- code: props.patientInfo.patNo,
- visitId: "",
- name: props.patientInfo.name,
- chargeType: props.patientInfo.medTypeName,
- sex: props.patientInfo.sexName,
- deptCode: props.patientInfo.smallDept,
- birthday: props.patientInfo.birthDate,
- height: "",
- weight: "",
- medconds: {
- diag: patientDiag,
- allergens: patientAllergenData.value,
- },
- },
- orders: yzList,
- };
- // console.log("userStore",userStore);
- // console.log("MLRKON_CLIENT",MLRKON_CLIENT)
- // console.log("MLRKON_CLIENT-params",params)
- // const getResult = (result) => {
- // console.log("result",result);
- // let {bSave} = result;
- // if(bSave){
- // props.confirmOrdersClick();
- // // xcMessage.error("合理用药未通过1");
- // } else {
- // xcMessage.error("合理用药未通过");
- // }
- // }
- // await MLRKON_CLIENT.doCall("srv_screen", JSON.stringify(params), { "api": false, "timeout": 10000}, getResult)
- props.confirmOrdersClick();
- // return
- };
- const mlrkonCallBack = data => {
- console.log("mlrkonCallBack", data);
- };
- /**
- * 确认医嘱
- */
- const confirmTheDoctorSOrderWithMedicineClick = () => {
- if (!props.patientInfo.inpatientNo) {
- BizException(ExceptionEnum.MESSAGE_ERROR, "请先选择患者");
- }
- confirmLoading.value = true;
- confirmTheDoctorSOrderWithMedicine(
- props.patientInfo.inpatientNo,
- props.patientInfo.admissTimes
- ).then(res => {
- if (res && res?.error) {
- errorMsgFunc.add(res.data);
- } else {
- queryYz();
- confirmLoading.value = false;
- }
- });
- };
- const deleteAnOrderByOrderNo = () => {
- yzMitt.emit("deleteAnOrderByOrderNo", yiZhuData.value);
- };
- /**
- * 点击批量删除数据
- */
- const batchDeleteOrdersClick = () => {
- emits("batchDeleteOrdersClick");
- };
- /**
- * 跳转到模板页面
- */
- const orderTemplateClick = () => {
- router.push({
- name: "orderTemplateMaintenance",
- });
- };
- /**
- * 选中复制的医嘱
- */
- const orderTemplateClickCopy = () => {
- let temp = clone(yzMitt.emit("getSelectedData"));
- if (listIsBlank(temp)) {
- xcMessage.error("请先选中医嘱。");
- return;
- }
- let dept = {
- code: huanZheXinXi.value.zkWard,
- name: huanZheXinXi.value.zkWardName,
- };
- router.push({
- name: "orderTemplateMaintenance",
- params: {
- data: JSON.stringify(temp),
- dept: JSON.stringify(dept),
- },
- });
- };
- /**
- * 批量停止时间
- */
- const clickToStopTheOrder = async () => {
- const tempData = yzMitt.emit("getSelectedData");
- tempData.forEach(item => {
- // 因为前端用的是浏览器自带的 所以要删除 T
- item.endTime = getFormatDatetime(item.endTimeTemp);
- });
- await CyMessageBox.confirm({
- message: `是否批量停止时间,${tempData.length}条`,
- });
- const param = {
- inpatientNo: huanZheXinXi.value.inpatientNo,
- admissTimes: huanZheXinXi.value.admissTimes,
- list: tempData,
- };
- stopOrder(param)
- .then(() => {
- yzMitt.emit("queryYz");
- yzMitt.emit("getTableRef")?.clearCheckboxRow();
- })
- .catch(e => {
- const tmp = {};
- for (const key in e.data) {
- tmp[key] = { error: [e.data[key]] };
- }
- errorMsgFunc.add(tmp);
- });
- };
- // 点击修改医嘱时间
- const clickToModifyTheDoctorSOrderTime = () => {
- router.push({
- name: "yzActOrderModify",
- query: {
- patNo: huanZheXinXi.value.inpatientNo,
- },
- });
- };
- // 跳转到病案首页
- const jumpToMedicalRecord = () => {
- router.push({
- name: "fillCaseFrontSheet",
- query: {
- patNo: huanZheXinXi.value.inpatientNo,
- deptCode: huanZheXinXi.value.smallDept,
- },
- });
- };
- // 合理用药
- const openRationalDrugUse = () => {
- window.open("http://130.150.161.153:8080");
- };
- function openNewNutrientPlus() {
- if (youWuXuanZheHuanZhe()) return;
- window.open(
- `http://172.16.32.159/sysmgrApi/sysmgr/staff/hisToLogin?account=${userStore.codeRs}&patientHospitalNumber=${huanZheXinXi.value.inpatientNo}`
- );
- }
- /**
- * 血糖
- */
- const routerBloodSugarClick = () => {
- router.push({
- name: "bloodSugarQuery",
- params: {
- patNo: huanZheXinXi.value.inpatientNo,
- times: huanZheXinXi.value.admissTimes,
- },
- });
- };
- // 点击确认关联
- const confirmAssociationClick = () => {
- if (associateOrders.value.actOrderNo === null) {
- BizException(ExceptionEnum.MESSAGE_ERROR, "请先选择需要关联的父医嘱");
- }
- if (associateOrders.value.associatedGroup.length === 0) {
- BizException(ExceptionEnum.MESSAGE_ERROR, "至少选择一个子医嘱");
- }
- ElMessageBox.confirm("请确认是否要关联这些医嘱。", "提示", {
- type: "warning",
- })
- .then(() => {
- associateOrdersApi(associateOrders.value).then(async res => {
- clearAssociate();
- await setOrderDataAndTwinkle(res[0].actOrderNo, res);
- });
- })
- .catch(() => {});
- };
- const crbOpen = () => {
- if (youWuXuanZheHuanZhe()) return;
- useDialog(ReportOfInfectiousDiseases, {
- params: {
- patNo: huanZheXinXi.value.inpatientNo,
- times: huanZheXinXi.value.admissTimes,
- },
- dialogProps: {
- title: "传染病上报",
- fullscreen: true,
- },
- confirmText: "保存",
- });
- };
- const outPatientDialog = ref(false);
- const outPatientDialogOpen = () => {
- if (stringIsBlank(huanZheXinXi.value.zkWard)) {
- BizException(ExceptionEnum.LOGICAL_ERROR, "请先选择患者。");
- }
- if (stringIsBlank(huanZheXinXi.value.mzNo)) {
- BizException(
- ExceptionEnum.LOGICAL_ERROR,
- "没有查询到患者门诊号,请先建档。"
- );
- }
- outPatientDialog.value = true;
- };
- const oneClickStopDialog = ref(false);
- const oneClickStopOpen = () => {
- if (youWuXuanZheHuanZhe()) return;
- oneClickStopDialog.value = true;
- };
- const rcvrcalcost = async () => {
- if (youWuXuanZheHuanZhe()) return;
- let { inpatientNo, admissTimes, ledgerSn, admissDate } = huanZheXinXi.value;
- await receiveAndRecalculateCost({
- inpatientNo,
- admissTimes,
- ledgerSn,
- admissDate,
- });
- huanZheXinXi.value = await getPatientInfo(inpatientNo);
- };
- const GraphicsTempalte = defineAsyncComponent(
- () => import("@/components/medical-advice/temperature/GraphicsTempalte")
- );
- function openSanCeDan() {
- if (youWuXuanZheHuanZhe()) return;
- const { inpatientNo, admissTimes } = huanZheXinXi.value;
- useDialog(GraphicsTempalte, {
- dialogProps: { title: "三测单", fullscreen: true },
- params: {
- patientInfo: {
- inpatientNo,
- admissTimes,
- },
- },
- }).catch(XEUtils.noop);
- }
- const EmrYzTemperature = defineAsyncComponent(
- () =>
- import(
- "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrYzTemperature.vue"
- )
- );
- function nursingRecordForm() {
- if (youWuXuanZheHuanZhe()) return;
- const { inpatientNo, admissTimes } = huanZheXinXi.value;
- useDialog(EmrYzTemperature, {
- dialogProps: {
- title: "护理记录单",
- fullscreen: true,
- },
- params: {
- patNo: inpatientNo,
- times: admissTimes,
- },
- });
- }
- onMounted(async () => {
- yzMitt.on("queryYz", val => {
- return queryYz(val);
- });
- yzMitt.on("confirmMedicalAdvice", () => {
- if (isCydy()) {
- confirmTheDoctorSOrderWithMedicineClick();
- } else {
- currentConfirmOrdersClick();
- }
- });
- });
- </script>
- <style scoped lang="scss">
- .status_color {
- width: 10px;
- height: 10px;
- }
- </style>
|