cdss.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805
  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.css')
  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)}`)
  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. const tabHei = $(".tabList").height()
  281. $(".contentWrapper").css("height",iframeHei-tabHei-20-30+3+19+'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. function renderPushWarning(){
  317. return getPusgWarning().then(res =>{
  318. hasCompleteTnterface++
  319. if(res.data.code == '0'){
  320. const result = res.data.data
  321. let billMsgList = result.billMsgList || [] //开单合理性提醒
  322. let highRiskList = result.highRiskList || [] //高危药品、手术
  323. let criticalValList = result.criticalValList || [] //危急值提醒
  324. let noteList = result.noteList || [] //检查内容注意事项
  325. let dubugStr = result.dubugStr || [] //注意调试信息
  326. let otherList = result.otherList || [] //其他提醒
  327. //$('.moduleItem.crivalue').append(titleStr('warning'))
  328. renderBillingPush(billMsgList,'开单合理性提醒','rationali')
  329. renderBillingPush(highRiskList,'高风险提示','highrisk')
  330. renderBillingPush(criticalValList,'危急值提醒','crivalue')
  331. //renderBillingPush(noteList,'检查内容注意事项')
  332. renderBillingPush(otherList,'其他提醒','otherremind')
  333. //moreInfo()
  334. $(".moduleItem.tips").wrapAll("<div class='tips-cont'></div>");
  335. $(titleStr('warning')).insertBefore('.tips-cont .moduleItem:first-child')
  336. // renderBillingPush(dubugStr,'注意调试信息')
  337. }
  338. if(hasCompleteTnterface === allInterface){
  339. $('.loading').css("display","none")
  340. if(moduleNum === 0){
  341. empty()
  342. }
  343. }
  344. })
  345. }
  346. function renderWriteStandard(){
  347. return getWriteStandardPush().then(res =>{
  348. hasCompleteTnterface++
  349. if(res.data.code == '0'){
  350. const list = res.data.data || {}
  351. let casewritingNum = $(".moduleItem.casewriting").attr("data-num") || 5
  352. renderwriteStandardPage(list,casewritingNum)
  353. }
  354. if(hasCompleteTnterface === allInterface){
  355. $('.loading').css("display","none")
  356. if(moduleNum === 0){
  357. empty()
  358. }
  359. }
  360. })
  361. }
  362. function renderwriteStandardPage(list,casewritingNum){
  363. let arr = Object.keys(list)
  364. if(arr.length > 0 && $(".moduleItem.casewriting").length > 0){
  365. moduleNum++
  366. $(".moduleItem.casewriting").append(titleStr("casewritingPush"))
  367. let longStr = ``
  368. let shortStr = ``
  369. for(let i = 0; i < arr.length; i++){
  370. if( i < casewritingNum){
  371. shortStr += `<div class="billingPushItem"><img class="iconMark" src=${iconMark}>${arr[i]}</div>`
  372. }
  373. longStr += `<div class="billingPushItem"><img class="iconMark" src=${iconMark}>${arr[i]}</div>`
  374. }
  375. let shortStrBox = `<div class="shortStrBox">${shortStr}</div>`
  376. let longStrBox = `<div class="longStrBox">${longStr}</div>`
  377. let allStr = `<div class="casewritingWrapper"></div>`
  378. $(".moduleItem.casewriting").append(allStr)
  379. $(".casewritingWrapper").append(shortStrBox)
  380. if( arr.length>casewritingNum){
  381. $(".shortStrBox .billingPushItem").eq( $(".shortStrBox .billingPushItem").length -1).append(`<span class="showMoreCaseWriting">更多<img class="iconArrowImg" src="${iconArrowDown}"></span>`)
  382. // $(".moduleItem .generalTreatInfo").append(`<span class="showLessGeneralTreat">收起<img class="iconArrowImg" src="${iconArrowUp}"></span>`)
  383. $(".casewritingWrapper").append(longStrBox)
  384. $(".longStrBox .billingPushItem").eq( $(".longStrBox .billingPushItem").length -1).append(`<span class="showLessCaseWriting">收起<img class="iconArrowImg" src="${iconArrowUp}"></span>`)
  385. }
  386. $('.moduleItem.casewriting').css("display","block")
  387. bindSlideCaseWriting()
  388. }
  389. }
  390. function renderBillingPush(list,name,code){
  391. if(list.length === 0){
  392. return
  393. }
  394. moduleNum++
  395. let str = ``
  396. for(let i = 0; i < list.length; i++){
  397. str += `<div class="billingPushItem"><img class="iconMark" src=${iconMark}>${list[i].msg}</div>`
  398. }
  399. let titleStr = titleStr2(name)
  400. let boxStr = `<div class="moduleBox">
  401. ${titleStr}
  402. ${str}
  403. </div>`
  404. $("."+code).append(boxStr)
  405. $('.moduleItem.'+code).addClass("tips").css("display", "block")
  406. }
  407. function renderDiag(diagPush){
  408. let possibleDiagPush = diagPush["可能诊断"] || []
  409. let previousDiagPush = diagPush["既往诊断"] || []
  410. let firstDiagPush = diagPush["初步诊断"] || []
  411. let identifyDiagPush = diagPush["鉴别诊断"] || []
  412. let warningDiagPush = diagPush["警惕"] || []
  413. let number = $('.moduleItem.diag').attr("data-num") || 5
  414. let warnNumber = $('.moduleItem.warning').attr("data-num") || 5
  415. $('.moduleItem.diag').append(titleStr("diagPush"))
  416. // let warningDiagPush = [{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
  417. // let firstDiagPush = [{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
  418. // let identifyDiagPush = diagPush["鉴别诊断"] || [{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
  419. renderDiagItem(possibleDiagPush,"可能诊断",number)
  420. renderDiagItem(previousDiagPush, "既往诊断", number)
  421. renderDiagItem(firstDiagPush,"初步诊断",number)
  422. renderDiagItem(identifyDiagPush,"鉴别诊断",number)
  423. renderWarningDiag(warningDiagPush,"警惕",warnNumber)
  424. moreInfo()
  425. }
  426. function renderDiagItem(list,name,number){
  427. if(list.length === 0){
  428. return
  429. }
  430. moduleNum++
  431. let titleStr = titleStr2(name)
  432. let {shortStr, longStr} = renderItemWrapper(list,number,1,true)
  433. let boxStr = `<div class="moduleBox">
  434. ${titleStr}
  435. ${shortStr}
  436. ${longStr}
  437. </div>`
  438. $(".diag").append(boxStr)
  439. $('.moduleItem.diag').css("display","block")
  440. }
  441. function renderWarningDiag(list,name,number){
  442. if(list.length > 0 && $(".moduleItem.warning").length > 0){
  443. moduleNum++
  444. $('.moduleItem.warning').append()
  445. let str = `<span class="warningTitle"><img class="warningTitImg" src=${warnImgWhite}>警惕</span>`
  446. for(let i = 0; i < list.length; i++){
  447. str+= renderPushItem(list[i],1)
  448. }
  449. $('.moduleItem.warning').append(str)
  450. $('.moduleItem.warning').css("display","block")
  451. }
  452. }
  453. function renderLis(list,showNum,type,hasInfo){
  454. if(list.length > 0 && $(".moduleItem.lis").length > 0){
  455. moduleNum++
  456. $('.moduleItem.lis').append(titleStr("lisPush"))
  457. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  458. $('.moduleItem.lis').append(shortStr).append(longStr)
  459. $('.moduleItem.lis').css("display","block")
  460. }
  461. }
  462. function renderScale(list,showNum,type,hasInfo){
  463. if(list.length > 0 && $(".moduleItem.evaluation").length > 0){
  464. moduleNum++
  465. $('.moduleItem.evaluation').append(titleStr("scalePush"))
  466. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  467. $('.moduleItem.evaluation').append(shortStr).append(longStr)
  468. $('.moduleItem.evaluation').css("display","block")
  469. $('.moduleItem.evaluation').children(".shortBox").children(".pushItemBox").children(".pushItemName").addClass("evaluationtitle")
  470. }
  471. }
  472. function renderNurse(list, showNum, type, hasInfo) {
  473. if (list.length > 0 && $(".moduleItem.nurse").length > 0) {
  474. moduleNum++
  475. $('.moduleItem.nurse').append(titleStr("nursePush"))
  476. let {shortStr, longStr} = renderItemWrapper(list, showNum, type, hasInfo)
  477. $('.moduleItem.nurse').append(shortStr).append(longStr);
  478. $('.moduleItem.nurse').css("display", "block")
  479. }
  480. }
  481. function renderPacs(list,showNum,type,hasInfo){
  482. if(list.length > 0 && $(".moduleItem.pacs").length > 0){
  483. moduleNum++
  484. $(".moduleItem.pacs").append(titleStr("pacsPush"))
  485. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  486. $(".moduleItem.pacs").append(shortStr).append(longStr)
  487. $('.moduleItem.pacs').css("display","block")
  488. }
  489. }
  490. function renderCheckup(list,showNum,type,hasInfo){
  491. if(list.length > 0 && $(".moduleItem.vital").length > 0){
  492. moduleNum++
  493. $(".moduleItem.vital").append(titleStr("checkupPush"))
  494. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  495. $(".moduleItem.vital").append(shortStr).append(longStr)
  496. $('.moduleItem.vital').css("display","block")
  497. }
  498. }
  499. function renderSymptomPush(list,showNum,type,hasInfo){
  500. $(".moduleItem.symptom").append(titleStr('symptomPush'))
  501. if(list.length > 0 && $(".moduleItem.symptom").length > 0){
  502. moduleNum++
  503. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  504. $(".moduleItem.symptom").append(shortStr).append(longStr)
  505. $(".moduleItem.symptom").css("display","block")
  506. }
  507. }
  508. function rendergeneraTreatPush(list){
  509. if(list&& $(".moduleItem.general").length > 0){
  510. $(".moduleItem.general").append(titleStr('generaTreatPush'))
  511. moduleNum++
  512. let str = `<div class="generalTreatInfo clearfix isOverFlow">${list}</div>`
  513. $(".moduleItem.general").append(str)
  514. $(".moduleItem.general").css("display","block")
  515. let generaTreatHei = $(".moduleItem .generalTreatInfo")[0].scrollHeight
  516. if(generaTreatHei > 50){
  517. $(".moduleItem .generalTreatInfo").append(`<span class="showMoreGeneralTreat">更多<img class="iconArrowImg more" src="${iconArrowDown}"></span>`)
  518. $(".moduleItem .generalTreatInfo").append(`<span class="showLessGeneralTreat">收起<img class="iconArrowImg" src="${iconArrowUp}"></span>`)
  519. bindGeneralSlide()
  520. }
  521. }
  522. }
  523. function renderMedicinesPush(list,showNum,type,hasInfo){
  524. $(".moduleItem.medicine").append(titleStr('drugPush'))
  525. if(list.length > 0 && $(".moduleItem.medicine").length > 0){
  526. moduleNum++
  527. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  528. $(".moduleItem.medicine").append(shortStr).append(longStr)
  529. $(".moduleItem.medicine").css("display","block")
  530. }
  531. }
  532. function renderOperationPush(list,showNum,type,hasInfo){
  533. $(".moduleItem.operation").append(titleStr('operationPush'))
  534. if(list.length > 0 && $(".moduleItem.operation").length > 0){
  535. moduleNum++
  536. let {shortStr, longStr} = renderItemWrapper(list,showNum,type,hasInfo)
  537. $(".moduleItem.operation").append(shortStr).append(longStr)
  538. $(".moduleItem.operation").css("display","block")
  539. }
  540. }
  541. function renderItemWrapper(list, showNum, type, hasInfo) {
  542. //console.log(33, type)
  543. let showNum1 = showNum || 5
  544. let shortStr = '', longStr = ''
  545. for(let i = 0; i < list.length; i++){
  546. if(i <= showNum1-1){
  547. shortStr += renderPushItem(list[i],type)
  548. }
  549. longStr += renderPushItem(list[i],type)
  550. }
  551. if(showNum1 >= list.length){
  552. return {
  553. shortStr:`<div class="shortBox">${shortStr}</div>`,
  554. longStr:''
  555. }
  556. }else{
  557. shortStr += `<span class="showMore">更多 <img class="iconArrowImg" src="${iconArrowDown}"></span>`
  558. longStr += `<span class="showLess">收起 <img class="iconArrowImg" src="${iconArrowUp}"></span>`
  559. return {
  560. shortStr:`<div class="shortBox clearfix">${shortStr}</div>`,
  561. longStr:`<div class="longBox clearfix">${longStr}</div>`
  562. }
  563. }
  564. }
  565. function renderPushItem(item,type){
  566. str= `<span class="pushItemBox" data-name="${item.name}" data-type="${type}"><span class="pushItemName">${type==8?('【'+item.name+'】'):item.name}</span>${item.hasInfo=="1"?`<img class="infoImg" src="${infoImg}">`:""}</span>`
  567. return str
  568. }
  569. function bindOpenInfo(){
  570. $(".infoImg").on("mouseenter", function(){
  571. $(this).attr("src", infoImgOn)
  572. }).on("mouseleave", function(){
  573. $(this).attr("src", infoImg)
  574. })
  575. }
  576. function bindSlide(){
  577. $(".showMore").on("click", function(){
  578. $(this).parent().parent().find(".longBox").css("display","block")
  579. $(this).parent().parent().find(".shortBox").css("display","none")
  580. })
  581. $(".showLess").on("click", function(){
  582. $(this).parent().parent().find(".longBox").css("display","none")
  583. $(this).parent().parent().find(".shortBox").css("display","block")
  584. })
  585. }
  586. function renderModuleWrapper(moduleList){
  587. if(!moduleList){
  588. return
  589. }
  590. let moduleStr = ''
  591. for(let i = 0; i < moduleList.length; i++){
  592. if(moduleList[i].status !='0'){
  593. if(moduleList[i].code == 'critical'){
  594. moduleStr += `<div class="moduleItem warning" data-num="${moduleList[i].number}" style="display:none"></div>`
  595. // moduleStr += `<div class="moduleItem tips" data-num="${moduleList[i].number}" style="display:none"></div>`
  596. }else{
  597. moduleStr += `<div class="moduleItem ${moduleList[i].code }" data-num="${moduleList[i].number}" style="display:none"></div>`
  598. }
  599. }
  600. }
  601. // console.log(moduleList,moduleStr)
  602. $(".recommendWrap").append(moduleStr)
  603. }
  604. function hasTab(tabName,tabList){
  605. if(!tabList){
  606. return
  607. }
  608. for(let i = 0; i < tabList.length; i++){
  609. if(tabList[i].name == tabName){
  610. return tabList[i]
  611. }
  612. }
  613. return false
  614. }
  615. function renderTab(tabList){
  616. let tabStr = ''
  617. for(let i = 0; i < tabList.length; i++){
  618. if(tabList[i].status == '1'){
  619. tabStr += `<span class="tab" data-name="${tabList[i].code}" >${tabList[i].name}<span class="activeLine"></span></span>`
  620. }
  621. }
  622. $(".tabList").append(tabStr)
  623. let tabNum = 0;
  624. if(isTcm=='true'){
  625. tabNum = $(".tabList .tab").length-1;
  626. }
  627. $(".tabList .tab").eq(tabNum).addClass("activeTab")
  628. let showModuleName = $(".tabList .tab").eq(tabNum).attr("data-name")
  629. getModuleShow(moduleConfig[showModuleName])
  630. bindTabClick()
  631. }
  632. function titleStr(type){
  633. let titleStr = ''
  634. titleStr += `<h4 class="moduleTitle" style="background:${titleConfig[type].background}"><img class="titleIcon" src=${titleConfig[type].icon}>${titleConfig[type].name}</h4>`
  635. return titleStr
  636. }
  637. function titleStr2(name){
  638. let titleStr = ''
  639. titleStr += `<p class="moduleBoxTitle">${name}:</p>`
  640. return titleStr
  641. }
  642. function bindTabClick(){
  643. $(".tabList .tab").on("click", function(){
  644. $(".activeTab").removeClass("activeTab")
  645. $(this).addClass("activeTab")
  646. const moduleName = $(this).attr("data-name")
  647. getModuleShow(moduleConfig[moduleName])
  648. if(moduleName == "medical"){
  649. $(".staticSearchT .ipt").find("input").focus()
  650. $(".contentWrapper").css("overflowY","hidden")
  651. }else if(moduleName == 'followup'){
  652. // $(".contentWrapper").css("overflowY","auto")
  653. }
  654. })
  655. }
  656. function getModuleShow(moduleClassName){
  657. if( $(`.${moduleClassName}`).css("display") =="none"){
  658. $(".moduleWrapper").css("display","none")
  659. $(`.${moduleClassName}`).css("display","block")
  660. }
  661. }
  662. function bindGeneralSlide(){
  663. $(".showMoreGeneralTreat").on("click",function(){
  664. $(".generalTreatInfo").toggleClass("isOverFlow")
  665. $(".showMoreGeneralTreat").toggle()
  666. })
  667. $(".showLessGeneralTreat").on("click",function(){
  668. $(".generalTreatInfo").toggleClass("isOverFlow")
  669. $(".showMoreGeneralTreat").toggle()
  670. })
  671. }
  672. function bindSlideCaseWriting(){
  673. $(".showMoreCaseWriting").on("click",function(){
  674. $(this).parents(".casewritingWrapper ").find(".shortStrBox").css("display","none")
  675. $(this).parents(".casewritingWrapper ").find(".longStrBox").css("display","block")
  676. })
  677. $(".showLessCaseWriting").on("click",function(){
  678. $(this).parents(".casewritingWrapper ").find(".shortStrBox").css("display","block")
  679. $(this).parents(".casewritingWrapper ").find(".longStrBox").css("display","none")
  680. })
  681. }
  682. function empty(){
  683. // $(".responsibility").css("display","none")
  684. $('.recommendWrap .empty').css("display","block")
  685. }
  686. $(function(){
  687. getDisclaimer(); //获取免责声明
  688. getVersion(); //获取版本信息
  689. $(".disclaimerInfo").on("click", function(){
  690. openNewWin("disclaimer.html")
  691. });
  692. $(".version-tip").on("click", function(){
  693. const ver = localStorage.getItem('versionTime');
  694. $(".version-tip").removeClass('new-icon');
  695. localStorage.setItem('versionTime',ver.replace("=new",""));
  696. openNewWin("version.html");
  697. });
  698. $.fn.extend({
  699. "preventScroll":function(){
  700. $(this).each(function(){
  701. var _this = this;
  702. if(navigator.userAgent.indexOf('Firefox') >= 0){ //firefox
  703. _this.addEventListener('DOMMouseScroll',function(e){
  704. _this.scrollTop += e.detail > 0 ? 60 : -60;
  705. e.preventDefault();
  706. },false);
  707. }else{
  708. _this.onmousewheel = function(e){
  709. e = e || window.event;
  710. _this.scrollTop += e.wheelDelta > 0 ? -60 : 60;
  711. return false;
  712. };
  713. }
  714. })
  715. }
  716. });
  717. // $(".iframeWrap").preventScroll();
  718. $(".iframeWrap").preventScroll();
  719. $(".recommendWrap").preventScroll();
  720. $(".tcmWarp").preventScroll();
  721. $(".infoWrap").preventScroll();
  722. $(".medicalKonwledgeWrap .staticSearchB ul").preventScroll();
  723. $(window).on("resize", function(){
  724. $(".iframeWrap").preventScroll();
  725. $(".recommendWrap").preventScroll();
  726. $(".tcmWarp").preventScroll();
  727. $(".medicalKonwledgeWrap .staticSearchB ul").preventScroll();
  728. adjustHei()
  729. })
  730. });