YzQueryCondition.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239
  1. <template>
  2. <div>
  3. <div>
  4. <CyDateRange v-model="queryParam" clearable />
  5. <el-button
  6. @click="queryYz"
  7. v-title="
  8. '医嘱过多导致查看医嘱困难,可选择时间范围来减少医嘱的条数,默认查询今天到90天前的数据,可通过选择日期后面的删除按钮,取消时间范围的查询'
  9. "
  10. >
  11. 查询
  12. </el-button>
  13. <el-divider direction="vertical" />
  14. <label>
  15. 显示范围:
  16. <select v-model="queryParam.displayRange" v-title="'显示范围'">
  17. <option :value="0" title="全部的医嘱">全部</option>
  18. <option :value="1" title="已经停止的医嘱">停止</option>
  19. <option :value="2" title="正在执行的长期医嘱">当前</option>
  20. <option :value="3" title="今天开的医嘱">今天</option>
  21. </select>
  22. </label>
  23. <label>
  24. 状态:
  25. <select v-model.number="queryParam.zhuangTai" v-title="`医嘱的状态`">
  26. <option :value="0">全部</option>
  27. <option :value="1">录入</option>
  28. <option :value="2">确认</option>
  29. <option :value="3">执行</option>
  30. <option :value="5">停止</option>
  31. </select>
  32. </label>
  33. <label>
  34. 药房:
  35. <YfGrouo
  36. v-model="queryParam.groupNo"
  37. style="width: 90px"
  38. v-title="'在新增医嘱的时候,去指定的药房查询药品。'"
  39. />
  40. </label>
  41. <label>
  42. 排序:
  43. <select v-model="queryParam.sort" @change="setYzOrderGroup">
  44. <option :value="OrderBy.asc">正序</option>
  45. <option :value="OrderBy.desc">反序</option>
  46. </select>
  47. </label>
  48. <el-divider direction="vertical" />
  49. <el-button-group>
  50. <el-button
  51. type="primary"
  52. @click="addYiZhuClick"
  53. v-title="'添加医嘱,快捷键 ALT+A'"
  54. >
  55. 添加
  56. </el-button>
  57. <el-button
  58. type="success"
  59. :loading="confirmLoading"
  60. @click="currentConfirmOrdersClick"
  61. v-title="'把录入状态的医嘱,变为确认状态。'"
  62. v-if="!isCydy()"
  63. >
  64. 确认
  65. </el-button>
  66. <el-button
  67. type="success"
  68. @click="confirmTheDoctorSOrderWithMedicineClick"
  69. v-else
  70. v-title="'把录入状态的医嘱,变为确认状态。'"
  71. >
  72. 确认带药
  73. </el-button>
  74. </el-button-group>
  75. <el-divider direction="vertical" />
  76. <el-dropdown
  77. split-button
  78. type="danger"
  79. @click="deleteAnOrderByOrderNo"
  80. v-title="
  81. '在表格中选中了一条医嘱后这个方法才能有效果,(这个医嘱需要在工作台显示),也可以在点击表格后面的删按钮<br /><span style=\'color:#fffe00\'>限制:</span>只能删除自己开的,只能删除(录入、确认)状态的医嘱。'
  82. "
  83. >
  84. 删除
  85. <template #dropdown>
  86. <el-dropdown-menu>
  87. <div
  88. v-title="
  89. '在表格中,点击前面的选择框,选中医嘱(多条或单挑),才能点击此按钮,限制:只能删除自己开的,只能删除(录入、确认)状态的医嘱。'
  90. "
  91. >
  92. <el-dropdown-item @click="batchDeleteOrdersClick">
  93. 批量删除
  94. </el-dropdown-item>
  95. </div>
  96. </el-dropdown-menu>
  97. </template>
  98. </el-dropdown>
  99. <el-divider direction="vertical" />
  100. <el-dropdown
  101. split-button
  102. @click="yzMitt.emit('clickOnTheOrderTemplate')"
  103. v-title="'获取医嘱的模板'"
  104. >
  105. 模板
  106. <template #dropdown>
  107. <el-dropdown-menu>
  108. <div v-title="'维护自己创建的模板'">
  109. <el-dropdown-item @click="orderTemplateClick">
  110. 维护模板
  111. </el-dropdown-item>
  112. </div>
  113. <div v-title="'选中表格中的医嘱作为模板'">
  114. <el-dropdown-item @click="orderTemplateClickCopy">
  115. 选中医嘱做模板
  116. </el-dropdown-item>
  117. </div>
  118. </el-dropdown-menu>
  119. </template>
  120. </el-dropdown>
  121. </div>
  122. <div style="border-top: 1px solid #000; margin: 5px 0" />
  123. <div>
  124. <el-dropdown
  125. split-button
  126. @click="clickToStopTheOrder"
  127. v-title="
  128. '批量停止医嘱,需要结束时间一栏的日期数据框变成红色则代表,是要停止这条医嘱。<br />' +
  129. '双击日期输入框,默认填充停止到当前时间,并选中医嘱,可点击输入框中的日历,去选择其他时间。<br />' +
  130. '鼠标右键数据框,可以取消停止。'
  131. "
  132. >
  133. 停止医嘱
  134. <template #dropdown>
  135. <el-dropdown-menu>
  136. <div v-title="'跳转到这个患者,修改医嘱时间的申请页面。'">
  137. <el-dropdown-item @click="clickToModifyTheDoctorSOrderTime">
  138. 修改医嘱时间
  139. </el-dropdown-item>
  140. </div>
  141. </el-dropdown-menu>
  142. </template>
  143. </el-dropdown>
  144. <el-dropdown split-button v-title="'跳转到指定患者的数据页面'">
  145. 页面跳转
  146. <template #dropdown>
  147. <el-dropdown-menu>
  148. <el-dropdown-item @click="jumpToMedicalRecord">
  149. 病案首页
  150. </el-dropdown-item>
  151. <el-dropdown-item @click="openRationalDrugUse">
  152. 合理用药
  153. </el-dropdown-item>
  154. <el-dropdown-item @click="routerBloodSugarClick">
  155. 血糖
  156. </el-dropdown-item>
  157. <el-dropdown-item @click="openNewNutrientPlus">
  158. 营养评估
  159. </el-dropdown-item>
  160. </el-dropdown-menu>
  161. </template>
  162. </el-dropdown>
  163. <el-dropdown
  164. split-button
  165. v-title="'设置选中医嘱成组。'"
  166. @click="confirmAssociationClick"
  167. >
  168. 关联
  169. <template #dropdown>
  170. <el-dropdown-menu>
  171. <el-dropdown-item @click="clearAssociate()"
  172. >取消关联
  173. </el-dropdown-item>
  174. </el-dropdown-menu>
  175. </template>
  176. </el-dropdown>
  177. <el-dropdown v-title="'患者数据维护,包含传染病、过敏源。'" split-button>
  178. 数据维护
  179. <template #dropdown>
  180. <el-dropdown-menu>
  181. <el-dropdown-item @click="yzMitt.emit('allergen')">
  182. 过敏源维护
  183. </el-dropdown-item>
  184. <el-dropdown-item @click="crbOpen"> 传染病上报</el-dropdown-item>
  185. <el-dropdown-item
  186. @click="
  187. router.push(
  188. `/outpatient/chronicDisease/chronicDiseaseRegister/${props.patientInfo.inpatientNo}`
  189. )
  190. "
  191. >
  192. 慢病登记
  193. </el-dropdown-item>
  194. </el-dropdown-menu>
  195. </template>
  196. </el-dropdown>
  197. <el-dropdown
  198. v-title="'工作台操作,录入、清空、医嘱弹窗、复制粘贴'"
  199. @click="yzMitt.emit('toAddAnOrder')"
  200. split-button
  201. >
  202. 录入医嘱
  203. <template #dropdown>
  204. <el-dropdown-menu>
  205. <div v-title="'清空,正在编辑的医嘱或者选中的医嘱。'">
  206. <el-dropdown-item @click="yzMitt.emit('emptyTheWorkbench')">
  207. 清空工作台
  208. </el-dropdown-item>
  209. </div>
  210. <div
  211. v-title="
  212. '打开医嘱弹窗,目前只有转科、抗菌药物信息、处置医嘱可以打开弹窗。'
  213. "
  214. >
  215. <el-dropdown-item @click="yzMitt.emit('openTheOrderPopUpWindow')">
  216. 医嘱弹窗
  217. </el-dropdown-item>
  218. </div>
  219. <div
  220. v-title="
  221. '复制并粘贴医嘱,如果想要分开,请在表格中鼠标右键一个医嘱,选择复制,然后在到表格中,选择粘贴医嘱。<br /><br />' +
  222. '<span style=\'color:#fffe00\'>注意:</span>如果你是在临时医嘱页面,那么长期医嘱会改为 ONCE 频率,如果在长期医嘱页面那么临时医嘱会改为 QD 频率,如果是成组的医嘱' +
  223. '复制父医嘱即可子医嘱会自动复制,目前不会提供批量复制医嘱的功能。'
  224. "
  225. >
  226. <el-dropdown-item @click="yzMitt.emit('duplicateAndPaste')">
  227. 复制并粘贴
  228. </el-dropdown-item>
  229. </div>
  230. <div
  231. v-title="
  232. '<span style=\'color:#fffe00\'>带有实验性质的功能,如果此方法出错频率高,后期可能会删除。</span>' +
  233. '<br />复制选中的医嘱并粘贴。'
  234. "
  235. >
  236. <el-dropdown-item @click="openCopyDialog">
  237. 复制选中的医嘱
  238. </el-dropdown-item>
  239. </div>
  240. </el-dropdown-menu>
  241. </template>
  242. </el-dropdown>
  243. <el-dropdown title="其他操作" split-button>
  244. 其他
  245. <template #dropdown>
  246. <el-dropdown-menu>
  247. <div
  248. v-title="
  249. '为即将出院的患者预约门诊,如果患者没有门诊号的话,需要先创建一个门诊号。'
  250. "
  251. >
  252. <el-dropdown-item @click="outPatientDialogOpen()">
  253. 门诊预约
  254. </el-dropdown-item>
  255. </div>
  256. <div
  257. v-title="
  258. '一键停止正在执行的医嘱,会生成一条医嘱,此医嘱是口头医嘱,有没任何效果。'
  259. "
  260. >
  261. <el-dropdown-item @click="oneClickStopOpen">
  262. 一键停止
  263. </el-dropdown-item>
  264. </div>
  265. <el-dropdown-item @click="clickTimeLimitReminder">
  266. 时限提示
  267. </el-dropdown-item>
  268. <el-dropdown-item @click="openSanCeDan"> 三测单</el-dropdown-item>
  269. <el-dropdown-item @click="nursingRecordForm">
  270. 护理记录单
  271. </el-dropdown-item>
  272. </el-dropdown-menu>
  273. </template>
  274. </el-dropdown>
  275. <el-button
  276. type="success"
  277. icon="RefreshRight"
  278. @click="rcvrcalcost"
  279. v-title="
  280. '如果患者费用存在问题或者有些费用看不到,<br />可以执行此操作。'
  281. "
  282. >
  283. 费用接收重算
  284. </el-button>
  285. <el-button
  286. type="primary"
  287. icon="Edit"
  288. @click="openYbDiag"
  289. v-title="'医保诊断录入'"
  290. >
  291. 出院诊断
  292. </el-button>
  293. </div>
  294. </div>
  295. <!-- 医保诊断对话框 -->
  296. <el-dialog
  297. v-model="showYbDiag"
  298. title="医保出院诊断"
  299. width="70%"
  300. top="30px"
  301. draggable
  302. >
  303. <div
  304. style="
  305. width: 100%;
  306. height: 30px;
  307. line-height: 30px;
  308. background: rgb(252, 160, 23);
  309. margin-bottom: 8px;
  310. border-radius: 8px;
  311. padding-left: 8px;
  312. color: white;
  313. "
  314. >
  315. <strong>主要诊断病种分值:{{ diseFamilyGrade }}</strong>
  316. </div>
  317. <el-tag type="info">医保诊断录入</el-tag>
  318. <el-tag style="margin-left: 12px"
  319. >患者:{{ props.patientInfo?.name }}</el-tag
  320. >
  321. <el-tag style="margin-left: 8px"
  322. >医疗类别:{{ props.patientInfo?.medTypeName }}
  323. </el-tag>
  324. <el-tag style="margin-left: 8px"
  325. >险种类型:{{ props.patientInfo?.insutype }}</el-tag
  326. >
  327. <div style="height: 5px"></div>
  328. <el-input
  329. v-model="ybDiag.name"
  330. placeholder="在此搜索诊断"
  331. readonly
  332. style="width: 160px"
  333. @click="showSearchData('ybDiag')"
  334. ></el-input>
  335. <el-input
  336. placeholder="诊断编码"
  337. disabled
  338. style="width: 100px"
  339. v-model="ybDiag.code"
  340. ></el-input>
  341. <el-select
  342. v-model="ybDiag.siDiagType"
  343. style="width: 100px"
  344. placeholder="诊断类别"
  345. >
  346. <el-option
  347. v-for="item in diagTypes"
  348. :key="item.code"
  349. :value="item.code"
  350. :label="item.name"
  351. ></el-option>
  352. </el-select>
  353. <el-select
  354. v-model="ybDiag.admissCond"
  355. style="width: 100px"
  356. placeholder="入院病情"
  357. >
  358. <el-option
  359. v-for="item in admissConds"
  360. :key="item.code"
  361. :value="item.code"
  362. :label="item.name"
  363. ></el-option>
  364. </el-select>
  365. <el-select
  366. v-model="ybDiag.cyzg"
  367. style="width: 120px"
  368. placeholder="出院转归"
  369. >
  370. <el-option
  371. v-for="item in cyzgs"
  372. :key="item.code"
  373. :value="item.code"
  374. :label="item.name"
  375. ></el-option>
  376. </el-select>
  377. <el-divider direction="vertical"></el-divider>
  378. <el-button type="primary" icon="Plus" @click="addToYbDiags">添加</el-button>
  379. <el-button type="success" icon="Upload" @click="saveYbDiags"
  380. >保存
  381. </el-button>
  382. <el-table :data="ybDiags" stripe :height="200">
  383. <el-table-column type="index" label="序号" width="45"></el-table-column>
  384. <el-table-column prop="code" label="诊断编码"></el-table-column>
  385. <el-table-column prop="name" label="诊断名称"></el-table-column>
  386. <el-table-column
  387. prop="siDiagType"
  388. label="诊断类别"
  389. width="80"
  390. ></el-table-column>
  391. <el-table-column
  392. prop="admissCond"
  393. label="入院病情"
  394. width="80"
  395. ></el-table-column>
  396. <el-table-column
  397. prop="cyzg"
  398. label="出院转归"
  399. width="80"
  400. ></el-table-column>
  401. <el-table-column
  402. prop="operId"
  403. label="录入人"
  404. width="70"
  405. ></el-table-column>
  406. <el-table-column prop="opDate" label="录入日期"></el-table-column>
  407. <el-table-column label="操作">
  408. <template #default="scope">
  409. <el-button
  410. type="danger"
  411. icon="Delete"
  412. @click="deleteYbDiag(scope.$index)"
  413. >删除
  414. </el-button>
  415. </template>
  416. </el-table-column>
  417. </el-table>
  418. <!-- <div style="height: 12px"></div>
  419. <el-tag type="info">病案首页诊断信息</el-tag>
  420. <el-table :data="filterDisDiagList" stripe :height="200">
  421. <el-table-column type="index" label="序号" width="45"></el-table-column>
  422. <el-table-column prop="code" label="诊断编码"></el-table-column>
  423. <el-table-column prop="name" label="诊断名称"></el-table-column>
  424. <el-table-column label="出院病情">
  425. <template #default="scope">
  426. {{ filterDismissStatus(scope.row.dismissStatus) }}
  427. </template>
  428. </el-table-column>
  429. <el-table-column label="操作">
  430. <template #default="scope">
  431. <el-button
  432. icon="Link"
  433. title="添加到医保诊断"
  434. circle
  435. @click="syncronizeWithSiDiagnose(scope.row.code)"
  436. ></el-button>
  437. </template>
  438. </el-table-column>
  439. </el-table> -->
  440. </el-dialog>
  441. <!-- 诊断搜索对话框 -->
  442. <el-dialog v-model="showSearch" title="数据搜索" width="730px" draggable>
  443. 检索依据:
  444. <el-select v-model="searchMethod" style="width: 100px">
  445. <el-option
  446. v-for="item in searchMethods"
  447. :key="item.code"
  448. :label="item.name"
  449. :value="item.code"
  450. ></el-option>
  451. </el-select>
  452. &nbsp;&nbsp;&nbsp;&nbsp; 搜索内容:
  453. <el-input
  454. ref="searchInput"
  455. v-model="searchContent"
  456. prefix-icon="Search"
  457. placeholder="请输入搜索内容"
  458. style="width: 160px"
  459. clearable
  460. @input="executeSearch"
  461. ></el-input>
  462. <el-table
  463. :data="searchResults"
  464. height="400"
  465. stripe
  466. highlight-current-row
  467. @row-click="handleSelectSearch"
  468. >
  469. <el-table-column prop="code" label="编码" width="130"></el-table-column>
  470. <el-table-column prop="name" label="名称"></el-table-column>
  471. </el-table>
  472. <div style="margin-top: 15px; width: 100%; text-align: right">
  473. <el-button
  474. type="primary"
  475. icon="ArrowLeft"
  476. @click="lastPage"
  477. :disabled="currentSRPage === 1"
  478. >
  479. 上一页
  480. </el-button>
  481. <el-button
  482. type="primary"
  483. icon="ArrowRight"
  484. @click="nextPage"
  485. :disabled="currentSRPage > 1 && searchResults.length < 10"
  486. >
  487. 下一页
  488. </el-button>
  489. </div>
  490. </el-dialog>
  491. <!-- 门诊预约 -->
  492. <OutpatientAppointments
  493. v-if="outPatientDialog"
  494. @closed="outPatientDialog = false"
  495. />
  496. <one-click-stop
  497. v-if="oneClickStopDialog"
  498. @closed="oneClickStopDialog = false"
  499. />
  500. <CopyTableDataOrder v-model="copyTableDialog" v-if="copyTableDialog" />
  501. </template>
  502. <script setup lang="jsx">
  503. import { MLRKON_CLIENT } from "@/api/heliyongyao/mlrkon.js";
  504. import {
  505. associateOrdersApi,
  506. confirmTheDoctorSOrderWithMedicine,
  507. stopOrder,
  508. } from "@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
  509. import {
  510. associateOrders,
  511. clearAssociate,
  512. clickTimeLimitReminder,
  513. confirmLoading,
  514. errorMsgFunc,
  515. huanZheXinXi,
  516. isCydy,
  517. jsQueryYzData,
  518. OrderBy,
  519. queryParam,
  520. setOrderDataAndTwinkle,
  521. setYzOrderGroup,
  522. yiZhuData,
  523. yiZhuDataInit,
  524. youWuXuanZheHuanZhe,
  525. yzMitt,
  526. } from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
  527. import { BizException, ExceptionEnum } from "@/utils/BizException";
  528. import router from "@/router";
  529. import { clone } from "@/utils/clone";
  530. import { listIsBlank, stringIsBlank } from "@/utils/blank-utils";
  531. import { xcMessage } from "@/utils/xiaochan-element-plus";
  532. import { getFormatDatetime } from "@/utils/date";
  533. import { ElMessageBox } from "element-plus";
  534. import ReportOfInfectiousDiseases from "@/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/report-of-infectious-diseases/ReportOfInfectiousDiseases.vue";
  535. import OutpatientAppointments from "@/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/components/OutpatientAppointments.vue";
  536. import OneClickStop from "@/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/components/OneClickStop.vue";
  537. import {
  538. getPatientInfo,
  539. receiveAndRecalculateCost,
  540. } from "@/api/inpatient/patient";
  541. import CopyTableDataOrder from "@/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/components/table/CopyTableDataOrder.vue";
  542. import { CyMessageBox } from "@/utils/cy-message-box";
  543. import { useUserStore } from "@/pinia/user-store";
  544. import CyDateRange from "@/components/cy/date-range/CyDateRange.vue";
  545. import { useDialog } from "@/components/cy/CyDialog/index";
  546. import XEUtils from "xe-utils";
  547. import { useYfGroupStore } from "@/pinia/use-yf-group";
  548. import {
  549. rationalUseOfMedicine,
  550. getInfoRationalUseOfMedicine,
  551. } from "@/api/heliyongyao/rational-use";
  552. import { getPatientAllergens } from "@/api/public-api";
  553. import {
  554. doSaveYbDiags,
  555. fetchSsfz,
  556. getYbDiags,
  557. selectSiDiagByBaDiag,
  558. sheetSearch,
  559. } from "@/api/case-front-sheet";
  560. import { getDisDiag } from "@/api/inpatient/patient";
  561. import { getDatetime } from "@/utils/date";
  562. import { watchEffect } from "vue";
  563. import YfGrouo from "@/components/cy/yf-group/YfGrouo.vue";
  564. const props = defineProps({
  565. patientInfo: {
  566. type: Object,
  567. },
  568. returnData: {
  569. type: Function,
  570. },
  571. frequCodeChange: Function,
  572. confirmOrdersClick: Function,
  573. clickOnTheOrderTemplate: Function,
  574. });
  575. const userStore = useUserStore().userInfo;
  576. const emits = defineEmits(["batchDeleteOrdersClick"]);
  577. const copyTableDialog = ref(false);
  578. const openCopyDialog = () => {
  579. if (youWuXuanZheHuanZhe()) return;
  580. copyTableDialog.value = true;
  581. };
  582. // ========== 医保诊断相关变量和函数 ==========
  583. const showYbDiag = ref(false);
  584. const diseFamilyGrade = ref(null);
  585. const ybDiag = reactive({});
  586. const ybDiags = ref([]);
  587. const showSearch = ref(false);
  588. const searchInput = ref(null);
  589. const searchMethod = ref("alpha");
  590. const searchContent = ref("");
  591. const searchResults = ref([]);
  592. const currentSRPage = ref(1);
  593. const searchUrl = ref("");
  594. const searchTargetCode = ref("");
  595. const filterDisDiagList = ref([]);
  596. // 出院转归选项
  597. const cyzgs = [
  598. { code: 0, name: "好转/治愈" },
  599. { code: 1, name: "未愈" },
  600. { code: 2, name: "转院(医院要求)" },
  601. { code: 3, name: "转院(病人要求)" },
  602. { code: 4, name: "转科" },
  603. { code: 5, name: "无效" },
  604. { code: 6, name: "死亡" },
  605. { code: 7, name: "双向转诊" },
  606. { code: 9, name: "其他" },
  607. ];
  608. // 入院病情选项
  609. const admissConds = [
  610. { code: 1, name: "有" },
  611. { code: 2, name: "临床未确定" },
  612. { code: 3, name: "情况不明" },
  613. { code: 4, name: "无" },
  614. ];
  615. // 诊断类别选项
  616. const diagTypes = [
  617. { code: 1, name: "西医诊断" },
  618. { code: 2, name: "中医主病诊断" },
  619. { code: 3, name: "中医主症诊断" },
  620. ];
  621. // 搜索方式选项
  622. const searchMethods = [
  623. { code: "alpha", name: "首字母" },
  624. { code: "name", name: "名称" },
  625. { code: "code", name: "编码" },
  626. ];
  627. // 过滤出院病情状态
  628. const filterDismissStatus = status => {
  629. const statusMap = {
  630. 1: "治愈",
  631. 2: "好转",
  632. 3: "未愈",
  633. 4: "死亡",
  634. 9: "其他",
  635. };
  636. return statusMap[status] || "";
  637. };
  638. // 打开医保诊断对话框
  639. const openYbDiag = () => {
  640. if (!props.patientInfo?.inpatientNo) {
  641. xcMessage.error("请先选择患者!");
  642. return;
  643. }
  644. if (!props.patientInfo?.medType) {
  645. xcMessage.error("该病人没选择医疗类别,请先去医保入院登记页面填写医疗类别!");
  646. return;
  647. }
  648. // 获取医保诊断列表
  649. getYbDiags(props.patientInfo.inpatientNo, props.patientInfo.admissTimes).then(
  650. res => {
  651. ybDiags.value = res;
  652. showYbDiag.value = true;
  653. }
  654. );
  655. // 获取病案诊断信息
  656. //getDisDiag(props.patientInfo.inpatientNo, props.patientInfo.admissTimes).then(res => {
  657. // filterDisDiagList.value = res.filter(item => item.code && item.name);
  658. // });
  659. };
  660. // 显示搜索对话框
  661. const showSearchData = flag => {
  662. searchUrl.value = "diag";
  663. searchTargetCode.value = "ybDiagCode";
  664. showSearch.value = true;
  665. setTimeout(() => {
  666. searchInput.value?.focus();
  667. }, 300);
  668. };
  669. // 执行搜索
  670. const executeSearch = () => {
  671. if (searchContent.value.length < 2) return;
  672. currentSRPage.value = 1;
  673. fetchSearchData();
  674. };
  675. // 获取搜索数据
  676. const fetchSearchData = () => {
  677. const param = {
  678. patNo: props.patientInfo.inpatientNo,
  679. times: props.patientInfo.admissTimes,
  680. method: searchMethod.value,
  681. target: searchUrl.value,
  682. content: searchContent.value,
  683. medType: props.patientInfo.medType,
  684. page: currentSRPage.value,
  685. };
  686. sheetSearch(param).then(res => {
  687. searchResults.value = res;
  688. });
  689. };
  690. // 上一页
  691. const lastPage = () => {
  692. currentSRPage.value--;
  693. fetchSearchData();
  694. };
  695. // 下一页
  696. const nextPage = () => {
  697. currentSRPage.value++;
  698. fetchSearchData();
  699. };
  700. // 处理搜索选择
  701. const handleSelectSearch = item => {
  702. if (searchTargetCode.value === "ybDiagCode") {
  703. ybDiag.code = item.code;
  704. ybDiag.name = item.name;
  705. ybDiag.cyzg = 0;
  706. ybDiag.siDiagType = 1;
  707. if (!ybDiags.value || ybDiags.value.length === 0) {
  708. fetchSsfz(
  709. item.code,
  710. props.patientInfo.inpatientNo,
  711. props.patientInfo.admissTimes
  712. ).then(res => {
  713. diseFamilyGrade.value = res;
  714. });
  715. }
  716. }
  717. searchContent.value = "";
  718. showSearch.value = false;
  719. };
  720. // 添加到医保诊断列表
  721. const addToYbDiags = () => {
  722. if (!ybDiag.siDiagType) {
  723. xcMessage.error("请选择诊断类别!");
  724. return;
  725. }
  726. if (!ybDiag.admissCond) {
  727. xcMessage.error("请选择入院病情!");
  728. return;
  729. }
  730. const temp = clone(ybDiag);
  731. temp.diagType = 13;
  732. temp.operId = userStore.code;
  733. temp.opDate = getDatetime();
  734. temp.bzfx = "普通";
  735. ybDiags.value.push(temp);
  736. ybDiag.code = ybDiag.name = ybDiag.cyzg = "";
  737. };
  738. // 删除医保诊断
  739. const deleteYbDiag = index => {
  740. ybDiags.value.splice(index, 1);
  741. };
  742. // 保存医保诊断
  743. const saveYbDiags = () => {
  744. const param = {
  745. bah: props.patientInfo.inpatientNo,
  746. times: props.patientInfo.admissTimes,
  747. ybDiags: ybDiags.value,
  748. };
  749. doSaveYbDiags(param).then(() => {
  750. xcMessage.success("保存成功");
  751. });
  752. };
  753. // 同步病案诊断到医保诊断
  754. const syncronizeWithSiDiagnose = code => {
  755. selectSiDiagByBaDiag(code).then(res => {
  756. ybDiag.code = res.code;
  757. ybDiag.name = res.name;
  758. ybDiag.cyzg = 0;
  759. ybDiag.siDiagType = 1;
  760. if (!ybDiags.value || ybDiags.value.length === 0) {
  761. fetchSsfz(
  762. res.code,
  763. props.patientInfo.inpatientNo,
  764. props.patientInfo.admissTimes
  765. ).then(res2 => {
  766. diseFamilyGrade.value = res2;
  767. });
  768. }
  769. });
  770. };
  771. // 监听搜索对话框状态
  772. watchEffect(() => {
  773. if (showSearch.value) {
  774. searchResults.value = [];
  775. setTimeout(() => {
  776. searchInput.value?.focus();
  777. }, 300);
  778. }
  779. });
  780. // ========== 医保诊断相关函数结束 ==========
  781. const queryYz = async (tableScrollTop = true) => {
  782. if (!props.patientInfo.inpatientNo) {
  783. BizException(ExceptionEnum.MESSAGE_ERROR, "请先选择患者");
  784. }
  785. try {
  786. yiZhuDataInit();
  787. yzMitt.emit("clearSelected");
  788. if (tableScrollTop) {
  789. yzMitt.emit("tableScroll", 0);
  790. }
  791. await jsQueryYzData();
  792. } catch (e) {}
  793. };
  794. const addYiZhuClick = () => {
  795. yzMitt.emit("toAddAnOrder");
  796. };
  797. let yzList = ref([]);
  798. let patientAllergenData = ref([]);
  799. const currentConfirmOrdersClick = async () => {
  800. if (!props.patientInfo.inpatientNo) {
  801. BizException(ExceptionEnum.MESSAGE_ERROR, "请先选择患者");
  802. }
  803. // console.log("patientInfo",props.patientInfo)
  804. // console.log("huanZheXinXi",huanZheXinXi)
  805. // 获取患者药品医嘱
  806. await getInfoRationalUseOfMedicine(
  807. props.patientInfo.inpatientNo,
  808. props.patientInfo.admissTimes
  809. )
  810. .then(res => {
  811. if (res && res.list && res.list.length > 0) {
  812. let resultList = res.list;
  813. let currentGroupNo = 0;
  814. resultList.forEach(item => {
  815. if (item.parentNo) {
  816. let groupParent = resultList.find(
  817. citem => citem.actOrderNo === item.parentNo
  818. );
  819. if (groupParent) {
  820. if (groupParent.group) {
  821. item.group = groupParent.group;
  822. } else {
  823. item.group = currentGroupNo;
  824. groupParent.group = currentGroupNo;
  825. }
  826. }
  827. currentGroupNo++;
  828. } else if (!item.group) {
  829. item.group = currentGroupNo;
  830. currentGroupNo++;
  831. }
  832. });
  833. console.log("resultList", resultList);
  834. yzList.value = resultList.map(item => ({
  835. id: item.id,
  836. code: item.orderCode,
  837. route: item.supplyCodeName,
  838. dose: item.dose,
  839. doseUnit: item.doseUnitName,
  840. freq: item.frequCode,
  841. unit: item.miniUnitName,
  842. repeat: item.frequCode ? (item.frequCode == "ONCE" ? "0" : "1") : "",
  843. startDateTime: item.startTime,
  844. group: item.group + "",
  845. }));
  846. console.log(yzList.value, "yzList");
  847. }
  848. })
  849. .catch(err => {
  850. console.log("err", err);
  851. BizException(ExceptionEnum.MESSAGE_ERROR, "网络错误!");
  852. });
  853. // 获取患者诊断
  854. let admissDigArr = props.patientInfo.admissDiag.split(",");
  855. let admissDigNameArr = props.patientInfo.admissDiagStr.split(",");
  856. let patientDiag = ref([]);
  857. for (let i = 0; i < admissDigArr.length; i++) {
  858. patientDiag.value.push({
  859. code: admissDigArr[i],
  860. name: admissDigNameArr[i],
  861. });
  862. }
  863. // 获取患者过敏史
  864. await getPatientAllergens(props.patientInfo.inpatientNo).then(res => {
  865. patientAllergenData.value = res;
  866. console.log("patientAllergenData", patientAllergenData.value);
  867. });
  868. // console.log("yiZhuData",yiZhuData);
  869. let params = {
  870. station: {
  871. type: "1", //门诊2 住院1,工作站类型
  872. },
  873. doctor: {
  874. code: userStore.codeRs, //医生编码
  875. name: userStore.name, //医生姓名
  876. deptCode: userStore.deptCode, //科室编码
  877. },
  878. patient: {
  879. id: props.patientInfo.inpatientNo,
  880. code: props.patientInfo.patNo,
  881. visitId: "",
  882. name: props.patientInfo.name,
  883. chargeType: props.patientInfo.medTypeName,
  884. sex: props.patientInfo.sexName,
  885. deptCode: props.patientInfo.smallDept,
  886. birthday: props.patientInfo.birthDate,
  887. height: "",
  888. weight: "",
  889. medconds: {
  890. diag: patientDiag,
  891. allergens: patientAllergenData.value,
  892. },
  893. },
  894. orders: yzList,
  895. };
  896. // console.log("userStore",userStore);
  897. // console.log("MLRKON_CLIENT",MLRKON_CLIENT)
  898. // console.log("MLRKON_CLIENT-params",params)
  899. // const getResult = (result) => {
  900. // console.log("result",result);
  901. // let {bSave} = result;
  902. // if(bSave){
  903. // props.confirmOrdersClick();
  904. // // xcMessage.error("合理用药未通过1");
  905. // } else {
  906. // xcMessage.error("合理用药未通过");
  907. // }
  908. // }
  909. // await MLRKON_CLIENT.doCall("srv_screen", JSON.stringify(params), { "api": false, "timeout": 10000}, getResult)
  910. props.confirmOrdersClick();
  911. // return
  912. };
  913. const mlrkonCallBack = data => {
  914. console.log("mlrkonCallBack", data);
  915. };
  916. /**
  917. * 确认医嘱
  918. */
  919. const confirmTheDoctorSOrderWithMedicineClick = () => {
  920. if (!props.patientInfo.inpatientNo) {
  921. BizException(ExceptionEnum.MESSAGE_ERROR, "请先选择患者");
  922. }
  923. confirmLoading.value = true;
  924. confirmTheDoctorSOrderWithMedicine(
  925. props.patientInfo.inpatientNo,
  926. props.patientInfo.admissTimes
  927. ).then(res => {
  928. if (res && res?.error) {
  929. errorMsgFunc.add(res.data);
  930. } else {
  931. queryYz();
  932. confirmLoading.value = false;
  933. }
  934. });
  935. };
  936. const deleteAnOrderByOrderNo = () => {
  937. yzMitt.emit("deleteAnOrderByOrderNo", yiZhuData.value);
  938. };
  939. /**
  940. * 点击批量删除数据
  941. */
  942. const batchDeleteOrdersClick = () => {
  943. emits("batchDeleteOrdersClick");
  944. };
  945. /**
  946. * 跳转到模板页面
  947. */
  948. const orderTemplateClick = () => {
  949. router.push({
  950. name: "orderTemplateMaintenance",
  951. });
  952. };
  953. /**
  954. * 选中复制的医嘱
  955. */
  956. const orderTemplateClickCopy = () => {
  957. let temp = clone(yzMitt.emit("getSelectedData"));
  958. if (listIsBlank(temp)) {
  959. xcMessage.error("请先选中医嘱。");
  960. return;
  961. }
  962. let dept = {
  963. code: huanZheXinXi.value.zkWard,
  964. name: huanZheXinXi.value.zkWardName,
  965. };
  966. router.push({
  967. name: "orderTemplateMaintenance",
  968. params: {
  969. data: JSON.stringify(temp),
  970. dept: JSON.stringify(dept),
  971. },
  972. });
  973. };
  974. /**
  975. * 批量停止时间
  976. */
  977. const clickToStopTheOrder = async () => {
  978. const tempData = yzMitt.emit("getSelectedData");
  979. tempData.forEach(item => {
  980. // 因为前端用的是浏览器自带的 所以要删除 T
  981. item.endTime = getFormatDatetime(item.endTimeTemp);
  982. });
  983. await CyMessageBox.confirm({
  984. message: `是否批量停止时间,${tempData.length}条`,
  985. });
  986. const param = {
  987. inpatientNo: huanZheXinXi.value.inpatientNo,
  988. admissTimes: huanZheXinXi.value.admissTimes,
  989. list: tempData,
  990. };
  991. stopOrder(param)
  992. .then(() => {
  993. yzMitt.emit("queryYz");
  994. yzMitt.emit("getTableRef")?.clearCheckboxRow();
  995. })
  996. .catch(e => {
  997. const tmp = {};
  998. for (const key in e.data) {
  999. tmp[key] = { error: [e.data[key]] };
  1000. }
  1001. errorMsgFunc.add(tmp);
  1002. });
  1003. };
  1004. // 点击修改医嘱时间
  1005. const clickToModifyTheDoctorSOrderTime = () => {
  1006. router.push({
  1007. name: "yzActOrderModify",
  1008. query: {
  1009. patNo: huanZheXinXi.value.inpatientNo,
  1010. },
  1011. });
  1012. };
  1013. // 跳转到病案首页
  1014. const jumpToMedicalRecord = () => {
  1015. router.push({
  1016. name: "fillCaseFrontSheet",
  1017. query: {
  1018. patNo: huanZheXinXi.value.inpatientNo,
  1019. deptCode: huanZheXinXi.value.smallDept,
  1020. },
  1021. });
  1022. };
  1023. // 合理用药
  1024. const openRationalDrugUse = () => {
  1025. window.open("http://130.150.161.153:8080");
  1026. };
  1027. function openNewNutrientPlus() {
  1028. if (youWuXuanZheHuanZhe()) return;
  1029. window.open(
  1030. `http://172.16.32.159/sysmgrApi/sysmgr/staff/hisToLogin?account=${userStore.codeRs}&patientHospitalNumber=${huanZheXinXi.value.inpatientNo}`
  1031. );
  1032. }
  1033. /**
  1034. * 血糖
  1035. */
  1036. const routerBloodSugarClick = () => {
  1037. router.push({
  1038. name: "bloodSugarQuery",
  1039. params: {
  1040. patNo: huanZheXinXi.value.inpatientNo,
  1041. times: huanZheXinXi.value.admissTimes,
  1042. },
  1043. });
  1044. };
  1045. // 点击确认关联
  1046. const confirmAssociationClick = () => {
  1047. if (associateOrders.value.actOrderNo === null) {
  1048. BizException(ExceptionEnum.MESSAGE_ERROR, "请先选择需要关联的父医嘱");
  1049. }
  1050. if (associateOrders.value.associatedGroup.length === 0) {
  1051. BizException(ExceptionEnum.MESSAGE_ERROR, "至少选择一个子医嘱");
  1052. }
  1053. ElMessageBox.confirm("请确认是否要关联这些医嘱。", "提示", {
  1054. type: "warning",
  1055. })
  1056. .then(() => {
  1057. associateOrdersApi(associateOrders.value).then(async res => {
  1058. clearAssociate();
  1059. await setOrderDataAndTwinkle(res[0].actOrderNo, res);
  1060. });
  1061. })
  1062. .catch(() => {});
  1063. };
  1064. const crbOpen = () => {
  1065. if (youWuXuanZheHuanZhe()) return;
  1066. useDialog(ReportOfInfectiousDiseases, {
  1067. params: {
  1068. patNo: huanZheXinXi.value.inpatientNo,
  1069. times: huanZheXinXi.value.admissTimes,
  1070. },
  1071. dialogProps: {
  1072. title: "传染病上报",
  1073. fullscreen: true,
  1074. },
  1075. confirmText: "保存",
  1076. });
  1077. };
  1078. const outPatientDialog = ref(false);
  1079. const outPatientDialogOpen = () => {
  1080. if (stringIsBlank(huanZheXinXi.value.zkWard)) {
  1081. BizException(ExceptionEnum.LOGICAL_ERROR, "请先选择患者。");
  1082. }
  1083. if (stringIsBlank(huanZheXinXi.value.mzNo)) {
  1084. BizException(
  1085. ExceptionEnum.LOGICAL_ERROR,
  1086. "没有查询到患者门诊号,请先建档。"
  1087. );
  1088. }
  1089. outPatientDialog.value = true;
  1090. };
  1091. const oneClickStopDialog = ref(false);
  1092. const oneClickStopOpen = () => {
  1093. if (youWuXuanZheHuanZhe()) return;
  1094. oneClickStopDialog.value = true;
  1095. };
  1096. const rcvrcalcost = async () => {
  1097. if (youWuXuanZheHuanZhe()) return;
  1098. let { inpatientNo, admissTimes, ledgerSn, admissDate } = huanZheXinXi.value;
  1099. await receiveAndRecalculateCost({
  1100. inpatientNo,
  1101. admissTimes,
  1102. ledgerSn,
  1103. admissDate,
  1104. });
  1105. huanZheXinXi.value = await getPatientInfo(inpatientNo);
  1106. };
  1107. const GraphicsTempalte = defineAsyncComponent(
  1108. () => import("@/components/medical-advice/temperature/GraphicsTempalte")
  1109. );
  1110. function openSanCeDan() {
  1111. if (youWuXuanZheHuanZhe()) return;
  1112. const { inpatientNo, admissTimes } = huanZheXinXi.value;
  1113. useDialog(GraphicsTempalte, {
  1114. dialogProps: { title: "三测单", fullscreen: true },
  1115. params: {
  1116. patientInfo: {
  1117. inpatientNo,
  1118. admissTimes,
  1119. },
  1120. },
  1121. }).catch(XEUtils.noop);
  1122. }
  1123. const EmrYzTemperature = defineAsyncComponent(
  1124. () =>
  1125. import(
  1126. "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrYzTemperature.vue"
  1127. )
  1128. );
  1129. function nursingRecordForm() {
  1130. if (youWuXuanZheHuanZhe()) return;
  1131. const { inpatientNo, admissTimes } = huanZheXinXi.value;
  1132. useDialog(EmrYzTemperature, {
  1133. dialogProps: {
  1134. title: "护理记录单",
  1135. fullscreen: true,
  1136. },
  1137. params: {
  1138. patNo: inpatientNo,
  1139. times: admissTimes,
  1140. },
  1141. });
  1142. }
  1143. onMounted(async () => {
  1144. yzMitt.on("queryYz", val => {
  1145. return queryYz(val);
  1146. });
  1147. yzMitt.on("confirmMedicalAdvice", () => {
  1148. if (isCydy()) {
  1149. confirmTheDoctorSOrderWithMedicineClick();
  1150. } else {
  1151. currentConfirmOrdersClick();
  1152. }
  1153. });
  1154. });
  1155. </script>
  1156. <style scoped lang="scss">
  1157. .status_color {
  1158. width: 10px;
  1159. height: 10px;
  1160. }
  1161. </style>