Ver Fonte

ca签名病程片段

xiaochan há 10 meses atrás
pai
commit
dadb516520

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

@@ -1459,6 +1459,7 @@ const restoreDefaultSettings = () => {
  * @param param
  */
 const loadDocument = (param: EmrParam): Promise<void> => {
+  console.log(param);
   return new Promise(async (resolve, reject) => {
     const { loadDocument: load } = editMain;
     if (!showIframeIsList(IframeTabs.正在编辑, IframeTabs.同时打开)) {
@@ -1645,6 +1646,46 @@ const initEdit = () => {
     emrStore.mutation.installPlugins(res, emrStore);
     if (isDev) {
       await sleep(500);
+      loadDocument({
+        documentId: "926126765108168704",
+        categoryCode: "shoucibingchengjilu",
+        name: "病程记录",
+        parent: "38ed7f50a6ba11eda4de571d638b2c14",
+        emrPatientData: {
+          id: 305698,
+          patNo: "0432709",
+          times: 1,
+          emrDocumentId: "926126765108168704",
+          emrCategoryCode: "shoucibingchengjilu",
+          delFlag: 0,
+          emrName: "首次病程记录",
+          name: "病程记录",
+          createId: "02686",
+          createName: "刘子琨",
+          createDate: "2024-11-01 15:37:10",
+          modifyId: "02686",
+          modifyDate: "2024-11-06 11:31:25",
+          emrDataElement: null,
+          emrDataElementStr: "",
+          submit: 0,
+          submitId: null,
+          submitTime: null,
+          documentData: null,
+          fragment: null,
+          parent: "38ed7f50a6ba11eda4de571d638b2c14",
+          referPhysician: null,
+          consultPhysician: null,
+          deptDirector: null,
+          reviewDoctors: null,
+          reviewTime: null,
+          signType: null,
+          signComplete: null,
+          archivePath: null,
+          type: "group-category",
+          courseJumpId: "qIGmwwSoIQ",
+        },
+        courseJumpId: "qIGmwwSoIQ",
+      });
     }
   });
 };

+ 19 - 2
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/plugins/ca/emr-ca.tsx

@@ -14,10 +14,12 @@ import {
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-func/useEmrStore";
 import {
   EmrRightTabs,
+  isCourse,
   patientInfo,
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
 import { stringNotBlank } from "@/utils/blank-utils";
 import { ElMessageBox } from "element-plus";
+import { parsingFragmentDataElements } from "@/utils/emr/emr-init-v2";
 
 const GenerateSignature = defineAsyncComponent(
   () =>
@@ -242,14 +244,14 @@ export function emrCa() {
     if (eleInfo?.code?.internal !== "授权CA签名") {
       return;
     }
-    const us = useUserStore().userInfo;
     const res = await useDialog(GenerateSignature, {
       dialogProps: {
         title: "授权签名",
       },
     });
+
     const code = res.code;
-    const msg = `由${us.name}发起签名,患者:【${patientInfo.name}】,性别:【${patientInfo.sexName}】,签名病历【${emrName}】`;
+    const msg = getSignMsg(patientInfo, emrName, view);
     const caData = await sendByCode({
       id: isDev ? "00026" : code,
       msg: msg,
@@ -258,6 +260,21 @@ export function emrCa() {
     view.sign([caData]);
   }
 
+  function getSignMsg(patientInfo, emrName, view) {
+    if (!isCourse(store.store.categoryCode)) {
+      return `由${us.name}发起签名,患者:【${patientInfo.name}】,性别:【${patientInfo.sexName}】,签名病历【${emrName}】`;
+    }
+    const area = editor.getViewByElType(view.el, "area");
+    const node = area.model;
+    const values = parsingFragmentDataElements(editor, node);
+
+    function get(name = "") {
+      return values[name].value;
+    }
+
+    return `病程片段:${us.name}发起签名,查房时间:${get("查房时间")},查房标题:${get("查房标题")}`;
+  }
+
   function 患者CA签名(_evt, _view, eleInfo, value) {
     if (eleInfo?.code?.internal !== "患者CA签名") {
       return;