Browse Source

Merge branch 'master' into test-ca

xiaochan 11 tháng trước cách đây
mục cha
commit
0e810667e0

+ 151 - 146
src/api/zhu-yuan-yi-sheng/emr-patient.ts

@@ -2,7 +2,7 @@
 import requestV2 from "../../utils/request-v2";
 import Patient from "../../ts-type/patient";
 
-let URL = 'Emr'
+let URL = "Emr";
 
 /**
  * 获取患者病历树状图
@@ -11,23 +11,23 @@ let URL = 'Emr'
  * @returns {*} 返回数
  */
 export function getPatientDataTree(patNo: string, times: number) {
-    return requestV2({
-        url: URL + '/getPatientDataTree',
-        method: 'get',
-        params: {patNo, times}
-    })
+  return requestV2({
+    url: URL + "/getPatientDataTree",
+    method: "get",
+    params: { patNo, times },
+  });
 }
 
 /**
  * 获取电子病历的树状图
  */
-export function getEmrTree(type: 'all' | 'dept' | 'hosp' = 'all') {
-    return requestV2<{ all: any[], dept: any[] }>({
-        url: URL + '/getEmrTree',
-        method: 'get',
-        showLoading: false,
-        params: {type}
-    })
+export function getEmrTree(type: "all" | "dept" | "hosp" = "all") {
+  return requestV2<{ all: any[]; dept: any[] }>({
+    url: URL + "/getEmrTree",
+    method: "get",
+    showLoading: false,
+    params: { type },
+  });
 }
 
 /**
@@ -35,54 +35,51 @@ export function getEmrTree(type: 'all' | 'dept' | 'hosp' = 'all') {
  * @returns {*}
  */
 export function getSnippetTree() {
-    return requestV2({
-        url: URL + '/getSnippetTree',
-        method: 'get',
-        showLoading: false,
-    })
+  return requestV2({
+    url: URL + "/getSnippetTree",
+    method: "get",
+    showLoading: false,
+  });
 }
 
 export function insertEmrData(data) {
-    return requestV2({
-        url: URL + '/insertEmrData',
-        method: 'post',
-        data
-    })
+  return requestV2({
+    url: URL + "/insertEmrData",
+    method: "post",
+    data,
+  });
 }
 
 export function deletePatientEmrByDocumentId(documentId) {
-    return requestV2({
-        url: URL + '/deletePatientEmrByDocumentId',
-        method: 'get',
-        params: {documentId}
-    })
+  return requestV2({
+    url: URL + "/deletePatientEmrByDocumentId",
+    method: "get",
+    params: { documentId },
+  });
 }
 
-
 export function audit(documentId) {
-    return requestV2({
-        url: URL + '/audit',
-        method: 'get',
-        params: {documentId}
-    })
+  return requestV2({
+    url: URL + "/audit",
+    method: "get",
+    params: { documentId },
+  });
 }
 
-
 export function submitMedicalRecord(documentId) {
-    return requestV2({
-        url: URL + '/submitMedicalRecord',
-        method: 'get',
-        params: {documentId}
-    })
+  return requestV2({
+    url: URL + "/submitMedicalRecord",
+    method: "get",
+    params: { documentId },
+  });
 }
 
-
 export function getDrgIntelligentGrouping(patNo, times) {
-    return requestV2({
-        url: URL + '/getDrgIntelligentGrouping',
-        method: 'get',
-        params: {patNo, times}
-    })
+  return requestV2({
+    url: URL + "/getDrgIntelligentGrouping",
+    method: "get",
+    params: { patNo, times },
+  });
 }
 
 /**
@@ -91,160 +88,168 @@ export function getDrgIntelligentGrouping(patNo, times) {
  * @param times 次数
  */
 export function getExtractDataElement(patNo, times) {
-    return requestV2({
-        url: URL + '/getExtractDataElement',
-        method: 'get',
-        params: {patNo, times}
-    })
+  return requestV2({
+    url: URL + "/getExtractDataElement",
+    method: "get",
+    params: { patNo, times },
+  });
 }
 
 export function getEmrAllWardsApi() {
-    return requestV2({
-        url: URL + '/getAllWards',
-        method: 'get',
-    })
+  return requestV2({
+    url: URL + "/getAllWards",
+    method: "get",
+  });
 }
 
 export function getHistory(documentId) {
-    return requestV2({
-        url: URL + '/getHistory',
-        method: 'get',
-        params: {documentId}
-    })
+  return requestV2({
+    url: URL + "/getHistory",
+    method: "get",
+    params: { documentId },
+  });
 }
 
 export function getEmrTips() {
-    return requestV2({
-        url: URL + '/getEmrTips',
-        method: 'get',
-    })
+  return requestV2({
+    url: URL + "/getEmrTips",
+    method: "get",
+  });
 }
 
 export function addEmrTips(data) {
-    return requestV2({
-        url: URL + '/addEmrTips',
-        method: 'post',
-        data
-    })
+  return requestV2({
+    url: URL + "/addEmrTips",
+    method: "post",
+    data,
+  });
 }
 
 export function updateEmrTips(data) {
-    return requestV2({
-        url: URL + '/updateEmrTips',
-        method: 'post',
-        data
-    })
+  return requestV2({
+    url: URL + "/updateEmrTips",
+    method: "post",
+    data,
+  });
 }
 
 export function deleteEmrTips(id) {
-    return requestV2({
-        url: URL + '/deleteEmrTips',
-        method: 'get',
-        params: {id}
-    })
+  return requestV2({
+    url: URL + "/deleteEmrTips",
+    method: "get",
+    params: { id },
+  });
 }
 
 export function getEmrTipsData(name) {
-    return requestV2({
-        url: URL + '/getEmrTipsData',
-        method: 'get',
-        params: {name}
-    })
+  return requestV2({
+    url: URL + "/getEmrTipsData",
+    method: "get",
+    params: { name },
+  });
 }
 
 export function hotSearchSorting(userCode, code, tableName) {
-    return requestV2({
-        url: URL + '/hotSearchSorting',
-        method: 'get',
-        params: {userCode, code, tableName}
-    })
+  return requestV2({
+    url: URL + "/hotSearchSorting",
+    method: "get",
+    params: { userCode, code, tableName },
+  });
 }
 
 export function getListOfDischargedPatients(patNo) {
-    return requestV2({
-        url: URL + '/getListOfDischargedPatients',
-        method: 'get',
-        params: {patNo}
-    })
+  return requestV2({
+    url: URL + "/getListOfDischargedPatients",
+    method: "get",
+    params: { patNo },
+  });
 }
 
 export function getYzTemperature(data) {
-    return requestV2({
-        url: URL + '/getYzTemperature',
-        method: 'post',
-        data
-    })
+  return requestV2({
+    url: URL + "/getYzTemperature",
+    method: "post",
+    data,
+  });
 }
 
 export function getExamine(patNo, times) {
-    return requestV2({
-        url: URL + '/getExamine',
-        method: 'get',
-        params: {patNo, times}
-    })
+  return requestV2({
+    url: URL + "/getExamine",
+    method: "get",
+    params: { patNo, times },
+  });
 }
 
 export function whetherItExistsInTheDepartment(patNo, times) {
-    return requestV2({
-        url: URL + '/whetherItExistsInTheDepartment',
-        method: 'get',
-        params: {patNo, times}
-    })
+  return requestV2({
+    url: URL + "/whetherItExistsInTheDepartment",
+    method: "get",
+    params: { patNo, times },
+  });
 }
 
 export function electronicMedicalRecordSequencing(data) {
-    return requestV2({
-        url: URL + '/electronicMedicalRecordSequencing',
-        method: 'post',
-        data
-    })
+  return requestV2({
+    url: URL + "/electronicMedicalRecordSequencing",
+    method: "post",
+    data,
+  });
 }
 
-
 export function getPastHistory(patNo, times) {
-    return requestV2({
-        url: URL + '/getPastHistory',
-        method: 'get',
-        params: {patNo, times}
-    })
+  return requestV2({
+    url: URL + "/getPastHistory",
+    method: "get",
+    params: { patNo, times },
+  });
 }
 
-export function getMzPatientDataByPatNo(patNo:string) {
-    return requestV2({
-        url: URL + '/getMzPatientDataByPatNo',
-        method: 'get',
-        params: {patNo}
-    })
+export function getMzPatientDataByPatNo(patNo: string) {
+  return requestV2({
+    url: URL + "/getMzPatientDataByPatNo",
+    method: "get",
+    params: { patNo },
+  });
 }
 
 export function getFluorescenceSpecimenResult(patNo, times) {
-    return requestV2({
-        url: URL + '/getFluorescenceSpecimenResult',
-        method: 'get',
-        params: {patNo, times}
-    })
+  return requestV2({
+    url: URL + "/getFluorescenceSpecimenResult",
+    method: "get",
+    params: { patNo, times },
+  });
 }
 
 export function getOpRecordList(patNo, times) {
-    return requestV2({
-        url: URL + '/getOpRecordList',
-        method: 'get',
-        params: {patNo, times}
-    })
+  return requestV2({
+    url: URL + "/getOpRecordList",
+    method: "get",
+    params: { patNo, times },
+  });
 }
 
 export function getPatientInfo(inpatientNo: string) {
-    return requestV2<Patient>({
-        url: '/patient/getInfo',
-        method: 'get',
-        params: {inpatientNo},
-    })
+  return requestV2<Patient>({
+    url: "/patient/getInfo",
+    method: "get",
+    params: { inpatientNo },
+  });
 }
 
 export function getDisPatient(patNo: string, times: number) {
-    return requestV2<Patient>({
-        url: '/patient/getDisPatient',
-        method: 'get',
-        params: {patNo, times},
-    })
+  return requestV2<Patient>({
+    url: "/patient/getDisPatient",
+    method: "get",
+    params: { patNo, times },
+  });
+}
+
+export function getEmrToken() {
+  return requestV2<string>({
+    url: URL + "/getEmrToken",
+    method: "get",
+  }).then(res => {
+    sessionStorage.setItem("emr-token", res);
+  });
 }

+ 2 - 0
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/EmrMain.vue

@@ -163,6 +163,7 @@ import { getServerDateApi, getUuid } from "@/api/public-api";
 import {
   audit,
   deletePatientEmrByDocumentId,
+  getEmrToken,
   hotSearchSorting,
   insertEmrData,
   submitMedicalRecord,
@@ -1733,6 +1734,7 @@ onMounted(async () => {
   doctorLevelFunc();
   await queryingBasicPatientInformation();
   await nextTick();
+  await getEmrToken();
   initEdit();
   window.addEventListener("beforeunload", monitorPageRefresh, {
     capture: true,

+ 50 - 38
src/views/view/patient360/src/Patient360.vue

@@ -1,11 +1,11 @@
 <template>
   <div :class="ns.e('body')">
     <div :class="ns.e('header')">
-      <InfoView/>
+      <InfoView />
     </div>
     <div :class="ns.e('main')">
-      <ViewOutPatient v-if="outOrHosp === 1"/>
-      <ViewHospMain v-if="outOrHosp === 2"/>
+      <ViewOutPatient v-if="outOrHosp === 1" />
+      <ViewHospMain v-if="outOrHosp === 2" />
     </div>
   </div>
 </template>
@@ -14,57 +14,69 @@
 import router from "@/router";
 import request from "@/utils/request-v2";
 import InfoView from "@/views/view/patient360/comp/InfoView.vue";
-import {patInfo, ns, outOrHosp, medicalTrackGrouping} from "@/views/view/patient360/src/index";
-import '../patient360.scss'
+import {
+  medicalTrackGrouping,
+  ns,
+  outOrHosp,
+  patInfo,
+} from "@/views/view/patient360/src/index";
+import "../patient360.scss";
 import ViewHospMain from "@/views/view/patient360/hospComp/ViewHospMain.vue";
 import ViewOutPatient from "@/views/view/patient360/out-patient-comp/ViewOutPatient.vue";
+import { getEmrToken } from "@/api/zhu-yuan-yi-sheng/emr-patient";
 
 function getMedicalTrack(patientId: string, outOrHosp: 1 | 2) {
   return request({
-    method: 'get',
-    url: '/patient360/getMedicalTrack',
-    params: {patientId, outOrHosp}
-  })
+    method: "get",
+    url: "/patient360/getMedicalTrack",
+    params: { patientId, outOrHosp },
+  });
 }
 
 function getMedicalTrackFunc(patNo: string, outOrHosp: 1 | 2) {
-  getMedicalTrack(patNo, outOrHosp).then(res => {
-    patInfo.value = res
+  getMedicalTrack(patNo, outOrHosp)
+    .then(res => {
+      patInfo.value = res;
 
-    patInfo.value.medicalTrackList.forEach((item) => {
-      if (item.outOrHosp === 1) {
-        medicalTrackGrouping.value.mz++
-      } else if (item.outOrHosp === 2) {
-        medicalTrackGrouping.value.zy++
-      }
+      patInfo.value.medicalTrackList.forEach(item => {
+        if (item.outOrHosp === 1) {
+          medicalTrackGrouping.value.mz++;
+        } else if (item.outOrHosp === 2) {
+          medicalTrackGrouping.value.zy++;
+        }
+      });
     })
-
-  }).catch(() => {
-    medicalTrackGrouping.value.mz = 0
-    medicalTrackGrouping.value.zy = 0
-    patInfo.value = {
-      inpatientNo: '',
-      mzNo: '',
-      name: '',
-      sex: '',
-      age: '',
-      sexName: '',
-      socialNo: '',
-      medicalTrackList: [],
-    }
-  })
+    .catch(() => {
+      medicalTrackGrouping.value.mz = 0;
+      medicalTrackGrouping.value.zy = 0;
+      patInfo.value = {
+        inpatientNo: "",
+        mzNo: "",
+        name: "",
+        sex: "",
+        age: "",
+        sexName: "",
+        socialNo: "",
+        medicalTrackList: [],
+      };
+    });
 }
 
 onMounted(() => {
+  getEmrToken();
   if (router.currentRoute.value.query.inpatientNo) {
-    getMedicalTrackFunc(router.currentRoute.value.query.inpatientNo as string, 2)
+    getMedicalTrackFunc(
+      router.currentRoute.value.query.inpatientNo as string,
+      2
+    );
   }
   if (router.currentRoute.value.query.outPatientNo) {
-    getMedicalTrackFunc(router.currentRoute.value.query.outPatientNo as string, 1)
+    getMedicalTrackFunc(
+      router.currentRoute.value.query.outPatientNo as string,
+      1
+    );
   }
-})
+});
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>