PatientSidebar.vue 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  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 ">
  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-2',
  162. label: '体格检查'
  163. },
  164. {
  165. name: '1-11',
  166. label: '首次病程记录'
  167. },
  168. {
  169. name: '1-2',
  170. label: '病程记录'
  171. }, {
  172. name: '1-5',
  173. label: '抢救记录'
  174. }, {
  175. name: '1-9',
  176. label: '阶段小结'
  177. }, {
  178. name: '1-10',
  179. label: '出院小结'
  180. },
  181. ]
  182. },
  183. {
  184. name: '4',
  185. label: '检验检查',
  186. children: [
  187. {
  188. name: '1-3',
  189. label: '肾科检验'
  190. },
  191. {
  192. name: '4-12',
  193. label: '新版肾科检验'
  194. },
  195. {
  196. name: '4-1',
  197. label: '肾科检查'
  198. },
  199. {
  200. name: '4-3',
  201. label: 'KT/V'
  202. },
  203. {
  204. name: '1-8',
  205. label: '传染病管理'
  206. },
  207. ]
  208. },
  209. {
  210. name: '5',
  211. label: '评估工具',
  212. children: [
  213. {
  214. name: '5-1',
  215. label: '跌倒评估'
  216. },
  217. {
  218. name: '5-2',
  219. label: '小儿跌倒风险评估'
  220. },
  221. {
  222. name: '5-3',
  223. label: '压疮风险评估'
  224. },
  225. {
  226. name: '5-4',
  227. label: 'OH压疮评估'
  228. },
  229. {
  230. name: '5-5',
  231. label: '日常生活能力评估'
  232. },
  233. {
  234. name: '5-6',
  235. label: '导管脱落风险评估'
  236. },
  237. {
  238. name: '5-7',
  239. label: 'RASS及疼痛评估'
  240. },
  241. {
  242. name: '5-8',
  243. label: '营养状况评估'
  244. },
  245. // {
  246. // name: '5-9',
  247. // label: '约束告知单'
  248. // },
  249. {
  250. name: '5-10',
  251. label: '心理评估'
  252. },
  253. {
  254. name: '5-11',
  255. label: '瘙痒评估'
  256. },
  257. {
  258. name: '5-12',
  259. label: '血液透析患者评估'
  260. },
  261. {
  262. name: '5-13',
  263. label: 'Glasgow昏迷评分量表'
  264. },
  265. {
  266. name: '5-14',
  267. label: '肌力评估表'
  268. },
  269. ]
  270. },
  271. {
  272. name: '6',
  273. label: '文书管理',
  274. children: [
  275. {
  276. name: '6-1',
  277. label: '知情同意书'
  278. },
  279. ]
  280. },
  281. {
  282. name: '7',
  283. label: '转归记录',
  284. },
  285. ],
  286. name:""
  287. }
  288. },
  289. methods: {
  290. handleNodeClick(data) {
  291. var name = data.name
  292. this.name = data.name
  293. window.sessionStorage.setItem('patientKey',data.name)
  294. if (name == '1-1') {
  295. this.$router.push({ path: '/patients/patient/' + this.id })
  296. } else if (name == '1-2') {
  297. this.$router.push({ path: '/patients/course?id=' + this.id })
  298. } else if (name == '1-3') {
  299. this.$router.push({ path: '/patients/inspection?id=' + this.id })
  300. } else if (name == '1-4') {
  301. this.$router.push({
  302. path: '/patients/patient/' + this.id + '/doctorAdvice'
  303. })
  304. } else if (name == '1-6') {
  305. this.$router.push({
  306. path: '/patients/patient/' + this.id + '/dryWeight'
  307. })
  308. } else if (name == '1-5') {
  309. this.$router.push({ path: '/patients/rescue?id=' + this.id })
  310. } else if (name == '2-1') {
  311. this.$router.push({
  312. path: '/patients/patient/' + this.id + '/dialysisSolution'
  313. })
  314. } else if (name == '2-2') {
  315. this.$router.push({
  316. path: '/patients/patient/' + this.id + '/dialysisRecord'
  317. })
  318. } else if (name == '2-4') {
  319. this.$router.push({
  320. path: '/patients/patient/' + this.id + '/scheduling'
  321. })
  322. } else if (name == '2-5') {
  323. this.$router.push({
  324. path: '/patients/patient/' + this.id + '/proeducation'
  325. })
  326. } else if (name == '1-7'){
  327. this.$router.push({path:'/patients/patient/'+this.id+'/vascularAccess'})
  328. } else if (name == '1-8'){
  329. this.$router.push({path:'/patients/patients/'+this.id+'/inspectionInfectious'})
  330. } else if (name == '1-9'){
  331. this.$router.push({path:'/patient/patient/'+this.id+'/templateSummary'})
  332. } else if(name == '1-10'){
  333. this.$router.push({path:'/patient/patient/'+this.id+'/hospitalSummary'})
  334. } else if(name == '1-11'){
  335. this.$router.push({path:'/patient/patient/'+this.id+'/firstDisease'})
  336. } else if(name == '3-1'){
  337. this.$router.push({ path: '/patients/sickhistory?id=' + this.id })
  338. } else if(name == '3-2'){
  339. this.$router.push({path:'/patients/physicalexamination?id='+this.id})
  340. } else if(name == '4-1'){
  341. this.$router.push({path:'/patients/inspection_check?id='+this.id})
  342. } else if(name == '4-3'){
  343. this.$router.push({path:'/patients/ktv?id='+this.id})
  344. }else if(name == '4-12'){
  345. this.$router.push({path:'/patients/newInspection?id='+this.id})
  346. }
  347. else if (name == '5-1') {
  348. this.$router.push({
  349. path: '/patients/patient/'+ this.id +'/Fallassessment'
  350. })
  351. } else if (name == '5-2') {
  352. this.$router.push({
  353. path: '/patients/patient/' + this.id + '/pediatricFallAssessment'
  354. })
  355. } else if (name == '5-3') {
  356. this.$router.push({
  357. path: '/patients/patient/' + this.id + '/pressuresore'
  358. })
  359. } else if (name == '5-4') {
  360. this.$router.push({
  361. path: '/patients/patient/' + this.id + '/OHpressuresore'
  362. })
  363. } else if (name == '5-5'){
  364. this.$router.push({path:'/patients/patient/'+this.id+'/dailyLife'})
  365. } else if (name == '5-6'){
  366. this.$router.push({path:'/patients/patient/'+this.id+'/Cathetershedding'})
  367. } else if (name == '5-7'){
  368. this.$router.push({path:'/patients/patient/'+this.id+'/RassAssessment'})
  369. } else if(name == '5-8'){
  370. this.$router.push({path:'/patients/patient/'+this.id+'/nourishmentAssessment'})
  371. } else if(name == '5-9'){
  372. this.$router.push({path:'/patients/patient/'+this.id+'/Constraintnotification'})
  373. } else if(name == '5-10'){
  374. this.$router.push({ path: '/patients/patient/' + this.id+'/mindAssessment'})
  375. } else if(name == '5-11'){
  376. this.$router.push({path:'/patients/patient/' + this.id+'/pruritusAssessment'})
  377. } else if(name == '5-12'){
  378. this.$router.push({path:'/patients/patient/' + this.id+'/hemodialysis'})
  379. } else if(name == '5-13'){
  380. this.$router.push({path:'/patients/patient/' + this.id+'/Glasgow'})
  381. } else if(name == '5-14'){
  382. this.$router.push({path:'/patients/patient/' + this.id+'/Muscleforce'})
  383. }else if(name == '6-1'){
  384. this.$router.push({path: '/patients/patient/' + this.id+ '/Informedconsent'})
  385. }else if(name == '7'){
  386. this.$router.push({path:'/patient/patient/'+this.id+'/lapsoSummary'})
  387. }
  388. },
  389. changePatient(value) {
  390. console.log(value)
  391. if(this.$route.path.indexOf('edit') > -1){
  392. this.$confirm('是否保存当前病历', '保存', {
  393. confirmButtonText: '确 定',
  394. cancelButtonText: '取 消',
  395. type: 'warning'
  396. }).then(() => {
  397. this.$emit('updateInfo')
  398. setTimeout(() => {
  399. this.$router.push('/patients/patient/' + value)
  400. },1000)
  401. }).catch(() => {
  402. this.$router.push('/patients/patient/' + value)
  403. })
  404. }else{
  405. this.$router.push('/patients/patient/' + value)
  406. }
  407. },
  408. getList() {
  409. fetchAllList().then(response => {
  410. if (response.data.state == 1) {
  411. if(this.org_id ==10191 || this.org_id == 0){
  412. var patients = response.data.data.patients
  413. // console.log("patients",patients)
  414. for(let i=0;i<patients.length;i++){
  415. if(patients[i].lapseto ==1){
  416. this.patientsList.push(patients[i])
  417. }
  418. }
  419. }else{
  420. this.patientsList = response.data.data.patients
  421. console.log("哈哈哈哈哈哈",this.patientsList)
  422. }
  423. var len = this.patientsList.length
  424. if (len > 0) {
  425. for (let index = 0; index < len; index++) {
  426. if (this.patientsList[index].id == this.id) {
  427. this.currentPatient = this.patientsList[index]
  428. // console.log("curr", this.currentPatient);
  429. this.selectID = this.patientsList[index].id
  430. this.$emit('tran-patient', this.currentPatient)
  431. break
  432. }
  433. }
  434. }
  435. }
  436. })
  437. },
  438. tranAge(birthday) {
  439. var birth = uParseTime(birthday, '{y}-{m}-{d}')
  440. return jsGetAge(birth, '-')
  441. },
  442. tranSex(gender) {
  443. var sex = '未知'
  444. switch (gender) {
  445. case 1:
  446. sex = '男'
  447. break
  448. case 2:
  449. sex = '女'
  450. break
  451. default:
  452. break
  453. }
  454. return sex
  455. },
  456. querySearchAsync(keyword, cb) {
  457. let key = ''
  458. if (keyword != undefined) {
  459. key = keyword
  460. }
  461. let searchArray = []
  462. PostSearch(key).then(response => {
  463. if (response.data.state == 1) {
  464. searchArray = response.data.data.patient
  465. cb(searchArray)
  466. } else {
  467. this.$message.error(response.data.msg)
  468. cb([])
  469. }
  470. })
  471. },
  472. handleSelect(val) {
  473. this.$router.push('/patients/patient/' + val.id)
  474. },
  475. getAge: function(val) {
  476. if (val.id_card_no == undefined) {
  477. return false
  478. }
  479. var thisLen = val.id_card_no.length
  480. var birth = ''
  481. if (thisLen == 15) {
  482. birth = '19' + val.id_card_no.substr(6, 6)
  483. } else {
  484. birth = val.id_card_no.substr(6, 8)
  485. }
  486. var birthtwo =
  487. birth.substr(0, 4) +
  488. '-' +
  489. birth.substr(4, 2) +
  490. '-' +
  491. birth.substr(6, 2)
  492. var age = jsGetAge(birthtwo, '-')
  493. return age
  494. }
  495. },
  496. created() {
  497. var patientKey = window.sessionStorage.getItem('patientKey')
  498. console.log("patient-----------------",patientKey)
  499. this.org_id = this.$store.getters.xt_user.template_info.org_id
  500. var query = this.$route.path
  501. console.log("query",this.$route.path)
  502. if(patientKey){
  503. this.treeKey = patientKey
  504. if(query.indexOf('edit') == -1){
  505. if (patientKey == '1-1') {
  506. this.$router.push({ path: '/patients/patient/' + this.id })
  507. } else if (patientKey == '1-2') {
  508. this.$router.push({ path: '/patients/course?id=' + this.id })
  509. } else if (patientKey == '1-3') {
  510. this.$router.push({ path: '/patients/inspection?id=' + this.id })
  511. } else if (patientKey == '1-4') {
  512. this.$router.push({
  513. path: '/patients/patient/' + this.id + '/doctorAdvice'
  514. })
  515. } else if (patientKey == '1-6') {
  516. this.$router.push({
  517. path: '/patients/patient/' + this.id + '/dryWeight'
  518. })
  519. }else if(patientKey == '1-11'){
  520. this.$router.push({path: '/patients/patient/' + this.id + '/firstDisease'})
  521. }else if (patientKey == '1-5') {
  522. this.$router.push({ path: '/patients/rescue?id=' + this.id })
  523. } else if (patientKey == '2-1') {
  524. this.$router.push({
  525. path: '/patients/patient/' + this.id + '/dialysisSolution'
  526. })
  527. } else if (patientKey == '2-2') {
  528. this.$router.push({
  529. path: '/patients/patient/' + this.id + '/dialysisRecord'
  530. })
  531. } else if (patientKey == '2-4') {
  532. this.$router.push({
  533. path: '/patients/patient/' + this.id + '/scheduling'
  534. })
  535. } else if (patientKey == '2-5') {
  536. this.$router.push({
  537. path: '/patients/patient/' + this.id + '/proeducation'
  538. })
  539. } else if (patientKey == '3-1') {
  540. this.$router.push({ path: '/patients/sickhistory?id=' + this.id })
  541. }else if(patientKey == '7'){
  542. this.$router.push({path:'/patient/patient/'+this.id+'/lapsoSummary'})
  543. }else if(patientKey == '4-12'){
  544. this.$router.push({path:'/patients/newInspection?id='+this.id})
  545. }
  546. }else{
  547. this.treeKey = "1-1"
  548. }
  549. }else{
  550. this.treeKey = this.defaultActive
  551. }
  552. this.getList()
  553. },
  554. }
  555. </script>
  556. <style>
  557. .patient-menu .el-tree-node__content {
  558. font-size: 14px;
  559. height: 40px;
  560. font-weight: 400;
  561. }
  562. .patient-menu .el-tree-node__label:hover {
  563. color: #409eff;
  564. }
  565. .patient-menu .el-tree-node:focus > .el-tree-node__content {
  566. color: #409eff;
  567. }
  568. .patient-menu .el-tree-node .el-tree-node.is-current > .el-tree-node__content {
  569. color: #409eff;
  570. }
  571. .patient-menu .el-tree {
  572. background: #f6f8f9;
  573. }
  574. .patient-menu {
  575. -webkit-transition: width 0.28s;
  576. transition: width 0.28s;
  577. width: 180px !important;
  578. height: 100%;
  579. position: relative;
  580. font-size: 0px;
  581. top: 0;
  582. float: left;
  583. bottom: 0;
  584. left: 0;
  585. /* z-index: 99; */
  586. overflow: hidden;
  587. }
  588. .patient-center-menu .el-icon-arrow-down:before {
  589. content: "";
  590. }
  591. </style>