cnhis-design-vue 3.2.18-beta.14 → 3.2.18-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/ai-chat/src/components/ChatMainInner.js +1 -1
- package/es/components/ai-chat/src/components/ChatRight.vue2.js +1 -1
- package/es/components/ai-chat/src/components/card/JsonCard.js +1 -1
- package/es/components/ai-chat/src/hooks/useProgram.js +1 -1
- package/es/components/ai-chat/src/hooks/useWebsocket.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as n,ref as t,computed as o,watch as s,createVNode as r,createTextVNode as a,nextTick as l,resolveComponent as i}from"vue";import{NSpin as c}from"naive-ui";import{InjectionAIChatEmits as u,InjectionAIChat as d}from"../types/index.js";import{isArray as v,isFunction as m}from"lodash-es";import{uuidGenerator as p}from"../../../../shared/utils/index.js";import{useLocalStorage as g}from"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{useScrollLoading as f}from"../../../../shared/hooks/useScrollLoading.js";import h from"./card/JsonCard.js";import{getHistoryRecordApi as y,conversationApi as j}from"../api/index.js";import{useProgram as C}from"../hooks/useProgram.js";var I=e({name:"ChatMain",inheritAttrs:!1,components:{JsonCard:h},setup(e,{attrs:h,slots:I,emit:b}){const M=g("aISessionIdMap",new Map);n(u);const{patientInfo:
|
1
|
+
import{defineComponent as e,inject as n,ref as t,computed as o,watch as s,createVNode as r,createTextVNode as a,nextTick as l,resolveComponent as i}from"vue";import{NSpin as c}from"naive-ui";import{InjectionAIChatEmits as u,InjectionAIChat as d}from"../types/index.js";import{isArray as v,isFunction as m}from"lodash-es";import{uuidGenerator as p}from"../../../../shared/utils/index.js";import{useLocalStorage as g}from"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{useScrollLoading as f}from"../../../../shared/hooks/useScrollLoading.js";import h from"./card/JsonCard.js";import{getHistoryRecordApi as y,conversationApi as j}from"../api/index.js";import{useProgram as C}from"../hooks/useProgram.js";var I=e({name:"ChatMain",inheritAttrs:!1,components:{JsonCard:h},setup(e,{attrs:h,slots:I,emit:b}){const M=g("aISessionIdMap",new Map);n(u);const{patientInfo:w,state:x}=n(d),{programMethod:T,MedicalOrderId:_}=C(),k=t(null),S=t([]),q=o((()=>{var e,n;return(null==(n=null==(e=w.value)?void 0:e.info)?void 0:n.vaa07)||"1876237140589948928"})),E={page:0,hasMore:!0};async function z(){const e=M.value.get(q.value);if(!E.hasMore||!e)return;E.page++,1==E.page&&(S.value=[]);const n=await y({sessionId:e,page:E.page,pageSize:20}),{rows:t,query:o={}}=n||{};v(t)&&(t.forEach((e=>{v(e.contents)&&e.contents.length>1&&e.contents.reverse()})),S.value.length<=+o.records&&(S.value=E.page>1?[...S.value,...t]:t,S.value.length>=+o.records&&(E.hasMore=!1,console.log("没有更多消息了"))))}async function J(e){var n;v(e.contents)&&(S.value.unshift(e),await l(),null==(n=k.value)||n.scrollTo({top:0,behavior:"auto"}))}function O(e,n){var t,o;return"json"===(null==(o=null==(t=null==e?void 0:e.contents)?void 0:t[n])?void 0:o.contentType)}function R(e,n){var t;const{contents:o=[],msgId:s=""}=e;if("json"===(null==(t=o[n])?void 0:t.contentType))return function(e,n){return r(i("json-card"),{item:e,messageItem:n},null)}(e,o[n]);return[o[n].content.replace(/\\n|\n|\r\n/g,"<br>").split("<br>").filter((e=>!!e)).map(((e,n,t)=>[e,n===t.length-1?null:r("br",null,null)]))]}function A({role:e=""}){return"user"===e}return f(k,(()=>{z()}),"top"),s((()=>q.value),(e=>{x.showRight=!1,S.value=[],E.page=0,E.hasMore=!0,z()}),{immediate:!0}),s((()=>x.reportContent),(e=>{e&&(J(e),x.reportContent=null)})),s((()=>x.sending),(async e=>{var n,t,o;if(e){x.sendContent&&(S.value.unshift({msgId:p(),contents:[{role:"user",content:x.sendContent}]}),null==(n=k.value)||n.scrollTo({top:0,behavior:"auto"}));const{opType:e}=x.params||{};if(e&&["recommend_treatment_plan","recommend_diagnosis"].includes(e)&&S.value.length>0){const e=S.value.find((e=>{var n;return!A(null==(n=null==e?void 0:e.contents)?void 0:n[0])}));e&&Object.assign(x.params,e,{contents:[{role:"user",content:"",contentType:"text"}]})}try{const n=await j({contents:[{role:"user",content:x.sendContent,contentType:"text"}],platform:"web",sessionType:"text_chat",source:"global",configs:w.value.info,...x.params});n.sessionId&&q.value&&!M.value.get(q.value)&&M.value.set(q.value,n.sessionId),"diagnosis"===e&&(x.refreshMedical=!0),v(n.contents)&&n.contents.length>1&&n.contents.reverse(),J(n),e&&["create_inquiry","create_medical"].includes(e)&&(x.showRight=!0,"create_inquiry"===e?x.consultationContent=n:(x.consultationContent=null,await T(_,{vac01:(null==(o=null==(t=w.value)?void 0:t.info)?void 0:o.vac01)||"1878974046080958465",type:1}))),x.sendContent="",x.params={}}catch(e){console.log("error ==>",e)}finally{x.sending=!1,x.loading=!1}}})),()=>[r("section",{class:"chat-main",ref:k,style:"column-reverse"},[[x.loading?r("div",{class:"message-item"},[r("div",{class:"content-box"},[r("div",{class:"content loading"},[r(c,{size:22,stroke:"#4170EE"},null),r("span",null,[a("正在加载中,请稍等...")])])])]):null,S.value.map((e=>e.contents.map(((n,t)=>r("div",{class:"message-item",key:e.msgId+t},[r("div",{class:["content-box",A(n)?"mine":""]},[r("div",{class:["content",{"content-json":!m(n.render)&&O(e,t)}]},[m(n.render)?n.render():R(e,t)])])])))))]])]}});export{I as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as t,inject as n,reactive as e,ref as o,watch as i,withDirectives as l,openBlock as a,createElementBlock as s,createElementVNode as c,createVNode as r,unref as u,withCtx as d,
|
1
|
+
import{defineComponent as t,inject as n,reactive as e,ref as o,watch as i,withDirectives as l,openBlock as a,createElementBlock as s,createElementVNode as c,createVNode as r,unref as u,withCtx as d,createTextVNode as y,vShow as f}from"vue";import{NButton as p,NIcon as k,NSpace as m}from"naive-ui";import{InjectionAIChat as g}from"../types/index.js";import{$message as _}from"../utils/index.js";import v from"../../../editor/index.js";import{CloseOutline as h}from"@vicons/ionicons5";import{saveApi as j}from"../api/index.js";const w={class:"ai-chat__right"},C={class:"header"},b={class:"main"};var z=t({__name:"ChatRight",setup(t){const z=[{key:"zs_yy",title:"主诉"},{key:"xbs_fuk",title:"现病史"},{key:"jws_vtk",title:"既往史"},{key:"patient_allergy_sync",title:"过敏史"},{key:"tgjcms_wsssss",title:"体格检查描述"},{key:"marriage",title:"婚姻状况"},{key:"nation",title:"民族"},{key:"profession",title:"职业"},{key:"jkzk_wyuu",title:"一般健康状况"},{key:"ryljlz_tbyvrt",title:"外长期居住史"},{key:"yjbz_qisf1",title:"饮酒标志"},{key:"gydwufcjfsxwzjcs_aogt_oietyntrrqk",title:"工业毒物、粉尘及放射性物质接触史"},{key:"yqtysjcs_ua_uirqk",title:"疫区、疫水接触史"},{key:"ryct_tbsw",title:"入院查体"},{key:"fzjclg_lessxj",title:"辅助检查结果"},{key:"o_hn_iyjc_hr",title:"互认回填"},{key:"cbzd_phyo",title:"初步诊断"},{key:"zljh_yuya",title:"诊疗计划"},{key:"wdcqjzs_qftanwk",title:"外地长期居住史"}],{state:x,patientInfo:q}=n(g),R=e({toolbarKeys:["bold","fontSize"]}),D=o(""),$=o(Date.now().toString());async function I(){var t;try{const n=E();x.consultationContent.contents[0].content.details.autoBackfillData=n,await j({msgId:x.consultationContent.msgId,contents:x.consultationContent.contents,configs:null==(t=q.value)?void 0:t.info}),_.success("保存成功")}catch(t){console.log("error ==>",t)}}function B(){const t=E();console.log("json ==>",t,x.consultationContent),x.consultationContent.contents[0].content.details.autoBackfillData=t,x.params={opType:"create_medical",...x.consultationContent,contents:[{role:"user",content:"",contentType:"text"}],medicalInfo:x.consultationContent},x.sending=!0,x.loading=!0}function E(){const t={};return z.forEach((n=>{const e=new RegExp(`<p><span.*?><strong>\\d+、${n.title}<\\/strong><\\/span><\\/p><p>(.*?)<\\/p>`,"i"),o=D.value.match(e);if(o&&o[1]){const e=o[1].trim();t[n.key]="<br>"===e?"":e}})),t}return i((()=>x.consultationContent),(t=>{var n,e,o;if(t){const{autoBackfillData:i}=(null==(o=null==(e=null==(n=null==t?void 0:t.contents)?void 0:n[0])?void 0:e.content)?void 0:o.details)||{};if(!i)return;z.forEach(((t,n)=>{D.value+=`<p><span style="font-size: 16px;"><strong>${n+1}、${t.title}</strong></span></p><p><span>${i[t.key]||""}</span></p><p>${n<z.length-1?"<br>":""}`}))}})),i((()=>x.showRight),(t=>{t||(x.consultationContent=null)})),i((()=>x.refreshMedical),(t=>{t&&($.value=Date.now().toString(),x.refreshMedical=!1)})),(t,n)=>l((a(),s("div",w,[c("div",C,[r(u(p),{quaternary:"",onClick:n[0]||(n[0]=()=>u(x).showRight=!1)},{icon:d((()=>[r(u(k),{size:"20",component:u(h)},null,8,["component"])])),_:1})]),l(c("div",b,[r(u(v),{"toolbar-config":R,modelValue:D.value,"onUpdate:modelValue":n[1]||(n[1]=t=>D.value=t)},null,8,["toolbar-config","modelValue"]),r(u(m),{class:"footer","wrap-item":!1},{default:d((()=>[r(u(p),{round:"",class:"gradient",disabled:u(x).loading,onClick:B},{default:d((()=>[y("审核完成")])),_:1},8,["disabled"]),r(u(p),{round:"",onClick:I},{default:d((()=>[y("暂存")])),_:1})])),_:1})],512),[[f,u(x).consultationContent]]),l((a(),s("div",{class:"main",id:"aiChatMedicalRecord",key:$.value})),[[f,!u(x).consultationContent]])],512)),[[f,u(x).showRight]])}});export{z as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as i,ref as a,computed as
|
1
|
+
import{defineComponent as e,inject as i,ref as a,computed as n,createVNode as s,resolveComponent as t,createTextVNode as l}from"vue";import{NSpace as o,NIcon as c,NImage as d,NButton as r}from"naive-ui";import u from"../../../../../shared/assets/img/file.png.js";import m from"../../../../../shared/assets/img/file-emr.png.js";import v from"../../../../../shared/assets/img/use.png.js";import{CheckmarkCircle as p}from"@vicons/ionicons5";import g from"./SelectIcon.js";import{InjectionAIChat as f}from"../../types/index.js";import{useProgram as h}from"../../hooks/useProgram.js";var y=e({name:"ChatJsonCard",inheritAttrs:!1,props:{item:{type:Object,default:()=>({})},messageItem:{type:Object,default:()=>({})}},components:{NSpace:o,NIcon:c,NImage:d,SelectIcon:g},emits:[],setup(e,{attrs:o,slots:c,emit:d}){const{state:g,patientInfo:y}=i(f),{programMethod:b,MedicalOrderId:x,ReportId:I}=h(),{messageType:C,content:_}=e.messageItem,k=a([]),w=a([]),T=n((()=>{var e,i;return(null==(i=null==(e=y.value)?void 0:e.info)?void 0:i.vac01)||"1878974046080958465"})),j=n((()=>{var e;return null==(e=null==_?void 0:_.diagnosis)?void 0:e[0]})),N=n((()=>{var e;return"diagnosis_added"===C&&(null==(e=j.value)?void 0:e.name)})),S=n((()=>N.value)),O=n((()=>"diagnosis"===C||"diagnosis_added"===C||"treatment_plan"===C));var q,E;"diagnosis_added"===C&&(k.value=null==(E=null==(q=_.recommendedExaminations)?void 0:q.map)?void 0:E.call(q,(e=>e.name)));const P=(e,i="name")=>{w.value.includes(e[i])?w.value=w.value.filter((a=>a!==e[i])):w.value.push(e[i])};function A(i,a){var n,s;null==(n=null==i?void 0:i.preventDefault)||n.call(i),null==(s=null==i?void 0:i.stopPropagation)||s.call(i);let t=a?[a]:[];arguments.length||(t=_.possibleConditions.filter((e=>w.value.includes(e.code)))),t.length&&(g.params={...e.item,opType:"diagnosis",contents:[{role:"user",content:"",contentType:"text"}],possibleConditions:[{condition:"睡眠呼吸暂停待查",code:"I88.104",probability:"60%",link:"https://icd.who.int/browse10/2019/en#/G47.3",description:"患者晚上有时打呼噜,不确定是否有呼吸暂停,存在相关症状,需要进一步做睡眠呼吸监测以明确诊断。"},{condition:"原发性淋巴水肿",code:"I89.001",probability:"60%",link:"https://icd.who.int/browse10/2019/en#/G47.3",description:"患者晚上有时打呼噜,不确定是否有呼吸暂停,存在相关症状,需要进一步做睡眠呼吸监测以明确诊断。"}]},g.sending=!0)}async function D(i,a){var n,s;null==(n=null==i?void 0:i.preventDefault)||n.call(i),null==(s=null==i?void 0:i.stopPropagation)||s.call(i);const t=a?k.value.includes(a.name)?[a.name]:[]:[...k.value];await b(x,{bbx05List:JSON.stringify(t),vac01:T.value,type:3});let l=a?[a]:[];arguments.length||(l=_.recommendedExaminations.filter((e=>w.value.includes(e.name)))),g.params={...e.item,opType:"medical_order",contents:[{role:"user",content:"",contentType:"text"}],recommendedExaminations:l},g.sending=!0,g.loading=!0}const J=async()=>{var e;const i=(null==(e=_.reports)?void 0:e[0])||{};await b(I,{vaa07:T.value,reportType:i.reportType,reportId:i.reportId})},G=async(e,i)=>{var a,n;null==(a=null==e?void 0:e.preventDefault)||a.call(e),null==(n=null==e?void 0:e.stopPropagation)||n.call(e);const s=i?[i.name]:w.value;await b(x,{drugNameList:JSON.stringify(s),vac01:T.value,type:3})},L=()=>{if(!("diagnosis_added"===C?!k.value.length:!w.value.length))return"diagnosis"===C?A():"diagnosis_added"===C?D():"treatment_plan"===C?G():void 0};async function M(){g.showRight=!0,"medical"===C?(async()=>{g.consultationContent=null,await b(x,{vac01:T.value,type:1})})():g.consultationContent=e.item}const R=()=>s("div",{class:"diagnosis-added-box"},[s("div",{class:"recommended-wrap"},[s("div",{class:"title"},[l("影像学检查")]),_.recommendedExaminations.map((e=>s("div",{class:"recommended-item"},[s("div",{class:"top"},[s("div",{class:"left-tag"},[s("span",{class:["recommended-tag",{active:k.value.includes(e.name)}],onClick:()=>(e=>{k.value.includes(e.name)?k.value=k.value.filter((i=>i!==e.name)):k.value.push(e.name)})(e)},[e.name,s(t("select-icon"),{class:"select-icon",width:16},null)])]),s("img",{class:"right-icon",src:v,onClick:i=>D(i,e)},null)]),s("div",{class:"desc"},[e.description])])))])]),H=()=>{var e,i;return S.value?s("div",{class:"card-header"},[s("span",{class:"left-title"},[s(t("n-icon"),{component:p},null),l("已添加诊断:"),null==(e=j.value)?void 0:e.name]),s("span",{class:"right-desc"},[l("创建时间: "),null==(i=j.value)?void 0:i.createdTime])]):null},z=()=>{if(!O.value)return null;const e="diagnosis_added"===C?!k.value.length:!w.value.length;return s("div",{class:"card-footer"},[s("span",{class:"left-desc"},[l("请注意,辅助诊断由AI推荐,结果仅供临床")]),s("span",{class:["right-btn",{disabled:e}],onClick:L},[l("引用所选")])])},B=()=>"inquiry"==C||"medical"==C?(()=>{var e,i;const a="inquiry"===C;return s("div",{class:"inquiry_medical-box",onClick:()=>M()},[s("div",{class:"left-img"},[s("img",{src:a?u:m},null)]),s("div",{class:"right-text"},[s("p",{class:"top-info"},[a?null==(e=_.summary)?void 0:e.inquiryStr:_.info]),s("p",{class:"sum-time"},[l("创建时间:"),(null==(i=_.summary)?void 0:i.creationTime)||_.creationTime])])])})():"diagnosis"==C?s("div",{class:"diagnosis-box"},[s("div",{class:"title"},[l("诊断辅助")]),s("div",{class:"desc"},[_.patientHistory]),_.possibleConditions.map((e=>s("div",{class:["con-item",{active:w.value.includes(e.code)}],onClick:()=>P(e,"code")},[s("div",{class:"top-content"},[s("div",{class:"left_wrap"},[s("a",{href:e.link,target:"_blank"},[l("【"),e.condition,l("】")]),e.code,l("("),e.probability,l(")")]),s("img",{class:"right-icon",src:v,onClick:i=>A(i,e)},null)]),s("div",{class:"btm-desc"},[e.description])])))]):"diagnosis_added"==C?R():"treatment_plan"==C?s("div",{class:"treatment-plan-box"},[s("div",{class:"top-div"},[s("div",{class:"title"},[_.title])]),s("div",{class:"desc"},[_.description]),s("div",{class:"medication-wrap"},[s("div",{class:"title"},[l("药物")]),_.medications.map((e=>s("div",{class:["medication-item",{active:w.value.includes(e.name)}],onClick:()=>P(e)},[s("div",{class:"top"},[s("div",{class:"name"},[e.name]),s("img",{class:"right-icon",src:v,onClick:i=>G(i,e)},null)]),s("ul",null,[s("li",null,[l("用量: "),e.dosage,e.purpose]),s("li",null,[l("用法: "),e.usageInstructions])])])))]),s("div",{class:"precaution-wrap"},[s("div",{class:"title"},[l("注意事项")]),s("div",{class:"precaution-div"},[_.precautions.map(((e,i)=>s("div",{class:"treatment-item"},[i+1,l(". "),e])))])])]):"report_message"==C?(()=>{var e,i;const a=(null==(e=_.reports)?void 0:e[0])||{},n=(null==(i=a.reportInterpretation)?void 0:i.replace(/\\n|\n|\r/g,"<br>").split("<br>"))||[""],o=n.map(((e,i)=>[e,i===n.length-1?null:s("br",null,null)]));return s("div",{class:"report-message-box"},[s("div",{class:"top-title"},[s("div",{class:"left-title"},[s(t("n-icon"),{component:p},null),a.reportName]),s("div",{class:"right-detail"},[s(r,{text:!0,onClick:J},{default:()=>[l("报告详情")]}),s(r,{text:!0},{default:()=>[l("推荐方案")]})])]),s("div",{class:"center-img"},[a.images.map((e=>"pdf"===e.imageType?s("embed",{class:"pdf-embed",src:e.image,type:"application/pdf"},null):s(t("n-image"),{src:e.image},null)))]),s("div",{class:"bottom-interpretation"},[o,s("div",{class:"desc-tip"},[l("请注意,辅助诊断由AI推荐,结果仅供临床参考。")])])])})():"默认json内容";return()=>s("section",{class:"json-card_section"},[H(),s("div",{class:"card-content"},[B()]),z()])}});export{y as default};
|
@@ -1 +1 @@
|
|
1
|
-
function r(){return{MedicalOrderId:"Y3ncua3BP36",ReportId:"Ys6k60gBP54",programMethod:async(r,
|
1
|
+
function r(){return{MedicalOrderId:"Y3ncua3BP36",ReportId:"Ys6k60gBP54",programMethod:async(r,a)=>{var n,e;try{return await(null==(e=null==(n=window._programArrange)?void 0:n.next)?void 0:e.call(n,{bpmnProcessId:r,variables:{...a}}))}catch(r){throw new Error("流程编排执行失败!")}}}}export{r as useProgram};
|
@@ -1 +1 @@
|
|
1
|
-
import{onBeforeUnmount as o}from"vue";import{isValidJSON as e}from"../utils/index.js";function n(n,t){if(!n.orgId||!n.userId)return;let r=!1;const s=new WebSocket(`/flow/ai/opd
|
1
|
+
import{onBeforeUnmount as o}from"vue";import{isValidJSON as e}from"../utils/index.js";function n(n,t){if(!n.orgId||!n.userId)return;let r=!1;const s=new WebSocket(`/flow/ai/opd/${n.orgId}_${n.userId}`);s.onopen=()=>{r=!0,console.log("0 websocket连接成功 ==>")},s.onerror=()=>console.log("WebSocket连接失败"),s.onmessage=o=>{const{data:n}=o||{};if(console.log("张铁柱 ==>",o),!e(n))return;const r=JSON.parse(n);t.reportContent=r||null},async function o(e=0){return e>5?console.log("websocket连接失败 ==>"):r?console.log("websocket连接成功 ==>"):void setTimeout((()=>{o(++e)}),100)}(),o((()=>{s.close()}))}export{n as useWebsocket};
|
@@ -1 +1 @@
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.2.18-beta.
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.2.18-beta.16",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.2.18-beta.16",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "cnhis-design-vue",
|
3
|
-
"version": "3.2.18-beta.
|
3
|
+
"version": "3.2.18-beta.16",
|
4
4
|
"license": "ISC",
|
5
5
|
"module": "./es/components/index.js",
|
6
6
|
"main": "./es/components/index.js",
|
@@ -72,5 +72,5 @@
|
|
72
72
|
"iOS 7",
|
73
73
|
"last 3 iOS versions"
|
74
74
|
],
|
75
|
-
"gitHead": "
|
75
|
+
"gitHead": "25d50480aa29284ea557cb0a49b07a983a7070dc"
|
76
76
|
}
|