cdss.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811
  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)}&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. 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. // $('.moduleItem.evaluation').children(".longBox").children(".pushItemBox").children(".pushItemName").addClass("evaluationtitle")
  471. }
  472. }
  473. function renderNurse(list, showNum, type, hasInfo) {
  474. if (list.length > 0 && $(".moduleItem.nurse").length > 0) {
  475. moduleNum++
  476. $('.moduleItem.nurse').append(titleStr("nursePush"))
  477. let { shortStr, longStr } = renderItemWrapper(list, showNum, type, hasInfo)
  478. $('.moduleItem.nurse').append(shortStr).append(longStr);
  479. $('.moduleItem.nurse').css("display", "block")
  480. }
  481. }
  482. function renderPacs(list, showNum, type, hasInfo) {
  483. if (list.length > 0 && $(".moduleItem.pacs").length > 0) {
  484. moduleNum++
  485. $(".moduleItem.pacs").append(titleStr("pacsPush"))
  486. let { shortStr, longStr } = renderItemWrapper(list, showNum, type, hasInfo)
  487. $(".moduleItem.pacs").append(shortStr).append(longStr)
  488. $('.moduleItem.pacs').css("display", "block")
  489. }
  490. }
  491. function renderCheckup(list, showNum, type, hasInfo) {
  492. if (list.length > 0 && $(".moduleItem.vital").length > 0) {
  493. moduleNum++
  494. $(".moduleItem.vital").append(titleStr("checkupPush"))
  495. let { shortStr, longStr } = renderItemWrapper(list, showNum, type, hasInfo)
  496. $(".moduleItem.vital").append(shortStr).append(longStr)
  497. $('.moduleItem.vital').css("display", "block")
  498. }
  499. }
  500. function renderSymptomPush(list, showNum, type, hasInfo) {
  501. $(".moduleItem.symptom").append(titleStr('symptomPush'))
  502. if (list.length > 0 && $(".moduleItem.symptom").length > 0) {
  503. moduleNum++
  504. let { shortStr, longStr } = renderItemWrapper(list, showNum, type, hasInfo)
  505. $(".moduleItem.symptom").append(shortStr).append(longStr)
  506. $(".moduleItem.symptom").css("display", "block")
  507. }
  508. }
  509. function rendergeneraTreatPush(list) {
  510. if (list && $(".moduleItem.general").length > 0) {
  511. $(".moduleItem.general").append(titleStr('generaTreatPush'))
  512. moduleNum++
  513. let str = `<div class="generalTreatInfo clearfix isOverFlow">${list}</div>`
  514. $(".moduleItem.general").append(str)
  515. $(".moduleItem.general").css("display", "block")
  516. let generaTreatHei = $(".moduleItem .generalTreatInfo")[0].scrollHeight
  517. if (generaTreatHei > 50) {
  518. $(".moduleItem .generalTreatInfo").append(`<span class="showMoreGeneralTreat">更多<img class="iconArrowImg more" src="${iconArrowDown}"></span>`)
  519. $(".moduleItem .generalTreatInfo").append(`<span class="showLessGeneralTreat">收起<img class="iconArrowImg" src="${iconArrowUp}"></span>`)
  520. bindGeneralSlide()
  521. }
  522. }
  523. }
  524. function renderMedicinesPush(list, showNum, type, hasInfo) {
  525. $(".moduleItem.medicine").append(titleStr('drugPush'))
  526. if (list.length > 0 && $(".moduleItem.medicine").length > 0) {
  527. moduleNum++
  528. let { shortStr, longStr } = renderItemWrapper(list, showNum, type, hasInfo)
  529. $(".moduleItem.medicine").append(shortStr).append(longStr)
  530. $(".moduleItem.medicine").css("display", "block")
  531. }
  532. }
  533. function renderOperationPush(list, showNum, type, hasInfo) {
  534. $(".moduleItem.operation").append(titleStr('operationPush'))
  535. if (list.length > 0 && $(".moduleItem.operation").length > 0) {
  536. moduleNum++
  537. let { shortStr, longStr } = renderItemWrapper(list, showNum, type, hasInfo)
  538. $(".moduleItem.operation").append(shortStr).append(longStr)
  539. $(".moduleItem.operation").css("display", "block")
  540. }
  541. }
  542. function renderItemWrapper(list, showNum, type, hasInfo) {
  543. //console.log(33, type)
  544. let showNum1 = showNum || 5
  545. let shortStr = '', longStr = ''
  546. for (let i = 0; i < list.length; i++) {
  547. if (i <= showNum1 - 1) {
  548. shortStr += renderPushItem(list[i], type)
  549. }
  550. longStr += renderPushItem(list[i], type)
  551. }
  552. if (showNum1 >= list.length) {
  553. return {
  554. shortStr: `<div class="shortBox">${shortStr}</div>`,
  555. longStr: ''
  556. }
  557. } else {
  558. shortStr += `<span class="showMore">更多 <img class="iconArrowImg" src="${iconArrowDown}"></span>`
  559. longStr += `<span class="showLess">收起 <img class="iconArrowImg" src="${iconArrowUp}"></span>`
  560. return {
  561. shortStr: `<div class="shortBox clearfix">${shortStr}</div>`,
  562. longStr: `<div class="longBox clearfix">${longStr}</div>`
  563. }
  564. }
  565. }
  566. function renderPushItem(item, type) {
  567. str = `<span class="pushItemBox" data-name="${item.name}" data-type="${type}">`
  568. 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>`}`
  569. str += `${ item.hasInfo == "1" ? `<img class="infoImg" src="${infoImg}">` : "" }`
  570. str += '</span >'
  571. return str
  572. }
  573. function bindOpenInfo() {
  574. $(".infoImg").on("mouseenter", function () {
  575. $(this).attr("src", infoImgOn)
  576. }).on("mouseleave", function () {
  577. $(this).attr("src", infoImg)
  578. })
  579. }
  580. function bindSlide() {
  581. $(".showMore").on("click", function () {
  582. $(this).parent().parent().find(".longBox").css("display", "block")
  583. $(this).parent().parent().find(".shortBox").css("display", "none")
  584. })
  585. $(".showLess").on("click", function () {
  586. $(this).parent().parent().find(".longBox").css("display", "none")
  587. $(this).parent().parent().find(".shortBox").css("display", "block")
  588. })
  589. }
  590. function renderModuleWrapper(moduleList) {
  591. if (!moduleList) {
  592. return
  593. }
  594. let moduleStr = ''
  595. for (let i = 0; i < moduleList.length; i++) {
  596. if (moduleList[i].status != '0') {
  597. if (moduleList[i].code == 'critical') {
  598. moduleStr += `<div class="moduleItem warning" data-num="${moduleList[i].number}" style="display:none"></div>`
  599. // moduleStr += `<div class="moduleItem tips" data-num="${moduleList[i].number}" style="display:none"></div>`
  600. } else {
  601. moduleStr += `<div class="moduleItem ${moduleList[i].code}" data-num="${moduleList[i].number}" style="display:none"></div>`
  602. }
  603. }
  604. }
  605. // console.log(moduleList,moduleStr)
  606. $(".recommendWrap").append(moduleStr)
  607. }
  608. function hasTab(tabName, tabList) {
  609. if (!tabList) {
  610. return
  611. }
  612. for (let i = 0; i < tabList.length; i++) {
  613. if (tabList[i].name == tabName) {
  614. return tabList[i]
  615. }
  616. }
  617. return false
  618. }
  619. function renderTab(tabList) {
  620. let tabStr = ''
  621. for (let i = 0; i < tabList.length; i++) {
  622. if (tabList[i].status == '1') {
  623. tabStr += `<span class="tab" data-name="${tabList[i].code}" >${tabList[i].name}<span class="activeLine"></span></span>`
  624. }
  625. }
  626. $(".tabList").append(tabStr)
  627. let tabNum = 0;
  628. if (isTcm == 'true') {
  629. tabNum = $(".tabList .tab").length - 1;
  630. }
  631. $(".tabList .tab").eq(tabNum).addClass("activeTab")
  632. let showModuleName = $(".tabList .tab").eq(tabNum).attr("data-name")
  633. getModuleShow(moduleConfig[showModuleName])
  634. bindTabClick()
  635. }
  636. function titleStr(type) {
  637. let titleStr = ''
  638. titleStr += `<h4 class="moduleTitle" style="background:${titleConfig[type].background}"><img class="titleIcon" src=${titleConfig[type].icon}>${titleConfig[type].name}</h4>`
  639. return titleStr
  640. }
  641. function titleStr2(name) {
  642. let titleStr = ''
  643. titleStr += `<p class="moduleBoxTitle">${name}:</p>`
  644. return titleStr
  645. }
  646. function bindTabClick() {
  647. $(".tabList .tab").on("click", function () {
  648. $(".activeTab").removeClass("activeTab")
  649. $(this).addClass("activeTab")
  650. const moduleName = $(this).attr("data-name")
  651. getModuleShow(moduleConfig[moduleName])
  652. if (moduleName == "medical") {
  653. $(".staticSearchT .ipt").find("input").focus()
  654. $(".contentWrapper").css("overflowY", "hidden")
  655. } else if (moduleName == 'followup') {
  656. // $(".contentWrapper").css("overflowY","auto")
  657. }
  658. })
  659. }
  660. function getModuleShow(moduleClassName) {
  661. if ($(`.${moduleClassName}`).css("display") == "none") {
  662. $(".moduleWrapper").css("display", "none")
  663. $(`.${moduleClassName}`).css("display", "block")
  664. }
  665. }
  666. function bindGeneralSlide() {
  667. $(".showMoreGeneralTreat").on("click", function () {
  668. $(".generalTreatInfo").toggleClass("isOverFlow")
  669. $(".showMoreGeneralTreat").toggle()
  670. })
  671. $(".showLessGeneralTreat").on("click", function () {
  672. $(".generalTreatInfo").toggleClass("isOverFlow")
  673. $(".showMoreGeneralTreat").toggle()
  674. })
  675. }
  676. function bindSlideCaseWriting() {
  677. $(".showMoreCaseWriting").on("click", function () {
  678. $(this).parents(".casewritingWrapper ").find(".shortStrBox").css("display", "none")
  679. $(this).parents(".casewritingWrapper ").find(".longStrBox").css("display", "block")
  680. })
  681. $(".showLessCaseWriting").on("click", function () {
  682. $(this).parents(".casewritingWrapper ").find(".shortStrBox").css("display", "block")
  683. $(this).parents(".casewritingWrapper ").find(".longStrBox").css("display", "none")
  684. })
  685. }
  686. function empty() {
  687. // $(".responsibility").css("display","none")
  688. $('.recommendWrap .empty').css("display", "block")
  689. }
  690. $(function () {
  691. getDisclaimer(); //获取免责声明
  692. getVersion(); //获取版本信息
  693. $(".disclaimerInfo").on("click", function () {
  694. openNewWin("disclaimer.html")
  695. });
  696. $(".version-tip").on("click", function () {
  697. const ver = localStorage.getItem('versionTime');
  698. $(".version-tip").removeClass('new-icon');
  699. localStorage.setItem('versionTime', ver.replace("=new", ""));
  700. openNewWin("version.html");
  701. });
  702. $.fn.extend({
  703. "preventScroll": function () {
  704. $(this).each(function () {
  705. var _this = this;
  706. if (navigator.userAgent.indexOf('Firefox') >= 0) { //firefox
  707. _this.addEventListener('DOMMouseScroll', function (e) {
  708. _this.scrollTop += e.detail > 0 ? 60 : -60;
  709. e.preventDefault();
  710. }, false);
  711. } else {
  712. _this.onmousewheel = function (e) {
  713. e = e || window.event;
  714. _this.scrollTop += e.wheelDelta > 0 ? -60 : 60;
  715. return false;
  716. };
  717. }
  718. })
  719. }
  720. });
  721. // $(".iframeWrap").preventScroll();
  722. $(".iframeWrap").preventScroll();
  723. $(".recommendWrap").preventScroll();
  724. $(".tcmWarp").preventScroll();
  725. $(".infoWrap").preventScroll();
  726. $(".medicalKonwledgeWrap .staticSearchB ul").preventScroll();
  727. $(window).on("resize", function () {
  728. $(".iframeWrap").preventScroll();
  729. $(".recommendWrap").preventScroll();
  730. $(".tcmWarp").preventScroll();
  731. $(".medicalKonwledgeWrap .staticSearchB ul").preventScroll();
  732. adjustHei()
  733. })
  734. });