pengjun 3 months ago
parent
commit
3c0b9a9a86
  1. 1
      src/components/doctorCheck/PatientRegisterBase2.vue
  2. 7
      src/components/patientRegister/patientRegisterQuery.vue
  3. 70
      src/views/doctorCheck/sumDoctorCheck.vue

1
src/components/doctorCheck/PatientRegisterBase2.vue

@ -255,6 +255,7 @@ export default {
let noVal = this.prBase[noType] // let noVal = this.prBase[noType] //
if (!noVal) return if (!noVal) return
let body = {} let body = {}
if(noType == 'idNo') noVal = noVal.toUpperCase()
body[noType] = noVal body[noType] = noVal
let patientRegister = { id: '' } let patientRegister = { id: '' }

7
src/components/patientRegister/patientRegisterQuery.vue

@ -305,7 +305,12 @@ export default {
toQuery(queryType) { toQuery(queryType) {
console.log('toQuery.queryType',queryType) console.log('toQuery.queryType',queryType)
this.query.queryType = queryType this.query.queryType = queryType
if(queryType != 'idCardNo') this.query.photo = ''
//
if(queryType == 'idCardNo'){
this.query.idCardNo = this.query.idCardNo.toUpperCase()
}else{
this.query.photo = ''
}
this.$emit('triggerQuery', this.query) this.$emit('triggerQuery', this.query)
}, },

70
src/views/doctorCheck/sumDoctorCheck.vue

@ -142,7 +142,7 @@
<!-- <el-tooltip content="根据诊断搜索医学解释、常见原因及健康指导" placement="top"></el-tooltip>--> <!-- <el-tooltip content="根据诊断搜索医学解释、常见原因及健康指导" placement="top"></el-tooltip>-->
<el-button icon="el-icon-cpu" <el-button icon="el-icon-cpu"
style="margin-left: 2px;min-width:21px;height:21px;padding:2px;" style="margin-left: 2px;min-width:21px;height:21px;padding:2px;"
@click="btnAIdiagnosis(scope.row.diagnosisNames)"
@click="btnAIdiagnosisDetail(scope.row.diagnosisNames)"
:disabled="sumBtnDisabled"></el-button> :disabled="sumBtnDisabled"></el-button>
<el-button :icon="scope.row.collapse ? 'el-icon-arrow-down' : 'el-icon-arrow-up'" <el-button :icon="scope.row.collapse ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"
@ -547,6 +547,9 @@
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import Sortable from "sortablejs"; import Sortable from "sortablejs";
import moment from "moment"; import moment from "moment";
import MarkdownIt from "markdown-it";
const md = new MarkdownIt();
import { getapi, postapi, putapi, deletapi, fetchStream } from "@/api/api"; import { getapi, postapi, putapi, deletapi, fetchStream } from "@/api/api";
import { arrayExistObj, arrayReduce, tcdate, getPagePriv, checkPagePriv, deepCopy, objCopy } from "../../utlis/proFunc"; import { arrayExistObj, arrayReduce, tcdate, getPagePriv, checkPagePriv, deepCopy, objCopy } from "../../utlis/proFunc";
@ -673,7 +676,7 @@ export default {
max: true, max: true,
visible: false, visible: false,
diagnosis: 'AI诊断信息', diagnosis: 'AI诊断信息',
isAssistant: false, // AI
isAssistant: true, // AI
question: "", // question: "", //
rawText: '', rawText: '',
html: "" html: ""
@ -1319,14 +1322,7 @@ export default {
// AI AI使 fetchStream // AI AI使 fetchStream
btnAIdiagnosis() { btnAIdiagnosis() {
this.AI.isAssistant = true
this.AI.question = ''
this.AI.visible = true
this.btnAImax(false);
this.toAIdiagnosis()
},
async toAIdiagnosis() {
this.AI.isAssistant = true
let message = this.AI.question; let message = this.AI.question;
if (!message) { if (!message) {
let linkStr = ';'; let linkStr = ';';
@ -1341,55 +1337,15 @@ export default {
message += (i + 1) + ')、' + e1.summaryContent; message += (i + 1) + ')、' + e1.summaryContent;
}); });
}); });
message = '性别:' + this.doctorCheck.prBase.sexName + ',年龄:' + this.doctorCheck.prBase.age + '岁,检查结果:' + message;
message = '性别:' + this.patient_register.sexName + ',年龄:' + this.patient_register.age + '岁,检查结果:' + message;
this.AI.question = message this.AI.question = message
} }
this.AI.rawText = '';
this.AI.html = '';
try {
await fetchStream('/api/app/AiMessageWs/GetAIMessageResult', { message }, (chunk) => {
// SSE
let cleaned = String(chunk).replace(/data:\s*\[DONE\]/g, '').replace(/^data:\s*/gm, '');
if (!cleaned) return;
//
if (!this.AI.visible) {
this.AI.visible = true;
this.btnAImax(false);
}
this.AI.rawText += cleaned;
// Markdown
this.AI.html = md.render(this.AI.rawText);
//
this.$nextTick(() => {
try {
const el = this.$refs.aiContent;
if (el) el.scrollTop = el.scrollHeight;
} catch (e) { }
});
});
} catch (err) {
// 退axios/postapi
try {
const res = await postapi('/api/app/AiMessageWs/GetAIMessageResult', { message });
if (res) {
let cleaned = String(res).replace(/data:\s*\[DONE\]/g, '').replace(/^data:\s*/gm, '');
if (cleaned) {
// 退
if (!this.AI.visible) {
this.AI.visible = true;
this.btnAImax(false);
}
this.AI.rawText += cleaned;
this.AI.html = md.render(this.AI.rawText);
}
}
} catch (e) {
this.$message.error({ showClose: true, message: (err && err.message) || 'AI诊断请求失败' });
}
}
this.AI.visible = true
this.btnAImax(false);
this.toAIdiagnosis()
}, },
// AI // AI
btnAImax(max) { btnAImax(max) {
this.AI.max = !max this.AI.max = !max
@ -1703,7 +1659,7 @@ export default {
// //
// AI AI // AI AI
btnAIdiagnosis(diagnosis) {
btnAIdiagnosisDetail(diagnosis) {
this.AI.visible = true this.AI.visible = true
this.AI.question = '' this.AI.question = ''
this.btnAImax(false) this.btnAImax(false)
@ -1718,7 +1674,7 @@ export default {
return return
} }
message = '性别:' + this.doctorCheck.prBase.sexName + ',年龄:' + this.doctorCheck.prBase.age + '岁,检查结果:' + diagnosis
message = '性别:' + this.patient_register.sexName + ',年龄:' + this.patient_register.age + '岁,检查结果:' + diagnosis
+ ' 请给出医学解释、常见原因及健康指导' + ' 请给出医学解释、常见原因及健康指导'
this.AI.question = message this.AI.question = message
} }

Loading…
Cancel
Save