PatientSidebar.vue 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  1. <template>
  2. <div>
  3. <div class="patient-menu">
  4. <el-autocomplete
  5. style="margin:16px 5px"
  6. popper-class="my-autocomplete"
  7. v-model.trim="value"
  8. :fetch-suggestions="querySearchAsync"
  9. :trigger-on-focus="false"
  10. placeholder="病人名字或者透析号"
  11. @select="handleSelect"
  12. >
  13. <i class="el-icon-search el-input__icon" slot="suffix"> </i>
  14. <template slot-scope="{ item }">
  15. <div class="name">{{ item.name }}</div>
  16. </template>
  17. </el-autocomplete>
  18. <el-select
  19. v-model="selectID"
  20. style="margin:0 5px 0px 5px;text-align: center;"
  21. @change="changePatient"
  22. placeholder="请选择"
  23. >
  24. <el-option
  25. v-for="item in patientsList"
  26. :key="item.id"
  27. :label="item.name"
  28. :value="item.id"
  29. >
  30. </el-option>
  31. </el-select>
  32. <el-tree
  33. :data="treeData"
  34. accordion
  35. node-key="name"
  36. :key="treeKey"
  37. :current-node-key="treeKey"
  38. :default-expanded-keys="[defaultActive]"
  39. @node-click="handleNodeClick"
  40. >
  41. </el-tree>
  42. </div>
  43. <div class="patient-app-container " :style="{width:(treeKey=='3-3')?'100vw':''}">
  44. <span class="patient-name"
  45. >姓名:{{ currentPatient.name }} &nbsp;&nbsp; 性别:{{
  46. tranSex(currentPatient.gender)
  47. }}
  48. &nbsp;&nbsp; 年龄:
  49. <span v-if="getAge(currentPatient)>200">
  50. {{ currentPatient.age }}
  51. </span>
  52. <span v-else>
  53. {{ getAge(currentPatient) }}
  54. </span>
  55. &nbsp;&nbsp; 透析号:{{
  56. currentPatient.dialysis_no
  57. }}
  58. </span>
  59. </div>
  60. </div>
  61. </template>
  62. <script>
  63. import { fetchAllList, PostSearch } from '@/api/patient'
  64. import { jsGetAge, uParseTime } from '@/utils/tools'
  65. export default {
  66. name: 'patientSidebar',
  67. value: '',
  68. searchArray: [],
  69. props: {
  70. id: 0,
  71. defaultActive: {
  72. type: String,
  73. default: '1-1'
  74. }
  75. },
  76. data() {
  77. return {
  78. thedefaultActive: 1,
  79. patientsList: [],
  80. currentPatient: {},
  81. selectID: 0,
  82. keyword: '',
  83. value: '',
  84. treeKey: '',
  85. org_id:0,
  86. treeData: [
  87. {
  88. name: '1',
  89. label: '电子病历',
  90. children: [
  91. {
  92. name: '1-1',
  93. label: '基本信息'
  94. },
  95. {
  96. name: '1-4',
  97. label: '医嘱管理'
  98. },
  99. {
  100. name: '1-6',
  101. label: '干体重'
  102. },
  103. {
  104. name:'1-7',
  105. label:'血管通路'
  106. },
  107. // {
  108. // name: '1-2',
  109. // label: '病程管理'
  110. // },
  111. // {
  112. // name: '1-9',
  113. // label: '阶段小结'
  114. // },
  115. // {
  116. // name: '1-10',
  117. // label: '出院小结'
  118. // },
  119. // {
  120. // name: '1-3',
  121. // label: '检验检查'
  122. // },
  123. // {
  124. // name:'1-8',
  125. // label:'传染病管理'
  126. // },
  127. // {
  128. // name: '1-5',
  129. // label: '抢救记录'
  130. // },
  131. // {
  132. // name: '1-11',
  133. // label: '首次病程记录'
  134. // }
  135. ]
  136. },
  137. {
  138. name: '2',
  139. label: '透析管理',
  140. children: [
  141. {
  142. name: '2-1',
  143. label: '长期透析处方'
  144. },
  145. {
  146. name: '2-2',
  147. label: '透析记录'
  148. },
  149. {
  150. name: '2-4',
  151. label: '排班信息'
  152. },
  153. {
  154. name: '2-5',
  155. label: '宣教信息'
  156. }
  157. ]
  158. },
  159. {
  160. name: '3',
  161. label: '病情记录',
  162. children: [
  163. {
  164. name: '3-1',
  165. label: '病史'
  166. },
  167. // {
  168. // name: '3-4',
  169. // label: '病史新'
  170. // },
  171. {
  172. name: '3-2',
  173. label: '体格检查'
  174. },
  175. // {
  176. // name: '3-3',
  177. // label: '体格检查新'
  178. // },
  179. {
  180. name: '3-5',
  181. label: '病程记录新'
  182. },
  183. {
  184. name: '1-11',
  185. label: '首次病程记录'
  186. },
  187. {
  188. name: '1-2',
  189. label: '病程记录'
  190. }, {
  191. name: '1-5',
  192. label: '抢救记录'
  193. }, {
  194. name: '1-9',
  195. label: '阶段小结'
  196. }, {
  197. name: '1-10',
  198. label: '出院小结'
  199. },
  200. ]
  201. },
  202. {
  203. name: '4',
  204. label: '检验检查',
  205. children: [
  206. {
  207. name: '1-3',
  208. label: '肾科检验'
  209. },
  210. {
  211. name: '4-2',
  212. label: '肾科检验新'
  213. },
  214. // {
  215. // name: '4-12',
  216. // label: '新版肾科检验'
  217. // },
  218. {
  219. name: '4-1',
  220. label: '肾科检查'
  221. },
  222. {
  223. name: '4-3',
  224. label: 'KT/V'
  225. },
  226. {
  227. name: '1-8',
  228. label: '传染病管理'
  229. },
  230. ]
  231. },
  232. {
  233. name: '5',
  234. label: '评估工具',
  235. children: [
  236. {
  237. name: '5-1',
  238. label: '跌倒评估'
  239. },
  240. {
  241. name: '5-2',
  242. label: '小儿跌倒风险评估'
  243. },
  244. {
  245. name: '5-3',
  246. label: '压疮风险评估'
  247. },
  248. {
  249. name: '5-4',
  250. label: 'OH压疮评估'
  251. },
  252. {
  253. name: '5-5',
  254. label: '日常生活能力评估'
  255. },
  256. {
  257. name: '5-6',
  258. label: '导管脱落风险评估'
  259. },
  260. {
  261. name: '5-7',
  262. label: 'RASS及疼痛评估'
  263. },
  264. {
  265. name: '5-8',
  266. label: '营养状况评估'
  267. },
  268. // {
  269. // name: '5-9',
  270. // label: '约束告知单'
  271. // },
  272. {
  273. name: '5-10',
  274. label: '心理评估'
  275. },
  276. {
  277. name: '5-11',
  278. label: '瘙痒评估'
  279. },
  280. {
  281. name: '5-12',
  282. label: '血液透析患者评估'
  283. },
  284. {
  285. name: '5-13',
  286. label: 'Glasgow昏迷评分量表'
  287. },
  288. {
  289. name: '5-14',
  290. label: '肌力评估表'
  291. },
  292. ]
  293. },
  294. {
  295. name: '6',
  296. label: '文书管理',
  297. children: [
  298. {
  299. name: '6-1',
  300. label: '知情同意书'
  301. },
  302. ]
  303. },
  304. {
  305. name: '7',
  306. label: '转归记录',
  307. },
  308. {
  309. name: '8',
  310. label: '死亡记录',
  311. },
  312. ],
  313. name:""
  314. }
  315. },
  316. methods: {
  317. handleNodeClick(data) {
  318. var name = data.name
  319. this.name = data.name
  320. window.sessionStorage.setItem('patientKey',data.name)
  321. if (name == '1-1') {
  322. this.$router.push({ path: '/patients/patient/' + this.id })
  323. } else if (name == '1-2') {
  324. this.$router.push({ path: '/patients/course?id=' + this.id })
  325. } else if (name == '1-3') {
  326. this.$router.push({ path: '/patients/inspection?id=' + this.id,query:{patient:this.currentPatient}})
  327. } else if (name == '1-4') {
  328. this.$router.push({
  329. path: '/patients/patient/' + this.id + '/doctorAdvice'
  330. })
  331. } else if (name == '1-6') {
  332. this.$router.push({
  333. path: '/patients/patient/' + this.id + '/dryWeight'
  334. })
  335. } else if (name == '1-5') {
  336. this.$router.push({ path: '/patients/rescue?id=' + this.id })
  337. } else if (name == '2-1') {
  338. this.$router.push({
  339. path: '/patients/patient/' + this.id + '/dialysisSolution'
  340. })
  341. } else if (name == '2-2') {
  342. this.$router.push({
  343. path: '/patients/patient/' + this.id + '/dialysisRecord'
  344. })
  345. } else if (name == '2-4') {
  346. this.$router.push({
  347. path: '/patients/patient/' + this.id + '/scheduling'
  348. })
  349. } else if (name == '2-5') {
  350. this.$router.push({
  351. path: '/patients/patient/' + this.id + '/proeducation'
  352. })
  353. } else if (name == '1-7'){
  354. this.$router.push({path:'/patients/patient/'+this.id+'/vascularAccess'})
  355. } else if (name == '1-8'){
  356. this.$router.push({path:'/patients/patients/'+this.id+'/inspectionInfectious'})
  357. } else if (name == '1-9'){
  358. this.$router.push({path:'/patient/patient/'+this.id+'/templateSummary'})
  359. } else if(name == '1-10'){
  360. this.$router.push({path:'/patient/patient/'+this.id+'/hospitalSummary'})
  361. } else if(name == '1-11'){
  362. this.$router.push({path:'/patient/patient/'+this.id+'/firstDisease'})
  363. } else if(name == '3-1'){
  364. this.$router.push({ path: '/patients/sickhistory?id=' + this.id })
  365. } else if(name == '3-2'){
  366. this.$router.push({path:'/patients/physicalexamination?id='+this.id})
  367. } else if(name == '3-3'){
  368. this.$router.push({path:'/patients/new_physicalexamination?id='+this.id})
  369. } else if(name == '3-4'){
  370. this.$router.push({ path: '/patients/sickHistory_new?id='+ this.id })
  371. } else if(name == '3-5'){
  372. this.$router.push({ path: '/patients/course_new?id='+ this.id })
  373. } else if(name == '4-1'){
  374. this.$router.push({path:'/patients/inspection_check?id='+this.id})
  375. } else if (name == '4-2') {
  376. this.$router.push({ path: '/patients/inspection_new?id=' + this.id })
  377. } else if(name == '4-3'){
  378. this.$router.push({path:'/patients/ktv?id='+this.id})
  379. }else if(name == '4-12'){
  380. this.$router.push({path:'/patients/newInspection?id='+this.id})
  381. }
  382. else if (name == '5-1') {
  383. this.$router.push({
  384. path: '/patients/patient/'+ this.id +'/Fallassessment'
  385. })
  386. } else if (name == '5-2') {
  387. this.$router.push({
  388. path: '/patients/patient/' + this.id + '/pediatricFallAssessment'
  389. })
  390. } else if (name == '5-3') {
  391. this.$router.push({
  392. path: '/patients/patient/' + this.id + '/pressuresore'
  393. })
  394. } else if (name == '5-4') {
  395. this.$router.push({
  396. path: '/patients/patient/' + this.id + '/OHpressuresore'
  397. })
  398. } else if (name == '5-5'){
  399. this.$router.push({path:'/patients/patient/'+this.id+'/dailyLife'})
  400. } else if (name == '5-6'){
  401. this.$router.push({path:'/patients/patient/'+this.id+'/Cathetershedding'})
  402. } else if (name == '5-7'){
  403. this.$router.push({path:'/patients/patient/'+this.id+'/RassAssessment'})
  404. } else if(name == '5-8'){
  405. this.$router.push({path:'/patients/patient/'+this.id+'/nourishmentAssessment'})
  406. } else if(name == '5-9'){
  407. this.$router.push({path:'/patients/patient/'+this.id+'/Constraintnotification'})
  408. } else if(name == '5-10'){
  409. this.$router.push({ path: '/patients/patient/' + this.id+'/mindAssessment'})
  410. } else if(name == '5-11'){
  411. this.$router.push({path:'/patients/patient/' + this.id+'/pruritusAssessment'})
  412. } else if(name == '5-12'){
  413. this.$router.push({path:'/patients/patient/' + this.id+'/hemodialysis'})
  414. } else if(name == '5-13'){
  415. this.$router.push({path:'/patients/patient/' + this.id+'/Glasgow'})
  416. } else if(name == '5-14'){
  417. this.$router.push({path:'/patients/patient/' + this.id+'/Muscleforce'})
  418. }else if(name == '6-1'){
  419. this.$router.push({path: '/patients/patient/' + this.id+ '/Informedconsent'})
  420. }else if(name == '7'){
  421. this.$router.push({path:'/patient/patient/'+this.id+'/lapsoSummary'})
  422. }else if(name == '8'){
  423. console.log("hhhhhhhhhhhhhhhhhhhhhhhhhhhhh")
  424. this.$router.push({path:'/patient/patient/'+this.id+'/deathSummary'})
  425. }
  426. },
  427. changePatient(value) {
  428. console.log(value)
  429. if(this.$route.path.indexOf('edit') > -1){
  430. this.$confirm('是否保存当前病历', '保存', {
  431. confirmButtonText: '确 定',
  432. cancelButtonText: '取 消',
  433. type: 'warning'
  434. }).then(() => {
  435. this.$emit('updateInfo')
  436. setTimeout(() => {
  437. this.$router.push('/patients/patient/' + value)
  438. },1000)
  439. }).catch(() => {
  440. this.$router.push('/patients/patient/' + value)
  441. })
  442. }else{
  443. this.$router.push('/patients/patient/' + value)
  444. }
  445. },
  446. getList() {
  447. fetchAllList().then(response => {
  448. if (response.data.state == 1) {
  449. if(this.org_id ==10191){
  450. var patients = response.data.data.patientsOne
  451. // console.log("patients",patients)
  452. for(let i=0;i<patients.length;i++){
  453. if(patients[i].lapseto ==1){
  454. this.patientsList.push(patients[i])
  455. }
  456. }
  457. }else{
  458. this.patientsList = response.data.data.patientsOne
  459. console.log("哈哈哈哈哈哈",this.patientsList)
  460. }
  461. var len = this.patientsList.length
  462. if (len > 0) {
  463. for (let index = 0; index < len; index++) {
  464. if (this.patientsList[index].id == this.id) {
  465. this.currentPatient = this.patientsList[index]
  466. // console.log("curr", this.currentPatient);
  467. this.selectID = this.patientsList[index].id
  468. this.$emit('tran-patient', this.currentPatient)
  469. break
  470. }
  471. }
  472. }
  473. }
  474. })
  475. },
  476. tranAge(birthday) {
  477. var birth = uParseTime(birthday, '{y}-{m}-{d}')
  478. return jsGetAge(birth, '-')
  479. },
  480. tranSex(gender) {
  481. var sex = '未知'
  482. switch (gender) {
  483. case 1:
  484. sex = '男'
  485. break
  486. case 2:
  487. sex = '女'
  488. break
  489. default:
  490. break
  491. }
  492. return sex
  493. },
  494. querySearchAsync(keyword, cb) {
  495. let key = ''
  496. if (keyword != undefined) {
  497. key = keyword
  498. }
  499. let searchArray = []
  500. PostSearch(key).then(response => {
  501. if (response.data.state == 1) {
  502. searchArray = response.data.data.patient
  503. cb(searchArray)
  504. } else {
  505. this.$message.error(response.data.msg)
  506. cb([])
  507. }
  508. })
  509. },
  510. handleSelect(val) {
  511. this.$router.push('/patients/patient/' + val.id)
  512. },
  513. getAge: function(val) {
  514. if (val.id_card_no == undefined) {
  515. return false
  516. }
  517. var thisLen = val.id_card_no.length
  518. var birth = ''
  519. if (thisLen == 15) {
  520. birth = '19' + val.id_card_no.substr(6, 6)
  521. } else {
  522. birth = val.id_card_no.substr(6, 8)
  523. }
  524. var birthtwo =
  525. birth.substr(0, 4) +
  526. '-' +
  527. birth.substr(4, 2) +
  528. '-' +
  529. birth.substr(6, 2)
  530. var age = jsGetAge(birthtwo, '-')
  531. return age
  532. }
  533. },
  534. created() {
  535. var patientKey = window.sessionStorage.getItem('patientKey')
  536. console.log("patient-----------------",patientKey)
  537. this.org_id = this.$store.getters.xt_user.template_info.org_id
  538. var query = this.$route.path
  539. console.log("query",this.$route.path)
  540. if(patientKey){
  541. this.treeKey = patientKey
  542. if(query.indexOf('edit') == -1){
  543. if (patientKey == '1-1') {
  544. this.$router.push({ path: '/patients/patient/' + this.id })
  545. } else if (patientKey == '1-2') {
  546. this.$router.push({ path: '/patients/course?id=' + this.id })
  547. } else if (patientKey == '1-3') {
  548. this.$router.push({ path: '/patients/inspection?id=' + this.id })
  549. } else if (patientKey == '1-4') {
  550. this.$router.push({
  551. path: '/patients/patient/' + this.id + '/doctorAdvice'
  552. })
  553. } else if (patientKey == '1-6') {
  554. this.$router.push({
  555. path: '/patients/patient/' + this.id + '/dryWeight'
  556. })
  557. }else if(patientKey == '1-11'){
  558. this.$router.push({path: '/patients/patient/' + this.id + '/firstDisease'})
  559. }else if (patientKey == '1-5') {
  560. this.$router.push({ path: '/patients/rescue?id=' + this.id })
  561. } else if (patientKey == '2-1') {
  562. this.$router.push({
  563. path: '/patients/patient/' + this.id + '/dialysisSolution'
  564. })
  565. } else if (patientKey == '2-2') {
  566. this.$router.push({
  567. path: '/patients/patient/' + this.id + '/dialysisRecord'
  568. })
  569. } else if (patientKey == '2-4') {
  570. this.$router.push({
  571. path: '/patients/patient/' + this.id + '/scheduling'
  572. })
  573. } else if (patientKey == '2-5') {
  574. this.$router.push({
  575. path: '/patients/patient/' + this.id + '/proeducation'
  576. })
  577. } else if (patientKey == '3-1') {
  578. this.$router.push({ path: '/patients/sickhistory?id=' + this.id })
  579. }else if(patientKey == '7'){
  580. this.$router.push({path:'/patient/patient/'+this.id+'/lapsoSummary'})
  581. }else if(patientKey == '8'){
  582. this.$router.push({path:'/patient/patient/'+this.id+'/deathSummary'})
  583. }else if(patientKey == '4-12'){
  584. this.$router.push({path:'/patients/newInspection?id='+this.id})
  585. }
  586. }else{
  587. this.treeKey = "1-1"
  588. }
  589. }else{
  590. this.treeKey = this.defaultActive
  591. }
  592. this.getList()
  593. },
  594. }
  595. </script>
  596. <style>
  597. .patient-menu .el-tree-node__content {
  598. font-size: 14px;
  599. height: 40px;
  600. font-weight: 400;
  601. }
  602. .patient-menu .el-tree-node__label:hover {
  603. color: #409eff;
  604. }
  605. .patient-menu .el-tree-node:focus > .el-tree-node__content {
  606. color: #409eff;
  607. }
  608. .patient-menu .el-tree-node .el-tree-node.is-current > .el-tree-node__content {
  609. color: #409eff;
  610. }
  611. .patient-menu .el-tree {
  612. background: #f6f8f9;
  613. }
  614. .patient-menu {
  615. -webkit-transition: width 0.28s;
  616. transition: width 0.28s;
  617. width: 180px !important;
  618. height: 100%;
  619. position: relative;
  620. font-size: 0px;
  621. top: 0;
  622. float: left;
  623. bottom: 0;
  624. left: 0;
  625. /* z-index: 99; */
  626. overflow: hidden;
  627. }
  628. .patient-center-menu .el-icon-arrow-down:before {
  629. content: "";
  630. }
  631. </style>