|
@@ -200,10 +200,12 @@
|
|
|
模式:{{ editorMod ? '只读' : '编辑' }}
|
|
|
</div>
|
|
|
<div class="creator_prompt-btn-sync">
|
|
|
- <el-button @click="syncEmrPatientData"
|
|
|
+ <el-button @click="syncEmrPatientData()"
|
|
|
+ @contextmenu.prevent.stop="selectFill"
|
|
|
:disabled="syncDisabled()"
|
|
|
+ v-title="emrTitle.同步"
|
|
|
type="warning">
|
|
|
- 同步
|
|
|
+ 同步数据
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -317,7 +319,7 @@ import {
|
|
|
patientInfo,
|
|
|
query,
|
|
|
vIframeTabs,
|
|
|
- showIframe, showIframeIsList
|
|
|
+ showIframe, showIframeIsList, emrTitle
|
|
|
} from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
|
|
|
import {ElInput, ElMessage, ElMessageBox} from "element-plus";
|
|
|
import {BizException, ExceptionEnum} from "@/utils/BizException";
|
|
@@ -343,7 +345,7 @@ import EmrWebSocket from "@/components/zhu-yuan-yi-sheng/emr/web-socket/EmrWebSo
|
|
|
import {stringIsBlank, stringNotBlank} from "@/utils/blank-utils";
|
|
|
import {isDev} from "@/utils/public";
|
|
|
import {forcedKickingOutOfPersonnelByDocumentId, isThereADoctorEditing} from "@/api/zhu-yuan-yi-sheng/emr-socket";
|
|
|
-import {computed, nextTick, onDeactivated, onMounted, toRaw, ref, watch} from "vue";
|
|
|
+import {computed, nextTick, onDeactivated, onMounted, toRaw, ref, watch, unref} from "vue";
|
|
|
import EmrFirstPageOfMedicalRecord from "@/components/zhu-yuan-yi-sheng/emr/EmrFirstPageOfMedicalRecord.vue";
|
|
|
import EmrResultReturns
|
|
|
from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/components/EmrResultReturns.vue";
|
|
@@ -400,6 +402,8 @@ import setDialogToJs from "@/components/js-dialog-comp/useDialogToJs";
|
|
|
import ReportOfInfectiousDiseases
|
|
|
from "@/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/report-of-infectious-diseases/ReportOfInfectiousDiseases.vue";
|
|
|
import {Expand, Fold} from "@element-plus/icons-vue";
|
|
|
+import ChooseToFillInData
|
|
|
+ from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/ChooseToFillInData.vue";
|
|
|
|
|
|
const props = defineProps({
|
|
|
maxHeight: {
|
|
@@ -414,8 +418,8 @@ const editRef = ref(null)
|
|
|
// 编辑器
|
|
|
let editor: EditType | null = null
|
|
|
let runtime: Runtime | null = null
|
|
|
-
|
|
|
let editMain: UseEmrInitReturn = {}
|
|
|
+let extractData = {}
|
|
|
|
|
|
const emrSocket = ref<{
|
|
|
clearDocument: () => void;
|
|
@@ -554,12 +558,9 @@ const emrEvent = {
|
|
|
data: {}
|
|
|
}
|
|
|
|
|
|
- if (stringIsBlank(createId) || createId === userInfoStore.value.code) {
|
|
|
- tempData.data = patientData.value
|
|
|
- }
|
|
|
-
|
|
|
- if (isDev) {
|
|
|
- tempData.data = patientData.value
|
|
|
+ // 只有是空的才触发
|
|
|
+ if (getId() === null) {
|
|
|
+ tempData.data = unref(patientData)
|
|
|
}
|
|
|
|
|
|
editor.setApplicationContext(tempData, true, false)
|
|
@@ -928,17 +929,17 @@ async function saveSuccessFunc(saveData: saveType) {
|
|
|
}
|
|
|
await nextTick()
|
|
|
await sleep(200)
|
|
|
- await loadDocument(data)
|
|
|
+ await loadDocument((data as any))
|
|
|
}
|
|
|
xcMessage.success('保存成功')
|
|
|
}
|
|
|
|
|
|
// 把提取到的数据放到 patientData 中.
|
|
|
function replaceDataElement(data) {
|
|
|
+ extractData = data
|
|
|
Object.assign(patientData.value, data)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 添加片段
|
|
|
const clickToFillInData = (value) => {
|
|
|
if (!readonlyPattern()) {
|
|
@@ -995,6 +996,7 @@ const clickDelete = () => {
|
|
|
let item = res[i]
|
|
|
// 删除提取到的数据源
|
|
|
delete patientData.value[item]
|
|
|
+ delete extractData[item]
|
|
|
}
|
|
|
}
|
|
|
isEditorChange.value = false
|
|
@@ -1281,22 +1283,30 @@ const courseSegmentLocking = async () => {
|
|
|
/**
|
|
|
* 重新设置提取的数据, 这里是强制替换
|
|
|
*/
|
|
|
-const syncEmrPatientData = () => {
|
|
|
+const syncEmrPatientData = (val?: string[]) => {
|
|
|
if (syncDisabled()) return
|
|
|
- if (getId() && patientData.value) {
|
|
|
- editor.setValues(patientData.value, true, true)
|
|
|
- isEditorChange.value = true
|
|
|
+ if (val) {
|
|
|
+ let temp = {}
|
|
|
+ val.forEach(item => {
|
|
|
+ temp[item] = extractData[item]
|
|
|
+ })
|
|
|
+ editor.setValues(temp, true, true)
|
|
|
+ } else {
|
|
|
+ editor.setValues(extractData, true, true)
|
|
|
}
|
|
|
+ editor.setValues(patientData.value, false, true)
|
|
|
+ isEditorChange.value = true
|
|
|
}
|
|
|
|
|
|
function syncDisabled() {
|
|
|
+ if (isDev) return false;
|
|
|
// 如果不是是编辑状态
|
|
|
if (!emrConfig.value.editor) return true;
|
|
|
// 如果是只读模式就不触发这个
|
|
|
if (readonlyPattern()) return true;
|
|
|
// 如果病历是空的 且创建人不是自己不触发
|
|
|
if (stringIsBlank(createId) || createId !== userInfoStore.value.code) return true;
|
|
|
- if (getId() && patientData.value) {
|
|
|
+ if (getId()) {
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
@@ -1320,14 +1330,15 @@ const clickToSubmitTheMedicalRecord = async () => {
|
|
|
|
|
|
/**
|
|
|
* 查询患者信息
|
|
|
- * @returns {Promise<void>}
|
|
|
*/
|
|
|
const queryingBasicPatientInformation = () => {
|
|
|
getEmrPatientData(patientInfo.value.inpatientNo, patientInfo.value.admissTimes).then(res => {
|
|
|
patientData.value = res
|
|
|
getCurrentPersonnelInformation()
|
|
|
})
|
|
|
-
|
|
|
+ getExtractDataElement(patientInfo.value.inpatientNo, patientInfo.value.admissTimes).then(res => {
|
|
|
+ extractData = res
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// DRG 智能分组
|
|
@@ -1982,6 +1993,19 @@ async function handleCrb() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+function selectFill() {
|
|
|
+ setDialogToJs(ChooseToFillInData, {data: extractData}).then(res => {
|
|
|
+ const [a] = res
|
|
|
+
|
|
|
+ if (a.length === 0) {
|
|
|
+ return xcMessage.error('请选择')
|
|
|
+ }
|
|
|
+ syncEmrPatientData(a)
|
|
|
+
|
|
|
+ }).catch(() => {
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
defineExpose({
|
|
|
closeBothSides,
|