EmrAuxiliaryTools.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. <template>
  2. <el-popover :width="0">
  3. <template #reference>
  4. <el-button>
  5. 辅助工具
  6. </el-button>
  7. </template>
  8. <template #default>
  9. <template v-for="(value , key) in drawerRange">
  10. <el-divider>
  11. {{ key }}
  12. </el-divider>
  13. <div class="div_container">
  14. <div v-for="item in value" @click="handelClick(item)">
  15. {{ item.name }}
  16. </div>
  17. </div>
  18. </template>
  19. </template>
  20. </el-popover>
  21. <el-drawer
  22. v-model="drawer"
  23. direction="btt"
  24. append-to-body
  25. @opened="handleDrawerOpened"
  26. modal-class="change_padding"
  27. @closed="currentComp = ''"
  28. destroy-on-close
  29. size="100%"
  30. :with-header="false">
  31. <el-button class="close_but"
  32. type="danger"
  33. :style="{zIndex: zIndex}"
  34. icon="Close"
  35. @click="drawer =false">
  36. 关闭
  37. </el-button>
  38. <Component :is="currentComp"/>
  39. </el-drawer>
  40. </template>
  41. <script setup lang="ts">
  42. import EmrOrderList from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrOrderList.vue";
  43. import {onMounted, ref, h, computed} from 'vue'
  44. import EmrYzTemperature from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrYzTemperature.vue";
  45. import {patInfo} from './emr-tools-store'
  46. import EmrInspect from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrInspect.vue";
  47. import {getServerDateApi} from "@/api/public-api";
  48. import {formatDate} from "@/utils/date";
  49. import InspectionReportIndex from "@/views/examination/InspectionReportIndex.vue";
  50. import EmrGroupConsultation from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrGroupConsultation.vue";
  51. import EmrOperation from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrOperation.vue";
  52. import EmrHerbs from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrHerbs.vue";
  53. import {
  54. emrMitt
  55. } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
  56. import {xcMessage} from "@/utils/xiaochan-element-plus";
  57. import EmrElectrocardiogram from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrElectrocardiogram.vue";
  58. import PimsWebView from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/PimsWebView.vue";
  59. import FluorescenceTest
  60. from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/fluorescence-test/FluorescenceTest.vue";
  61. import EmrTestV2 from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrTestV2/EmrTestV2.vue";
  62. import {useZIndex} from "element-plus";
  63. import {openPatientImage} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
  64. import BloodSugar from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/BloodSugar.vue";
  65. import NreTable from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/NreTable.vue";
  66. const props = defineProps({
  67. patInfo: {
  68. type: Object
  69. },
  70. emrData: {
  71. type: Object
  72. }
  73. })
  74. const emits = defineEmits(['toFillInData'])
  75. const end = ref('')
  76. const start = ref('')
  77. const drawer = ref(false)
  78. const toFillInData = (data) => {
  79. emits('toFillInData', data)
  80. }
  81. const index = ref(-1)
  82. const open = (val) => {
  83. localStorage.removeItem('clipBoardData');
  84. drawer.value = true
  85. index.value = val
  86. }
  87. const close = () => {
  88. drawer.value = false
  89. index.value = -1
  90. }
  91. let emrChannel = new BroadcastChannel('emrChannel')
  92. const emrChannelClick = (name) => {
  93. let str = {
  94. name,
  95. data: props.patInfo
  96. }
  97. let patInfoStr = JSON.stringify(str)
  98. if (emrMitt.emit('患者病区判断')) {
  99. emrChannel.postMessage(patInfoStr)
  100. } else {
  101. xcMessage.error('当前患者不存在您的病区,无法进行该操作。')
  102. }
  103. }
  104. const zIndex = ref(useZIndex().nextZIndex())
  105. const handleDrawerOpened = () => {
  106. zIndex.value = useZIndex().nextZIndex()
  107. }
  108. function openWindow() {
  109. openPatientImage(patInfo.value.inpatientNo)
  110. }
  111. const propsPatientInfo = computed(() => {
  112. return {
  113. patNo: patInfo.value.inpatientNo,
  114. times: patInfo.value.admissTimes,
  115. onClose: close
  116. }
  117. })
  118. const drawerRange: {
  119. [key: string]: {
  120. name: string,
  121. comp?: () => any,
  122. click?: () => any
  123. }[]
  124. } = {
  125. "查询": [
  126. {
  127. name: '检验',
  128. comp: () => {
  129. return h(InspectionReportIndex, {...propsPatientInfo.value, start: start.value, end: end.value})
  130. }
  131. },
  132. {
  133. name: '病理',
  134. comp: () => {
  135. return h(PimsWebView, {...propsPatientInfo.value})
  136. }
  137. }, {
  138. name: '荧光',
  139. comp: () => {
  140. return h('div', {style: {width: '100%', height: '100%'}},
  141. h(FluorescenceTest, {
  142. ...propsPatientInfo.value,
  143. showCopy: true
  144. }))
  145. }
  146. }, {
  147. name: '影像',
  148. click: () => {
  149. openWindow()
  150. }
  151. }, {
  152. name: '草药',
  153. comp: () => {
  154. return h(EmrHerbs, {...propsPatientInfo.value})
  155. }
  156. }, {
  157. name: '心电',
  158. comp: () => {
  159. return h(EmrElectrocardiogram, {...propsPatientInfo.value})
  160. }
  161. },
  162. // {
  163. // name: '血糖',
  164. // comp: () => {
  165. // return h(BloodSugarQuery, {...propsPatientInfo.value})
  166. // }
  167. // },
  168. {
  169. name: '血糖',
  170. comp: () => {
  171. return h(BloodSugar, {...propsPatientInfo.value})
  172. }
  173. }, {
  174. name: '麻醉',
  175. comp: () => {
  176. return h('iframe', {
  177. class: 'iframe_max_border0',
  178. src: `http://172.16.32.181/interface/patient/doc.html?admissionNum=${propsPatientInfo.value.patNo}&admissionTimes=${propsPatientInfo.value.times}`
  179. })
  180. }
  181. }
  182. ,
  183. {
  184. name: '护理',
  185. comp: () => {
  186. return h('iframe', {
  187. class: 'iframe_max_border0',
  188. src: `http://172.16.32.181/interface/patient/doc.html?admissionNum=${propsPatientInfo.value.patNo}&admissionTimes=${propsPatientInfo.value.times}`
  189. })
  190. }
  191. }
  192. ],
  193. "引用": [
  194. {
  195. name: '医嘱',
  196. comp: () => {
  197. return h(EmrOrderList, {...propsPatientInfo.value})
  198. }
  199. },
  200. {
  201. name: '检查',
  202. comp: () => {
  203. return h(EmrInspect, {...propsPatientInfo.value})
  204. }
  205. }, {
  206. name: '检验',
  207. comp: () => {
  208. return h(EmrTestV2, {...propsPatientInfo.value, isEmr: true})
  209. }
  210. },
  211. {
  212. name: '护理',
  213. comp: () => h(EmrYzTemperature, {...propsPatientInfo.value})
  214. },
  215. {
  216. name: '会诊',
  217. comp: () => h(EmrGroupConsultation, {...propsPatientInfo.value})
  218. },
  219. {
  220. name: '手术',
  221. comp: () => h(EmrOperation, {...propsPatientInfo.value, onToFillInData: toFillInData})
  222. },
  223. {
  224. name: '营养',
  225. comp: () => h(NreTable, {
  226. ...propsPatientInfo.value,
  227. defaultValue: [start.value, end.value],
  228. quote: (data) => {
  229. emrMitt.emit('dataSourcePadding', data)
  230. close()
  231. }
  232. })
  233. }
  234. ],
  235. }
  236. function handelClick(item) {
  237. if (item.click) {
  238. item.click()
  239. } else {
  240. setComp(item.comp)
  241. }
  242. }
  243. const currentComp = ref('')
  244. const setComp = (comp) => {
  245. currentComp.value = comp
  246. drawer.value = true
  247. }
  248. onMounted(async () => {
  249. patInfo.value = props.patInfo
  250. start.value = formatDate(props.patInfo.admissDate)
  251. end.value = formatDate(await getServerDateApi())
  252. emrMitt.on('openTools', (val) => {
  253. open(val)
  254. })
  255. })
  256. </script>
  257. <style lang="scss">
  258. .change_padding {
  259. .el-drawer__body {
  260. padding: 5px !important;
  261. }
  262. }
  263. .close_but {
  264. position: absolute;
  265. top: 0.13rem;
  266. right: 0.07rem;
  267. }
  268. .div_container {
  269. display: grid;
  270. grid-template-columns: 1fr 1fr 1fr 1fr;
  271. grid-gap: 10px;
  272. width: max-content;
  273. div {
  274. width: 50px;
  275. border: 1px solid #000;
  276. border-radius: 5px;
  277. line-height: 30px;
  278. text-align: center;
  279. user-select: none;
  280. cursor: pointer;
  281. }
  282. }
  283. </style>