|
@@ -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;
|