PatientSidebar.vue 17KB

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