|
@@ -1,403 +1,403 @@
|
|
|
// @ts-nocheck
|
|
|
-import {computed, defineComponent, h, onMounted, ref} from "vue";
|
|
|
+import { computed, defineComponent, h, onMounted, ref } from "vue";
|
|
|
// @ts-ignore
|
|
|
-import {ElIcon, ElInput, ElTree, ElTreeV2} from "element-plus";
|
|
|
-import {useCompRef} from "@/utils/useCompRef";
|
|
|
-import {TreeNodeData} from "element-plus/es/components/tree/src/tree.type";
|
|
|
+import { ElIcon, ElInput, ElTree, ElTreeV2 } from "element-plus";
|
|
|
+import { useCompRef } from "@/utils/useCompRef";
|
|
|
+import { TreeNodeData } from "element-plus/es/components/tree/src/tree.type";
|
|
|
import {
|
|
|
- EmrCategoryData,
|
|
|
- EmrPatientData,
|
|
|
- getEmrTree,
|
|
|
- getMzPatientDataByPatNo,
|
|
|
- getPastHistory,
|
|
|
- getPatientDataTree,
|
|
|
- whetherItExistsInTheDepartment,
|
|
|
+ EmrCategoryData,
|
|
|
+ EmrPatientData,
|
|
|
+ getEmrTree,
|
|
|
+ getMzPatientDataByPatNo,
|
|
|
+ getPastHistory,
|
|
|
+ getPatientDataTree,
|
|
|
+ whetherItExistsInTheDepartment,
|
|
|
} from "@/api/zhu-yuan-yi-sheng/emr-patient";
|
|
|
-import {Document, Folder} from "@element-plus/icons-vue";
|
|
|
+import { Document, Folder } from "@element-plus/icons-vue";
|
|
|
import "./emr-css.scss";
|
|
|
import {
|
|
|
- canIUnlockIt,
|
|
|
- emrConfig,
|
|
|
- emrMitt,
|
|
|
- EmrParam,
|
|
|
- patientInfo,
|
|
|
- unlockEnum,
|
|
|
+ canIUnlockIt,
|
|
|
+ emrConfig,
|
|
|
+ emrMitt,
|
|
|
+ EmrParam,
|
|
|
+ patientInfo,
|
|
|
+ unlockEnum,
|
|
|
} from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
|
|
|
-import {isDev} from "@/utils/public";
|
|
|
-import {getAllWards} from "@/api/zhu-yuan-yi-sheng/resident-doctor";
|
|
|
-import {BizException, ExceptionEnum} from "@/utils/BizException";
|
|
|
+import { isDev } from "@/utils/public";
|
|
|
+import { getAllWards } from "@/api/zhu-yuan-yi-sheng/resident-doctor";
|
|
|
+import { BizException, ExceptionEnum } from "@/utils/BizException";
|
|
|
// @ts-ignore
|
|
|
import PatientEmrData from "@/components/zhu-yuan-yi-sheng/emr/emr-template/comp/PatientEmrData.vue";
|
|
|
// @ts-ignore
|
|
|
import PatientHistoryData from "@/components/zhu-yuan-yi-sheng/emr/emr-template/comp/PatientHistoryData.vue";
|
|
|
// @ts-ignore
|
|
|
import CyFlex from "@/components/cy/flex/src/CyFlex.vue";
|
|
|
-import {useUserStore} from "@/pinia/user-store";
|
|
|
+import { useUserStore } from "@/pinia/user-store";
|
|
|
import {
|
|
|
- emrRootContextKey,
|
|
|
- EmrStore
|
|
|
+ emrRootContextKey,
|
|
|
+ EmrStore,
|
|
|
} from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-func/useEmrStore";
|
|
|
import TabsResizer from "@/components/cy/cy-el-tabs/TabsResizer.vue";
|
|
|
import TabPaneResizer from "@/components/cy/cy-el-tabs/TabPaneResizer.vue";
|
|
|
import XEUtils from "xe-utils";
|
|
|
|
|
|
const defaultProps = {
|
|
|
- children: "children",
|
|
|
- label: "name",
|
|
|
- value: "_id",
|
|
|
+ children: "children",
|
|
|
+ label: "name",
|
|
|
+ value: "_id",
|
|
|
};
|
|
|
|
|
|
const HospitalTemplate = defineComponent({
|
|
|
- props: {
|
|
|
- data: {
|
|
|
- type: Array,
|
|
|
- required: true,
|
|
|
- },
|
|
|
+ props: {
|
|
|
+ data: {
|
|
|
+ type: Array,
|
|
|
+ required: true,
|
|
|
},
|
|
|
- emits: ["nodeClick"],
|
|
|
- setup(props, {emit}) {
|
|
|
- const inputValue = ref("");
|
|
|
- const treeRef = useCompRef(ElTreeV2);
|
|
|
+ },
|
|
|
+ emits: ["nodeClick"],
|
|
|
+ setup(props, { emit }) {
|
|
|
+ const inputValue = ref("");
|
|
|
+ const treeRef = useCompRef(ElTreeV2);
|
|
|
|
|
|
- function filterMethod(query: string, node: TreeNodeData) {
|
|
|
- return node.name!.includes(query);
|
|
|
- }
|
|
|
+ function filterMethod(query: string, node: TreeNodeData) {
|
|
|
+ return node.name!.includes(query);
|
|
|
+ }
|
|
|
|
|
|
- const isItAFolder = ({data}: any) => {
|
|
|
- return h(ElIcon, null, {
|
|
|
- default: () => {
|
|
|
- if (data.type === "category") {
|
|
|
- return h(Document);
|
|
|
- } else {
|
|
|
- return h(Folder);
|
|
|
- }
|
|
|
- },
|
|
|
- });
|
|
|
- };
|
|
|
+ const isItAFolder = ({ data }: any) => {
|
|
|
+ return h(ElIcon, null, {
|
|
|
+ default: () => {
|
|
|
+ if (data.type === "category") {
|
|
|
+ return h(Document);
|
|
|
+ } else {
|
|
|
+ return h(Folder);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ };
|
|
|
|
|
|
- function inputChange() {
|
|
|
- treeRef.value?.filter(inputValue.value);
|
|
|
- }
|
|
|
+ function inputChange() {
|
|
|
+ treeRef.value?.filter(inputValue.value);
|
|
|
+ }
|
|
|
|
|
|
- function click(node: any) {
|
|
|
- emit("nodeClick", node);
|
|
|
- }
|
|
|
+ function click(node: any) {
|
|
|
+ emit("nodeClick", node);
|
|
|
+ }
|
|
|
|
|
|
- return () => {
|
|
|
- return (
|
|
|
- <CyFlex>
|
|
|
- {{
|
|
|
- header: () => (
|
|
|
- <ElInput
|
|
|
- modelValue={inputValue.value}
|
|
|
- onUpdate:modelValue={value => {
|
|
|
- inputValue.value = value;
|
|
|
- }}
|
|
|
- onInput={inputChange}
|
|
|
- clearable
|
|
|
- ></ElInput>
|
|
|
- ),
|
|
|
- content: () => (
|
|
|
- <ElTree
|
|
|
- class="down-tree"
|
|
|
- ref={treeRef}
|
|
|
- // @ts-ignore
|
|
|
- data={props.data}
|
|
|
- filterNodeMethod={filterMethod}
|
|
|
- props={defaultProps}
|
|
|
- highlightCurrent
|
|
|
- onNode-click={click}
|
|
|
- >
|
|
|
- {{
|
|
|
- default({node}: any) {
|
|
|
- return (
|
|
|
- <div style={{width: "max-content"}}>
|
|
|
+ return () => {
|
|
|
+ return (
|
|
|
+ <CyFlex>
|
|
|
+ {{
|
|
|
+ header: () => (
|
|
|
+ <ElInput
|
|
|
+ modelValue={inputValue.value}
|
|
|
+ onUpdate:modelValue={value => {
|
|
|
+ inputValue.value = value;
|
|
|
+ }}
|
|
|
+ onInput={inputChange}
|
|
|
+ clearable
|
|
|
+ ></ElInput>
|
|
|
+ ),
|
|
|
+ content: () => (
|
|
|
+ <ElTree
|
|
|
+ class="down-tree"
|
|
|
+ ref={treeRef}
|
|
|
+ // @ts-ignore
|
|
|
+ data={props.data}
|
|
|
+ filterNodeMethod={filterMethod}
|
|
|
+ props={defaultProps}
|
|
|
+ highlightCurrent
|
|
|
+ onNode-click={click}
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ default({ node }: any) {
|
|
|
+ return (
|
|
|
+ <div style={{ width: "max-content" }}>
|
|
|
<span title={node.label}>
|
|
|
{isItAFolder(node)} {node.label}
|
|
|
</span>
|
|
|
- </div>
|
|
|
- );
|
|
|
- },
|
|
|
- }}
|
|
|
- </ElTree>
|
|
|
- ),
|
|
|
- }}
|
|
|
- </CyFlex>
|
|
|
- );
|
|
|
- };
|
|
|
- },
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ },
|
|
|
+ }}
|
|
|
+ </ElTree>
|
|
|
+ ),
|
|
|
+ }}
|
|
|
+ </CyFlex>
|
|
|
+ );
|
|
|
+ };
|
|
|
+ },
|
|
|
});
|
|
|
|
|
|
const EmrSidebar = defineComponent({
|
|
|
- name: "EmrSidebar",
|
|
|
- props: {
|
|
|
- doctorGrade: {
|
|
|
- type: Number,
|
|
|
- },
|
|
|
- isCreate: {
|
|
|
- type: Boolean,
|
|
|
- },
|
|
|
+ name: "EmrSidebar",
|
|
|
+ props: {
|
|
|
+ doctorGrade: {
|
|
|
+ type: Number,
|
|
|
+ },
|
|
|
+ isCreate: {
|
|
|
+ type: Boolean,
|
|
|
},
|
|
|
- setup(props, {emit, expose}) {
|
|
|
- const root = inject(emrRootContextKey) as EmrStore;
|
|
|
+ },
|
|
|
+ setup(props, { emit, expose }) {
|
|
|
+ const root = inject(emrRootContextKey) as EmrStore;
|
|
|
|
|
|
- const returnData = root.emrTemplate;
|
|
|
+ const returnData = root.emrTemplate;
|
|
|
|
|
|
- const templateType = ref(0);
|
|
|
- const editor = emrConfig.value.editor;
|
|
|
- let wardList: (string | undefined)[] = [];
|
|
|
- const hisData = ref([]);
|
|
|
- const mzHisDate = ref([]);
|
|
|
+ const templateType = ref(2);
|
|
|
+ const editor = emrConfig.value.editor;
|
|
|
+ let wardList: (string | undefined)[] = [];
|
|
|
+ const hisData = ref([]);
|
|
|
+ const mzHisDate = ref([]);
|
|
|
|
|
|
- function queryData() {
|
|
|
- return getPatientDataTree(
|
|
|
- patientInfo.value!.inpatientNo as string,
|
|
|
- patientInfo.value!.admissTimes as number
|
|
|
- ).then(res => {
|
|
|
- if (res?.length > 0) {
|
|
|
- templateType.value = 2;
|
|
|
- }
|
|
|
- returnData.value.patientTree = res;
|
|
|
- });
|
|
|
+ function queryData() {
|
|
|
+ return getPatientDataTree(
|
|
|
+ patientInfo.value!.inpatientNo as string,
|
|
|
+ patientInfo.value!.admissTimes as number
|
|
|
+ ).then(res => {
|
|
|
+ if (res?.length > 0) {
|
|
|
+ templateType.value = 2;
|
|
|
}
|
|
|
+ returnData.value.patientTree = res;
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
- const hisComp = computed(() => {
|
|
|
- const zy = [
|
|
|
- {
|
|
|
- name: `住院病历`,
|
|
|
- children: hisData.value,
|
|
|
- emrDocumentId: `住院病历`,
|
|
|
- type: "group-category",
|
|
|
- },
|
|
|
- ];
|
|
|
+ const hisComp = computed(() => {
|
|
|
+ const zy = [
|
|
|
+ {
|
|
|
+ name: `住院病历`,
|
|
|
+ children: hisData.value,
|
|
|
+ emrDocumentId: `住院病历`,
|
|
|
+ type: "group-category",
|
|
|
+ },
|
|
|
+ ];
|
|
|
|
|
|
- const mz = [
|
|
|
- {
|
|
|
- name: `门诊病历`,
|
|
|
- children: mzHisDate.value,
|
|
|
- emrDocumentId: `门诊病历`,
|
|
|
- type: "group-category",
|
|
|
- },
|
|
|
- ];
|
|
|
+ const mz = [
|
|
|
+ {
|
|
|
+ name: `门诊病历`,
|
|
|
+ children: mzHisDate.value,
|
|
|
+ emrDocumentId: `门诊病历`,
|
|
|
+ type: "group-category",
|
|
|
+ },
|
|
|
+ ];
|
|
|
|
|
|
- return [...zy, ...mz];
|
|
|
- });
|
|
|
+ return [...zy, ...mz];
|
|
|
+ });
|
|
|
|
|
|
- const determineWhetherItCanBeCreated = () => {
|
|
|
- // @ts-ignore
|
|
|
- if (
|
|
|
- useUserStore().userInfo.code === patientInfo.value.referPhysician ||
|
|
|
- props!.doctorGrade > 1
|
|
|
- ) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- return wardList.includes(patientInfo.value.ward);
|
|
|
- };
|
|
|
+ const determineWhetherItCanBeCreated = () => {
|
|
|
+ // @ts-ignore
|
|
|
+ if (
|
|
|
+ useUserStore().userInfo.code === patientInfo.value.referPhysician ||
|
|
|
+ props!.doctorGrade > 1
|
|
|
+ ) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return wardList.includes(patientInfo.value.ward);
|
|
|
+ };
|
|
|
|
|
|
- const judgeTheCreationOfTransfer = async () => {
|
|
|
- let res = (await whetherItExistsInTheDepartment(
|
|
|
- patientInfo.value.inpatientNo,
|
|
|
- patientInfo.value.admissTimes
|
|
|
- )) as any;
|
|
|
- if (res === null) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (res.timeout) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- return wardList.includes(res.fDeptCode);
|
|
|
- };
|
|
|
+ const judgeTheCreationOfTransfer = async () => {
|
|
|
+ let res = (await whetherItExistsInTheDepartment(
|
|
|
+ patientInfo.value.inpatientNo,
|
|
|
+ patientInfo.value.admissTimes
|
|
|
+ )) as any;
|
|
|
+ if (res === null) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (res.timeout) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return wardList.includes(res.fDeptCode);
|
|
|
+ };
|
|
|
|
|
|
- const wardCreationJudgment = async () => {
|
|
|
- if (determineWhetherItCanBeCreated()) {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (await judgeTheCreationOfTransfer()) {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (canIUnlockIt(unlockEnum.转科创建病历)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (isDev) {
|
|
|
- return;
|
|
|
- }
|
|
|
- BizException(
|
|
|
- ExceptionEnum.MESSAGE_ERROR,
|
|
|
- "当前患者所在病区不在您的管理病区范围内,无法创建病历。"
|
|
|
- );
|
|
|
- };
|
|
|
+ const wardCreationJudgment = async () => {
|
|
|
+ if (determineWhetherItCanBeCreated()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (await judgeTheCreationOfTransfer()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (canIUnlockIt(unlockEnum.转科创建病历)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (isDev) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ BizException(
|
|
|
+ ExceptionEnum.MESSAGE_ERROR,
|
|
|
+ "当前患者所在病区不在您的管理病区范围内,无法创建病历。"
|
|
|
+ );
|
|
|
+ };
|
|
|
|
|
|
- const pastHistory = () => {
|
|
|
- getPastHistory(
|
|
|
- patientInfo.value.inpatientNo,
|
|
|
- patientInfo.value.admissTimes
|
|
|
- ).then(res => {
|
|
|
- let temp = [];
|
|
|
- for (let key in res) {
|
|
|
- temp.push({
|
|
|
- name: `第${key}次住院`,
|
|
|
- children: res[key],
|
|
|
- emrDocumentId: `第${key}次住院`,
|
|
|
- type: "group-category",
|
|
|
- });
|
|
|
- }
|
|
|
- // @ts-ignore
|
|
|
- hisData.value = temp;
|
|
|
- });
|
|
|
- // @ts-ignore
|
|
|
- getMzPatientDataByPatNo(patientInfo.value.inpatientNo).then(res => {
|
|
|
- let temp = [];
|
|
|
- for (let key in res) {
|
|
|
- temp.push({
|
|
|
- name: `第${key}次就诊`,
|
|
|
- children: res[key],
|
|
|
- emrDocumentId: `第${key}次就诊`,
|
|
|
- type: "group-category",
|
|
|
- });
|
|
|
- }
|
|
|
- // @ts-ignore
|
|
|
- mzHisDate.value = temp;
|
|
|
- });
|
|
|
- };
|
|
|
+ const pastHistory = () => {
|
|
|
+ getPastHistory(
|
|
|
+ patientInfo.value.inpatientNo,
|
|
|
+ patientInfo.value.admissTimes
|
|
|
+ ).then(res => {
|
|
|
+ let temp = [];
|
|
|
+ for (let key in res) {
|
|
|
+ temp.push({
|
|
|
+ name: `第${key}次住院`,
|
|
|
+ children: res[key],
|
|
|
+ emrDocumentId: `第${key}次住院`,
|
|
|
+ type: "group-category",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // @ts-ignore
|
|
|
+ hisData.value = temp;
|
|
|
+ });
|
|
|
+ // @ts-ignore
|
|
|
+ getMzPatientDataByPatNo(patientInfo.value.inpatientNo).then(res => {
|
|
|
+ let temp = [];
|
|
|
+ for (let key in res) {
|
|
|
+ temp.push({
|
|
|
+ name: `第${key}次就诊`,
|
|
|
+ children: res[key],
|
|
|
+ emrDocumentId: `第${key}次就诊`,
|
|
|
+ type: "group-category",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // @ts-ignore
|
|
|
+ mzHisDate.value = temp;
|
|
|
+ });
|
|
|
+ };
|
|
|
|
|
|
- const template = async (val: EmrCategoryData) => {
|
|
|
- if (val.type === "group-category") return;
|
|
|
- await wardCreationJudgment();
|
|
|
- emrMitt.emit("loadDocument", {
|
|
|
- categoryCode: val.code,
|
|
|
- categoryId: val._id,
|
|
|
- name: val.name,
|
|
|
- parent: val.parent,
|
|
|
- emrPatientData: {},
|
|
|
- courseJumpId: null,
|
|
|
- });
|
|
|
- };
|
|
|
+ const template = async (val: EmrCategoryData) => {
|
|
|
+ if (val.type === "group-category") return;
|
|
|
+ await wardCreationJudgment();
|
|
|
+ emrMitt.emit("loadDocument", {
|
|
|
+ categoryCode: val.code,
|
|
|
+ categoryId: val._id,
|
|
|
+ name: val.name,
|
|
|
+ parent: val.parent,
|
|
|
+ emrPatientData: {},
|
|
|
+ courseJumpId: null,
|
|
|
+ });
|
|
|
+ };
|
|
|
|
|
|
- function loadByDocumentId(id: string) {
|
|
|
- const findData = XEUtils.findTree(returnData.value.patientTree, item => {
|
|
|
- return item.emrDocumentId === id;
|
|
|
- });
|
|
|
- if (findData.item) {
|
|
|
- saveEmr(findData.item);
|
|
|
- }
|
|
|
- }
|
|
|
+ function loadByDocumentId(id: string) {
|
|
|
+ const findData = XEUtils.findTree(returnData.value.patientTree, item => {
|
|
|
+ return item.emrDocumentId === id;
|
|
|
+ });
|
|
|
+ if (findData.item) {
|
|
|
+ saveEmr(findData.item);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- function saveEmr(val: EmrPatientData) {
|
|
|
- const params: EmrParam = {
|
|
|
- documentId: val.emrDocumentId,
|
|
|
- categoryCode: val.emrCategoryCode,
|
|
|
- name: val.name,
|
|
|
- parent: val.parent,
|
|
|
- emrPatientData: val,
|
|
|
- courseJumpId: val.courseJumpId,
|
|
|
- };
|
|
|
+ function saveEmr(val: EmrPatientData) {
|
|
|
+ const params: EmrParam = {
|
|
|
+ documentId: val.emrDocumentId,
|
|
|
+ categoryCode: val.emrCategoryCode,
|
|
|
+ name: val.name,
|
|
|
+ parent: val.parent,
|
|
|
+ emrPatientData: val,
|
|
|
+ courseJumpId: val.courseJumpId,
|
|
|
+ };
|
|
|
|
|
|
- if (val.signComplete && val.archivePath) {
|
|
|
- window.open(val.archivePath, "_blank");
|
|
|
- return;
|
|
|
- }
|
|
|
+ if (val.signComplete && val.archivePath) {
|
|
|
+ window.open(val.archivePath, "_blank");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- emrMitt.emit("loadDocument", params);
|
|
|
- }
|
|
|
+ emrMitt.emit("loadDocument", params);
|
|
|
+ }
|
|
|
|
|
|
- emrMitt.on("loadTemplate", template);
|
|
|
- emrMitt.on("loadByDocumentId", loadByDocumentId);
|
|
|
+ emrMitt.on("loadTemplate", template);
|
|
|
+ emrMitt.on("loadByDocumentId", loadByDocumentId);
|
|
|
|
|
|
- onMounted(() => {
|
|
|
- emrMitt.on("determineWhetherItCanBeCreated", () => {
|
|
|
- return determineWhetherItCanBeCreated();
|
|
|
- });
|
|
|
- emrMitt.on("querySidebar", queryData);
|
|
|
- pastHistory();
|
|
|
- queryData();
|
|
|
- if (editor) {
|
|
|
- getAllWards().then(res => {
|
|
|
- // @ts-ignore
|
|
|
- if (res && res.length > 0) {
|
|
|
- // @ts-ignore
|
|
|
- for (let i = 0, len = res.length; i < len; i++) {
|
|
|
- // @ts-ignore
|
|
|
- wardList.push(res[i].code);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- getEmrTree().then(res => {
|
|
|
- returnData.value.emrTree = res.all;
|
|
|
- returnData.value.deptTree = res.dept;
|
|
|
- });
|
|
|
- } else {
|
|
|
- templateType.value = 2;
|
|
|
+ onMounted(() => {
|
|
|
+ emrMitt.on("determineWhetherItCanBeCreated", () => {
|
|
|
+ return determineWhetherItCanBeCreated();
|
|
|
+ });
|
|
|
+ emrMitt.on("querySidebar", queryData);
|
|
|
+ pastHistory();
|
|
|
+ queryData();
|
|
|
+ if (editor) {
|
|
|
+ getAllWards().then(res => {
|
|
|
+ // @ts-ignore
|
|
|
+ if (res && res.length > 0) {
|
|
|
+ // @ts-ignore
|
|
|
+ for (let i = 0, len = res.length; i < len; i++) {
|
|
|
+ // @ts-ignore
|
|
|
+ wardList.push(res[i].code);
|
|
|
}
|
|
|
+ }
|
|
|
+ });
|
|
|
+ getEmrTree().then(res => {
|
|
|
+ returnData.value.emrTree = res.all;
|
|
|
+ returnData.value.deptTree = res.dept;
|
|
|
});
|
|
|
+ } else {
|
|
|
+ templateType.value = 2;
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
- let findNode = false;
|
|
|
+ let findNode = false;
|
|
|
|
|
|
- function diseaseDurationRecordTime(id: string, list: any[]) {
|
|
|
- findNode = false;
|
|
|
- findMedicalRecordById(id, list, returnData.value.patientTree);
|
|
|
- }
|
|
|
+ function diseaseDurationRecordTime(id: string, list: any[]) {
|
|
|
+ findNode = false;
|
|
|
+ findMedicalRecordById(id, list, returnData.value.patientTree);
|
|
|
+ }
|
|
|
|
|
|
- const findMedicalRecordById = (
|
|
|
- id: string,
|
|
|
- roundTimes: any[],
|
|
|
- list: any[]
|
|
|
- ) => {
|
|
|
- for (let i = 0, len = list.length; i < len; i++) {
|
|
|
- if (findNode) return;
|
|
|
- let item = list[i];
|
|
|
- if (item.emrDocumentId === id) {
|
|
|
- findNode = true;
|
|
|
- item.type = "group-category";
|
|
|
- item.children = roundTimes;
|
|
|
- return;
|
|
|
- }
|
|
|
- if (item.children) {
|
|
|
- findMedicalRecordById(id, roundTimes, item.children);
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
+ const findMedicalRecordById = (
|
|
|
+ id: string,
|
|
|
+ roundTimes: any[],
|
|
|
+ list: any[]
|
|
|
+ ) => {
|
|
|
+ for (let i = 0, len = list.length; i < len; i++) {
|
|
|
+ if (findNode) return;
|
|
|
+ let item = list[i];
|
|
|
+ if (item.emrDocumentId === id) {
|
|
|
+ findNode = true;
|
|
|
+ item.type = "group-category";
|
|
|
+ item.children = roundTimes;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (item.children) {
|
|
|
+ findMedicalRecordById(id, roundTimes, item.children);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
|
|
|
- expose({
|
|
|
- queryData,
|
|
|
- diseaseDurationRecordTime,
|
|
|
- });
|
|
|
+ expose({
|
|
|
+ queryData,
|
|
|
+ diseaseDurationRecordTime,
|
|
|
+ });
|
|
|
|
|
|
- return () => {
|
|
|
- return (
|
|
|
- <TabsResizer
|
|
|
- value={220}
|
|
|
- min={100}
|
|
|
- max={500}
|
|
|
- style={{marginRight: "5px"}}
|
|
|
- modelValue={templateType.value}
|
|
|
- onUpdate:modelValue={val => (templateType.value = val)}
|
|
|
- >
|
|
|
- <TabPaneResizer label="全院" name={0}>
|
|
|
- <HospitalTemplate
|
|
|
- data={returnData.value.emrTree}
|
|
|
- onNodeClick={template}
|
|
|
- />
|
|
|
- </TabPaneResizer>
|
|
|
- <TabPaneResizer label="科室" name={1}>
|
|
|
- <HospitalTemplate
|
|
|
- onNodeClick={template}
|
|
|
- data={returnData.value.deptTree}
|
|
|
- />
|
|
|
- </TabPaneResizer>
|
|
|
- <TabPaneResizer label="当前" name={2}>
|
|
|
- <PatientEmrData
|
|
|
- onRefresh={queryData}
|
|
|
- onNodeClick={saveEmr}
|
|
|
- treeData={returnData.value.patientTree}
|
|
|
- />
|
|
|
- </TabPaneResizer>
|
|
|
- <TabPaneResizer label="历史" name={3}>
|
|
|
- <PatientHistoryData data={hisComp.value}/>
|
|
|
- </TabPaneResizer>
|
|
|
- </TabsResizer>
|
|
|
- );
|
|
|
- };
|
|
|
- },
|
|
|
+ return () => {
|
|
|
+ return (
|
|
|
+ <TabsResizer
|
|
|
+ value={220}
|
|
|
+ min={100}
|
|
|
+ max={500}
|
|
|
+ style={{ marginRight: "5px" }}
|
|
|
+ modelValue={templateType.value}
|
|
|
+ onUpdate:modelValue={val => (templateType.value = val)}
|
|
|
+ >
|
|
|
+ {/*<TabPaneResizer label="全院" name={0}>*/}
|
|
|
+ {/* <HospitalTemplate*/}
|
|
|
+ {/* data={returnData.value.emrTree}*/}
|
|
|
+ {/* onNodeClick={template}*/}
|
|
|
+ {/* />*/}
|
|
|
+ {/*</TabPaneResizer>*/}
|
|
|
+ {/*<TabPaneResizer label="科室" name={1}>*/}
|
|
|
+ {/* <HospitalTemplate*/}
|
|
|
+ {/* onNodeClick={template}*/}
|
|
|
+ {/* data={returnData.value.deptTree}*/}
|
|
|
+ {/* />*/}
|
|
|
+ {/*</TabPaneResizer>*/}
|
|
|
+ <TabPaneResizer label="当前" name={2}>
|
|
|
+ <PatientEmrData
|
|
|
+ onRefresh={queryData}
|
|
|
+ onNodeClick={saveEmr}
|
|
|
+ treeData={returnData.value.patientTree}
|
|
|
+ />
|
|
|
+ </TabPaneResizer>
|
|
|
+ <TabPaneResizer label="历史" name={3}>
|
|
|
+ <PatientHistoryData data={hisComp.value} />
|
|
|
+ </TabPaneResizer>
|
|
|
+ </TabsResizer>
|
|
|
+ );
|
|
|
+ };
|
|
|
+ },
|
|
|
});
|
|
|
|
|
|
export default EmrSidebar;
|