{"version":3,"sources":["webpack:///./src/layouts/Task.vue?faf3","webpack:///src/layouts/Task.vue","webpack:///./src/layouts/Task.vue?f501","webpack:///./src/layouts/Task.vue"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","initialize","_e","_v","hasAccount","keyExpired","_s","message","getTaskCurrentTaskType","tag","attrs","linkInfo","staticRenderFns","components","CreateAccount","PatientInfo","NphComplaintLocation","NphComplaintQuestions","NphAutoAccident","NphQuestion","NphPersonalHistory","NphFamilyHistory","NphThankyou","NphInsurance","ResetPassword","Statement","data","task","module","computed","mapGetters","key","$route","query","methods","mapActions","console","log","apiRes","api","auth","request","apiLogin","sessionStorage","setItem","token","$auth","isAuthenticated","setTaskCurrentTaskType","$router","push","path","resp","getLink","taskRes","setUrlLinkInfo","setTimeout","patientID","gettask","facilityId","facilityID","patientId","find","el","taskID","taskType","info","taskinfo","JSON","parse","TaskType","TaskID","setTaskInfo","stringify","getSpecificTask","pLookup","patientLookup","facilityInfo","getFacilityInfo","setFacilityInfo","setTaskOfficeName","officeName","setTaskIsAccessOnly","setTaskCode","setBillingStatementTask","warn","component"],"mappings":"gJAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACA,EAAG,MAAM,CAACE,YAAY,gBAAgB,CAACF,EAAG,MAAM,CAACE,YAAY,gDAAgD,CAAGN,EAAIO,WAAsDP,EAAIQ,KAA9CJ,EAAG,KAAK,CAACJ,EAAIS,GAAG,0BAAoCT,EAAIO,aAAeP,EAAIU,YAAcV,EAAIW,YAAaP,EAAG,KAAK,CAACJ,EAAIS,GAAGT,EAAIY,GAAGZ,EAAIa,YAAYb,EAAIQ,OAAOJ,EAAG,aAAa,CAAEJ,EAAc,WAAEI,EAAGJ,EAAIc,uBAAuB,CAACC,IAAI,YAAYC,MAAM,CAAC,YAAYhB,EAAIiB,YAAYjB,EAAIQ,MAAM,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AC,QAAAC,KAAA,CAAAC,KAAA,mBACA,MACA,QACAf,QAAAiD,KAAA,sCAAA1D,KAAAsC,UACA,WC3L2W,I,YCOvWqB,EAAY,eACd,EACA7F,EACAmB,GACA,EACA,KACA,KACA,MAIa,aAAA0E,E","file":"js/chunk-639c2486.05413e93.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:\"content-body\"},[_c('div',{staticClass:\"row mt-5 mr-2 ml-2 justify-content-md-center\"},[(!_vm.initialize)?_c('h2',[_vm._v(\"Initializing App ...\")]):_vm._e(),(_vm.initialize && (_vm.hasAccount || _vm.keyExpired))?_c('h2',[_vm._v(_vm._s(_vm.message))]):_vm._e()]),_c('keep-alive',[(_vm.initialize)?_c(_vm.getTaskCurrentTaskType,{tag:\"component\",attrs:{\"link-info\":_vm.linkInfo}}):_vm._e()],1)],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <div>\n    <div class=\"content-body\">\n      <div class=\"row mt-5 mr-2 ml-2 justify-content-md-center\">\n        <h2 v-if=\"!initialize\">Initializing App ...</h2>\n        <h2 v-if=\"initialize && (hasAccount || keyExpired)\">{{ message }}</h2>\n      </div>\n      <keep-alive>\n        <component\n          v-bind:is=\"getTaskCurrentTaskType\"\n          v-if=\"initialize\"\n          :link-info=\"linkInfo\"\n        ></component>\n      </keep-alive>\n    </div>\n  </div>\n</template>\n<script>\nimport api from '../api/http-common.js'\nimport { mapGetters, mapActions } from 'vuex'\nimport '../assets/FormLayout.css'\nexport default {\n  components: {\n    // Lazy Loading components\n    CreateAccount: () => import('../views/account/Create.vue'),\n    PatientInfo: () => import('../components/task/PatientInfo.vue'),\n    NphComplaintLocation: () =>\n      import('../components/task/NphComplaintLocation.vue'),\n    NphComplaintQuestions: () =>\n      import('../components/task/NphComplaintQuestions.vue'),\n    NphAutoAccident: () => import('../components/task/NphAutoAccident.vue'),\n    NphQuestion: () => import('../components/task/NphQuestion.vue'),\n    NphPersonalHistory: () =>\n      import('../components/task/NphPersonalHistory.vue'),\n    NphFamilyHistory: () => import('../components/task/NphFamilyHistory.vue'),\n    NphThankyou: () => import('../components/task/NphThankyou.vue'),\n    NphInsurance: () => import('../components/task/NphInsurance.vue'),\n    ResetPassword: () => import('../components/task/ResetPassword.vue'),\n    Statement: () => import('../components/billing/TaskStatement.vue')\n  },\n  data() {\n    return {\n      initialize: false,\n      linkInfo: null,\n      task: null,\n      module: null,\n      hasAccount: false,\n      keyExpired: false\n    }\n  },\n  computed: {\n    ...mapGetters(['getTaskCurrentTaskType']),\n    key() {\n      return this.$route.query.key\n    },\n    message() {\n      if (this.keyExpired && this.initialize) {\n        return 'Link key expired. Redirecting to login page...'\n      }\n      if (this.initialize && this.hasAccount) {\n        return 'Patient Link Account found. Redirecting to login page ...'\n      }\n      return ''\n    }\n  },\n  methods: {\n    ...mapActions([\n      'setTaskCurrentTaskType',\n      'setTaskOfficeName',\n      'setTaskCode',\n      'setTaskIsAccessOnly',\n      'setBillingStatementTask',\n      'setFacilityInfo',\n      'setTaskInfo',\n      'setUrlLinkInfo'\n    ])\n  },\n  async mounted() {\n    console.log('task.vue mounted')\n    const apiRes = await api.auth.request.apiLogin()\n    // NOTE: Temporary will be move to cookies soon!\n    // localStorage.setItem('config', apiRes.data.token)\n    sessionStorage.setItem('config', apiRes.data.token)\n    if (!this.key) {\n      if (this.$auth.isAuthenticated()) {\n        this.setTaskCurrentTaskType('PatientInfo')\n        this.initialize = true\n        return\n      } else {\n        this.$router.push({ path: '/account/login' })\n      }\n    }\n\n    // NOTE: This is via task key>account>task type\n    const resp = await api.auth.request.getLink(this.key)\n    this.linkInfo = resp.data\n    if (!this.linkInfo) {\n      this.initialize = true\n      this.keyExpired = true\n\n      setTimeout(() => {\n        this.$router.push({ path: '/account/login' })\n      }, 5000)\n    } else {\n      this.setUrlLinkInfo(resp.data)\n    }\n    // Get Task\n    let taskRes\n    if (this.linkInfo.patientID > 0) {\n      taskRes = await api.task.request.gettask({\n        facilityId: this.linkInfo.facilityID,\n        patientId: this.linkInfo.patientID\n      })\n      this.task = taskRes.data.find((el) => el.taskID === this.linkInfo.taskID)\n      // added by Rizza Herrero 10/10/2024\n      if (this.task && this.task.taskType === 'INS') {\n        if (this.task.info !== '') {\n          var taskinfo = JSON.parse(this.task.info)\n          taskinfo.TaskType = this.task.taskType\n          taskinfo.TaskID = this.task.taskID\n          this.setTaskInfo(JSON.stringify(taskinfo))\n        } else {\n          this.setTaskInfo('')\n        }\n        await this.setTaskCurrentTaskType(this.task.taskType)\n      }\n      // added by Rizza Herrero 10/10/2024 end\n    } else {\n      taskRes = await api.task.request.getSpecificTask(this.linkInfo.taskID)\n      this.task = taskRes.data\n    }\n\n    const pLookup = await api.task.request.patientLookup({\n      facilityId: this.linkInfo.facilityID,\n      patientId: this.linkInfo.patientID\n    })\n    if (pLookup.data) {\n      this.initialize = true\n      this.hasAccount = true\n      setTimeout(() => {\n        this.$router.push({ path: '/account/login' })\n      }, 5000)\n    } else {\n      this.initialize = true\n\n      const facilityInfo = await api.auth.request.getFacilityInfo(\n        this.linkInfo.facilityID\n      )\n      this.setFacilityInfo(facilityInfo)\n      await this.setTaskOfficeName(facilityInfo.officeName)\n\n      if (!this.task || taskRes.data.taskID === 0) {\n        this.hasAccount = false\n        this.setTaskIsAccessOnly(true)\n        this.setTaskCurrentTaskType('CreateAccount')\n        return\n      }\n      console.log('this.task.taskType>', this.task.taskType)\n      console.log('task>', this.task.taskType === 'NPH')\n      this.setTaskCode(this.task.taskType)\n      switch (this.task.taskType) {\n        case 'NPH':\n        case 'AANPH':\n        case 'CH':\n        case 'AACH':\n          console.log('it is nph')\n          this.setTaskCurrentTaskType('CreateAccount')\n          break\n        case 'STMT':\n          this.hasAccount = false\n          this.setTaskIsAccessOnly(true)\n          this.setTaskIsAccessOnly('/menu/statement')\n          this.setBillingStatementTask(taskRes.data)\n          this.setTaskCurrentTaskType('CreateAccount')\n          // taskRes = await api.task.request.getSpecificTask(this.task.taskID)\n          // this.setBillingStatementTask(taskRes.data)\n          // this.setTaskCurrentTaskType('Statement')\n          // this.$router.push({ path: '/menu/statement' })\n          break\n        case 'RESETPWD':\n          this.setTaskCurrentTaskType('ResetPassword')\n          break\n        case 'INS':\n          this.$router.push({ path: '/account/login' })\n          break\n        default:\n          console.warn('Unable to recognise task type ' + this.task.taskType)\n          break\n      }\n    }\n  }\n}\n</script>\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./Task.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./Task.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./Task.vue?vue&type=template&id=82994f0a\"\nimport script from \"./Task.vue?vue&type=script&lang=js\"\nexport * from \"./Task.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\nexport default component.exports"],"sourceRoot":""}