cdss.js 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454
  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/icon_admin.png').replace(/^undefined/g, '')
  17. require('./../images/empty2.png').replace(/^undefined/g, '')
  18. require('./../images/empty3.png').replace(/^undefined/g, '')
  19. require('./../images/icon_no.png').replace(/^undefined/g, '')
  20. require('./../images/loading.gif').replace(/^undefined/g, '')
  21. require('./../images/right.png').replace(/^undefined/g, '')
  22. require('./../images/new.png').replace(/^undefined/g, '')
  23. require('./../images/t1.png').replace(/^undefined/g, '')
  24. require('./../images/t2.png').replace(/^undefined/g, '')
  25. require('./../images/t3.png').replace(/^undefined/g, '')
  26. require('./../images/go.png').replace(/^undefined/g, '')
  27. require('./../images/g1.png').replace(/^undefined/g, '')
  28. // require('./popupEdit.js');
  29. let infoImg = require('./../images/icon_info.png').replace(/^undefined/g, '')
  30. let infoImgOn = require('./../images/icon_info_on.png').replace(/^undefined/g, '')
  31. let iconArrowUp = require('./../images/icon_arrow_up.png').replace(/^undefined/g, '')
  32. let iconArrowDown = require('./../images/icon_arrow_down.png').replace(/^undefined/g, '')
  33. let iconMark = require('./../images/icon_mark.png').replace(/^undefined/g, '')
  34. let warnImg = require('./../images/icon_warning.png').replace(/^undefined/g, '')
  35. let warnImgWhite = require('./../images/icon_waring_white.png').replace(/^undefined/g, '')
  36. let down = require('./../images/d1.png').replace(/^undefined/g, '')
  37. let more = require('./../images/more.png').replace(/^undefined/g, '')
  38. let up = require('./../images/icon-up.png').replace(/^undefined/g, '')
  39. let maydiagnoseList = [], hasdiagnoseList = [];
  40. let maydiagnoseType = false, hasdiagnoseType = false;
  41. const $ = require("jquery");
  42. const { post, config, getUrlArgObject, openNewWin, titleConfig } = require('./promise.js');
  43. const { renderFollowUp, followEmpty } = require('./followUp.js');
  44. const { getTcmMr } = require('./tcmiss.js');
  45. const { transConf } = require('./util.js');
  46. //静态知识类型: 1:诊断 2.药品 3.化验套餐 4.化验明细 5.辅检 6.手术和操作
  47. let moduleConfig = {
  48. auxiliary: "recommendWrap",
  49. qc: "qcWrap",
  50. medical: "medicalKonwledgeWrap",
  51. followup: "followUpWrap",
  52. tcmiss: 'tcmWarp',
  53. }
  54. let allInterface = 0; //需要调用的推送接口的个数
  55. let hasCompleteTnterface = 0; //已返回的推送接口的个数
  56. let moduleNum = 0
  57. let indexNow
  58. let mrId = getUrlArgObject('mrId')
  59. let isTcm = getUrlArgObject('isTcm')
  60. let pushMrId = getUrlArgObject('pushMrId')
  61. const tipsMode = getUrlArgObject('tipsMode') || 1
  62. let planCode = getUrlArgObject('planCode') || 'all'
  63. let hospitalIdUrl = getUrlArgObject('hospitalId') || ''
  64. let msg;
  65. let treatDisName;
  66. function getMRInfo() {
  67. return post(config.getMr2, { mrId: mrId })
  68. }
  69. let ifInputParam; //是否有入参,显示输入空状态用
  70. if (mrId) {
  71. Promise.all([getConf(), getMRInfo()]).then(([res1, res2]) => {
  72. const data = res1.data.data && res1.data.data[0]
  73. msg = res2.data.data || {}
  74. if (!(msg && msg.diseaseName && msg.diseaseName.name)) {
  75. msg.diseaseName = null
  76. }
  77. window.msg = msg;
  78. renderPage(data)
  79. })
  80. } else {
  81. getConf().then(res => {
  82. if (res.data.code == '0') {
  83. // const configArr = res.data.data.pushSetList || []
  84. // getPageInfo(configArr)
  85. const data = res.data.data && res.data.data[0]
  86. renderPage(data)
  87. }
  88. })
  89. followEmpty()
  90. }
  91. function hasInputParam() {
  92. const checkKeys = ["chief", "diag", "diseaseName", "drug", "drugOrder", "lis", "lisOrder", 'marital', 'menstrual', "operation", "operationOrder", "otherIndex", "otherOrder", "pacs", "pacsOrder", "pasts", "personal", "symptom", "transfusion", "transfusionOrder", "vital"];
  93. let res = false;
  94. let val;
  95. checkKeys.map((it) => {
  96. val = msg[it];
  97. if (typeof val === 'string') {
  98. if (val !== '') {
  99. res = true;
  100. }
  101. } else {
  102. const str = JSON.stringify(val);
  103. if (!(str === '{}' || str === '[]')) {
  104. res = true;
  105. }
  106. }
  107. });
  108. return res;
  109. }
  110. function getConf() {
  111. var msg = window.msg
  112. return post(config.getPushSet, { hospitalId: hospitalIdUrl || msg.hospitalId || 1, planCode: planCode })
  113. }
  114. function getPushInfo() {
  115. return post(config.pushInner, Object.assign({}, msg, {
  116. featureType: '1,4,5,6,7,8,9,10,12,13',
  117. hospitalId: hospitalIdUrl || msg.hospitalId,
  118. ruleType: config.ruleTypeMap['22'],
  119. }))
  120. }
  121. function pushByDisease(name, i) {
  122. return post(config.pushInner, Object.assign({}, msg, {
  123. featureType: '1,4,5,6,7,8,9,10,12,13',
  124. hospitalId: hospitalIdUrl || msg.hospitalId,
  125. ruleType: config.ruleTypeMap['22'],
  126. diseaseName: {
  127. name: name,
  128. uniqueName: name
  129. }
  130. }))
  131. }
  132. function getPusgWarning() {
  133. const indPush = pushMrId ? config.indicationPushCache : config.indicationPush;
  134. return post(indPush, Object.assign({}, msg, { ruleType: '1,2,3,4', mrId: pushMrId || mrId }))
  135. }
  136. function getWriteStandardPush() {
  137. return post(config.caseWritingPrompt, Object.assign({}, msg, { hospitalId: 2 || msg.hospitalId }))
  138. }
  139. function getHosptDeptUsal() {
  140. var msg = window.msg
  141. const param = {
  142. age: msg.age,
  143. deptName: msg.deptName,
  144. hospitalCode: msg.hosCode,
  145. sexType: msg.sex,
  146. type: 1,
  147. }
  148. return post(config.getHosptDeptUsal, param)
  149. }
  150. function getPushData(res) {
  151. if (res && res.data && res.data.data && res.data.data.dis && res.data.data.dis) {
  152. let dis = res.data.data.dis;
  153. //急诊显示规则,主诊断有急诊优先显示,没有则显示推送的,推送也没有就不显示
  154. if (dis && dis['页面急诊'] && (dis['页面急诊'].length > 0)) {
  155. let name = dis['页面急诊'][0].name || ''
  156. $(".allDis .disName").html(name)
  157. disName = name
  158. if (name) {
  159. $(".singleDis").css("display", "block")
  160. }
  161. } else if (dis && dis['急诊'] && dis['急诊'].length > 0) {
  162. let name = dis['急诊'][0].name || ''
  163. $(".allDis .disName").html(name)
  164. disName = name
  165. if (name) {
  166. $(".singleDis").css("display", "block")
  167. }
  168. }
  169. }
  170. }
  171. let disName = ""
  172. function handleShow() {
  173. const newinConf = {
  174. width: '600', //窗口的文档显示区的宽度。以像素计。
  175. height: '826', //窗口文档显示区的高度。以像素计。
  176. left: '0', //窗口的 x 坐标。以像素计。
  177. top: '0', //窗口的 y 坐标。以像素计。
  178. openMode: "_blank" //每次都是新窗口打开为_blank,打开同一窗口填写任意字符串
  179. }
  180. const newWindowLocation = `width=${newinConf.width}, height=${newinConf.height}, left=${newinConf.left}, top=${newinConf.top} scrollbars=yes`
  181. window.open('./emergency.html?disName=' + disName, newinConf.openMode, newWindowLocation)
  182. }
  183. $(document).on('click', ".allDis .allName", function () {
  184. handleShow()
  185. })
  186. $(document).on('click', ".singleDis", function () {
  187. $(this).next().css("display", "block")
  188. $(this).css("display", "none")
  189. })
  190. $(document).on('click', ".allDis .right,.allDis .secDis", function () {
  191. $(".allDis").css("display", "none")
  192. $(".singleDis").css("display", "block")
  193. })
  194. function moreInfo() {
  195. $('.infoImg').off("click").click(function () {
  196. const name = $(this).parents(".pushItemBox").attr('data-name')
  197. const type = $(this).parents(".pushItemBox").attr('data-type')
  198. openNewWin(`staticInfo.html?type=${encodeURIComponent(type)}&position=0&name=${encodeURIComponent(name)}&mrId=${encodeURIComponent(mrId)}`)
  199. })
  200. $('.evaluationtitle').off("click").click(function () {
  201. const name = $(this).parents(".pushItemBox").attr('data-name')
  202. const type = $(this).parents(".pushItemBox").attr('data-type')
  203. openNewWin(`staticInfo.html?type=${encodeURIComponent(type)}&position=0&name=${encodeURIComponent(name)}&page=1&mrId=${encodeURIComponent(mrId)}&gauge=gauge`)
  204. })
  205. }
  206. function getVersion() {
  207. return post(config.getVersion, 'confArr').then((res) => {
  208. const data = res.data.data;
  209. const ver = localStorage.getItem('versionTime');
  210. const time = data.refreshTime;
  211. if (!ver || ver === time + "=new" || time !== ver.replace("=new", "")) { //判断版本是否更新
  212. $(".version-tip").addClass('new-icon');
  213. localStorage.setItem('versionTime', time + "=new"); //保存版本更新时间
  214. } else {
  215. $(".version-tip").removeClass("new-icon");
  216. }
  217. })
  218. }
  219. function getDisclaimer() {
  220. return post(config.disclaimer, {}).then((res) => {
  221. const data = res.data.data.filter(item => item.disclaimerCode == "2");
  222. $(".responsibility").html((data[0] || {}).description);
  223. // $(".iframeWrap").css({height: $(window).height()-115-$(".responsibility").height()+"px"})
  224. })
  225. }
  226. function renderPage(pageSet) {
  227. const setInfo = pageSet.sysSetInfo;
  228. if (!pageSet || !setInfo) {
  229. return
  230. }
  231. renderTab(setInfo)
  232. adjustHei()
  233. const hasAuxiliary = hasTab("辅助信息", setInfo);
  234. const hasMedical = hasTab("医学知识", setInfo)
  235. const hasFollowUp = hasTab("随访计划", setInfo)
  236. const hasTcm = hasTab("中医辅助", setInfo);
  237. //所有模块都未开启配置,显示功能未开启(无tab)
  238. if (hasAuxiliary.status === 0 && hasMedical.status === 0 && hasFollowUp.status === 0 && hasTcm.status === 0) {
  239. const nullTxt = `<div class="empty-box" style="left: -20px;display: block;">
  240. <img class="emptyImg" src="../images/icon_admin.png" alt="空">
  241. <p class="emptyTxt">功能未开启</p>
  242. </div>`
  243. $(".contentWrapper").html(nullTxt);
  244. return;
  245. }
  246. if (hasTcm) {
  247. getTcmMr(mrId, hasTcm);
  248. }
  249. if (!mrId) {
  250. return
  251. }
  252. if (hasFollowUp) {
  253. renderFollowUp(msg)
  254. }
  255. const planDetail = hasAuxiliary.planDetails;
  256. const configs = planDetail.filter((it) => it.status !== 0) || [];
  257. if (!configs[0]) { //没有开启辅助信息各项配置
  258. $('.empty-box').hide();
  259. $('.recommendBox .empty-right').show();
  260. return;
  261. }
  262. if (hasAuxiliary) {
  263. $('.empty-box').hide();
  264. $(".loading").show();
  265. renderModuleWrapper(planDetail)
  266. let needPush = isNeedPush(planDetail)
  267. let needPushWarning = isNeedPushWarning(planDetail)
  268. let needWriteStandardPush = isNeedwriteStandardPush(planDetail);
  269. if (needPush) {
  270. renderPushData()
  271. allInterface++
  272. }
  273. if (needPushWarning) {
  274. renderPushWarning()
  275. allInterface++
  276. }
  277. if (needWriteStandardPush) {
  278. renderWriteStandard()
  279. allInterface++
  280. }
  281. }
  282. }
  283. function renderPushData() {
  284. return getPushInfo().then(res => {
  285. $(".loading").hide();
  286. hasCompleteTnterface++
  287. if (res.data.code == "0") {
  288. const result = res.data.data
  289. let diagList = result.clickPosDis || [] //可能诊断
  290. let AffList = result.clickAffDis || [] //已诊断疾病
  291. let diagPush = result.dis || {}
  292. let lisPush = result.lis || []
  293. let scalePush = result.scale || []
  294. let pacsPush = result.pacs || []
  295. let symptomPush = result.symptom || []
  296. let checkupPush = result.vital || []
  297. let medicinesPush = result.medicines || []
  298. let operationsPush = result.operations || []
  299. let treatPush = result.treat && result.treat[0] || {}
  300. let nursePush = result.nurse || []
  301. treatDisName = treatPush && treatPush["name"]
  302. let generaTreatPush = treatPush && treatPush["generaTreat"]
  303. let lisNum = $(".moduleItem.lis").attr("data-num") || 5
  304. let scaleNum = $(".moduleItem.evaluation").attr("data-num") || 5
  305. let pacsNum = $(".moduleItem.pacs").attr("data-num") || 5
  306. let checkupNum = $(".moduleItem.vital").attr("data-num") || 5
  307. let symptomNum = $(".moduleItem.symptom").attr("data-num") || 5
  308. let medicinesNum = $(".moduleItem.medicine").attr("data-num") || 5
  309. let operationsNum = $(".moduleItem.operation").attr("data-num") || 5
  310. let nurseNum = $(".moduleItem.nurse").attr("data-num") || 5
  311. renderLis(lisPush, lisNum)
  312. renderScale(scalePush, scaleNum)
  313. renderPacs(pacsPush, pacsNum)
  314. renderCheckup(checkupPush, checkupNum)
  315. renderSymptomPush(symptomPush, symptomNum)
  316. renderDiag(diagPush)
  317. renderMedicinesPush(medicinesPush, medicinesNum)
  318. renderOperationPush(operationsPush, operationsNum)
  319. rendergeneraTreatPush(generaTreatPush)
  320. renderNurse(nursePush, nurseNum)
  321. renderDiagList(diagList)
  322. renderAffListList(AffList)
  323. bindOpenInfo()
  324. moreInfo()
  325. bindSlide();
  326. }
  327. empty(); //判断是否显示空状态
  328. })
  329. }
  330. function renderpushByMayDisease(name, i) {
  331. return pushByDisease(name, i).then(res => {
  332. $(".loading").hide();
  333. hasCompleteTnterface++
  334. if (res.data.code == "0") {
  335. const result = res.data.data
  336. let symptomPush = result.symptom || []
  337. let vitalPush = result.vital || []
  338. let lisPush = result.lis || []
  339. let pacsPush = result.pacs || []
  340. let scalePush = result.scale || []
  341. let disPush = result.dis['大数据推送诊断'] || []
  342. let treatPush = result.treat || []
  343. let medicinesPush = result.medicines || []
  344. let operationsPush = result.operations || []
  345. let nursePush = result.nurse || []
  346. console.log(maydiagnoseType);
  347. if (symptomPush.length == 0 && vitalPush.length == 0 && lisPush.length == 0 && pacsPush.length == 0 && scalePush.length == 0 && disPush.length == 0 && treatPush.length == 0 && medicinesPush.length == 0 && operationsPush.length == 0 && nursePush.length == 0) {
  348. $.toast('toast1', '', 3000,'.maydiagnose',i);
  349. } else if(maydiagnoseType){
  350. $.toast('toast2', '', 3000,'.maydiagnose',i);
  351. }else{
  352. renderMaySymptomPush(symptomPush)
  353. renderMayVitalPush(vitalPush)
  354. renderMayLisPush(lisPush)
  355. renderMayPacsPush(pacsPush)
  356. renderMayScalePush(scalePush)
  357. renderMayDisPush(disPush)
  358. renderMayPush(treatPush, medicinesPush, operationsPush, nursePush)
  359. bindOpenInfo()
  360. moreInfo()
  361. bindSlide();
  362. }
  363. // renderMaySymptomPush(symptomPush)
  364. // renderMayVitalPush(vitalPush)
  365. // renderMayLisPush(lisPush)
  366. // renderMayPacsPush(pacsPush)
  367. // renderMayScalePush(scalePush)
  368. // renderMayDisPush(disPush)
  369. // renderMayPush(treatPush, medicinesPush, operationsPush, nursePush)
  370. // bindOpenInfo()
  371. // moreInfo()
  372. // bindSlide();
  373. }
  374. })
  375. }
  376. function renderpushByHasDisease(name, i) {
  377. return pushByDisease(name, i).then(res => {
  378. $(".loading").hide();
  379. hasCompleteTnterface++
  380. if (res.data.code == "0") {
  381. const result = res.data.data
  382. let symptomPush = result.symptom || []
  383. let vitalPush = result.vital || []
  384. let lisPush = result.lis || []
  385. let pacsPush = result.pacs || []
  386. let scalePush = result.scale || []
  387. let disPush = result.dis['鉴别诊断'] || {}
  388. let treatPush = result.treat || {}
  389. let medicinesPush = result.medicines || {}
  390. let operationsPush = result.operations || {}
  391. let nursePush = result.nurse || {}
  392. console.log(hasdiagnoseType);
  393. if (symptomPush.length == 0 && vitalPush.length == 0 && lisPush.length == 0 && pacsPush.length == 0 && scalePush.length == 0 && disPush.length == 0 && treatPush.length == 0 && medicinesPush.length == 0 && operationsPush.length == 0 && nursePush.length == 0) {
  394. $.toast('toast1', '', 3000,'.hasdiagnose',i);
  395. } else if(hasdiagnoseType){
  396. $.toast('toast2', '', 3000,'.hasdiagnose',i);
  397. }else {
  398. renderHasSymptomPush(symptomPush)
  399. renderHasVitalPush(vitalPush)
  400. renderHasLisPush(lisPush)
  401. renderHasPacsPush(pacsPush)
  402. renderHasScalePush(scalePush)
  403. renderHasDisPush(disPush)
  404. renderHasPush(treatPush, medicinesPush, operationsPush, nursePush)
  405. bindOpenInfo()
  406. moreInfo()
  407. bindSlide();
  408. }
  409. }
  410. })
  411. }
  412. function adjustHei() {
  413. const iframeHei = $(".bodyWrap").height()
  414. $(".contentWrapper").css("height", iframeHei - 20 - 30 - 60 + 3 + 19 + 'px')
  415. $(".tabList").css("height", iframeHei + 'px')
  416. }
  417. function isNeedPush(list) {
  418. let pass = false;
  419. let pushCode = ['critical', "diag", "lis", "pacs", "symptom", "vital", "treat", "medicines", 'evaluation', 'general', 'medicine', 'operation', 'nurse']
  420. for (let i = 0; i < list.length; i++) {
  421. if (pushCode.indexOf(list[i].code) > -1) {
  422. if (list[i].status == "1") {
  423. pass = true
  424. }
  425. }
  426. }
  427. return pass;
  428. }
  429. function isNeedwriteStandardPush(list) {
  430. let pass = false;
  431. let pushCode = ["casewriting"]
  432. for (let i = 0; i < list.length; i++) {
  433. if (pushCode.indexOf(list[i].code) > -1) {
  434. if (list[i].status == "1") {
  435. pass = true
  436. }
  437. }
  438. }
  439. return pass
  440. }
  441. function isNeedPushWarning(list) {
  442. let pushCode = ["crivalue", "rationali", "highrisk", "otherremind"];
  443. let pass = false;
  444. for (let i = 0; i < list.length; i++) {
  445. if (pushCode.indexOf(list[i].code.trim()) > -1) {
  446. if (+list[i].status === 1) {
  447. pass = true
  448. }
  449. }
  450. }
  451. return pass
  452. }
  453. //let popNum = 0;//气泡显示数字
  454. function renderPushWarning() {
  455. return getPusgWarning().then(res => {
  456. $(".loading").hide();
  457. hasCompleteTnterface++
  458. if (res.data.code == '0') {
  459. const result = res.data.data;
  460. let billMsgList = result.billMsgList || [] //开单合理性提醒
  461. let highRiskList = result.highRiskList || [] //高危药品、手术
  462. let criticalValList = result.criticalValList || [] //危急值提醒
  463. let otherList = result.otherList || [] //其他提醒
  464. renderBillingPush(billMsgList, '开单合理性提醒', 'rationali')
  465. renderBillingPush(highRiskList, '高风险提示', 'highrisk')
  466. renderBillingPush(criticalValList, '危急值提醒', 'crivalue')
  467. //renderBillingPush(noteList,'检查内容注意事项')
  468. renderBillingPush(otherList, '其他提醒', 'otherremind')
  469. //moreInfo()
  470. $(".moduleItem.tips").wrapAll("<div class='tips-cont'></div>");
  471. updatePopNum();
  472. $(titleStr('warning')).insertBefore('.tips-cont .moduleItem:first-child')
  473. }
  474. empty();
  475. })
  476. }
  477. function renderWriteStandard() {
  478. return getWriteStandardPush().then(res => {
  479. $(".loading").hide();
  480. hasCompleteTnterface++
  481. if (res.data.code == '0') {
  482. const list = res.data.data || {}
  483. let casewritingNum = $(".moduleItem.casewriting").attr("data-num") || 5
  484. renderwriteStandardPage(list, casewritingNum)
  485. } else {
  486. empty();
  487. }
  488. })
  489. }
  490. function renderwriteStandardPage(list, casewritingNum) {
  491. let arr = Object.keys(list);
  492. if (arr.length > 0 && $(".moduleItem.casewriting").length > 0) {
  493. moduleNum++
  494. $(".moduleItem.casewriting").append(titleStr("casewritingPush"))
  495. let longStr = ``
  496. let shortStr = ``
  497. for (let i = 0; i < arr.length; i++) {
  498. if (i < casewritingNum) {
  499. shortStr += `<div class="billingPushItem"><img class="iconMark" src=${iconMark}>${arr[i]}</div>`
  500. }
  501. longStr += `<div class="billingPushItem"><img class="iconMark" src=${iconMark}>${arr[i]}</div>`
  502. }
  503. let shortStrBox = `<div class="shortStrBox">${shortStr}</div>`
  504. let longStrBox = `<div class="longStrBox">${longStr}</div>`
  505. let allStr = `<div class="casewritingWrapper"></div>`
  506. $(".moduleItem.casewriting").append(allStr)
  507. $(".casewritingWrapper").append(shortStrBox)
  508. if (arr.length > casewritingNum) {
  509. $(".shortStrBox .billingPushItem").eq($(".shortStrBox .billingPushItem").length - 1).append(`<span class="showMoreCaseWriting"><img class="iconArrowImg" src="${iconArrowDown}"></span>`)
  510. // $(".moduleItem .generalTreatInfo").append(`<span class="showLessGeneralTreat">收起<img class="iconArrowImg" src="${iconArrowUp}"></span>`)
  511. $(".casewritingWrapper").append(longStrBox)
  512. $(".longStrBox .billingPushItem").eq($(".longStrBox .billingPushItem").length - 1).append(`<span class="showLessCaseWriting"><img class="iconArrowImg" src="${iconArrowUp}"></span>`)
  513. }
  514. $('.moduleItem.casewriting').css("display", "block")
  515. updatePopNum();
  516. bindSlideCaseWriting()
  517. }
  518. empty();
  519. }
  520. function renderBillingPush(list, name, code) {
  521. if (list.length === 0) {
  522. return
  523. }
  524. moduleNum++
  525. let str = ``
  526. for (let i = 0; i < list.length; i++) {
  527. str += `<div class="billingPushItem"><img class="iconMark" src=${iconMark}>${list[i].msg}</div>`
  528. }
  529. let titleStr = titleStr2(name)
  530. let boxStr = `<div class="moduleBox">
  531. ${titleStr}
  532. ${str}
  533. </div>`
  534. $("." + code).append(boxStr)
  535. $('.moduleItem.' + code).addClass("tips").css("display", "block")
  536. //输血后血常规提醒,传参给his
  537. $(".otherremind .billingPushItem:contains('输血完成后,请及时复查血常规')").css("cursor", "pointer").click(() => {
  538. window.parent.postMessage({
  539. "mrn": msg.mrn, //病历号 getMr返回-技术服务返回
  540. "series": msg.series, //就诊次数
  541. "orders": [
  542. {
  543. "type": 1,
  544. "orders": [
  545. '输血(血小板)'
  546. ]
  547. }
  548. ]
  549. }, '*')
  550. })
  551. }
  552. //更新消息个数
  553. function updatePopNum() {
  554. const writeNum = $(".casewriting .longStrBox").length ? $(".casewriting .longStrBox .billingPushItem").length : $(".casewriting .shortStrBox .billingPushItem").length;
  555. const warnNum = $(".tips-cont .billingPushItem").length + writeNum; //病例书写规范有隐藏元素
  556. if (warnNum === 0) {
  557. $(".tabList .numPop").hide();
  558. return;
  559. }
  560. $(".tabList .numPop").text(warnNum).show()
  561. }
  562. function renderDiag(diagPush) {
  563. let possibleDiagPush = diagPush["可能诊断"] || []
  564. let previousDiagPush = diagPush["既往诊断"] || []
  565. let firstDiagPush = diagPush["初步诊断"] || []
  566. let identifyDiagPush = diagPush["鉴别诊断"] || []
  567. let warningDiagPush = diagPush["警惕"] || []
  568. let number = $('.moduleItem.diag').attr("data-num") || 5
  569. let warnNumber = $('.moduleItem.warning').attr("data-num") || 5
  570. $('.moduleItem.diag').append(titleStr("diagPush"))
  571. // let warningDiagPush = [{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
  572. // let firstDiagPush = [{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
  573. // let identifyDiagPush = diagPush["鉴别诊断"] || [{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
  574. renderDiagItem(possibleDiagPush, "可能诊断", number)
  575. renderDiagItem(previousDiagPush, "既往诊断", number)
  576. renderDiagItem(firstDiagPush, "初步诊断", number)
  577. renderDiagItem(identifyDiagPush, "鉴别诊断", number)
  578. renderWarningDiag(warningDiagPush, "警惕", warnNumber)
  579. moreInfo()
  580. }
  581. function renderDiagItem(list, name, number) {
  582. if (list.length === 0) {
  583. return
  584. }
  585. moduleNum++
  586. let titleStr = titleStr2(name)
  587. let { shortStr, longStr } = renderItemWrapper(list, number)
  588. let boxStr = `<div class="moduleBox">
  589. ${titleStr}
  590. ${shortStr}
  591. ${longStr}
  592. </div>`
  593. $(".diag").append(boxStr)
  594. $('.moduleItem.diag').css("display", "block")
  595. }
  596. function renderWarningDiag(list, name, number) {
  597. if (list.length > 0 && $(".moduleItem.warning").length > 0) {
  598. moduleNum++
  599. $('.moduleItem.warning').append()
  600. let str = `<span class="warningTitle"><img class="warningTitImg" src=${warnImgWhite}>警惕</span>`
  601. for (let i = 0; i < list.length; i++) {
  602. str += renderPushItem(list[i], 1)
  603. }
  604. $('.moduleItem.warning').append(str)
  605. $('.moduleItem.warning').css("display", "block")
  606. }
  607. }
  608. function renderDiagList(list, showNum) {
  609. if (list.length > 0 && $(".moduleItem.maydiagnose").length > 0) {
  610. moduleNum++
  611. let str = `<div class="item">`
  612. $('.moduleItem.maydiagnose').append(titleStr("maydiagnosePush"))
  613. for (var i = 0; i < list.length; i++) {
  614. const item = list[i];
  615. str +=
  616. `<div class='box ${i > 2 ? `box-1` : ''}' data-index="${i}">
  617. <p class='box-p goDetail' data-name="${item.name}" data-index="${i}"><span class='box-title'>${item.name}</span><img class="box-img" src=${down} /></p>
  618. <div class="moduleCenter"></div>
  619. </div>`
  620. }
  621. str += `${list.length > 3 ? `<p class="toogle">加载更多<img src=${more}/></p>` : ''} </div>`
  622. $('.moduleItem.maydiagnose').append(str)
  623. $('.moduleItem.maydiagnose').css("display", "block")
  624. $('.maydiagnose .goDetail').on("click", function (e) {
  625. e.preventDefault()
  626. const name = $(this).attr('data-name');
  627. const i = $(this).attr('data-index');
  628. indexNow = i
  629. const showList = $(".box[data-index=" + i + "]").find(".moduleCenter").css("display")
  630. if (showList == "none" || !showList) {
  631. $(".loading").show();
  632. $(".maydiagnose .box[data-index=" + i + "]").find(".moduleCenter").html('')
  633. $(".maydiagnose .box").find(".moduleCenter").css("display", "none")
  634. $(".maydiagnose .box[data-index=" + i + "]").find(".moduleCenter").css("display", "block")
  635. renderpushByMayDisease(name, i)
  636. } else {
  637. $(".maydiagnose .box[data-index=" + i + "]").find(".moduleCenter").css("display", "none")
  638. }
  639. });
  640. }
  641. }
  642. function renderAffListList(list, showNum) {
  643. if (list.length > 0 && $(".moduleItem.hasdiagnose").length > 0) {
  644. moduleNum++
  645. let str = `<div class="item">`
  646. $('.moduleItem.hasdiagnose').append(titleStr("hasdiagnosePush"))
  647. for (var i = 0; i < list.length; i++) {
  648. const item = list[i];
  649. str +=
  650. `<div class='box ${i > 2 ? `box-1` : ''}' data-index="${i}">
  651. <p class='box-p goDetail' data-name="${item.name}" data-index="${i}"><span class='box-title'>${item.name}</span><img class="box-img" src=${down} /></p>
  652. <div class="moduleCenter"></div>
  653. </div>`
  654. }
  655. str += `${list.length > 3 ? `<p class="toogle">加载更多<img src=${more}/></p>` : ''} </div>`
  656. $('.moduleItem.hasdiagnose').append(str)
  657. $('.moduleItem.hasdiagnose').css("display", "block")
  658. $('.hasdiagnose .goDetail').on("click", function (e) {
  659. e.preventDefault()
  660. const name = $(this).attr('data-name');
  661. const i = $(this).attr('data-index');
  662. indexNow = i
  663. const showList = $(".box[data-index=" + i + "]").find(".moduleCenter").css("display")
  664. if (showList == "none" || !showList) {
  665. $(".loading").show();
  666. $(".hasdiagnose .box[data-index=" + i + "]").find(".moduleCenter").html('')
  667. $(".hasdiagnose .box").find(".moduleCenter").css("display", "none")
  668. $(".hasdiagnose .box[data-index=" + i + "]").find(".moduleCenter").css("display", "block")
  669. renderpushByHasDisease(name, i)
  670. } else {
  671. $(".hasdiagnose .box[data-index=" + i + "]").find(".moduleCenter").css("display", "none")
  672. }
  673. });
  674. }
  675. }
  676. function renderSymptomPush(list, showNum) {
  677. $(".moduleItem.symptom").append(titleStr('symptomPush'))
  678. if (list.length > 0 && $(".moduleItem.symptom").length > 0) {
  679. moduleNum++
  680. let { shortStr, longStr } = renderItemWrapper(list, showNum)
  681. $(".moduleItem.symptom").append(shortStr).append(longStr)
  682. $(".moduleItem.symptom").css("display", "block")
  683. }
  684. }
  685. function renderLis(list, showNum) {
  686. if (list.length > 0 && $(".moduleItem.lis").length > 0) {
  687. moduleNum++
  688. $('.moduleItem.lis').append(titleStr("lisPush"))
  689. let { shortStr, longStr } = renderItemWrapper(list, showNum)
  690. $('.moduleItem.lis').append(shortStr).append(longStr)
  691. $('.moduleItem.lis').css("display", "block")
  692. }
  693. }
  694. function renderScale(list, showNum) {
  695. if (list.length > 0 && $(".moduleItem.evaluation").length > 0) {
  696. moduleNum++
  697. $('.moduleItem.evaluation').append(titleStr("scalePush"))
  698. let { shortStr, longStr } = renderItemWrapper(list, showNum)
  699. $('.moduleItem.evaluation').append(shortStr).append(longStr)
  700. $('.moduleItem.evaluation').css("display", "block")
  701. }
  702. }
  703. function renderNurse(list, showNum) {
  704. if (list.length > 0 && $(".moduleItem.nurse").length > 0) {
  705. moduleNum++
  706. $('.moduleItem.nurse').append(titleStr("nursePush"))
  707. let { shortStr, longStr } = renderItemWrapper(list, showNum)
  708. $('.moduleItem.nurse').append(shortStr).append(longStr);
  709. $('.moduleItem.nurse').css("display", "block")
  710. }
  711. }
  712. function renderPacs(list, showNum) {
  713. if (list.length > 0 && $(".moduleItem.pacs").length > 0) {
  714. moduleNum++
  715. $(".moduleItem.pacs").append(titleStr("pacsPush"))
  716. let { shortStr, longStr } = renderItemWrapper(list, showNum)
  717. $(".moduleItem.pacs").append(shortStr).append(longStr)
  718. $('.moduleItem.pacs').css("display", "block")
  719. }
  720. }
  721. function renderCheckup(list, showNum) {
  722. if (list.length > 0 && $(".moduleItem.vital").length > 0) {
  723. moduleNum++
  724. $(".moduleItem.vital").append(titleStr("checkupPush"))
  725. let { shortStr, longStr } = renderItemWrapper(list, showNum)
  726. $(".moduleItem.vital").append(shortStr).append(longStr)
  727. $('.moduleItem.vital').css("display", "block")
  728. }
  729. }
  730. function renderMaySymptomPush(list) {
  731. let num, state
  732. for (let i = 0; i < maydiagnoseList.length; i++) {
  733. const item = maydiagnoseList[i];
  734. if (item.code == 'maysymptom') {
  735. num = item.number
  736. state = item.status
  737. }
  738. }
  739. if (list.length > 0 && state != 0) {
  740. moduleNum++
  741. let { shortStr, longStr } = renderItemWrapper(list, num, '症状')
  742. $(".box[data-index=" + indexNow + "]").find(".moduleCenter").append(`<div class='maysymptom'></div>`)
  743. $(".box[data-index=" + indexNow + "]").find(".moduleCenter .maysymptom").append(shortStr).append(longStr)
  744. }
  745. }
  746. function renderHasSymptomPush(list,) {
  747. let num, state
  748. for (let i = 0; i < hasdiagnoseList.length; i++) {
  749. const item = hasdiagnoseList[i];
  750. if (item.code == 'hassymptom') {
  751. num = item.number
  752. state = item.status
  753. }
  754. }
  755. if (list.length > 0 && state != 0) {
  756. moduleNum++
  757. let { shortStr, longStr } = renderItemWrapper(list, num, '症状')
  758. $(".box[data-index=" + indexNow + "]").find(".moduleCenter").append(`<div class='hassymptom'></div>`)
  759. $(".box[data-index=" + indexNow + "]").find(".moduleCenter .hassymptom").append(shortStr).append(longStr)
  760. }
  761. }
  762. function renderMayVitalPush(list) {
  763. let num, state
  764. for (let i = 0; i < maydiagnoseList.length; i++) {
  765. const item = maydiagnoseList[i];
  766. if (item.code == 'mayvital') {
  767. num = item.number
  768. state = item.status
  769. }
  770. }
  771. if (list.length > 0 && state != 0) {
  772. moduleNum++
  773. let { shortStr, longStr } = renderItemWrapper(list, num, '体征')
  774. $(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("<div class='mayvital'></div>")
  775. $(".box[data-index=" + indexNow + "]").find(".moduleCenter .mayvital").append(shortStr).append(longStr)
  776. }
  777. }
  778. function renderHasVitalPush(list) {
  779. let num, state
  780. for (let i = 0; i < hasdiagnoseList.length; i++) {
  781. const item = hasdiagnoseList[i];
  782. if (item.code == 'mayvital') {
  783. num = item.number
  784. state = item.status
  785. }
  786. }
  787. if (list.length > 0 && state != 0) {
  788. moduleNum++
  789. let { shortStr, longStr } = renderItemWrapper(list, num, '体征')
  790. $(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("<div class='hasvital'></div>")
  791. $(".box[data-index=" + indexNow + "]").find(".moduleCenter .hasvital").append(shortStr).append(longStr)
  792. }
  793. }
  794. function renderMayLisPush(list) {
  795. let num, state
  796. for (let i = 0; i < maydiagnoseList.length; i++) {
  797. const item = maydiagnoseList[i];
  798. if (item.code == 'maylis') {
  799. num = item.number
  800. state = item.status
  801. }
  802. }
  803. if (list.length > 0 && state != 0) {
  804. moduleNum++
  805. let { shortStr, longStr } = renderItemWrapper(list, num, '推荐检验')
  806. $(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("<div class='maylis'></div>")
  807. $(".box[data-index=" + indexNow + "]").find(".moduleCenter .maylis").append(shortStr).append(longStr)
  808. }
  809. }
  810. function renderHasLisPush(list) {
  811. let num, state
  812. for (let i = 0; i < hasdiagnoseList.length; i++) {
  813. const item = hasdiagnoseList[i];
  814. if (item.code == 'haslis') {
  815. num = item.number
  816. state = item.status
  817. }
  818. }
  819. if (list.length > 0 && state != 0) {
  820. moduleNum++
  821. let { shortStr, longStr } = renderItemWrapper(list, num, '推荐检验')
  822. $(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("<div class='haslis'></div>")
  823. $(".box[data-index=" + indexNow + "]").find(".moduleCenter .haslis").append(shortStr).append(longStr)
  824. }
  825. }
  826. function renderMayPacsPush(list) {
  827. let num, state
  828. for (let i = 0; i < maydiagnoseList.length; i++) {
  829. const item = maydiagnoseList[i];
  830. if (item.code == 'maypacs') {
  831. num = item.number
  832. state = item.status
  833. }
  834. }
  835. if (list.length > 0 && state != 0) {
  836. moduleNum++
  837. let { shortStr, longStr } = renderItemWrapper(list, num, '推荐检查')
  838. $(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("<div class='maypacs'></div>")
  839. $(".box[data-index=" + indexNow + "]").find(".moduleCenter .maypacs").append(shortStr).append(longStr)
  840. }
  841. }
  842. function renderHasPacsPush(list) {
  843. let num, state
  844. for (let i = 0; i < hasdiagnoseList.length; i++) {
  845. const item = hasdiagnoseList[i];
  846. if (item.code == 'haspacs') {
  847. num = item.number
  848. state = item.status
  849. }
  850. }
  851. if (list.length > 0 && state != 0) {
  852. moduleNum++
  853. let { shortStr, longStr } = renderItemWrapper(list, num, '推荐检查')
  854. $(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("<div class='haspacs'></div>")
  855. $(".box[data-index=" + indexNow + "]").find(".moduleCenter .haspacs").append(shortStr).append(longStr)
  856. }
  857. }
  858. function renderMayScalePush(list) {
  859. let num, state
  860. for (let i = 0; i < maydiagnoseList.length; i++) {
  861. const item = maydiagnoseList[i];
  862. if (item.code == 'mayevaluation') {
  863. num = item.number
  864. state = item.status
  865. }
  866. }
  867. if (list.length > 0 && state != 0) {
  868. moduleNum++
  869. let { shortStr, longStr } = renderItemWrapper(list, num, '推荐量表')
  870. $(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("<div class='mayevaluation'></div>")
  871. $(".box[data-index=" + indexNow + "]").find(".moduleCenter .mayevaluation").append(shortStr).append(longStr)
  872. }
  873. }
  874. function renderHasScalePush(list) {
  875. let num, state
  876. for (let i = 0; i < hasdiagnoseList.length; i++) {
  877. const item = hasdiagnoseList[i];
  878. if (item.code == 'hasevaluation') {
  879. num = item.number
  880. state = item.status
  881. }
  882. }
  883. if (list.length > 0 && state != 0) {
  884. moduleNum++
  885. let { shortStr, longStr } = renderItemWrapper(list, num, '推荐量表')
  886. $(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("<div class='hasevaluation'></div>")
  887. $(".box[data-index=" + indexNow + "]").find(".moduleCenter .hasevaluation").append(shortStr).append(longStr)
  888. }
  889. }
  890. function renderMayDisPush(list) {
  891. let num, state
  892. for (let i = 0; i < maydiagnoseList.length; i++) {
  893. const item = maydiagnoseList[i];
  894. if (item.code == 'mayantidias') {
  895. num = item.number
  896. state = item.status
  897. }
  898. }
  899. if (list.length > 0 && state != 0) {
  900. console.log(123);
  901. moduleNum++
  902. let { shortStr, longStr } = renderItemWrapper(list, num, '鉴别诊断')
  903. $(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("<div class='mayantidias'></div>")
  904. $(".box[data-index=" + indexNow + "]").find(".moduleCenter .mayantidias").append(shortStr).append(longStr)
  905. }
  906. }
  907. function renderHasDisPush(list) {
  908. let num, state
  909. for (let i = 0; i < maydiagnoseList.length; i++) {
  910. const item = maydiagnoseList[i];
  911. if (item.code == 'hasantidias') {
  912. num = item.number
  913. state = item.status
  914. }
  915. }
  916. if (list.length > 0 && state != 0) {
  917. moduleNum++
  918. let { shortStr, longStr } = renderItemWrapper(list, num, '鉴别诊断')
  919. $(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("<div class='hasantidias'></div>")
  920. $(".box[data-index=" + indexNow + "]").find(".moduleCenter .hasantidias").append(shortStr).append(longStr)
  921. }
  922. }
  923. function renderMayPush(treatPush, medicinesPush, operationsPush, nursePush) {
  924. $(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("<div class='centerBox'></div>")
  925. let str = `<ul>
  926. ${treatPush.length > 0 ? `<li class="general">一般治疗</li>` : ''}
  927. ${medicinesPush.length > 0 ? `<li class="medicine">推荐用药</li>` : ''}
  928. ${operationsPush.length > 0 ? `<li class="operation">推荐手术/操作</li>` : ''}
  929. ${nursePush.length > 0 ? `<li class="nurse">推荐护理</li>` : ''}
  930. </ul>
  931. <div class="centerBoxItem">
  932. ${treatPush.length > 0 ? `<div class="checkBox generalItem maygeneral" data-index="0"></div>` : ''}
  933. ${medicinesPush.length > 0 ? `<div class="checkBox medicineItem maymedicine" data-index="1"></div>` : ''}
  934. ${operationsPush.length > 0 ? `<div class="checkBox operationItem mayoperation" data-index="2"></div>` : ''}
  935. ${nursePush.length > 0 ? `<div class="checkBox nurseItem maynurse" data-index="3"></div>` : ''}
  936. </div>`
  937. $(".maydiagnose .box[data-index=" + indexNow + "]").find(".moduleCenter .centerBox").append(str)
  938. renderMayTreatPush(treatPush)
  939. renderMayMedicPush(medicinesPush)
  940. renderMayOperationsPush(operationsPush)
  941. renderMayNursePush(nursePush)
  942. $('.maydiagnose .centerBox ul li').click(function () {
  943. var i = $(this).index();
  944. if ($(this).hasClass('active')) {
  945. $(this).removeClass('active');
  946. $(".maydiagnose .checkBox[data-index=" + i + "]").removeClass('onshow');
  947. } else {
  948. $(this).addClass('active').siblings().removeClass('active');
  949. $(".maydiagnose .checkBox[data-index=" + i + "]").addClass('onshow').siblings().removeClass('onshow');
  950. }
  951. });
  952. }
  953. function renderHasPush(treatPush, medicinesPush, operationsPush, nursePush) {
  954. $(".hasdiagnose .box[data-index=" + indexNow + "]").find(".moduleCenter").append("<div class='centerBox'></div>")
  955. let str = `<ul>
  956. ${treatPush.length > 0 ? `<li class="general">一般治疗</li>` : ''}
  957. ${medicinesPush.length > 0 ? `<li class="medicine">推荐用药</li>` : ''}
  958. ${operationsPush.length > 0 ? `<li class="operation">推荐手术/操作</li>` : ''}
  959. ${nursePush.length > 0 ? `<li class="nurse">推荐护理</li>` : ''}
  960. </ul>
  961. <div class="centerBoxItem">
  962. ${treatPush.length > 0 ? `<div class="checkBox generalItem hasgeneral" data-index="0"></div>` : ''}
  963. ${medicinesPush.length > 0 ? `<div class="checkBox medicineItem hasmedicine" data-index="1"></div>` : ''}
  964. ${operationsPush.length > 0 ? `<div class="checkBox operationItem hasoperation" data-index="2"></div>` : ''}
  965. ${nursePush.length > 0 ? `<div class="checkBox nurseItem hasnurse" data-index="3"></div>` : ''}
  966. </div>`
  967. $(".hasdiagnose .box[data-index=" + indexNow + "]").find(".moduleCenter .centerBox").append(str)
  968. renderHasTreatPush(treatPush)
  969. renderHasMedicPush(medicinesPush)
  970. renderHasOperationsPush(operationsPush)
  971. renderHasNursePush(nursePush)
  972. $('.hasdiagnose .centerBox ul li').click(function () {
  973. var i = $(this).index();
  974. if ($(this).hasClass('active')) {
  975. $(this).removeClass('active');
  976. $(".hasdiagnose .checkBox[data-index=" + i + "]").removeClass('onshow');
  977. } else {
  978. $(this).addClass('active').siblings().removeClass('active');
  979. $(".hasdiagnose .checkBox[data-index=" + i + "]").addClass('onshow').siblings().removeClass('onshow');
  980. }
  981. });
  982. }
  983. function renderMayTreatPush(list) {
  984. let state
  985. for (let i = 0; i < maydiagnoseList.length; i++) {
  986. const item = maydiagnoseList[i];
  987. if (item.code == 'maygeneral') {
  988. state = item.status
  989. }
  990. }
  991. if (list.length > 0 && state != 0) {
  992. let str = ''
  993. for (let i = 0; i < list.length; i++) {
  994. const item = list[i];
  995. str = `${item.generaTreat}`
  996. }
  997. $(".maygeneral").append(str)
  998. }
  999. }
  1000. function renderHasTreatPush(list) {
  1001. let state
  1002. for (let i = 0; i < hasdiagnoseList.length; i++) {
  1003. const item = hasdiagnoseList[i];
  1004. if (item.code == 'hasgeneral') {
  1005. state = item.status
  1006. }
  1007. }
  1008. if (list.length > 0 && state != 0) {
  1009. let str = ''
  1010. for (let i = 0; i < list.length; i++) {
  1011. const item = list[i];
  1012. str = `${item.generaTreat}`
  1013. }
  1014. $(".hasgeneral").append(str)
  1015. }
  1016. }
  1017. function renderMayMedicPush(list) {
  1018. let num, state
  1019. for (let i = 0; i < maydiagnoseList.length; i++) {
  1020. const item = maydiagnoseList[i];
  1021. if (item.code == 'maymedicine') {
  1022. num = item.number
  1023. state = item.status
  1024. }
  1025. }
  1026. if (list.length > 0 && state != 0) {
  1027. moduleNum++
  1028. let { shortStr, longStr } = renderItemWrapper(list, num)
  1029. $(".maymedicine").append(shortStr).append(longStr)
  1030. }
  1031. }
  1032. function renderHasMedicPush(list) {
  1033. let num, state
  1034. for (let i = 0; i < hasdiagnoseList.length; i++) {
  1035. const item = hasdiagnoseList[i];
  1036. if (item.code == 'hasmedicine') {
  1037. num = item.number
  1038. state = item.status
  1039. }
  1040. }
  1041. if (list.length > 0 && state != 0) {
  1042. moduleNum++
  1043. let { shortStr, longStr } = renderItemWrapper(list, num)
  1044. $(".hasmedicine").append(shortStr).append(longStr)
  1045. }
  1046. }
  1047. function renderMayOperationsPush(list) {
  1048. let num, state
  1049. for (let i = 0; i < maydiagnoseList.length; i++) {
  1050. const item = maydiagnoseList[i];
  1051. if (item.code == 'mayoperation') {
  1052. num = item.number
  1053. state = item.status
  1054. }
  1055. }
  1056. if (list.length > 0 && state != 0) {
  1057. moduleNum++
  1058. let { shortStr, longStr } = renderItemWrapper(list, num)
  1059. $(".mayoperation").append(shortStr).append(longStr)
  1060. }
  1061. }
  1062. function renderHasOperationsPush(list) {
  1063. let num, state
  1064. for (let i = 0; i < hasdiagnoseList.length; i++) {
  1065. const item = hasdiagnoseList[i];
  1066. if (item.code == 'hasoperation') {
  1067. num = item.number
  1068. state = item.status
  1069. }
  1070. }
  1071. if (list.length > 0 && state != 0) {
  1072. moduleNum++
  1073. let { shortStr, longStr } = renderItemWrapper(list, num)
  1074. $(".hasoperation").append(shortStr).append(longStr)
  1075. }
  1076. }
  1077. function renderMayNursePush(list) {
  1078. let num, state
  1079. for (let i = 0; i < maydiagnoseList.length; i++) {
  1080. const item = maydiagnoseList[i];
  1081. if (item.code == 'maynurse') {
  1082. num = item.number
  1083. state = item.status
  1084. }
  1085. }
  1086. if (list.length > 0 && state != 0) {
  1087. moduleNum++
  1088. let { shortStr, longStr } = renderItemWrapper(list, num)
  1089. $(".maynurse").append(shortStr).append(longStr)
  1090. }
  1091. }
  1092. function renderHasNursePush(list) {
  1093. let num, state
  1094. for (let i = 0; i < hasdiagnoseList.length; i++) {
  1095. const item = hasdiagnoseList[i];
  1096. if (item.code == 'hasnurse') {
  1097. num = item.number
  1098. state = item.status
  1099. }
  1100. }
  1101. if (list.length > 0 && state != 0) {
  1102. moduleNum++
  1103. let { shortStr, longStr } = renderItemWrapper(list, num)
  1104. $(".hasnurse").append(shortStr).append(longStr)
  1105. }
  1106. }
  1107. function rendergeneraTreatPush(list) {
  1108. if (list && $(".moduleItem.general").length > 0) {
  1109. $(".moduleItem.general").append(titleStr('generaTreatPush'))
  1110. moduleNum++
  1111. let str = `<div class="generalTreatInfo clearfix isOverFlow">${list}</div>`
  1112. $(".moduleItem.general").append(str)
  1113. $(".moduleItem.general").css("display", "block")
  1114. let generaTreatHei = $(".moduleItem .generalTreatInfo")[0].scrollHeight
  1115. if (generaTreatHei > 50) {
  1116. $(".moduleItem .generalTreatInfo").append(`<span class="showMoreGeneralTreat"><img class="iconArrowImg more" src="${iconArrowDown}"></span>`)
  1117. $(".moduleItem .generalTreatInfo").append(`<span class="showLessGeneralTreat"><img class="iconArrowImg" src="${iconArrowUp}"></span>`)
  1118. bindGeneralSlide()
  1119. }
  1120. }
  1121. }
  1122. function renderMedicinesPush(list, showNum) {
  1123. $(".moduleItem.medicine").append(titleStr('drugPush'))
  1124. if (list.length > 0 && $(".moduleItem.medicine").length > 0) {
  1125. moduleNum++
  1126. let { shortStr, longStr } = renderItemWrapper(list, showNum)
  1127. $(".moduleItem.medicine").append(shortStr).append(longStr)
  1128. $(".moduleItem.medicine").css("display", "block")
  1129. }
  1130. }
  1131. function renderOperationPush(list, showNum) {
  1132. $(".moduleItem.operation").append(titleStr('operationPush'))
  1133. if (list.length > 0 && $(".moduleItem.operation").length > 0) {
  1134. moduleNum++
  1135. let { shortStr, longStr } = renderItemWrapper(list, showNum)
  1136. $(".moduleItem.operation").append(shortStr).append(longStr)
  1137. $(".moduleItem.operation").css("display", "block")
  1138. }
  1139. }
  1140. function renderItemWrapper(list, showNum, name) {
  1141. let showNum1 = showNum || 5
  1142. let shortStr = '', longStr = ''
  1143. for (let i = 0; i < list.length; i++) {
  1144. if (i <= showNum1 - 1) {
  1145. shortStr += renderPushItem(list[i])
  1146. }
  1147. longStr += renderPushItem(list[i])
  1148. }
  1149. if (showNum1 >= list.length) {
  1150. return {
  1151. shortStr: `<div class="shortBox">${name ? name + ':' : ''}${shortStr}</div>`,
  1152. longStr: ''
  1153. }
  1154. } else {
  1155. shortStr += `<span class="showMore"><img class="iconArrowImg" src="${iconArrowDown}"></span>`
  1156. longStr += `<span class="showLess"><img class="iconArrowImg" src="${iconArrowUp}"></span>`
  1157. return {
  1158. shortStr: `<div class="shortBox">${name ? name + ':' : ''}${shortStr}</div>`,
  1159. longStr: `<div class="longBox">${name ? name + ':' : ''}${longStr}</div></div>`
  1160. }
  1161. }
  1162. }
  1163. function renderPushItem(item) {
  1164. const infoIcon = `${item.hasInfo == "1" ? `<img class="infoImg" src="${infoImg}">` : ""}`;
  1165. str = `<span class="pushItemBox" data-name="${item.name}" data-type="${item.type}">`
  1166. str += `<span class="pushItemName ${item.hasScale == "1" ? 'evaluationtitle' : ''} ${item.hasInfo == "1" ? '' : 'noInfo'}">${item.type == 8 ? ('【' + item.name + '】') : item.name} ${infoIcon}<i class="hidden-i"></i></span>`
  1167. str += `</span>`;
  1168. return str
  1169. }
  1170. function bindOpenInfo() {
  1171. $(".infoImg").on("mouseenter", function () {
  1172. $(this).attr("src", infoImgOn)
  1173. }).on("mouseleave", function () {
  1174. $(this).attr("src", infoImg)
  1175. })
  1176. }
  1177. function bindSlide() {
  1178. $(".showMore").off("click").on("click", function () {
  1179. $(this).parent().parent().find(".longBox").css("display", "block")
  1180. $(this).parent().parent().find(".shortBox").css("display", "none")
  1181. })
  1182. $(".showLess").off("click").on("click", function () {
  1183. $(this).parent().parent().find(".longBox").css("display", "none")
  1184. $(this).parent().parent().find(".shortBox").css("display", "block")
  1185. })
  1186. }
  1187. function renderModuleWrapper(moduleList) {
  1188. if (!moduleList) {
  1189. return
  1190. }
  1191. let moduleStr = ''
  1192. for (let i = 0; i < moduleList.length; i++) {
  1193. if (moduleList[i].status != '0') {
  1194. if (moduleList[i].code == 'critical') {
  1195. moduleStr += `<div class="moduleItem warning" data-num="${moduleList[i].number}" style="display:none"></div>`
  1196. // moduleStr += `<div class="moduleItem tips" data-num="${moduleList[i].number}" style="display:none"></div>`
  1197. } else if (moduleList[i].code == 'maydiagnose') {
  1198. maydiagnoseList = moduleList[i].planDetails
  1199. moduleStr += `<div class="moduleItem ${moduleList[i].code}" data-num="${moduleList[i].number}" style="display:none"></div>`
  1200. let arr = []
  1201. for (let j = 0; j < moduleList[i].planDetails.length; j++) {
  1202. let item = moduleList[i].planDetails[j]
  1203. arr.push(item.status)
  1204. }
  1205. if(arr.indexOf(1) == -1){
  1206. maydiagnoseType = true
  1207. }
  1208. } else if (moduleList[i].code == 'hasdiagnose') {
  1209. hasdiagnoseList = moduleList[i].planDetails
  1210. moduleStr += `<div class="moduleItem ${moduleList[i].code}" data-num="${moduleList[i].number}" style="display:none"></div>`
  1211. let arr = []
  1212. for (let j = 0; j < moduleList[i].planDetails.length; j++) {
  1213. let item = moduleList[i].planDetails[j]
  1214. arr.push(item.status)
  1215. }
  1216. if(arr.indexOf(1) == -1){
  1217. hasdiagnoseType = true
  1218. }
  1219. } else {
  1220. moduleStr += `<div class="moduleItem ${moduleList[i].code}" data-num="${moduleList[i].number}" style="display:none"></div>`
  1221. }
  1222. }
  1223. }
  1224. $(".recommendWrap").append(moduleStr)
  1225. }
  1226. function hasTab(tabName, tabList) {
  1227. if (!tabList) {
  1228. return
  1229. }
  1230. for (let i = 0; i < tabList.length; i++) {
  1231. if (tabList[i].name == tabName) {
  1232. return tabList[i]
  1233. }
  1234. }
  1235. return false
  1236. }
  1237. function renderTab(tabList) {
  1238. let tabStr = '<ul>'
  1239. for (let i = 0; i < tabList.length; i++) {
  1240. if (tabList[i].status == '1') {
  1241. tabStr += `<li class="tab" data-name="${tabList[i].code}" ><span>${tabList[i].name}</span></li>`
  1242. }
  1243. }
  1244. tabStr += `</ul><div class="numPop"></div>`;
  1245. $(".tabList").append(tabStr)
  1246. let tabNum = 0;
  1247. if (isTcm == 'true') {
  1248. tabNum = $(".tabList .tab").length - 1;
  1249. }
  1250. $(".tabList .tab").eq(tabNum).addClass("activeTab")
  1251. let showModuleName = $(".tabList .tab").eq(tabNum).attr("data-name")
  1252. getModuleShow(moduleConfig[showModuleName])
  1253. bindTabClick()
  1254. }
  1255. function titleStr(type) {
  1256. let titleStr = ''
  1257. titleStr += `<h4 class="moduleTitle" style="background:${titleConfig[type].background}"><img class="titleIcon" src=${titleConfig[type].icon}>${titleConfig[type].name}</h4>`
  1258. return titleStr
  1259. }
  1260. function titleStr2(name) {
  1261. let titleStr = ''
  1262. titleStr += `<p class="moduleBoxTitle">${name}:</p>`
  1263. return titleStr
  1264. }
  1265. function bindTabClick() {
  1266. $(".tabList .tab").off("click").on("click", function () {
  1267. $(".activeTab").removeClass("activeTab")
  1268. $(this).addClass("activeTab")
  1269. const moduleName = $(this).attr("data-name")
  1270. getModuleShow(moduleConfig[moduleName])
  1271. if (moduleName == "medical") {
  1272. $(".staticSearchT .ipt").find("input").focus()
  1273. //$(".contentWrapper").css("overflowY","hidden")
  1274. } else if (moduleName == 'followup') {
  1275. // $(".contentWrapper").css("overflowY","auto")
  1276. }
  1277. })
  1278. }
  1279. function getModuleShow(moduleClassName) {
  1280. if ($(`.${moduleClassName}`).css("display") == "none") {
  1281. $(".moduleWrapper").css("display", "none")
  1282. $(`.${moduleClassName}`).css("display", "block")
  1283. }
  1284. }
  1285. function bindGeneralSlide() {
  1286. $(".showMoreGeneralTreat").off("click").on("click", function () {
  1287. $(".generalTreatInfo").toggleClass("isOverFlow")
  1288. $(".showMoreGeneralTreat").toggle()
  1289. })
  1290. $(".showLessGeneralTreat").off("click").on("click", function () {
  1291. $(".generalTreatInfo").toggleClass("isOverFlow")
  1292. $(".showMoreGeneralTreat").toggle()
  1293. })
  1294. }
  1295. function bindSlideCaseWriting() {
  1296. $(".showMoreCaseWriting").off("click").on("click", function () {
  1297. $(this).parents(".casewritingWrapper ").find(".shortStrBox").css("display", "none")
  1298. $(this).parents(".casewritingWrapper ").find(".longStrBox").css("display", "block")
  1299. })
  1300. $(".showLessCaseWriting").off("click").on("click", function () {
  1301. $(this).parents(".casewritingWrapper ").find(".shortStrBox").css("display", "block")
  1302. $(this).parents(".casewritingWrapper ").find(".longStrBox").css("display", "none")
  1303. })
  1304. }
  1305. //显示空状态
  1306. function empty() {
  1307. ifInputParam = hasInputParam();
  1308. if (!ifInputParam) { //没有输入数据时
  1309. $(".recommendBox .empty-box").hide();
  1310. $(".recommendBox .empty").show();
  1311. return;
  1312. }
  1313. if (hasCompleteTnterface === allInterface) { //需调的推送接口全部返回后
  1314. setTimeout(function () {
  1315. const emptyShownBox = $('.recommendWrap .empty-box:visible').length;
  1316. const configShownBox = $('.recommendWrap .moduleItem:visible').length;
  1317. if (configShownBox === 0 && emptyShownBox === 0) { //有配置但没数据
  1318. $('.empty-box').hide();
  1319. $('.recommendBox .empty-null').show();
  1320. return;
  1321. }
  1322. $(".empty-box").hide();
  1323. }, 200);
  1324. }
  1325. /*setTimeout(function(){
  1326. const emptyShownBox = $('.recommendWrap .empty-box:visible').length;
  1327. const configShownBox = $('.recommendWrap .moduleItem:visible').length;
  1328. if(configShownBox===0&&emptyShownBox===0){ //有配置但没数据
  1329. $('.empty-box').hide();
  1330. $('.recommendBox .empty-null').show();
  1331. return;
  1332. }
  1333. $(".empty-box").hide();
  1334. },200);*/
  1335. }
  1336. $(function () {
  1337. //隐藏logo
  1338. if (getUrlArgObject("hideLg")) {
  1339. $(".disclaimer .logo").hide();
  1340. }
  1341. getDisclaimer(); //获取免责声明
  1342. getVersion(); //获取版本信息
  1343. $(".disclaimerInfo").on("click", function () {
  1344. openNewWin("disclaimer.html")
  1345. });
  1346. $(".version-tip").on("click", function () {
  1347. const ver = localStorage.getItem('versionTime');
  1348. $(".version-tip").removeClass('new-icon');
  1349. localStorage.setItem('versionTime', ver.replace("=new", ""));
  1350. openNewWin("version.html");
  1351. });
  1352. $.fn.extend({
  1353. "preventScroll": function () {
  1354. $(this).each(function () {
  1355. var _this = this;
  1356. if (navigator.userAgent.indexOf('Firefox') >= 0) { //firefox
  1357. _this.addEventListener('DOMMouseScroll', function (e) {
  1358. _this.scrollTop += e.detail > 0 ? 60 : -60;
  1359. e.preventDefault();
  1360. }, false);
  1361. } else {
  1362. _this.onmousewheel = function (e) {
  1363. e = e || window.event;
  1364. _this.scrollTop += e.wheelDelta > 0 ? -60 : 60;
  1365. return false;
  1366. };
  1367. }
  1368. })
  1369. }
  1370. });
  1371. $(window).on("resize", function () {
  1372. adjustHei()
  1373. })
  1374. });
  1375. //展开更多
  1376. $(document).on("click", ".toogle", (e) => {
  1377. if ($(e.target).is(".up")) {
  1378. $(e.target).removeClass("up").html("加载更多").append(`<img class="arrow" src=${more} alt="下拉">`);
  1379. $(e.target).parents(".item").find(".box-1").css("display", 'none');
  1380. return;
  1381. }
  1382. $(".item").each(function (i) {
  1383. $(this).find('.toogle').removeClass("up")
  1384. $(this).find(".box-1").css("display", 'none');
  1385. $(this).find('.toogle').html("加载更多").append(`<img class="arrow" src=${more} alt="下拉">`);
  1386. });
  1387. $(e.target).addClass("up").html("收起").append(`<img class="arrow" src=${up} alt="下拉">`);
  1388. $(e.target).parents(".item").find(".box-1").css("display", 'block');
  1389. });