PatientSidebar.vue 18KB

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