require('../css/index.less');
require('../css/reset.css');
require('../css/popup.css');
require('./popup');
const $ = require("jquery");
const { post,config,getUrlArgObject,openNewWin } = require('./promise.js');
// var msg = {
// age: getUrlArgObject('age'),
// sex: getUrlArgObject('sex') == '男'?1:(getUrlArgObject('sex') == '女'?2:(getUrlArgObject('sex') == '通用'?3:getUrlArgObject('sex'))),
// symptom: getUrlArgObject('symptomJson'),
// vital: getUrlArgObject('vitalJson'),
// lis: getUrlArgObject('lisJson')? JSON.parse(getUrlArgObject('lisJson')) : [],
// pacs: getUrlArgObject('pacsJson'),
// diag: getUrlArgObject('diagJson'),
// diseaseName: getUrlArgObject('diagJson'),
// other: getUrlArgObject('otherJson') + getUrlArgObject('pastJson'),
// hosCode:getUrlArgObject('hospitalCode') || ''
// }//推送相关信息
var msg = JSON.parse(getUrlArgObject('msg'))
window.msg = msg
window.pushMessage = {}
post(config.pushInner,Object.assign(msg,{featureType: '22',ruleType:config.ruleTypeMap['22']})).then((res)=>{
var data = res.data
if(data.code == 0) {
var result = data.data;
if (result.medicalIndications && result.medicalIndications.length > 0) {//病情提示
window.pushMessage = result.medicalIndications;//计算的需要的相关数据
bqtsFun(result.medicalIndications)
}
}
});
function bqtsFun(data){//病情提示
let tmpBqDetailAllStr = '';
//let names = [];
for(var k = 0;k < data.length;k++){
var tmpBq = data[k]
let hasSritical = false
let tmpBqStr;
if(tmpBq.details) {
for(let i = 0; i < tmpBq.details.length; i++) {
if(tmpBq.details[i].type == 4) {
hasSritical= true
}
}
}
if(hasSritical) {
/*if(names.includes(tmpBq.name)){ //name相同去重
tmpBqStr='';
}else{
names.push(tmpBq.name);*/
tmpBqStr = `
${tmpBq.name}
`
//}
} else {
tmpBqStr = '患者可能有
'+tmpBq.name+' :';
}
var tmpBqDetailStr = ''
for(var m = 0;m < tmpBq.details.length;m++){
var tmpBqDetail = tmpBq.details[m]
if(tmpBqDetail.type == 1){
tmpBqDetailStr+=tmpBqStr+ "
【"+tmpBqDetail.content.name+"】
"+
'
';
}
if(tmpBqDetail.type == 2){
var deepDetailName = ''+tmpBqDetail.content.name+'
'
var deepDetailStr = ''
var deepDetailResultStr = ''
for(var n = 0;n < tmpBqDetail.content.details.length;n++){
var deepDetail = tmpBqDetail.content.details[n]
if(deepDetail.controlType == 2){//0-radio,1-checkbox,2-text,3-dropdownlist
if(deepDetail.isShow == 0) {
deepDetailStr+=''+deepDetail.name+': ' + deepDetail.value +' '+ deepDetail.uint+''
} else {
deepDetailStr+='请输入'+deepDetail.name+': '+deepDetail.uint+''
}
}
if(deepDetail.controlType == 0){
let tooDeepDetailStr = ''
for(var f = 0;f'+tooDeepDetail.detailName+''
tooDeepDetailStr+=''+tooDeepDetail.detailName+''
}
}else{
tooDeepDetailStr+=''+tooDeepDetail.detailName+''+(tooDeepDetail.state == 1?"(智能推荐)":"")+''
}
}
deepDetailStr+=''+deepDetail.name+': '+
''+
''
}
}
for(var v = 0;v < tmpBqDetail.content.result.length;v++){
deepDetailResultStr+=''+tmpBqDetail.content.result[v].name+':
'
}
tmpBqDetailStr+='计算公式结果:'+
'请选择'+
''+
''+
'
'
}
if(tmpBqDetail.type == 3){
var deepDetailName = ''+tmpBqDetail.content.name+': '
var deepDetailStr = ''
for(var n = 0;n < tmpBqDetail.content.details.length;n++){
var deepDetail = tmpBqDetail.content.details[n]
deepDetailStr+=''+deepDetail.detailName+''+(deepDetail.state == 1?"(智能推荐)":"")+''
}
tmpBqDetailStr+='可能结果:请选择'+
''+
'
'
}
if(tmpBqDetail.type == 4){
tmpBqDetailStr+=tmpBqStr +
// "诊断要点:"+tmpBqDetail.content.name+"
"+
'';
}
}
/*if(tmpBqStr != '' || tmpBqDetailStr != ''){
$(".conditionHintTipsNull").css("display","none")
}*/
tmpBqDetailAllStr += tmpBqDetailStr
}
$(".conditionHintTipsNull").html('')
$(".mayIllness .infoMsg").on("click",function(){
const infoMsgName = $(this).parent().attr('data-name')
openNewWin(`information.html?type=22&position=2&name=${encodeURIComponent(infoMsgName)}`)
})
$(".illnessTable").on('click',function(){
const msg1 = JSON.parse(JSON.stringify(msg))
msg1.scaleName = $(this).attr('data-scaleName')
msg1.featureType = 21
openNewWin(`scale.html?msg=${encodeURIComponent(JSON.stringify(msg1))}`)
})
}