|
@@ -47,7 +47,8 @@ let xhg2img = require('./../images/xhg2.png')
|
|
|
let xhg3img = require('./../images/xhg3.png')
|
|
|
let xhg4img = require('./../images/xhg4.png')
|
|
|
|
|
|
-const kgrtUrl = "http://172.16.8.57:4500" //知识图谱检索工具地址
|
|
|
+const kgrtUrl = 'http://' + window.location.hostname + ":88" //知识图谱检索工具地址
|
|
|
+// const kgrtUrl = 'http://' + window.location.hostname + ":4500" //知识图谱检索工具地址
|
|
|
const $ = require("jquery");
|
|
|
const { post, config, getUrlArgObject, openNewWin, titleConfig, get } = require('./promise.js');
|
|
|
const { renderFollowUp, followEmpty } = require('./followUp.js');
|
|
@@ -162,9 +163,6 @@ function getHosptDeptUsal() {
|
|
|
return post(config.getHosptDeptUsal, param)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
function getPushData(res) {
|
|
|
if (res && res.data && res.data.data && res.data.data.dis && res.data.data.dis) {
|
|
|
let dis = res.data.data.dis;
|
|
@@ -213,7 +211,7 @@ $(document).on('click', ".allDis .right,.allDis .secDis", function () {
|
|
|
|
|
|
|
|
|
function moreInfo() {
|
|
|
- $('.infoImg').off("click").click(function () {
|
|
|
+ $('.infoImg').off("click").on('click', function () {
|
|
|
const name = $(this).parents(".pushItemBox").attr('data-name')
|
|
|
const type = $(this).parents(".pushItemBox").attr('data-type')
|
|
|
openNewWin(`staticInfo.html?type=${encodeURIComponent(type)}&position=0&name=${encodeURIComponent(name)}&mrId=${encodeURIComponent(mrId)}`)
|
|
@@ -252,6 +250,7 @@ function renderPage(pageSet) {
|
|
|
if (!pageSet || !setInfo) {
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
renderTab(setInfo)
|
|
|
adjustHei()
|
|
|
const hasAuxiliary = hasTab("辅助信息", setInfo);
|
|
@@ -259,6 +258,8 @@ function renderPage(pageSet) {
|
|
|
const hastcmk = hasTab("中医知识", setInfo)
|
|
|
const hasFollowUp = hasTab("随访计划", setInfo)
|
|
|
const hasTcm = hasTab("中医辅助", setInfo);
|
|
|
+
|
|
|
+ // console.log("pageSet", pageSet, hasAuxiliary)
|
|
|
//所有模块都未开启配置,显示功能未开启(无tab)
|
|
|
if (hasAuxiliary.status === 0 && hasMedical.status === 0 && hastcmk.status === 0 && hasFollowUp.status === 0 && hasTcm.status === 0) {
|
|
|
const nullTxt = `<div class="empty-box" style="left: -20px;display: block;">
|
|
@@ -312,36 +313,77 @@ function renderPage(pageSet) {
|
|
|
function renderPushData() {
|
|
|
return getPushInfo().then(res => {
|
|
|
$(".loading").hide();
|
|
|
- // $(".loading").show();
|
|
|
+
|
|
|
hasCompleteTnterface++
|
|
|
if (res.data.code == "0") {
|
|
|
const result = res.data.data
|
|
|
let diagPush = result.dis || {}
|
|
|
let lisPush = result.lis || []
|
|
|
// console.log("lisPush", lisPush, diagPush)
|
|
|
- if (msg.chief) {
|
|
|
- // $(".loading").show();
|
|
|
- get(`/graph/nodes/recommend?chief=${msg.chief}&sex=${+msg.sex === 2 ? '女' : '男'}&age=${+msg.age * 12}&department=${msg.dept[0].name}&present_illness=${msg.symptom}`).then((res) => {
|
|
|
- const { success, data, error_code } = res.data
|
|
|
- const records = data
|
|
|
- // console.log(" records", res.data)
|
|
|
- if (success) {
|
|
|
- diagPush["可能诊断"] = records["可能诊断"] || []
|
|
|
- // console.log("records可能诊断", diagPush["可能诊断"])
|
|
|
- lisPush = records["推荐检验"] || []
|
|
|
- let lisNum = $(".moduleItem.lis").attr("data-num") || 5
|
|
|
- renderLis(lisPush, lisNum)
|
|
|
- renderDiag(diagPush)
|
|
|
+
|
|
|
+ get(`knowledge/disease/recommend?chief=${msg.chief.trim()}&sex=${+msg.sex === 2 ? '女' : '男'}&age=${+msg.age * 12}&department=${msg.dept[0].name}&present_illness=${msg.symptom.trim()}`).then((res) => {
|
|
|
+ const { success, data, error_code } = res.data
|
|
|
+ const records = data
|
|
|
+ // console.log(" records", res.data)
|
|
|
+ if (success) {
|
|
|
+ diagPush["可能诊断"] = records["可能诊断"] || []
|
|
|
+ diagPush["鉴别诊断"] = records.disease_detail?.differential_diagnosis || []
|
|
|
+ renderDiag(diagPush)
|
|
|
+
|
|
|
+ let pacsPush = records.disease_detail?.examinations || []
|
|
|
+ let pacsNum = $(".moduleItem.pacs").attr("data-num") || 5
|
|
|
+ renderPacs(pacsPush, pacsNum)
|
|
|
+
|
|
|
+ lisPush = records.disease_detail?.laboratory_tests || []
|
|
|
+ let lisNum = $(".moduleItem.lis").attr("data-num") || 5
|
|
|
+ renderLis(lisPush, lisNum)
|
|
|
+
|
|
|
+ let medicinesPush = data.disease_detail?.treatments['药物治疗'] || {}
|
|
|
+ let medicinesNum = $(".moduleItem.medicine").attr("data-num") || 5
|
|
|
+ renderMedicinesPush(medicinesPush, medicinesNum)
|
|
|
+
|
|
|
+ let operationsPush = data.disease_detail?.treatments['非药物治疗'] || {}
|
|
|
+ let operationsNum = $(".moduleItem.operation").attr("data-num") || 5
|
|
|
+ renderOperationPush(operationsPush, operationsNum)
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.log(e)
|
|
|
+ }).finally(() => {
|
|
|
+ bindSlide()
|
|
|
+ bindDetailShow()
|
|
|
+ bindOpenInfo()
|
|
|
+ moreInfo()
|
|
|
+ $(".mask").css("display", 'none')
|
|
|
+ $(".diag .moduleBox .pushItemBox .detail-show").first().trigger("click")
|
|
|
+ $(".diag .pushItemName .disease-name").on("click", function () {
|
|
|
+ const diseaseName = $(this).attr("disease-name")
|
|
|
+ get(`/knowledge/disease/${diseaseName}/detail`).then((res) => {
|
|
|
+ // console.log(res)
|
|
|
+ const { data, success } = res.data
|
|
|
+ if (success) {
|
|
|
+ let pacsPush = data.examinations || []
|
|
|
+ let pacsNum = $(".moduleItem.pacs").attr("data-num") || 5
|
|
|
+ renderPacs(pacsPush, pacsNum)
|
|
|
+
|
|
|
+ lisPush = data.laboratory_tests || []
|
|
|
+ let lisNum = $(".moduleItem.lis").attr("data-num") || 5
|
|
|
+ renderLis(lisPush, lisNum)
|
|
|
+
|
|
|
+ let diagNum = $('.moduleItem.diag').attr("data-num") || 5
|
|
|
+ renderDiagItem(data.differential_diagnosis, "鉴别诊断", diagNum, "differential-diagnosis")
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ }).finally(() => {
|
|
|
bindSlide()
|
|
|
bindDetailShow()
|
|
|
- $(".diag .moduleBox .pushItemBox .detail-show").first().click()
|
|
|
- }
|
|
|
-
|
|
|
- $(".mask").css("display", 'none')
|
|
|
- }).catch(err => {
|
|
|
- $(".mask").css("display", 'none')
|
|
|
+ bindOpenInfo()
|
|
|
+ moreInfo()
|
|
|
+ })
|
|
|
})
|
|
|
- }
|
|
|
+ // $(".diag .possible-diagnosis .disease-name").first().trigger("click")
|
|
|
+ })
|
|
|
+
|
|
|
let scalePush = result.scale || []
|
|
|
let pacsPush = result.pacs || []
|
|
|
let symptomPush = result.symptom || []
|
|
@@ -363,7 +405,7 @@ function renderPushData() {
|
|
|
let casesNum = $(".moduleItem.classiccase").attr("data-num") || 5
|
|
|
let operationsNum = $(".moduleItem.operation").attr("data-num") || 5
|
|
|
let nurseNum = $(".moduleItem.nurse").attr("data-num") || 5
|
|
|
- // renderLis(lisPush, lisNum)
|
|
|
+ renderLis(lisPush, lisNum)
|
|
|
// renderDiag(diagPush)
|
|
|
renderScale(scalePush, scaleNum)
|
|
|
renderPacs(pacsPush, pacsNum)
|
|
@@ -376,11 +418,13 @@ function renderPushData() {
|
|
|
rendergeneraTreatPush(generaTreatPush)
|
|
|
renderNurse(nursePush, nurseNum)
|
|
|
|
|
|
- bindOpenInfo()
|
|
|
- moreInfo()
|
|
|
- bindSlide();
|
|
|
+ // bindOpenInfo()
|
|
|
+ // moreInfo()
|
|
|
+ // bindSlide();
|
|
|
}
|
|
|
empty(); //判断是否显示空状态
|
|
|
+ }).catch((e) => {
|
|
|
+ console.log(e)
|
|
|
})
|
|
|
}
|
|
|
function adjustHei() {
|
|
@@ -389,7 +433,7 @@ function adjustHei() {
|
|
|
$(".tabList").css("height", iframeHei + 'px')
|
|
|
}
|
|
|
function bindDetailShow() {
|
|
|
- $(".moduleBox .pushItemBox .detail-show").on("click", function () {
|
|
|
+ $(".pushItemBox .detail-show.icon-down").off('click').on("click", function () {
|
|
|
// alert($(this).parents(".pushItemBox").next().css("display"))
|
|
|
const deg = $(this).parents(".pushItemBox").next().css("display") === 'none' ? 180 : 0;
|
|
|
$(this).animate( //animate无法给动画加过渡时间
|
|
@@ -415,6 +459,7 @@ function isNeedPush(list) {
|
|
|
if (list[i].status == "1") {
|
|
|
pass = true
|
|
|
}
|
|
|
+ // pass = true
|
|
|
}
|
|
|
}
|
|
|
// console.log(pass);
|
|
@@ -554,22 +599,26 @@ function renderDiag(diagPush) {
|
|
|
// let warningDiagPush = [{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
|
|
|
// let firstDiagPush = [{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
|
|
|
// let identifyDiagPush = diagPush["鉴别诊断"] || [{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
|
|
|
- renderDiagItem(possibleDiagPush, "可能诊断", number)
|
|
|
- renderDiagItem(previousDiagPush, "既往诊断", number)
|
|
|
- renderDiagItem(firstDiagPush, "初步诊断", number)
|
|
|
- renderDiagItem(identifyDiagPush, "鉴别诊断", number)
|
|
|
- renderWarningDiag(warningDiagPush, "警惕", warnNumber)
|
|
|
+ renderDiagItem(possibleDiagPush, "可能诊断", number, 'possible-diagnosis')
|
|
|
+ renderDiagItem(previousDiagPush, "既往诊断", number, 'previous-diagnosis')
|
|
|
+ renderDiagItem(firstDiagPush, "初步诊断", number, 'primary-diagnosis')
|
|
|
+ renderDiagItem(identifyDiagPush, "鉴别诊断", number, 'differential-diagnosis')
|
|
|
+ renderWarningDiag(warningDiagPush, "警惕", warnNumber, 'warning-diagnosis')
|
|
|
moreInfo()
|
|
|
}
|
|
|
|
|
|
-function renderDiagItem(list, name, number) {
|
|
|
+function renderDiagItem(list, name, number, boxClassName = "") {
|
|
|
+ if (boxClassName) {
|
|
|
+ $(`.${boxClassName}`).remove()
|
|
|
+ }
|
|
|
if (list.length === 0) {
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
moduleNum++
|
|
|
let titleStr = titleStr2(name)
|
|
|
let { shortStr, longStr } = renderItemWrapper(list, number, name)
|
|
|
- let boxStr = `<div class="moduleBox">
|
|
|
+ let boxStr = `<div class="moduleBox ${boxClassName}">
|
|
|
${titleStr}
|
|
|
${shortStr}
|
|
|
${longStr}
|
|
@@ -592,10 +641,11 @@ function renderWarningDiag(list, name, number) {
|
|
|
}
|
|
|
|
|
|
function renderLis(list, showNum) {
|
|
|
+ $(".lis").empty()
|
|
|
if (list.length > 0 && $(".moduleItem.lis").length > 0) {
|
|
|
moduleNum++
|
|
|
$('.moduleItem.lis').append(titleStr("lisPush"))
|
|
|
- let { shortStr, longStr } = renderItemWrapper(list, showNum)
|
|
|
+ let { shortStr, longStr } = renderItemWrapper(list, showNum, '推荐检验')
|
|
|
$('.moduleItem.lis').append(shortStr).append(longStr)
|
|
|
$('.moduleItem.lis').css("display", "block")
|
|
|
}
|
|
@@ -621,10 +671,11 @@ function renderNurse(list, showNum) {
|
|
|
}
|
|
|
}
|
|
|
function renderPacs(list, showNum) {
|
|
|
+ $(".pacs").empty()
|
|
|
if (list.length > 0 && $(".moduleItem.pacs").length > 0) {
|
|
|
moduleNum++
|
|
|
$(".moduleItem.pacs").append(titleStr("pacsPush"))
|
|
|
- let { shortStr, longStr } = renderItemWrapper(list, showNum)
|
|
|
+ let { shortStr, longStr } = renderItemWrapper(list, showNum, '推荐检查')
|
|
|
$(".moduleItem.pacs").append(shortStr).append(longStr)
|
|
|
$('.moduleItem.pacs').css("display", "block")
|
|
|
}
|
|
@@ -666,45 +717,66 @@ function rendergeneraTreatPush(list) {
|
|
|
}
|
|
|
}
|
|
|
function renderMedicinesPush(obj, showNum) {
|
|
|
+ $(".moduleItem.medicine").empty()
|
|
|
+ if (JSON.stringify(obj) === '{}') return
|
|
|
$(".moduleItem.medicine").append(titleStr('drugPush'));
|
|
|
let showNum1 = 2;
|
|
|
let mshortStr1 = "";
|
|
|
let mlongStr1 = "";
|
|
|
let keys = Object.keys(obj);
|
|
|
let cateNames = Array.from(keys);
|
|
|
- if (cateNames.length > 0 && $(".moduleItem.medicine").length > 0) {
|
|
|
- moduleNum++;
|
|
|
- for (let i = 0; i < cateNames.length; i++) {
|
|
|
- let drugs = obj[cateNames[i]];
|
|
|
- let { shortStr, longStr } = renderItemWrapper(drugs, showNum);
|
|
|
- // console.log("long", shortStr);
|
|
|
-
|
|
|
- if (i < showNum1) {
|
|
|
- mshortStr1 += ` ${i + 1}.${cateNames[i]}<br>`;
|
|
|
- mshortStr1 += shortStr;
|
|
|
- }
|
|
|
- // // 添加药品分类和短内容
|
|
|
- // mshortStr1 += ` ${i + 1}.${cateNames[i]}<br>`;
|
|
|
- // mshortStr1 += shortStr;
|
|
|
-
|
|
|
- // 添加药品分类和长内容
|
|
|
- mlongStr1 += ` ${i + 1}.${cateNames[i]}<br>`;
|
|
|
-
|
|
|
- mlongStr1 += longStr;
|
|
|
-
|
|
|
- }
|
|
|
- // 判断显示逻辑
|
|
|
- if (showNum1 > cateNames.length) {
|
|
|
- $(".moduleItem.medicine").append(`<div class="shortBox">${mshortStr1}</div>`);
|
|
|
+ // console.log(cateNames, keys)
|
|
|
+ const itemList = []
|
|
|
+ for (let i in obj) {
|
|
|
+ if (obj[i].hasOwnProperty('items')) {
|
|
|
+ itemList.push({ name: i, content: [{ scheme: "", subScheme: obj[i].items }] })
|
|
|
} else {
|
|
|
- mshortStr1 += `<span class="showMore"><img class="iconArrowImg" src="${iconArrowDown}"></span>`;
|
|
|
- mlongStr1 += `<span class="showLess"><img class="iconArrowImg" src="${iconArrowUp}"></span>`;
|
|
|
- $(".moduleItem.medicine").append(`<div class="shortBox">${mshortStr1}</div>`);
|
|
|
- $(".moduleItem.medicine").append(`<div class="longBox">${mlongStr1}</div>`);
|
|
|
+ let items = []
|
|
|
+ for (let j in obj[i]) {
|
|
|
+ items.push({ scheme: j, subScheme: obj[i][j].items })
|
|
|
+ }
|
|
|
+ itemList.push({ name: i, content: items })
|
|
|
}
|
|
|
-
|
|
|
- $(".moduleItem.medicine").css("display", "block");
|
|
|
}
|
|
|
+ // console.log("renderMedicinesPush", itemList)
|
|
|
+ let { shortStr, longStr } = renderItemWrapper(itemList, showNum, '推荐用药');
|
|
|
+ // if (cateNames.length > 0 && $(".moduleItem.medicine").length > 0) {
|
|
|
+ // moduleNum++;
|
|
|
+ // for (let i = 0; i < cateNames.length; i++) {
|
|
|
+ // let drugs = obj[cateNames[i]];
|
|
|
+ // console.log("drugs", cateNames[i], drugs)
|
|
|
+ // let { shortStr, longStr } = renderItemWrapper(drugs, showNum, '推荐用药');
|
|
|
+ // // console.log("long", shortStr);
|
|
|
+
|
|
|
+ // if (i < showNum1) {
|
|
|
+ // mshortStr1 += ` ${i + 1}.${cateNames[i]}<br>`;
|
|
|
+ // mshortStr1 += shortStr;
|
|
|
+ // }
|
|
|
+ // // // 添加药品分类和短内容
|
|
|
+ // // mshortStr1 += ` ${i + 1}.${cateNames[i]}<br>`;
|
|
|
+ // // mshortStr1 += shortStr;
|
|
|
+
|
|
|
+ // // 添加药品分类和长内容
|
|
|
+ // mlongStr1 += ` ${i + 1}.${cateNames[i]}<br>`;
|
|
|
+
|
|
|
+ // mlongStr1 += longStr;
|
|
|
+
|
|
|
+ // }
|
|
|
+ // 判断显示逻辑
|
|
|
+ // if (showNum > itemList.length) {
|
|
|
+ // // $(".moduleItem.medicine").append(`<div class="shortBox">${shortStr}</div>`);
|
|
|
+ // $(".moduleItem.medicine").append(shortStr);
|
|
|
+ // } else {
|
|
|
+ // // mshortStr1 += `<span class="showMore"><img class="iconArrowImg" src="${iconArrowDown}"></span>`;
|
|
|
+ // // mlongStr1 += `<span class="showLess"><img class="iconArrowImg" src="${iconArrowUp}"></span>`;
|
|
|
+ // // $(".moduleItem.medicine").append(`<div class="shortBox">${shortStr}</div>`);
|
|
|
+ // // $(".moduleItem.medicine").append(`<div class="longBox">${longStr}</div>`);
|
|
|
+ // $(".moduleItem.medicine").append(shortStr);
|
|
|
+ // $(".moduleItem.medicine").append(longStr);
|
|
|
+ // }
|
|
|
+ $(".moduleItem.medicine").append(longStr);
|
|
|
+ $(".moduleItem.medicine").css("display", "block");
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -740,11 +812,25 @@ function renderCasesPush(list, showNum) {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
-function renderOperationPush(list, showNum) {
|
|
|
+function renderOperationPush(obj, showNum) {
|
|
|
+ $(".moduleItem.operation").empty()
|
|
|
+ // const changeList = []
|
|
|
+ const itemList = []
|
|
|
+ for (let i in obj) {
|
|
|
+ if (obj[i].hasOwnProperty('items')) {
|
|
|
+ itemList.push({ name: i, content: [{ scheme: "", subScheme: obj[i].items }] })
|
|
|
+ } else {
|
|
|
+ let items = []
|
|
|
+ for (let j in obj[i]) {
|
|
|
+ items.push({ scheme: j, subScheme: obj[i][j].items })
|
|
|
+ }
|
|
|
+ itemList.push({ name: i, content: items })
|
|
|
+ }
|
|
|
+ }
|
|
|
$(".moduleItem.operation").append(titleStr('operationPush'))
|
|
|
- if (list.length > 0 && $(".moduleItem.operation").length > 0) {
|
|
|
+ if (itemList.length > 0 && $(".moduleItem.operation").length > 0) {
|
|
|
moduleNum++
|
|
|
- let { shortStr, longStr } = renderItemWrapper(list, showNum)
|
|
|
+ let { shortStr, longStr } = renderItemWrapper(itemList, showNum, '非药物治疗方案')
|
|
|
$(".moduleItem.operation").append(shortStr).append(longStr)
|
|
|
$(".moduleItem.operation").css("display", "block")
|
|
|
}
|
|
@@ -763,31 +849,39 @@ function renderItemWrapper(list, showNum, name) {
|
|
|
}
|
|
|
// console.log(shortStr);
|
|
|
|
|
|
+ return {
|
|
|
+ shortStr: "",
|
|
|
+ longStr: `<div class="longBox">${longStr}</div>`
|
|
|
+ }
|
|
|
if (showNum1 >= list.length) {
|
|
|
return {
|
|
|
shortStr: `<div class="shortBox">${shortStr}</div>`,
|
|
|
longStr: `<div class="longBox">${longStr}</div>`
|
|
|
}
|
|
|
} else {
|
|
|
- shortStr += `<span class="showMore"><img class="iconArrowImg" src="${iconArrowDown}"></span>`
|
|
|
- longStr += `<span class="showLess"><img class="iconArrowImg" src="${iconArrowUp}"></span>`
|
|
|
+ // shortStr += `<span class="showMore"><img class="iconArrowImg" src="${iconArrowDown}"></span>`
|
|
|
+ // longStr += `<span class="showLess"><img class="iconArrowImg" src="${iconArrowUp}"></span>`
|
|
|
return {
|
|
|
shortStr: `<div class="shortBox">${shortStr}</div>`,
|
|
|
longStr: `<div class="longBox">${longStr}</div>`
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
function renderPushItem(item, name, index, totalItems) {
|
|
|
-
|
|
|
+ item.hasInfo = "1"
|
|
|
const infoIcon = `${item.hasInfo == "1" ? `<img class="infoImg" src="${infoImg}">` : ""}`;
|
|
|
let signalStr = "";
|
|
|
- // const percentage = (index / totalItems) * 100;
|
|
|
- const percentage = item.score * 100;
|
|
|
- const queryImg = `<a href="${kgrtUrl}/#/kgrt/entry?keyword=${item.name}" target="_blank"><img class="queryImg" src="${queryIcon}"></a>`
|
|
|
+ let queryImg = `<a href="${kgrtUrl}/#/kgrt/entry?keyword=${item.dest_node?.name || item.name}${name === '可能诊断' || name === '鉴别诊断' ? '&category=疾病&exact' : ''}" target="_blank"><img class="queryImg" src="${queryIcon}"></a>`
|
|
|
+ let str = `<span class="pushItemBox" data-name="${item.dest_node?.name || item.name}" data-type="${item.dest_node?.category || item.type}">`
|
|
|
|
|
|
- // 根据百分比添加不同的信号格图片
|
|
|
- if (name === "可能诊断") {
|
|
|
+ if (name === "经典病例") {
|
|
|
+ str += `<span class="pushItemName ${item.hasInfo == "1" ? 'evaluationtitle' : ''} ${item.hasInfo == "1" ? '' : 'noInfo'}">${item.type == 8 ? ('【' + item.name + '】') : item.name} ${signalStr}${infoIcon}${queryImg}<i class="hidden-i"></i></span>`
|
|
|
+ } else if (name === "可能诊断") {
|
|
|
+ // 根据百分比添加不同的信号格图片
|
|
|
+ const percentage = item.score * 100;
|
|
|
if (percentage <= 20) {
|
|
|
signalStr = `<span class="signal"><img class="xhg4img" src="${xhg1img}"></span>`;
|
|
|
} else if (percentage <= 40) {
|
|
@@ -798,27 +892,103 @@ function renderPushItem(item, name, index, totalItems) {
|
|
|
signalStr = `<span class="signal"><img class="xhg1img" src="${xhg4img}"></span>`;
|
|
|
}
|
|
|
signalStr += `<i class="detail-show icon-down"></i>`
|
|
|
- }
|
|
|
- str = `<span class="pushItemBox" data-name="${item.name}" data-type="${item.type}">`
|
|
|
|
|
|
- if (name === "经典病例") {
|
|
|
- str += `<span class="pushItemName ${item.hasInfo == "1" ? 'evaluationtitle' : ''} ${item.hasInfo == "1" ? '' : 'noInfo'}">${item.type == 8 ? ('【' + item.name + '】') : item.name} ${signalStr}${infoIcon}${queryImg}<i class="hidden-i"></i></span>`
|
|
|
- } else if (name === "可能诊断") {
|
|
|
- str += `<span class="pushItemName inline-block ${item.hasScale == "1" ? 'evaluationtitle' : ''} ${item.hasInfo == "1" ? '' : 'noInfo'}">${item.type == 8 ? ('【' + item.name + '】') : item.name} ${signalStr}${infoIcon}${queryImg}<i class="hidden-i"></i></span>`
|
|
|
- } else {
|
|
|
- str += `<span class="pushItemName ${item.hasScale == "1" ? 'evaluationtitle' : ''} ${item.hasInfo == "1" ? '' : 'noInfo'}">${item.type == 8 ? ('【' + item.name + '】') : item.name} ${signalStr}${infoIcon}${queryImg}<i class="hidden-i"></i></span>`
|
|
|
- }
|
|
|
+ str += `<span class="pushItemName inline-block ${item.hasScale == "1" ? 'evaluationtitle' : ''} ${item.hasInfo == "1" ? '' : 'noInfo'}">
|
|
|
+ <i class="disease-name" disease-name="${item.name}">
|
|
|
+ ${item.type == 8 ? ('【' + item.name + '】') : item.name}
|
|
|
+ </i>
|
|
|
+ ${signalStr}${infoIcon}${queryImg}<i class="hidden-i"></i>
|
|
|
+ </span>`
|
|
|
+
|
|
|
+
|
|
|
+ str += `</span>`;
|
|
|
+
|
|
|
|
|
|
- str += `</span>`;
|
|
|
- if (name === "可能诊断") {
|
|
|
let str1 = ""
|
|
|
for (let i = 0; i < item.symptoms.length; i++) {
|
|
|
- str1 += `<i class="${item.symptoms[i].matched ? 'red' : ''}" style="margin-right:10px">${item.symptoms[i].name}</i>`
|
|
|
+ str1 += `<i class="${item.symptoms[i].matched ? 'red' : ''}" style="margin-right:10px;white-space:nowrap;">${item.symptoms[i].name}</i>`
|
|
|
}
|
|
|
str += `<div class="pushItemBox-detail" >
|
|
|
<ul><li><span>症状表现:</span><p>${str1}</p></li></ul>
|
|
|
</div>`
|
|
|
+ str += `<div class="divider"></div>`
|
|
|
+ } else if (name === '鉴别诊断') {
|
|
|
+ signalStr += `<i class="detail-show icon-down"></i>`
|
|
|
+ str += `<span class="pushItemName inline-block ${item.hasScale == "1" ? 'evaluationtitle' : ''} ${item.hasInfo == "1" ? '' : 'noInfo'}">
|
|
|
+ <i class="disease-name" disease-name="${item.dest_node.name}" >
|
|
|
+ ${item.type == 8 ? ('【' + item.dest_node.name + '】') : item.dest_node.name}
|
|
|
+ </i>
|
|
|
+ ${signalStr}${infoIcon}${queryImg}<i class="hidden-i"></i>
|
|
|
+ </span>`
|
|
|
+ str += `</span>`;
|
|
|
+ let str1 = ""
|
|
|
+ if (Array.isArray(item.props)) {
|
|
|
+ for (let i = 0; i < item.props.length; i++) {
|
|
|
+ // console.log(item.props[i].prop_value)
|
|
|
+ str1 += `<li>
|
|
|
+ <pre>${Array.isArray(item.props[i].prop_value) ? item.props[i].prop_value.join("").replace(/\*\*(.*?)\*\*/g, (a, b) => '<strong>' + b + '</strong>') : ""}</pre>
|
|
|
+ </li>`
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ str1 += `<li><pre>无</pre></li>`
|
|
|
+ }
|
|
|
+ str += `<div class="pushItemBox-detail" >
|
|
|
+ <ul>${str1}</ul>
|
|
|
+ </div>`
|
|
|
+ str += `<div class="divider"></div>`
|
|
|
+ } else if (name === '推荐检查' || name === '推荐检验' || name === '推荐用药' || name === '非药物治疗方案') {
|
|
|
+ let itemName = item.dest_node?.name || item.name
|
|
|
+
|
|
|
+ let str1 = ""
|
|
|
+ if (Array.isArray(item.props)) {
|
|
|
+ let index = 1
|
|
|
+ for (let i = 0; i < item.props.length; i++) {
|
|
|
+ if (Array.isArray(item.props[i].prop_value) && item.props[i].prop_name !== 'timelimit') {
|
|
|
+ for (let j = 0; j < item.props[i].prop_value.length; j++) {
|
|
|
+ str1 += `<li>${index}. ${item.props[i].prop_value[j]}</li>`
|
|
|
+ index++
|
|
|
+ }
|
|
|
+ } else if (item.props[i].prop_name === 'timelimit' && typeof item.props[i].prop_value === 'string') {
|
|
|
+ itemName += `(${item.props[i].prop_value})`
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (Array.isArray(item.content)) { //针对“推荐用药”和“非药物治疗方案”设置的
|
|
|
+ for (let i = 0; i < item.content.length; i++) {
|
|
|
+ let str2 = ""
|
|
|
+ if (Array.isArray(item.content[i].subScheme)) {
|
|
|
+ for (let j = 0; j < item.content[i].subScheme.length; j++) {
|
|
|
+ str2 += `<i style="margin-right:10px">${item.content[i].subScheme[j].name}</i>`
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (item.content[i].scheme) {
|
|
|
+ str1 += `<li >
|
|
|
+ <div class="padding-1">●${item.content[i].scheme}</div>
|
|
|
+ <div class="padding-1">${str2}</div>
|
|
|
+ </li>`
|
|
|
+ } else {
|
|
|
+ str1 += `<li><div class="padding-1">${str2}</div></li>`
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ signalStr += `<i class="detail-show icon-down"></i>`
|
|
|
+ str += `<span class="pushItemName inline-block ${item.hasScale == "1" ? 'evaluationtitle' : ''} ${item.hasInfo == "1" ? '' : 'noInfo'}">
|
|
|
+ <i style="border-left:2px solid #EC5F18;padding-left:10px;" >
|
|
|
+ ${item.type == 8 ? ('【' + itemName + '】') : itemName}
|
|
|
+ </i>
|
|
|
+ ${signalStr}${infoIcon}${queryImg}
|
|
|
+ <i class="hidden-i"></i>
|
|
|
+ </span>`
|
|
|
+ str += `</span>`;
|
|
|
+
|
|
|
+ str += `<div class="pushItemBox-detail" >
|
|
|
+ <ul>${str1}</ul>
|
|
|
+ </div>`
|
|
|
+ str += `<div class="divider"></div>`
|
|
|
+ } else {
|
|
|
+ str += `<span class="pushItemName ${item.hasScale == "1" ? 'evaluationtitle' : ''} ${item.hasInfo == "1" ? '' : 'noInfo'}">${item.type == 8 ? ('【' + item.name + '】') : item.name} ${signalStr}${infoIcon}${queryImg}<i class="hidden-i"></i></span>`
|
|
|
}
|
|
|
+ // console.log("name", name)
|
|
|
// $(".pushItemBox").css("display", "flex")
|
|
|
return str;
|
|
|
}
|
|
@@ -831,13 +1001,26 @@ function bindOpenInfo() {
|
|
|
}
|
|
|
|
|
|
function bindSlide() {
|
|
|
+ //moduleItem可以包含多个moduleBox
|
|
|
$(".showMore").off("click").on("click", function () {
|
|
|
- $(this).parent().parent().find(".longBox").css("display", "block")
|
|
|
- $(this).parent().parent().find(".shortBox").css("display", "none")
|
|
|
+ if ($(this).parents(".moduleBox").length > 0) {
|
|
|
+ $(this).parents(".moduleBox").find(".longBox").css("display", "block")
|
|
|
+ $(this).parents(".moduleBox").find(".shortBox").css("display", "none")
|
|
|
+ } else {
|
|
|
+ $(this).parents(".moduleItem").find(".longBox").css("display", "block")
|
|
|
+ $(this).parents(".moduleItem").find(".shortBox").css("display", "none")
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
$(".showLess").off("click").on("click", function () {
|
|
|
- $(this).parent().parent().find(".longBox").css("display", "none")
|
|
|
- $(this).parent().parent().find(".shortBox").css("display", "block")
|
|
|
+ if ($(this).parents(".moduleBox").length > 0) {
|
|
|
+ $(this).parents(".moduleBox").find(".longBox").css("display", "none")
|
|
|
+ $(this).parents(".moduleBox").find(".shortBox").css("display", "block")
|
|
|
+ } else {
|
|
|
+ $(this).parents(".moduleItem").find(".longBox").css("display", "none")
|
|
|
+ $(this).parents(".moduleItem").find(".shortBox").css("display", "block")
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -845,15 +1028,26 @@ function renderModuleWrapper(moduleList) {
|
|
|
if (!moduleList) {
|
|
|
return
|
|
|
}
|
|
|
+ let pushCode = ['critical', "diag", "lis", "pacs", "symptom", "vital", "treat", "medicines", 'evaluation', 'general', 'medicine', 'operation', 'nurse', 'classiccase']
|
|
|
+
|
|
|
let moduleStr = ''
|
|
|
- for (let i = 0; i < moduleList.length; i++) {
|
|
|
- if (moduleList[i].status != '0') {
|
|
|
- if (moduleList[i].code == 'critical') {
|
|
|
- moduleStr += `<div class="moduleItem warning" data-num="${moduleList[i].number}" style="display:none"></div>`
|
|
|
- // moduleStr += `<div class="moduleItem tips" data-num="${moduleList[i].number}" style="display:none"></div>`
|
|
|
- } else {
|
|
|
- moduleStr += `<div class="moduleItem ${moduleList[i].code}" data-num="${moduleList[i].number}" style="display:none"></div>`
|
|
|
- }
|
|
|
+ // for (let i = 0; i < moduleList.length; i++) {
|
|
|
+ // if (moduleList[i].status != '0') {
|
|
|
+ // if (moduleList[i].code == 'critical') {
|
|
|
+ // moduleStr += `<div class="moduleItem warning" data-num="${moduleList[i].number}" style="display:none"></div>`
|
|
|
+ // // moduleStr += `<div class="moduleItem tips" data-num="${moduleList[i].number}" style="display:none"></div>`
|
|
|
+ // } else {
|
|
|
+ // moduleStr += `<div class="moduleItem ${moduleList[i].code}" data-num="${moduleList[i].number}" style="display:none"></div>`
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ for (let i = 0; i < pushCode.length; i++) {
|
|
|
+ if (pushCode[i] == 'critical') {
|
|
|
+ moduleStr += `<div class="moduleItem warning" data-num="${5}" style="display:none"></div>`
|
|
|
+ // moduleStr += `<div class="moduleItem tips" data-num="${moduleList[i].number}" style="display:none"></div>`
|
|
|
+ } else {
|
|
|
+ moduleStr += `<div class="moduleItem ${pushCode[i]}" data-num="${5}" style="display:none"></div>`
|
|
|
}
|
|
|
}
|
|
|
$(".recommendWrap").append(moduleStr)
|