Sfoglia il codice sorgente

临床路径提示表

xiaochan 3 mesi fa
parent
commit
42d270ded7

+ 107 - 106
src/api/public-api.js

@@ -1,28 +1,28 @@
-import request from '@/utils/request'
+import request from "@/utils/request";
 import axios from "axios";
 
-export function getRenYuan(code, deptCode = '') {
-    return request({
-        url: '/publicApi/getRenYuan',
-        method: 'get',
-        params: {code, deptCode},
-    })
+export function getRenYuan(code, deptCode = "") {
+  return request({
+    url: "/publicApi/getRenYuan",
+    method: "get",
+    params: { code, deptCode },
+  });
 }
 
 export function getRenYuanPage(code, curPage) {
-    return request({
-        url: '/publicApi/getRenYuanPage',
-        method: 'get',
-        params: {code, curPage},
-    })
+  return request({
+    url: "/publicApi/getRenYuanPage",
+    method: "get",
+    params: { code, curPage },
+  });
 }
 
 export function getChargeCode(pyCode) {
-    return request({
-        url: '/publicApi/getChargeCode',
-        method: 'get',
-        params: {pyCode},
-    })
+  return request({
+    url: "/publicApi/getChargeCode",
+    method: "get",
+    params: { pyCode },
+  });
 }
 
 /**
@@ -30,95 +30,99 @@ export function getChargeCode(pyCode) {
  * @return Promise<any[]>
  */
 export function getDept() {
-    return request({
-        url: '/publicApi/getDept',
-        method: 'get',
-    })
+  return request({
+    url: "/publicApi/getDept",
+    method: "get",
+  });
 }
 
 export function getZhuYuanDept() {
-    return request({
-        url: '/publicApi/getZhuYuanDept',
-        method: 'get',
-    })
+  return request({
+    url: "/publicApi/getZhuYuanDept",
+    method: "get",
+  });
 }
 
 export function queryDept(code) {
-    return request({
-        url: '/publicApi/queryDept',
-        method: 'get',
-        params: {code}
-    })
+  return request({
+    url: "/publicApi/queryDept",
+    method: "get",
+    params: { code },
+  });
 }
 
 export function maZuiFangShi() {
-    return request({
-        url: '/publicApi/maZuiFangShi',
-        method: 'get',
-    })
+  return request({
+    url: "/publicApi/maZuiFangShi",
+    method: "get",
+  });
 }
 
+/**
+ *
+ * @return {Promise<string>}
+ */
 export function getServerDateApi() {
-    return request({
-        url: '/publicApi/getDate',
-        method: 'get',
-    });
+  return request({
+    url: "/publicApi/getDate",
+    method: "get",
+  });
 }
 
 export function yaoPinXiangMuPiPeiYiBao(data) {
-    return request({
-        url: '/publicApi/yaoPinXiangMuPiPeiYiBao',
-        method: 'post',
-        data
-    })
+  return request({
+    url: "/publicApi/yaoPinXiangMuPiPeiYiBao",
+    method: "post",
+    data,
+  });
 }
 
 export function getAllergens(name) {
-    return request({
-        url: '/publicApi/getAllergens',
-        method: 'get',
-        params: {name}
-    });
+  return request({
+    url: "/publicApi/getAllergens",
+    method: "get",
+    params: { name },
+  });
 }
 
 export function getPatientAllergens(patNo) {
-    return request({
-        url: '/publicApi/getPatientAllergens',
-        method: 'get',
-        params: {patNo}
-    });
+  return request({
+    url: "/publicApi/getPatientAllergens",
+    method: "get",
+    params: { patNo },
+  });
 }
 
 export function newPatientAllergens(patNo, allergenCode, allergenType) {
-    return request({
-        url: '/publicApi/newPatientAllergens',
-        method: 'get',
-        params: {patNo, allergenCode, allergenType}
-    });
+  return request({
+    url: "/publicApi/newPatientAllergens",
+    method: "get",
+    params: { patNo, allergenCode, allergenType },
+  });
 }
 
 export function removePatientAllergens(id) {
-    return request({
-        url: '/publicApi/removePatientAllergens',
-        method: 'get',
-        params: {id}
-    });
+  return request({
+    url: "/publicApi/removePatientAllergens",
+    method: "get",
+    params: { id },
+  });
 }
 
 export function getDrugInfo(name) {
-    return request({
-        url: '/publicApi/getDrugInfo',
-        method: 'get',
-        params: {name}
-    });
+  return request({
+    url: "/publicApi/getDrugInfo",
+    method: "get",
+    params: { name },
+  });
 }
 
 export function getBldCat(name) {
-    return request({
-        url: '/publicApi/getBldCat',
-        method: 'get',
-        params: {name}
-    });
+  return request({
+    url: "/publicApi/getBldCat",
+    method: "get",
+    params: { name },
+  });
 }
 
 /**
@@ -126,32 +130,32 @@ export function getBldCat(name) {
  * @returns {*}
  */
 export function getTheTransferList() {
-    return request({
-        url: '/publicApi/getTheTransferList',
-        method: 'get'
-    });
+  return request({
+    url: "/publicApi/getTheTransferList",
+    method: "get",
+  });
 }
 
 export function getPeopleToFillInInformation() {
-    return request({
-        url: '/publicApi/getPeopleToFillInInformation',
-        method: 'get'
-    });
+  return request({
+    url: "/publicApi/getPeopleToFillInInformation",
+    method: "get",
+  });
 }
 
 export function idVerificationApi(idCard) {
-    return request({
-        url: '/publicApi/idVerification',
-        method: 'get',
-        params: {idCard}
-    });
+  return request({
+    url: "/publicApi/idVerification",
+    method: "get",
+    params: { idCard },
+  });
 }
 
 export function getSystemAnnouncement() {
-    return request({
-        url: '/getSystemAnnouncement',
-        method: 'get',
-    });
+  return request({
+    url: "/getSystemAnnouncement",
+    method: "get",
+  });
 }
 
 /**
@@ -159,26 +163,23 @@ export function getSystemAnnouncement() {
  * @return {Promise<String>}
  */
 export function getUuid() {
-    return request({
-        url: '/publicApi/getUuid',
-        method: 'get',
-    })
+  return request({
+    url: "/publicApi/getUuid",
+    method: "get",
+  });
 }
 
 export function getPersonnelAll() {
-    return request({
-        url: '/publicApi/getPersonnelAll',
-        method: 'get',
-    })
+  return request({
+    url: "/publicApi/getPersonnelAll",
+    method: "get",
+  });
 }
 
 export function getItemDrug(code) {
-    return request({
-        url: '/publicApi/getItemDrug',
-        method: 'get',
-        params: {code}
-    });
+  return request({
+    url: "/publicApi/getItemDrug",
+    method: "get",
+    params: { code },
+  });
 }
-
-
-

+ 47 - 0
src/api/zhu-yuan-yi-sheng/sendDockerPrompt.ts

@@ -0,0 +1,47 @@
+import requestV2 from "@/utils/request-v2";
+
+export interface SendDockerPrompt {
+  id: string;
+  patNo: string;
+  times: number;
+  prompt: string;
+  promptTime: Date;
+  doctorCode: string;
+}
+
+export interface SavePrompt {
+  patNo: string;
+  times: number;
+  doctorCode?: string;
+  list: SavePromptList[];
+}
+
+export interface SavePromptList {
+  date: string;
+  prompt: string;
+}
+
+export function getSendDockerPrompt(patNo: string, times: number) {
+  return requestV2<SendDockerPrompt[]>({
+    url: "/sendDockerPrompt/getSendDockerPrompt",
+    method: "get",
+    params: { patNo, times },
+  });
+}
+
+export function readPrompt(ids: string[]) {
+  return requestV2({
+    url: "/sendDockerPrompt/readPrompt",
+    method: "post",
+    data: ids,
+    showLoading: false,
+  });
+}
+
+export function sendPrompt(data: SavePrompt) {
+  return requestV2({
+    url: "/sendDockerPrompt/sendPrompt",
+    method: "post",
+    data,
+  });
+}

+ 4 - 1
src/components/cy/CyDialog/index.vue

@@ -93,7 +93,10 @@ const style = (item: DialogState) => {
     :show-close="false"
     @closed="closed(item, index)"
   >
-    <template #header="{ close, titleId, titleClass }">
+    <template
+      #header="{ close, titleId, titleClass }"
+      v-if="item.dialogProps.showClose"
+    >
       <div
         style="
           display: flex;

+ 31 - 6
src/views/hospitalization/zhu-yuan-yi-sheng/clinical-pathway/components/DialogOrder.vue

@@ -11,6 +11,8 @@ import {
 import { getServerDateApi } from "@/api/public-api";
 import { insertTemplateOrder } from "@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
 import { VxeTableInstance } from "vxe-table";
+import dayjs from "dayjs";
+import { sendPrompt } from "@/api/zhu-yuan-yi-sheng/sendDockerPrompt";
 
 defineOptions({
   name: "DialogOrder",
@@ -70,6 +72,10 @@ function setTableMap(key, value) {
 defineExpose<UseDialogType.Expose>({
   async confirm() {
     const orderData = [];
+    const prompt: {
+      date: string;
+      prompt: string;
+    }[] = [];
 
     const now = await getServerDateApi();
 
@@ -85,6 +91,19 @@ defineExpose<UseDialogType.Expose>({
           row.orderTime = now;
           row.groupNo = queryParam.value.groupNo;
           row.drugSpecification = row.specification;
+
+          if (row.execDay > 1) {
+            // 使用 dayjs 添加 execDay 天
+            const tmpDate = dayjs(now)
+              .add(row.execDay, "day")
+              .format("YYYY-MM-DD");
+
+            prompt.push({
+              date: tmpDate,
+              prompt: `【临床路径】仅提示,因您在临床路径中选择的医嘱有选择执行【${row.execDay}天】,今天需要停止医嘱名称:【${row.orderName}】编码:【${row.orderCode}】。`,
+            });
+          }
+
           orderData.push(row);
         } else if (row.type === 1) {
           const tmp = {
@@ -116,13 +135,19 @@ defineExpose<UseDialogType.Expose>({
       });
     }
     if (orderData.length > 0) {
-      await insertTemplateOrder({
-        inpatientNo: huanZheXinXi.value.inpatientNo,
-        admissTimes: huanZheXinXi.value.admissTimes,
-        list: orderData,
-      }).then(() => {
-        jsQueryYzData();
+      console.log(prompt);
+      sendPrompt({
+        patNo: huanZheXinXi.value.inpatientNo,
+        times: huanZheXinXi.value.admissTimes,
+        list: prompt,
       });
+      // await insertTemplateOrder({
+      //   inpatientNo: huanZheXinXi.value.inpatientNo,
+      //   admissTimes: huanZheXinXi.value.admissTimes,
+      //   list: orderData,
+      // }).then(() => {
+      //   jsQueryYzData();
+      // });
     }
   },
 });

+ 42 - 0
src/views/hospitalization/zhu-yuan-yi-sheng/comp/SendPromptDialog.vue

@@ -0,0 +1,42 @@
+<script setup lang="ts">
+import {
+  readPrompt,
+  SendDockerPrompt,
+} from "@/api/zhu-yuan-yi-sheng/sendDockerPrompt";
+import { UseDialogType } from "@/components/cy/CyDialog/index";
+
+const props = defineProps<{
+  value: SendDockerPrompt[];
+}>();
+
+defineExpose<UseDialogType.Expose>({
+  confirm() {
+    const tmp = [];
+
+    props.value.forEach(item => {
+      tmp.push(item.id);
+    });
+
+    readPrompt(tmp);
+  },
+});
+</script>
+
+<template>
+  <div style="max-height: 300px; overflow: auto">
+    <div
+      style="
+        padding: 9px;
+        margin: 5px;
+        background: var(--el-color-warning);
+        color: var(--el-color-white);
+        border-radius: 5px;
+      "
+      v-for="(item, index) in value"
+    >
+      {{ index + 1 }}、{{ item.prompt }}
+    </div>
+  </div>
+</template>
+
+<style lang="scss"></style>

+ 27 - 0
src/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng.ts

@@ -36,6 +36,8 @@ import { useSystemStore } from "@/pinia/system-store";
 import { TableMethods } from "vxe-table";
 import ItemInstructions from "@/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/ItemInstructions.vue";
 import { useDialog } from "@/components/cy/CyDialog/index";
+import { getSendDockerPrompt } from "@/api/zhu-yuan-yi-sheng/sendDockerPrompt";
+import SendPromptDialog from "@/views/hospitalization/zhu-yuan-yi-sheng/comp/SendPromptDialog.vue";
 
 export interface PatInfo {
   inpatientNo?: string | null;
@@ -827,6 +829,30 @@ export function clickTimeLimitReminder() {
   );
 }
 
+async function queryPrompt() {
+  const data = await getSendDockerPrompt(
+    huanZheXinXi.value.inpatientNo,
+    huanZheXinXi.value.admissTimes
+  ).catch(() => []);
+
+  if (data.length === 0) {
+    return;
+  }
+
+  useDialog(SendPromptDialog, {
+    dialogProps: {
+      title: "提示",
+      closeOnClickModal: false,
+      closeOnPressEscape: false,
+      showClose: false,
+    },
+    showCancel: false,
+    params: {
+      value: data,
+    },
+  }).catch(XEUtils.noop);
+}
+
 /**
  * 点击查询患者信息
  * @param patNo 住院号
@@ -836,6 +862,7 @@ export const clickOnThePatient = async (patNo: string) => {
   huanZheXinXi.value = (await getPatientInfo(patNo)) as any;
 
   yzMitt.emit("setTableKey", huanZheXinXi.value!.inpatientNo);
+  queryPrompt();
   changePatientHook.forEach(item => {
     item();
   });