123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- require('./../css/reset.css');
- require('./../css/indexVert.less');
- require('./../css/popup.css');
- // require('./popupEdit.js');
- var Promise = require("bluebird");
- const $ = require("jquery");
- const { post,config,getUrlArgObject,openNewWin } = require('./promise.js');
- const { transConf } = require('./util.js');
- const { renderRecommendInfo, renderMultRecommendInfo, renderTreat, renderRecommendConditTips, renderTipsInfo } = require('./indexVertDom.js');
- let mrId = getUrlArgObject('mrId')
- let msg;
- if(mrId) {
- post(config.getMr,{mrId:mrId}).then((res) => {
- const data = res.data
- if(data.code == 0) {
- msg = Object.assign(data.data, {hosCode:getUrlArgObject('hospitalCode') || '',plan:getUrlArgObject('plan') || '0',})
- window.msg = msg
- window.pushMessage = {}
- getPageInfo();
- }
- })
- } else {
- msg = {
- age: getUrlArgObject('age'),
- sex: getUrlArgObject('sex') == '男'?1:(getUrlArgObject('sex') == '女'?2:(getUrlArgObject('sex') == '通用'?3:getUrlArgObject('sex'))),
- symptom: getUrlArgObject('symptomJson'),
- vital: getUrlArgObject('vitalJson'),
- lis: getUrlArgObject('lisJson')? JSON.parse(getUrlArgObject('lisJson')) : [],
- pacs: getUrlArgObject('pacsJson'),
- diag: getUrlArgObject('diagJson'),
- diseaseName: getUrlArgObject('diseaseName'),
- other: getUrlArgObject('otherJson') + getUrlArgObject('pastJson'),
- hosCode:getUrlArgObject('hospitalCode') || '',
- plan:getUrlArgObject('plan') || '0',
- }
- window.msg = msg
- window.pushMessage = {}
- getPageInfo();
- }
- // var msg = {
- // age: getUrlArgObject('age'),
- // sex: getUrlArgObject('sex') == '男'?1:(getUrlArgObject('sex') == '女'?2:(getUrlArgObject('sex') == '通用'?3:getUrlArgObject('sex'))),
- // symptom: getUrlArgObject('symptomJson'),
- // vital: getUrlArgObject('vitalJson'),
- // lis: getUrlArgObject('lisJson')? JSON.parse(getUrlArgObject('lisJson')) : [],
- // pacs: getUrlArgObject('pacsJson'),
- // diag: getUrlArgObject('diagJson'),
- // diseaseName: getUrlArgObject('diseaseName'),
- // other: getUrlArgObject('otherJson') + getUrlArgObject('pastJson'),
- // hosCode:getUrlArgObject('hospitalCode') || '',
- // plan:getUrlArgObject('plan') || '0',
- // }//推送相关信息
- // // http://localhost:8082/indexVert.html?age=28&diseaseId=280&lisJson=&diagJson=%E6%80%A5%E6%80%A7%E8%83%B0%E8%85%BA%E7%82%8E&pastJson=%E6%97%A0%E5%BF%83%E8%84%8F%E7%97%85&otherJson=%E6%97%A0%E9%AB%98%E8%A1%80%E5%8E%8B&pacsJson=%E8%85%B9%E9%83%A8B%E8%B6%85:%E6%97%A0%E5%BC%82%E5%B8%B8,%20%E6%8A%A5%E5%91%8A%E6%97%A5%E6%9C%9F:2019-05-07&sex=%E7%94%B7&symptomJson=%E6%81%B6%E5%BF%83%E5%91%95%E5%90%90%E8%85%B0%E7%97%9B&vitalJson=%E8%A1%80%E5%8E%8B%E5%B7%A6%E4%B8%8A%E8%82%A213/12mmHg
- // window.msg = msg
- // window.pushMessage = {}
- function getConf() {
- return post(config.getSysSetInfoDatas,{hospitalCode: msg.hosCode,plan:msg.plan})
- }
- function getPushInfo() {
- return post(config.pushInner,Object.assign({featureType: '1,4,5,6,7,22'},msg))
-
- }
- function getTreatment() {
- return post(config.pushTreatment,Object.assign({featureType: '8'},msg))
- }
- function getTipsInfo() {
- return post(config.information,{name:getUrlArgObject('tipsName'),type:getUrlArgObject('tipsType'), position: 1})
- }
- function getPageInfo() {
- Promise.all([getConf(),getPushInfo(),getTreatment(),getTipsInfo()]).then(([res1, res2, res3, res4]) =>{
- console.log({res1, res2, res3, res4})
- const configArr = res1&&res1.data&&res1.data.data || []
- const pushInfo = res2&&res2.data || {}
- const treatInfo = res3&&res3.data || {}
- const tipsInfo = res4&&res4.data || {}
- const confArr = transConf(configArr)
- pushResult = pushInfo.data || {};
- treatResult = treatInfo.data || {}
- tipsResult = tipsInfo.data || {}
- const diagPossible = pushResult.dis&&pushResult.dis['可能诊断'] || []//可能
- const diagDoubt = pushResult.dis&&pushResult.dis['疑似诊断'] || [] // 疑似
- const diagDeter = pushResult.dis&&pushResult.dis['确诊'] || []//确诊
- const diagWaring = pushResult.dis&&pushResult.dis['警惕'] || [] // 推荐警惕诊断
- const symptomRecommend = pushResult.symptom || [] //推荐问诊症状
- const physiExamRecommend = pushResult.vital || [] //推荐体格检查
- const diagRecommend = diagPossible.concat(diagDoubt, diagDeter) //推荐诊断
- const labRecommend = pushResult.lab || []
- const pacsRecommend = pushResult.pacs || []
- const medicalIndications = pushResult.medicalIndications || []
- const labAndPacsRecommend = [
- {
- title: '化验',
- className: 'labRecommend',
- data: labRecommend
- },
- {
- title: '辅检',
- className: 'pacsRecommend',
- data: pacsRecommend
- }
- ]
- window.pushMessage = medicalIndications;//计算的需要的相关数据
- for(let i = 0; i < confArr.length; i++) {
- switch(confArr[i].code) {
- case "inquiry_show": //问诊症状
- renderRecommendInfo('symptomRecommend', '问诊症状', symptomRecommend, false)
- break;
- case "health_show": //体格检查
- renderRecommendInfo('physiExamRecommend', '体格检查', physiExamRecommend, false)
- break;
- case "illness_show": //病情提示
- renderRecommendConditTips('conditTips','病情提示', medicalIndications || [])
- break;
- case "vigilant_show": //警惕诊断
- renderRecommendInfo('warning', '警惕诊断', diagWaring, true,7,2)
- break;
- case "lispacs_show": //检验检查
- renderMultRecommendInfo('labAndPacsRecommend', '检验检查', labAndPacsRecommend, false)
- break;
- case "cure_show": //治疗方案
- renderTreat('treatRecommend','治疗方案',treatResult)
- break;
- case "diagnose_show": //推荐诊断
- renderRecommendInfo('diagRecommend', '推荐诊断', diagRecommend, true,7,2)
- break;
- case "tip_show": //提示信息
- renderTipsInfo('tipsInfo','提示信息',tipsResult)
- moreInfo()
- break;
- default:
- return
- }
- }
- }).catch(function (err) {
- console.log(err);
- })
- }
- function moreInfo() {
- $('.moreInfo').click(function(){
- const name = $(this).attr('data-name')
- const type = getUrlArgObject('tipsType')
- openNewWin(`information.html?type=${type}&position=0&name=${name}`)
- })
- }
- function getVersion() {
- post(config.getVersion, '').then((res) => {
- const data = res.data.data;
- const ver = localStorage.getItem('versionTime');
- const time = data.refreshTime;
- if(!ver||ver===time+"=new"||time!==ver.replace("=new","")){ //判断版本是否更新
- $(".version-tip").addClass('new-icon');
- localStorage.setItem('versionTime',time+"=new"); //保存版本更新时间
- }else{
- $(".version-tip").removeClass('new-icon');
- }
- })
- }
- function getDisclaimer() {
- post(config.disclaimer, '').then((res) => {
- const data = res.data.data.find(item => item.disclaimerCode == '2');
- $(".responsibility").html(data.description);
- })
- }
- $(function(){
- getDisclaimer(); //获取免责声明
- getVersion(); //获取版本信息
- $(".disclaimerInfo").on("click", function(){
- openNewWin("disclaimer.html")
- });
- $(".version-tip").on("click", function(){
- const ver = localStorage.getItem('versionTime');
- $(".version-tip").removeClass('new-icon');
- localStorage.setItem('versionTime',ver.replace("=new",""));
- openNewWin("version.html");
- });
- });
|