cdss.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816
  1. if(!Promise){
  2. var Promise = require("bluebird");
  3. // Configure
  4. Promise.config({
  5. longStackTraces: true,
  6. warnings: true // note, run node with --trace-warnings to see full stack traces for warnings
  7. })
  8. }
  9. require('./../css/reset.css');
  10. require('./../css/cdss.less');
  11. require('./../css/popup.css');
  12. require('./../css/followUpV.less');
  13. require('../css/staticSearch.less')
  14. require('./../js/staticSearch.js');//静态知识搜索
  15. require('./../images/empty.png').replace(/^undefined/g, '')
  16. require('./../images/empty2.png').replace(/^undefined/g, '')
  17. require('./../images/empty3.png').replace(/^undefined/g, '')
  18. require('./../images/loading.gif').replace(/^undefined/g, '')
  19. require('./../images/right.png').replace(/^undefined/g, '')
  20. require('./../images/new.png').replace(/^undefined/g, '')
  21. require('./../images/t1.png').replace(/^undefined/g, '')
  22. require('./../images/t2.png').replace(/^undefined/g, '')
  23. require('./../images/t3.png').replace(/^undefined/g, '')
  24. require('./../images/go.png').replace(/^undefined/g, '')
  25. require('./../images/g1.png').replace(/^undefined/g, '')
  26. // require('./popupEdit.js');
  27. let infoImg = require('./../images/icon_info.png').replace(/^undefined/g, '')
  28. let infoImgOn = require('./../images/icon_info_on.png').replace(/^undefined/g, '')
  29. let iconArrowUp = require('./../images/icon_arrow_up.png').replace(/^undefined/g, '')
  30. let iconArrowDown = require('./../images/icon_arrow_down.png').replace(/^undefined/g, '')
  31. let iconMark = require('./../images/icon_mark.png').replace(/^undefined/g, '')
  32. let warnImg = require('./../images/icon_warning.png').replace(/^undefined/g, '')
  33. let warnImgWhite = require('./../images/icon_waring_white.png').replace(/^undefined/g, '')
  34. const $ = require("jquery");
  35. const { post,config,getUrlArgObject,openNewWin,titleConfig } = require('./promise.js');
  36. const { renderFollowUp, followEmpty } = require('./followUp.js');
  37. const {getTcmMr} = require('./tcmiss.js');
  38. const { transConf } = require('./util.js');
  39. //静态知识类型: 1:诊断 2.药品 3.化验套餐 4.化验明细 5.辅检 6.手术和操作
  40. let moduleConfig={
  41. auxiliary:"recommendWrap",
  42. qc:"qcWrap",
  43. medical:"medicalKonwledgeWrap",
  44. followup: "followUpWrap",
  45. tcmiss: 'tcmWarp',
  46. }
  47. let allInterface = 0
  48. let hasCompleteTnterface = 0
  49. let moduleNum = 0
  50. let mrId = getUrlArgObject('mrId')
  51. let isTcm = getUrlArgObject('isTcm')
  52. let pushMrId = getUrlArgObject('pushMrId')
  53. const tipsMode = getUrlArgObject('tipsMode') || 1
  54. let planCode = getUrlArgObject('planCode') || 'all'
  55. let hospitalIdUrl = getUrlArgObject('hospitalId') || ''
  56. let msg;
  57. let treatDisName;
  58. function getMRInfo() {
  59. return post(config.getMr2,{mrId:mrId})
  60. }
  61. $('.empty').css("display","none")
  62. if(mrId){
  63. Promise.all([getConf(),getMRInfo()]).then(([res1,res2])=>{
  64. const data = res1.data.data&&res1.data.data[0]
  65. msg = res2.data.data ||{}
  66. if(!(msg&&msg.diseaseName&&msg.diseaseName.name)){
  67. msg.diseaseName={}
  68. }
  69. window.msg = msg;
  70. renderPage(data)
  71. })
  72. } else{
  73. getConf().then(res =>{
  74. if(res.data.code == '0'){
  75. // const configArr = res.data.data.pushSetList || []
  76. // getPageInfo(configArr)
  77. const data = res.data.data&&res.data.data[0]
  78. renderPage(data)
  79. }
  80. })
  81. followEmpty()
  82. }
  83. function getConf() {
  84. var msg = window.msg
  85. return post(config.getPushSet,{hospitalId:hospitalIdUrl||msg.hospitalId||1,planCode: planCode})
  86. }
  87. function getPushInfo() {
  88. return post(config.pushInner, Object.assign({}, msg, {
  89. featureType: '1,4,5,6,7,8,9,10,12,13',
  90. hospitalId: hospitalIdUrl || msg.hospitalId,
  91. ruleType: config.ruleTypeMap['22']
  92. }))
  93. }
  94. function getPusgWarning(){
  95. const indPush = pushMrId ? config.indicationPushCache : config.indicationPush;
  96. return post(indPush, Object.assign({}, msg, {ruleType: '1,2,3,4', mrId: pushMrId || mrId}))
  97. }
  98. function getWriteStandardPush(){
  99. return post(config.caseWritingPrompt,Object.assign({},msg,{hospitalId:2||msg.hospitalId}))
  100. }
  101. function getHosptDeptUsal(){
  102. var msg = window.msg
  103. const param ={
  104. age: msg.age,
  105. deptName: msg.deptName,
  106. hospitalCode: msg.hosCode,
  107. sexType: msg.sex,
  108. type: 1,
  109. }
  110. return post(config.getHosptDeptUsal,param)
  111. }
  112. function getPushData(res){
  113. if(res&&res.data&&res.data.data&&res.data.data.dis&&res.data.data.dis){
  114. let dis = res.data.data.dis;
  115. //急诊显示规则,主诊断有急诊优先显示,没有则显示推送的,推送也没有就不显示
  116. if(dis&&dis['页面急诊']&&(dis['页面急诊'].length>0)){
  117. let name = dis['页面急诊'][0].name || ''
  118. $(".allDis .disName").html(name)
  119. disName = name
  120. if(name){
  121. $(".singleDis").css("display","block")
  122. }
  123. }else if(dis&&dis['急诊']&&dis['急诊'].length>0){
  124. let name = dis['急诊'][0].name || ''
  125. $(".allDis .disName").html(name)
  126. disName = name
  127. if(name){
  128. $(".singleDis").css("display","block")
  129. }
  130. }
  131. }
  132. }
  133. let disName=""
  134. function handleShow(){
  135. const newinConf = {
  136. width: '600', //窗口的文档显示区的宽度。以像素计。
  137. height: '826', //窗口文档显示区的高度。以像素计。
  138. left: '0', //窗口的 x 坐标。以像素计。
  139. top: '0', //窗口的 y 坐标。以像素计。
  140. openMode: "_blank" //每次都是新窗口打开为_blank,打开同一窗口填写任意字符串
  141. }
  142. const newWindowLocation = `width=${newinConf.width}, height=${newinConf.height}, left=${newinConf.left}, top=${newinConf.top} scrollbars=yes`
  143. window.open('./emergency.html?disName='+disName, newinConf.openMode, newWindowLocation)
  144. }
  145. $(document).on('click',".allDis .allName",function(){
  146. handleShow()
  147. })
  148. $(document).on('click',".singleDis",function(){
  149. $(this).next().css("display","block")
  150. $(this).css("display","none")
  151. })
  152. $(document).on('click',".allDis .right,.allDis .secDis",function(){
  153. $(".allDis").css("display","none")
  154. $(".singleDis").css("display","block")
  155. })
  156. function moreInfo() {
  157. $('.infoImg').off("click").click(function(){
  158. const name = $(this).parent().attr('data-name')
  159. const type = $(this).parent().attr('data-type')
  160. openNewWin(`staticInfo.html?type=${encodeURIComponent(type)}&position=0&name=${encodeURIComponent(name)}&mrId=${encodeURIComponent(mrId)}`)
  161. })
  162. $('.evaluationtitle').off("click").click(function () {
  163. const name = $(this).parent().attr('data-name')
  164. const type = $(this).parent().attr('data-type')
  165. openNewWin(`staticInfo.html?type=${encodeURIComponent(type)}&position=0&name=${encodeURIComponent(name)}&page=1&mrId=${encodeURIComponent(mrId)}&gauge=gauge`)
  166. })
  167. }
  168. function getVersion() {
  169. return post(config.getVersion, 'confArr').then((res) => {
  170. const data = res.data.data;
  171. const ver = localStorage.getItem('versionTime');
  172. const time = data.refreshTime;
  173. if(!ver||ver===time+"=new"||time!==ver.replace("=new","")){ //判断版本是否更新
  174. $(".version-tip").addClass('new-icon');
  175. localStorage.setItem('versionTime',time+"=new"); //保存版本更新时间
  176. }else{
  177. $(".version-tip").removeClass("new-icon");
  178. }
  179. })
  180. }
  181. function getDisclaimer() {
  182. return post(config.disclaimer, {}).then((res) => {
  183. const data = res.data.data.filter(item => item.disclaimerCode == "2");
  184. $(".responsibility").html((data[0] || {}).description);
  185. // $(".iframeWrap").css({height: $(window).height()-115-$(".responsibility").height()+"px"})
  186. })
  187. }
  188. function renderPage(pageSet){
  189. if(!pageSet || !pageSet.sysSetInfo){
  190. return
  191. }
  192. renderTab(pageSet.sysSetInfo)
  193. adjustHei()
  194. const hasAuxiliary = hasTab("辅助信息",pageSet.sysSetInfo)
  195. const hasMedical = hasTab("医学知识",pageSet.sysSetInfo)
  196. const hasFollowUp = hasTab("随访计划",pageSet.sysSetInfo)
  197. const hasTcm = hasTab("中医辅助", pageSet.sysSetInfo);
  198. if (hasTcm) {
  199. getTcmMr(mrId, hasTcm);
  200. }
  201. if(!mrId){
  202. empty()
  203. return
  204. }
  205. if(hasAuxiliary){
  206. renderModuleWrapper(hasAuxiliary.planDetails)
  207. let needPush = isNeedPush(hasAuxiliary.planDetails)
  208. let needPushWarning = isNeedPushWarning(hasAuxiliary.planDetails)
  209. let needWriteStandardPush = isNeedwriteStandardPush(hasAuxiliary.planDetails)
  210. if(needPush || needPushWarning){
  211. renderPushData()
  212. allInterface++
  213. }
  214. if(needPushWarning){
  215. renderPushWarning()
  216. allInterface++
  217. }
  218. if(needWriteStandardPush){
  219. renderWriteStandard()
  220. allInterface++
  221. }
  222. }
  223. if(hasFollowUp){
  224. renderFollowUp(msg)
  225. }
  226. }
  227. function renderPushData(){
  228. return getPushInfo().then(res =>{
  229. hasCompleteTnterface++
  230. if(res.data.code == "0"){
  231. console.log(1)
  232. const result = res.data.data
  233. let diagPush = result.dis ||{}
  234. let lisPush = result.lis || []
  235. let scalePush = result.scale || []
  236. let pacsPush = result.pacs || []
  237. let symptomPush = result.symptom ||[]
  238. let checkupPush = result.vital ||[]
  239. let medicinesPush = result.medicines || []
  240. let operationsPush = result.operations ||[]
  241. let treatPush = result.treat&&result.treat[0] ||{}
  242. let nursePush = result.nurse || []
  243. treatDisName = treatPush&&treatPush["name"]
  244. let generaTreatPush = treatPush&&treatPush["generaTreat"]
  245. // let lisPush =[{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
  246. // let pacsPush = [{name:"胸部x射线",hisNameList:null},{name:"心电图",hisNameList:null}]
  247. // let checkupPush = [{name:"神志表情",hisNameList:null},{name:"面部表情",hisNameList:null}]
  248. let lisNum = $(".moduleItem.lis").attr("data-num") || 5
  249. let scaleNum = $(".moduleItem.evaluation").attr("data-num") || 5
  250. let pacsNum = $(".moduleItem.pacs").attr("data-num") || 5
  251. let checkupNum = $(".moduleItem.vital").attr("data-num") || 5
  252. let symptomNum = $(".moduleItem.symptom").attr("data-num") || 5
  253. let medicinesNum = $(".moduleItem.medicine").attr("data-num") || 5
  254. let operationsNum = $(".moduleItem.operation").attr("data-num") || 5
  255. let nurseNum = $(".moduleItem.nurse").attr("data-num") || 5
  256. renderLis(lisPush,lisNum,3,true)
  257. renderScale(scalePush,scaleNum,8,true)
  258. renderPacs(pacsPush,pacsNum,5,true)
  259. renderCheckup(checkupPush,checkupNum,null,true)
  260. renderSymptomPush(symptomPush,symptomNum,null,true)
  261. renderDiag(diagPush)
  262. renderMedicinesPush(medicinesPush,medicinesNum,2,true)
  263. renderOperationPush(operationsPush,operationsNum,6,true)
  264. rendergeneraTreatPush(generaTreatPush)
  265. renderNurse(nursePush, nurseNum, 9, true)
  266. if(hasCompleteTnterface === allInterface){
  267. $('.loading').css("display","none")
  268. if(moduleNum === 0){
  269. empty()
  270. }
  271. }
  272. bindOpenInfo()
  273. moreInfo()
  274. bindSlide()
  275. }
  276. })
  277. }
  278. function adjustHei(){
  279. const iframeHei = $(".bodyWrap").height()
  280. $(".contentWrapper").css("height",iframeHei-20-30-60+3+19+'px')
  281. $(".tabList").css("height",iframeHei+'px')
  282. }
  283. function isNeedPush(list){
  284. let pushCode = ["diag","lis","pacs","symptom","vital","treat","medicines"]
  285. for(let i = 0; i < list.length; i++){
  286. if(pushCode.indexOf(list[i].code)>-1){
  287. if(list[i].status == "1"){
  288. return true
  289. }
  290. }
  291. }
  292. return false
  293. }
  294. function isNeedwriteStandardPush(list){
  295. let pushCode = ["casewriting"]
  296. for(let i = 0; i < list.length; i++){
  297. if(pushCode.indexOf(list[i].code)>-1){
  298. if(list[i].status == "1"){
  299. return true
  300. }
  301. }
  302. }
  303. return false
  304. }
  305. function isNeedPushWarning(list){
  306. let pushCode = ["crivalue", "rationali", "highrisk", "otherremind"]
  307. for(let i = 0; i < list.length; i++){
  308. if(pushCode.indexOf(list[i].code)>-1){
  309. if(list[i].status == "1"){
  310. return true
  311. }
  312. }
  313. }
  314. return false
  315. }
  316. let popNum = 0;//气泡显示数字
  317. function renderPushWarning(){
  318. return getPusgWarning().then(res =>{
  319. hasCompleteTnterface++
  320. if(res.data.code == '0'){
  321. const result = res.data.data
  322. let billMsgList = result.billMsgList || [] //开单合理性提醒
  323. let highRiskList = result.highRiskList || [] //高危药品、手术
  324. let criticalValList = result.criticalValList || [] //危急值提醒
  325. let noteList = result.noteList || [] //检查内容注意事项
  326. let dubugStr = result.dubugStr || [] //注意调试信息
  327. let otherList = result.otherList || [] //其他提醒
  328. //$('.moduleItem.crivalue').append(titleStr('warning'))
  329. renderBillingPush(billMsgList,'开单合理性提醒','rationali')
  330. renderBillingPush(highRiskList,'高风险提示','highrisk')
  331. renderBillingPush(criticalValList,'危急值提醒','crivalue')
  332. //renderBillingPush(noteList,'检查内容注意事项')
  333. renderBillingPush(otherList,'其他提醒','otherremind')
  334. //moreInfo()
  335. $(".moduleItem.tips").wrapAll("<div class='tips-cont'></div>");
  336. $(titleStr('warning')).insertBefore('.tips-cont .moduleItem:first-child')
  337. popNum = billMsgList.length+highRiskList.length+criticalValList.length+otherList.length;
  338. // renderBillingPush(dubugStr,'注意调试信息')
  339. }
  340. if(hasCompleteTnterface === allInterface){
  341. $('.loading').css("display","none")
  342. if(moduleNum === 0){
  343. empty()
  344. }
  345. }
  346. })
  347. }
  348. function renderWriteStandard(){
  349. return getWriteStandardPush().then(res =>{
  350. hasCompleteTnterface++
  351. if(res.data.code == '0'){
  352. const list = res.data.data || {}
  353. let casewritingNum = $(".moduleItem.casewriting").attr("data-num") || 5
  354. renderwriteStandardPage(list,casewritingNum)
  355. const warnNum = popNum + Object.keys(list).length;
  356. $(".tabList .numPop").text(warnNum).show()
  357. }
  358. if(hasCompleteTnterface === allInterface){
  359. $('.loading').css("display","none")
  360. if(moduleNum === 0){
  361. empty()
  362. $(".tabList .numPop").hide()
  363. }
  364. }
  365. })
  366. }
  367. function renderwriteStandardPage(list,casewritingNum){
  368. let arr = Object.keys(list)
  369. if(arr.length > 0 && $(".moduleItem.casewriting").length > 0){
  370. moduleNum++
  371. $(".moduleItem.casewriting").append(titleStr("casewritingPush"))
  372. let longStr = ``
  373. let shortStr = ``
  374. for(let i = 0; i < arr.length; i++){
  375. if( i < casewritingNum){
  376. shortStr += `<div class="billingPushItem"><img class="iconMark" src=${iconMark}>${arr[i]}</div>`
  377. }
  378. longStr += `<div class="billingPushItem"><img class="iconMark" src=${iconMark}>${arr[i]}</div>`
  379. }
  380. let shortStrBox = `<div class="shortStrBox">${shortStr}</div>`
  381. let longStrBox = `<div class="longStrBox">${longStr}</div>`
  382. let allStr = `<div class="casewritingWrapper"></div>`
  383. $(".moduleItem.casewriting").append(allStr)
  384. $(".casewritingWrapper").append(shortStrBox)
  385. if( arr.length>casewritingNum){
  386. $(".shortStrBox .billingPushItem").eq( $(".shortStrBox .billingPushItem").length -1).append(`<span class="showMoreCaseWriting"><img class="iconArrowImg" src="${iconArrowDown}"></span>`)
  387. // $(".moduleItem .generalTreatInfo").append(`<span class="showLessGeneralTreat">收起<img class="iconArrowImg" src="${iconArrowUp}"></span>`)
  388. $(".casewritingWrapper").append(longStrBox)
  389. $(".longStrBox .billingPushItem").eq( $(".longStrBox .billingPushItem").length -1).append(`<span class="showLessCaseWriting"><img class="iconArrowImg" src="${iconArrowUp}"></span>`)
  390. }
  391. $('.moduleItem.casewriting').css("display","block")
  392. bindSlideCaseWriting()
  393. }
  394. }
  395. function renderBillingPush(list,name,code){
  396. if(list.length === 0){
  397. return
  398. }
  399. moduleNum++
  400. let str = ``
  401. for(let i = 0; i < list.length; i++){
  402. str += `<div class="billingPushItem"><img class="iconMark" src=${iconMark}>${list[i].msg}</div>`
  403. }
  404. let titleStr = titleStr2(name)
  405. let boxStr = `<div class="moduleBox">
  406. ${titleStr}
  407. ${str}
  408. </div>`
  409. $("."+code).append(boxStr)
  410. $('.moduleItem.'+code).addClass("tips").css("display", "block")
  411. }
  412. function renderDiag(diagPush){
  413. let possibleDiagPush = diagPush["可能诊断"] || []
  414. let previousDiagPush = diagPush["既往诊断"] || []
  415. let firstDiagPush = diagPush["初步诊断"] || []
  416. let identifyDiagPush = diagPush["鉴别诊断"] || []
  417. let warningDiagPush = diagPush["警惕"] || []
  418. let number = $('.moduleItem.diag').attr("data-num") || 5
  419. let warnNumber = $('.moduleItem.warning').attr("data-num") || 5
  420. $('.moduleItem.diag').append(titleStr("diagPush"))
  421. // let warningDiagPush = [{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
  422. // let firstDiagPush = [{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
  423. // let identifyDiagPush = diagPush["鉴别诊断"] || [{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
  424. renderDiagItem(possibleDiagPush,"可能诊断",number)
  425. renderDiagItem(previousDiagPush, "既往诊断", number)
  426. renderDiagItem(firstDiagPush,"初步诊断",number)
  427. renderDiagItem(identifyDiagPush,"鉴别诊断",number)
  428. renderWarningDiag(warningDiagPush,"警惕",warnNumber)
  429. moreInfo()
  430. }
  431. function renderDiagItem(list,name,number){
  432. if(list.length === 0){
  433. return
  434. }
  435. moduleNum++
  436. let titleStr = titleStr2(name)
  437. let {shortStr, longStr} = renderItemWrapper(list,number,1,true)
  438. let boxStr = `<div class="moduleBox">
  439. ${titleStr}
  440. ${shortStr}
  441. ${longStr}
  442. </div>`
  443. $(".diag").append(boxStr)
  444. $('.moduleItem.diag').css("display","block")
  445. }
  446. function renderWarningDiag(list,name,number){
  447. if(list.length > 0 && $(".moduleItem.warning").length > 0){
  448. moduleNum++
  449. $('.moduleItem.warning').append()
  450. let str = `<span class="warningTitle"><img class="warningTitImg" src=${warnImgWhite}>警惕</span>`
  451. for(let i = 0; i < list.length; i++){
  452. str+= renderPushItem(list[i],1)
  453. }
  454. $('.moduleItem.warning').append(str)
  455. $('.moduleItem.warning').css("display","block")
  456. }
  457. }
  458. function renderLis(list,showNum,type,hasInfo){
  459. if(list.length > 0 && $(".moduleItem.lis").length > 0){
  460. moduleNum++
  461. $('.moduleItem.lis').append(titleStr("lisPush"))
  462. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  463. $('.moduleItem.lis').append(shortStr).append(longStr)
  464. $('.moduleItem.lis').css("display","block")
  465. }
  466. }
  467. function renderScale(list,showNum,type,hasInfo){
  468. if(list.length > 0 && $(".moduleItem.evaluation").length > 0){
  469. moduleNum++
  470. $('.moduleItem.evaluation').append(titleStr("scalePush"))
  471. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  472. $('.moduleItem.evaluation').append(shortStr).append(longStr)
  473. $('.moduleItem.evaluation').css("display", "block")
  474. // $('.moduleItem.evaluation').children(".shortBox").children(".pushItemBox").children(".pushItemName").addClass("evaluationtitle")
  475. // $('.moduleItem.evaluation').children(".longBox").children(".pushItemBox").children(".pushItemName").addClass("evaluationtitle")
  476. }
  477. }
  478. function renderNurse(list, showNum, type, hasInfo) {
  479. if (list.length > 0 && $(".moduleItem.nurse").length > 0) {
  480. moduleNum++
  481. $('.moduleItem.nurse').append(titleStr("nursePush"))
  482. let {shortStr, longStr} = renderItemWrapper(list, showNum, type, hasInfo)
  483. $('.moduleItem.nurse').append(shortStr).append(longStr);
  484. $('.moduleItem.nurse').css("display", "block")
  485. }
  486. }
  487. function renderPacs(list,showNum,type,hasInfo){
  488. if(list.length > 0 && $(".moduleItem.pacs").length > 0){
  489. moduleNum++
  490. $(".moduleItem.pacs").append(titleStr("pacsPush"))
  491. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  492. $(".moduleItem.pacs").append(shortStr).append(longStr)
  493. $('.moduleItem.pacs').css("display","block")
  494. }
  495. }
  496. function renderCheckup(list,showNum,type,hasInfo){
  497. if(list.length > 0 && $(".moduleItem.vital").length > 0){
  498. moduleNum++
  499. $(".moduleItem.vital").append(titleStr("checkupPush"))
  500. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  501. $(".moduleItem.vital").append(shortStr).append(longStr)
  502. $('.moduleItem.vital').css("display","block")
  503. }
  504. }
  505. function renderSymptomPush(list,showNum,type,hasInfo){
  506. $(".moduleItem.symptom").append(titleStr('symptomPush'))
  507. if(list.length > 0 && $(".moduleItem.symptom").length > 0){
  508. moduleNum++
  509. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  510. $(".moduleItem.symptom").append(shortStr).append(longStr)
  511. $(".moduleItem.symptom").css("display","block")
  512. }
  513. }
  514. function rendergeneraTreatPush(list){
  515. if(list&& $(".moduleItem.general").length > 0){
  516. $(".moduleItem.general").append(titleStr('generaTreatPush'))
  517. moduleNum++
  518. let str = `<div class="generalTreatInfo clearfix isOverFlow">${list}</div>`
  519. $(".moduleItem.general").append(str)
  520. $(".moduleItem.general").css("display","block")
  521. let generaTreatHei = $(".moduleItem .generalTreatInfo")[0].scrollHeight
  522. if(generaTreatHei > 50){
  523. $(".moduleItem .generalTreatInfo").append(`<span class="showMoreGeneralTreat">更多<img class="iconArrowImg more" src="${iconArrowDown}"></span>`)
  524. $(".moduleItem .generalTreatInfo").append(`<span class="showLessGeneralTreat">收起<img class="iconArrowImg" src="${iconArrowUp}"></span>`)
  525. bindGeneralSlide()
  526. }
  527. }
  528. }
  529. function renderMedicinesPush(list,showNum,type,hasInfo){
  530. $(".moduleItem.medicine").append(titleStr('drugPush'))
  531. if(list.length > 0 && $(".moduleItem.medicine").length > 0){
  532. moduleNum++
  533. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  534. $(".moduleItem.medicine").append(shortStr).append(longStr)
  535. $(".moduleItem.medicine").css("display","block")
  536. }
  537. }
  538. function renderOperationPush(list,showNum,type,hasInfo){
  539. $(".moduleItem.operation").append(titleStr('operationPush'))
  540. if(list.length > 0 && $(".moduleItem.operation").length > 0){
  541. moduleNum++
  542. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  543. $(".moduleItem.operation").append(shortStr).append(longStr)
  544. $(".moduleItem.operation").css("display","block")
  545. }
  546. }
  547. function renderItemWrapper(list, showNum, type, hasInfo) {
  548. //console.log(33, type)
  549. let showNum1 = showNum || 5
  550. let shortStr = '', longStr = ''
  551. for(let i = 0; i < list.length; i++){
  552. if(i <= showNum1-1){
  553. shortStr += renderPushItem(list[i],type)
  554. }
  555. longStr += renderPushItem(list[i],type)
  556. }
  557. if(showNum1 >= list.length){
  558. return {
  559. shortStr:`<div class="shortBox">${shortStr}</div>`,
  560. longStr:''
  561. }
  562. }else{
  563. shortStr += `<span class="showMore"><img class="iconArrowImg" src="${iconArrowDown}"></span>`
  564. longStr += `<span class="showLess"><img class="iconArrowImg" src="${iconArrowUp}"></span>`
  565. return {
  566. shortStr:`<div class="shortBox">${shortStr}</div>`,
  567. longStr:`<div class="longBox">${longStr}</div>`
  568. }
  569. }
  570. }
  571. function renderPushItem(item, type) {
  572. str = `<span class="pushItemBox" data-name="${item.name}" data-type="${type}">`
  573. str += `${item.hasScale == "0" ? `<span class="pushItemName">${type == 8 ? ('【' + item.name + '】') : item.name}</span>` : item.hasScale == "1" ? `<span class="pushItemName evaluationtitle">${type == 8 ? ('【' + item.name + '】') : item.name}</span>` : `<span class="pushItemName">${type == 8 ? ('【' + item.name + '】') : item.name}</span>`}`
  574. str += `${ item.hasInfo == "1" ? `<img class="infoImg" src="${infoImg}">` : "" }`
  575. str += '</span >'
  576. return str
  577. }
  578. function bindOpenInfo(){
  579. $(".infoImg").on("mouseenter", function(){
  580. $(this).attr("src", infoImgOn)
  581. }).on("mouseleave", function(){
  582. $(this).attr("src", infoImg)
  583. })
  584. }
  585. function bindSlide(){
  586. $(".showMore").off("click").on("click", function(){
  587. $(this).parent().parent().find(".longBox").css("display","block")
  588. $(this).parent().parent().find(".shortBox").css("display","none")
  589. })
  590. $(".showLess").off("click").on("click", function(){
  591. $(this).parent().parent().find(".longBox").css("display","none")
  592. $(this).parent().parent().find(".shortBox").css("display","block")
  593. })
  594. }
  595. function renderModuleWrapper(moduleList){
  596. if(!moduleList){
  597. return
  598. }
  599. let moduleStr = ''
  600. for(let i = 0; i < moduleList.length; i++){
  601. if(moduleList[i].status !='0'){
  602. if(moduleList[i].code == 'critical'){
  603. moduleStr += `<div class="moduleItem warning" data-num="${moduleList[i].number}" style="display:none"></div>`
  604. // moduleStr += `<div class="moduleItem tips" data-num="${moduleList[i].number}" style="display:none"></div>`
  605. }else{
  606. moduleStr += `<div class="moduleItem ${moduleList[i].code }" data-num="${moduleList[i].number}" style="display:none"></div>`
  607. }
  608. }
  609. }
  610. // console.log(moduleList,moduleStr)
  611. $(".recommendWrap").append(moduleStr)
  612. }
  613. function hasTab(tabName,tabList){
  614. if(!tabList){
  615. return
  616. }
  617. for(let i = 0; i < tabList.length; i++){
  618. if(tabList[i].name == tabName){
  619. return tabList[i]
  620. }
  621. }
  622. return false
  623. }
  624. function renderTab(tabList){
  625. let tabStr = '<ul>'
  626. for(let i = 0; i < tabList.length; i++){
  627. if(tabList[i].status == '1'){
  628. tabStr += `<li class="tab" data-name="${tabList[i].code}" ><span>${tabList[i].name}</span></li>`
  629. }
  630. }
  631. tabStr += `</ul><div class="numPop"></div>`;
  632. $(".tabList").append(tabStr)
  633. let tabNum = 0;
  634. if(isTcm=='true'){
  635. tabNum = $(".tabList .tab").length-1;
  636. }
  637. $(".tabList .tab").eq(tabNum).addClass("activeTab")
  638. let showModuleName = $(".tabList .tab").eq(tabNum).attr("data-name")
  639. getModuleShow(moduleConfig[showModuleName])
  640. bindTabClick()
  641. }
  642. function titleStr(type){
  643. let titleStr = ''
  644. titleStr += `<h4 class="moduleTitle" style="background:${titleConfig[type].background}"><img class="titleIcon" src=${titleConfig[type].icon}>${titleConfig[type].name}</h4>`
  645. return titleStr
  646. }
  647. function titleStr2(name){
  648. let titleStr = ''
  649. titleStr += `<p class="moduleBoxTitle">${name}:</p>`
  650. return titleStr
  651. }
  652. function bindTabClick(){
  653. $(".tabList .tab").off("click").on("click", function(){
  654. $(".activeTab").removeClass("activeTab")
  655. $(this).addClass("activeTab")
  656. const moduleName = $(this).attr("data-name")
  657. getModuleShow(moduleConfig[moduleName])
  658. if(moduleName == "medical"){
  659. $(".staticSearchT .ipt").find("input").focus()
  660. $(".contentWrapper").css("overflowY","hidden")
  661. }else if(moduleName == 'followup'){
  662. // $(".contentWrapper").css("overflowY","auto")
  663. }
  664. })
  665. }
  666. function getModuleShow(moduleClassName){
  667. if( $(`.${moduleClassName}`).css("display") =="none"){
  668. $(".moduleWrapper").css("display","none")
  669. $(`.${moduleClassName}`).css("display","block")
  670. }
  671. }
  672. function bindGeneralSlide(){
  673. $(".showMoreGeneralTreat").off("click").on("click",function(){
  674. $(".generalTreatInfo").toggleClass("isOverFlow")
  675. $(".showMoreGeneralTreat").toggle()
  676. })
  677. $(".showLessGeneralTreat").off("click").on("click",function(){
  678. $(".generalTreatInfo").toggleClass("isOverFlow")
  679. $(".showMoreGeneralTreat").toggle()
  680. })
  681. }
  682. function bindSlideCaseWriting(){
  683. $(".showMoreCaseWriting").off("click").on("click",function(){
  684. $(this).parents(".casewritingWrapper ").find(".shortStrBox").css("display","none")
  685. $(this).parents(".casewritingWrapper ").find(".longStrBox").css("display","block")
  686. })
  687. $(".showLessCaseWriting").off("click").on("click",function(){
  688. $(this).parents(".casewritingWrapper ").find(".shortStrBox").css("display","block")
  689. $(this).parents(".casewritingWrapper ").find(".longStrBox").css("display","none")
  690. })
  691. }
  692. function empty(){
  693. // $(".responsibility").css("display","none")
  694. $('.recommendWrap .empty').css("display","block")
  695. }
  696. $(function(){
  697. getDisclaimer(); //获取免责声明
  698. getVersion(); //获取版本信息
  699. $(".disclaimerInfo").on("click", function(){
  700. openNewWin("disclaimer.html")
  701. });
  702. $(".version-tip").on("click", function(){
  703. const ver = localStorage.getItem('versionTime');
  704. $(".version-tip").removeClass('new-icon');
  705. localStorage.setItem('versionTime',ver.replace("=new",""));
  706. openNewWin("version.html");
  707. });
  708. $.fn.extend({
  709. "preventScroll":function(){
  710. $(this).each(function(){
  711. var _this = this;
  712. if(navigator.userAgent.indexOf('Firefox') >= 0){ //firefox
  713. _this.addEventListener('DOMMouseScroll',function(e){
  714. _this.scrollTop += e.detail > 0 ? 60 : -60;
  715. e.preventDefault();
  716. },false);
  717. }else{
  718. _this.onmousewheel = function(e){
  719. e = e || window.event;
  720. _this.scrollTop += e.wheelDelta > 0 ? -60 : 60;
  721. return false;
  722. };
  723. }
  724. })
  725. }
  726. });
  727. // $(".iframeWrap").preventScroll();
  728. $(".iframeWrap").preventScroll();
  729. $(".recommendWrap").preventScroll();
  730. $(".tcmWarp").preventScroll();
  731. $(".infoWrap").preventScroll();
  732. $(".medicalKonwledgeWrap .staticSearchB ul").preventScroll();
  733. $(window).on("resize", function(){
  734. $(".iframeWrap").preventScroll();
  735. $(".recommendWrap").preventScroll();
  736. $(".tcmWarp").preventScroll();
  737. $(".medicalKonwledgeWrap .staticSearchB ul").preventScroll();
  738. adjustHei()
  739. })
  740. });