Explorar o código

慢病以主诉为入口,自动填充现病史模板

liucf %!s(int64=6) %!d(string=hai) anos
pai
achega
7c81e0ab2a

+ 19 - 14
src/components/ChronicInfo/index.jsx

@@ -33,7 +33,8 @@ class ChronicInfo extends React.Component{
       showAssess:false,      //评估弹窗
       infoId:null,  //静态知识
       formulaId:null, //计算公式
-      optionId:null  //可能结果
+      optionId:null,  //可能结果
+      tableName:''
     };
     this.showInfo = this.showInfo.bind(this);
     this.closeInfo = this.closeInfo.bind(this);
@@ -73,20 +74,26 @@ class ChronicInfo extends React.Component{
       optionId:null
     })
   }
-  showTable(){
+  showTable(it){
     // 密西根糖尿病周围神经病评分(MDNS) 为例
-    const item = {
+    /*const item = {
       id:40744,
       name:'密西根糖尿病周围神经病评分(MDNS)'
+    }*/
+    const item = {
+      id:it.id,
+      name:it.name
     }
     this.props.getScaleInfo(item);
     this.setState({
-      showTable:true
+      showTable:true,
+      tableName:it.name
     })
   }
   closeTable(){
     this.setState({
-      showTable:false
+      showTable:false,
+      tableName:''
     })
   }
   showAssessFn(){
@@ -231,8 +238,8 @@ class ChronicInfo extends React.Component{
       <span className={style['print']}><img src={printIcon} alt=""/>打印</span>
       <span className={style['okBtn']}>确定</span>
     </div>;
-    const {chronicMagItem,showList,tableList,scaleInfo,data} = this.props;
-    const {showInfo,showOption,showTable,showAssess} = this.state;
+    const {chronicMagItem,showList,tableList,scaleInfo,data,chronicDesease} = this.props;
+    const {showInfo,showOption,showTable,showAssess,tableName} = this.state;
     return <div className={style["tips"]} style={{marginBottom:'15px'}}>
               <div className={`${style["tips-title"]} ${style["chronic"]}`}>
                 <div className={style["tips-name"]}>
@@ -248,11 +255,9 @@ class ChronicInfo extends React.Component{
                   >
                     管理和评估
                   </span>
-                  <span
-                    className={style["tipsDetails"]}
-                    onClick={() => this.showTableList(chronicMagItem&&chronicMagItem.id)}
-                  >
-                    量表
+                  {/*<span className={style["tipsDetails"]} onClick={() => this.showTableList(chronicMagItem&&chronicMagItem.id)}>量表
+                  </span>*/}
+                  <span className={style["tipsDetails"]} onClick={() => this.showTableList(chronicDesease&&chronicDesease.id)}>量表
                   </span>
                 </div>
               </div>
@@ -269,12 +274,12 @@ class ChronicInfo extends React.Component{
                       </ul>
               </ConfirmModal>
               {showTable?<ComplexModal onclose={this.closeTable} footer={footer}
-                      title='密西根糖尿病神经筛查表(MDNS)' 
+                      title={tableName} 
                       icon={tableIcon}
                       top={20}
                       bottom={20}
                       width={820}>
-                <ScaleTable data={scaleInfo}></ScaleTable>
+                <ScaleTable data={scaleInfo} title={tableName}></ScaleTable>
               </ComplexModal>:''}
               {showAssess?<ComplexModal onclose={this.showAssessFn} footer={footer}
                       title='管理和评估' 

+ 18 - 0
src/components/ChronicInfo/index.less

@@ -160,6 +160,24 @@
           }
         }
       }
+      .infoOption{
+        padding: 20px 0;
+      }
+      .infoConBtn{
+        text-align: right;
+        border-top: 1px solid #EAEDF1;
+        padding-top: 10px;
+        span{
+          color:#3B9ED0;
+          display: inline-block;
+          width: 66px;
+          height: 32px;
+          line-height: 32px;
+          text-align: center;
+          border: 1px solid #3B9ED0;
+          border-radius: 4px;
+        }
+      }
       .list:last-child{
         border-bottom:none;
       }

+ 1 - 1
src/components/CurrentIll/index.jsx

@@ -57,7 +57,7 @@ class CurrentIll extends Component{
     }else {
       let num = moduleNum.num;//主诉使用了几个模板
       // if(editClear && data.length==0){//第一次聚焦去设置现病史的data
-      if(data.length==0){
+      if(data.length==0 && !isChronic){
         // setData && setData({useEmpty,num,mainData,mainIds});
         clearTimeout(setDataTimer);
         setDataTimer = setTimeout(function(){//延时,等待主诉失焦数据返回

+ 22 - 19
src/components/MainSuit/index.jsx

@@ -6,7 +6,7 @@ import SearchDrop from '@components/SearchDrop';
 import CommonSymptom from '@components/CommonSymptom';
 import chooseType from '@containers/eleType.js';
 import config from "@config/index";
-import {isIE,getPageCoordinate,windowEventHandler,filterDataArr} from "@utils/tools.js"
+import {isIE,getPageCoordinate,windowEventHandler,filterDataArr,getAllDataList,getAllDataStringList,ifOtherClear} from "@utils/tools.js"
 import { initItemList } from '@store/async-actions/historyTemplates';
 import tableIcon from '@common/images/table.png';
 import iconRadioDefault from '@common/images/icon-radio-default.png'
@@ -35,7 +35,6 @@ class MainSuit extends Component{
       overFlag:false,
       tmpScroll:0,
       tmpTop:0,
-      showRecord:false,
       activeHistory: -1,
       showHistoryCase:false
     };
@@ -256,11 +255,13 @@ class MainSuit extends Component{
       e.target.innerText?(e.target.innerText=""):(e.target.innerHTML="")
       freeText && freeText(data.trim());
       // 慢病模板获取:精确匹配"糖尿病复诊",储存慢病字段
-      if(data.trim()=='糖尿病复诊'){
+      // 页面有模板数据 就不在请求
+      let baseList = store.getState();
+      let jsonData = getAllDataList(baseList);
+      let jsonStr = getAllDataStringList(baseList);
+      let flg = ifOtherClear(jsonData,jsonStr,baseList);//除主诉外 其他是否为空
+      if(data.trim()=='糖尿病复诊' && !flg){
         saveChronic && saveChronic({name:'糖尿病',id:21773});
-        this.setState({
-          showRecord:true
-        })
       }
     }else{
       if(datas.length==0){
@@ -281,20 +282,19 @@ class MainSuit extends Component{
   }
 
   // 慢病
-  referRecord() {//是否引用历史病例弹窗
-    const { chronicDesease } = this.props
-    // hideReferRecord && hideReferRecord()
-    // showHistoryCaseModal && showHistoryCaseModal()
+  referRecord() {//是否引用历史病例弹窗--是
+    const { chronicDesease,closeHisBox } = this.props
+    closeHisBox&&closeHisBox();//关闭
     this.setState({
-      showRecord:false,
       showHistoryCase:true
     })
     store.dispatch(initItemList(chronicDesease));
   }
-  noReferRecord() {
-    this.setState({
-      showRecord:false
-    })
+  noReferRecord() {//否
+    const {closeHisBox,autoFillMoudles} = this.props;
+    closeHisBox&&closeHisBox();
+    // 不引用病例 -直接分发模板进行填充
+    autoFillMoudles && autoFillMoudles()
   }
   referCase() {
         const { items } = this.props
@@ -312,11 +312,14 @@ class MainSuit extends Component{
             activeHistory: -1
         })
     }
-  closeHistoryCaseModal() {
+  closeHistoryCaseModal() {//关闭病例列表
+    const {autoFillMoudles} = this.props;
       this.setState({
         activeHistory: -1,
         showHistoryCase:false
       })
+     // 不引用病例直接分发模板进行填充 
+     autoFillMoudles&&autoFillMoudles();
   }
   handleQuoteClick(item, index) {
       console.log('asadsd', item)
@@ -337,8 +340,8 @@ class MainSuit extends Component{
 
 
   render(){
-    const {type,CommonSymptoms,searchData,fetchPushInfos,isRead,totalHide,handleInput,fuzhen,saveText,editClear,datas,commSymHide,boxLeft,boxTop} = this.props;
-    const {showModule,show,symptom,search,showRecord,showHistoryCase} = this.state;
+    const {type,CommonSymptoms,searchData,fetchPushInfos,isRead,totalHide,handleInput,fuzhen,saveText,editClear,datas,commSymHide,boxLeft,boxTop,showHisBox} = this.props;
+    const {showModule,show,symptom,search,showHistoryCase} = this.state;
     const symptomFlag = CommonSymptoms.length>0 ? true : false;
     const searchFlag = searchData.length>0 ? true : false;
     const boxTop1 = datas.length>0?boxTop:45;
@@ -362,7 +365,7 @@ class MainSuit extends Component{
       </ItemBox>
       {/*没有推送结果就不显示*/}
       {symptomFlag && !searchFlag ? <CommonSymptom data={CommonSymptoms} show={!totalHide&&symptom} onSelect={this.handleSelect} /> : ( searchFlag ? <SearchDrop data={searchData} show={!commSymHide} onSelect={this.handleSearchSelect} left={boxLeft1} top={boxTop1} mainEmpty={datas.length==0?true:false}/>:"")}
-      <ConfirmModal visible={showRecord} okText='是' cancelText='否' confirm={this.referRecord}  cancel={this.noReferRecord} close={this.noReferRecord}>
+      <ConfirmModal visible={showHisBox} okText='是' cancelText='否' confirm={this.referRecord}  cancel={this.noReferRecord} close={this.noReferRecord}>
           <div className={style['confirm-info']}>是否引用往期病历</div> 
       </ConfirmModal>
       <ConfirmModal visible={showHistoryCase} noFooter='true' title='请选择历史病历' close={this.closeHistoryCaseModal} titleBg="#DFEAFE" icon={tableIcon} height={300}>

+ 14 - 28
src/components/ScaleTable/index.jsx

@@ -1,8 +1,12 @@
 import React from 'react';
 import style from './index.less';
 import mocks from '../../mock/chronicTable.js'
-
-// 量表 具体信息页面
+ 
+/**
+*量表 具体信息页面
+*title:量表标题
+*data:量表内容
+**/
 class ScaleTable extends React.Component{
   constructor(props){
     super(props);
@@ -14,14 +18,15 @@ class ScaleTable extends React.Component{
   }
 
   render(){
-    const {data} = this.props;
-    const content = data && data[1].content;
+    const {data,title} = this.props;
+    const content = data && data[1].content;//表格内容
+    const preContent = data && data[0].content;//表前文字
+    const footContent = data && data[2].content; //表后文字
     const datas = content && JSON.parse(content);
-    console.log(5555,datas);
 
     return <div className={style['tableBox']}>
-            <h1>密西根糖尿病神经筛查表(MDNS)</h1>
-            <p>MDNS可与MNSI联合应用以确定是否存在周围神经病变,在一段时间内对患者进行评分可以评估疾病的进展情况。</p>
+            <h1>{title}</h1>
+            <div dangerouslySetInnerHTML={{__html:preContent}} className={style['textlh']}></div>
             <table className={style['table']}>
               <thead>
                 <tr>
@@ -36,12 +41,10 @@ class ScaleTable extends React.Component{
                     <td>{v.name}</td>
                     <td>
                       {v.details.map((it,index)=>{
-                        /*return <td style={{display:'block'}}>{it.detailName}</td>*/
                         return <td className={style['block']}>
                           <label>
                             <input type="radio" name={v.name} value={it.score} onChange={this.handleChange}/>{it.detailName}
-                            {/*<span style={{display:+it.state==1?'inline':'none',color:'#3B9ED0'}}>(智能推荐)</span>*/}
-                            <span style={{display:it.detailName=='正常'?'inline':'none',color:'#3B9ED0'}}>(智能推荐)</span>
+                            <span style={{display:it.state==1?'inline':'none',color:'#3B9ED0'}}>(智能推荐)</span>
                           </label>
                         </td>
                       })}
@@ -61,24 +64,7 @@ class ScaleTable extends React.Component{
                 </tr>
               </tfoot>
             </table>
-            <div>
-              <p>
-                1. 计算方法:<br/>
-              感觉损伤得分=左右两侧感觉检查项目的分数之和<br/>
-              肌力得分=左右两侧肌力检查项目的分数之和<br/>
-              反射得分=左右两侧反射检查项目的分数之和<br/>
-              体格检查得分=感觉损伤得分+肌力得分+反射得分
-              </p>
-              <p>
-                2. 临床体格检查部分:<br/>
-              最低得分0  最高得分46, 分数越高,周围神经病越重
-              </p>
-              {datas&&datas.calculate.range.map((v,i)=>{
-                return <p>
-                  <span>{v.min}~{v.max}</span>&nbsp;<span>{v.text}</span>
-                </p>
-              })}
-            </div>
+            <div dangerouslySetInnerHTML={{__html:footContent}} className={style['textlh']}></div>
           </div>
   }
 }

+ 17 - 5
src/components/ScaleTable/index.less

@@ -14,11 +14,6 @@
   margin: 10px 0 10px;
   border-top: 10px solid #D8D8D8;
   border-bottom: 10px solid #D8D8D8;
-  thead,tfoot{
-    tr{
-      height: 54px;
-    }
-  }
   tr{
     border-bottom: 1px solid #979797;
     td{
@@ -26,10 +21,27 @@
       padding: 7px 0;
     }
   }
+  thead,tfoot{
+    tr{
+      height: 54px;
+    }
+    td{
+      color:#000;
+      font-weight: bold;
+    }
+  }
   .sum{
     text-align: right;
   }
   .block{
     display: block;
   }
+}
+strong{
+  font-weight: bold;
+}
+.textlh{
+  p{
+    line-height: 22px;
+  }
 }

+ 1 - 0
src/containers/ChronicInfo.js

@@ -10,6 +10,7 @@ function mapStateToProps(state){
     tableList: state.pushMessage.tableList,
     showList: state.pushMessage.showList,
     scaleInfo: state.pushMessage.scaleInfo,//量表明细
+    chronicDesease:state.mainSuit.chronicDesease,//主诉存的慢病
   }
 }
 

+ 2 - 1
src/containers/CurrentIll.js

@@ -42,7 +42,8 @@ function mapStateToProps(state) { //console.log(111,state);
         boxTop:state.homePage.boxTop,
         boxLeft:state.homePage.boxLeft,
         allModules:state.homePage.allModules,
-        isChronic:!!state.diagnosticList.chronicMagItem
+        // isChronic:!!state.diagnosticList.chronicMagItem,
+        isChronic:!!state.mainSuit.chronicDesease,
 
     }
 }

+ 15 - 3
src/containers/MainSuit.js

@@ -1,7 +1,7 @@
 import React from 'react';
 import { connect } from 'react-redux';
 import MainSuit from '@components/MainSuit';
-import {CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,CLEAR_SEARCH,SET_SEARCH,SAVE_FREE,SET_DATA,INSERT_SEARCH,SETTEXTMODEVALUE,SET_FEATURE,SAVE_CHRONIC} from '@store/types/mainSuit';
+import {CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,CLEAR_SEARCH,SET_SEARCH,SAVE_FREE,SET_DATA,INSERT_SEARCH,SETTEXTMODEVALUE,SET_FEATURE,SAVE_CHRONIC,SHOW_HISTORY_BOX,HIDE_HISTORY_BOX} from '@store/types/mainSuit';
 import {RESET,CLICKCOUNT,ISREAD,SEARCH_DROP_LOCATION,MODI_LOADING} from '@store/types/homePage.js';
 import {getCommSymptoms,getCommSymptomPush} from '@store/async-actions/mainSuit.js'
 import {SET_MAIN_SUIT} from '@store/types/fillInfo';
@@ -12,6 +12,7 @@ import {filterArr,didPushParamChange,filterDataArr} from '@utils/tools.js';
 import config from '@config/index.js';
 import {Notify} from '@commonComp';
 import {getInitModules} from '@store/async-actions/homePage.js';
+import {CURRENT_CHRONIC} from '@store/types/currentIll'
 
 function mapStateToProps(state) {//console.log(11,state);
   return {
@@ -41,6 +42,7 @@ function mapStateToProps(state) {//console.log(11,state);
     allModules:state.homePage.allModules,
     chronicDesease:state.mainSuit.chronicDesease,
     items:state.historyTemplates.items,
+    showHisBox:state.mainSuit.showHisBox,
   }
 }
 
@@ -187,22 +189,32 @@ function mapDispatchToProps(dispatch) {
         }
       },
       async saveChronic(item){//储存慢病信息
+        // 页面已有数据不再请求
+        
         // loading
         dispatch({type:MODI_LOADING,flag:true});
+        // 存慢病
         dispatch({
           type:SAVE_CHRONIC,
           data:item
         })
-        // 弹窗是否引用历史病例?
-
         // 取模板
         await dispatch(getInitModules);
         // 模板回来关闭;loading
         dispatch({type:MODI_LOADING,flag:false});
+        // 弹窗是否引用历史病例?
+        dispatch({type:SHOW_HISTORY_BOX});
+
+      },
+      closeHisBox(){
+        dispatch({type:HIDE_HISTORY_BOX})
       },
       getBilling: () => {
         dispatch(billing())
       },
+      autoFillMoudles(){//自动填充模板
+        dispatch({type:CURRENT_CHRONIC})//现病史
+      }
     }
 }
 

+ 28 - 14
src/store/actions/currentIll.js

@@ -25,20 +25,25 @@ export const setModule = (state,action)=>{
   const originalSonData = action.processModule;
   let spreadLabels=[];
   let sonSpreadLabels=[];//子模板
-  for(let i=0; i<originalData.length;i++){
-    if(originalData[i].tagType==4){
-      spreadLabels.push(...originalData[i].questionMapping);
-    }else{
-      spreadLabels.push(originalData[i]);
+  if(originalData&&originalData.length>0){
+    for(let i=0; i<originalData.length;i++){
+      if(originalData[i].tagType==4){
+        spreadLabels.push(...originalData[i].questionMapping);
+      }else{
+        spreadLabels.push(originalData[i]);
+      }
     }
   }
-  for(let j=0; j<originalSonData.length;j++){
-    if(originalSonData[j].tagType==4){
-      sonSpreadLabels.push(...originalSonData[j].questionMapping);
-    }else{
-      sonSpreadLabels.push(originalSonData[j]);
+  if(originalSonData&&originalSonData.length>0){
+    for(let j=0; j<originalSonData.length;j++){
+      if(originalSonData[j].tagType==4){
+        sonSpreadLabels.push(...originalSonData[j].questionMapping);
+      }else{
+        sonSpreadLabels.push(originalSonData[j]);
+      }
     }
   }
+  
   // res.moduleData = action.data;
   // res.processModule = action.processModule;//病程变化模板
   res.moduleData = spreadLabels;
@@ -88,6 +93,16 @@ function addPos(data,num){
   return newData;
 }
 
+//慢病填充模板
+export const fillChronicModule = (state,action)=>{
+  let res = Object.assign({},state);
+  let moduleData = JSON.parse(JSON.stringify(res.moduleData));//现病史模板
+  res.data = fullfillText(moduleData).newArr;
+  res.saveText = fullfillText(res.data).saveText;
+  res.update=Math.random();
+  return res;
+}
+
 //聚焦时设置 现病史模板
 export const setData = (state,action) =>{
   let res = Object.assign({},state);
@@ -120,18 +135,17 @@ export const setData = (state,action) =>{
   
 
   // 是慢病,暂且使用现病史慢病模板,不区分空模板
-  if(isChronic){
+  /*if(isChronic){
     res.data = fullfillText(moduleData).newArr;
     res.saveText = fullfillText(res.data).saveText;
     res.update=Math.random();
     return res;
-  }
+  }*/
 
   /****************************************/
   // 是否使用空模板:num=0时判断mainIds,num>=1,截取第一病程遍历是否有症状exist
   if(num==0){
-    // useEmpty = mainIds.length>0 ? false:true;
-    useEmpty = mainIds.length==0 && !symptomFeature || symptomFeature.length==0? true:false;
+    useEmpty = mainIds.length>0 ? false:true;
     mainData = mainModleData;
   }else{
     // 模板也分词时得加上分词结果的判断

+ 2 - 0
src/store/actions/mainSuit.js

@@ -667,6 +667,7 @@ export const clearMainSuit = (state,action)=>{//回读和清除
   // res.saveText = fullfillText(action.data).saveText;//解决删除data里的值保存,回读后页面上有内容saveText里没有的情况
   res.selecteds = action.selecteds?action.selecteds:[];
   res.mainIds = action.mainIds;
+  res.chronicDesease = action.chronicDesease;//慢病疾病字段
   if(action.editClear){
     res.editClear = action.editClear;
   }
@@ -676,6 +677,7 @@ export const clearMainSuit = (state,action)=>{//回读和清除
   if(action.symptomFeature !== undefined){//清除分词数据
     res.symptomFeature.featureData = action.symptomFeature;
   }
+  console.log(res,action);
   return res;
 }
 

+ 1 - 0
src/store/actions/pushMessage.js

@@ -222,6 +222,7 @@ export const clearAllPushMessage = (state, action) => {
 	res.determine = [];
 	res.assay = [];
 	res.check = [];
+  res.medicalIndications = [];//量表
 	return res;
 }
 

+ 30 - 22
src/store/async-actions/homePage.js

@@ -44,7 +44,7 @@ export const getInitModules= (dispatch,getStore)=>{
   // return json(api.getModules,{age:message.patientAge,sexType:message.sex}).then((res) => {
   return json(api.getModules,param).then((res) => {
       dispatch(initHistoryDetails(message));      //历史病历回读
-      if (res.data.code == '0') {//console.log('糖尿病模板',chronicId,res.data.data);
+      if (res.data.code == '0') {
         const newObj = modulesParseJson(res.data.data);
         const initData = newObj.json;
         const initSaveText = newObj.saveTextJson;
@@ -58,27 +58,35 @@ export const getInitModules= (dispatch,getStore)=>{
           type: SETINITDATA,
           data: initData
         });
-        dispatch({
-          type:SET_MAINSUIT,
-          // data:fullfillText(initData.mainSuit).newArr,
-          // addSymptom:fullfillText(initData.addSymptom).newArr,
-          data:initData.mainSuit,
-          addSymptom:initData.addSymptom,
-          addModuleName:initModuleName.addSymptom,//模板名称
-		      // save:initSaveText.mainSuit
-        });
-        dispatch({
-          type:SET_CURRENT,
-          data:formatContinueDots(initData.current),
-          save:initSaveText.current,
-          // processModule:formatContinueDots(initData.process),//病程变化
-          // processModuleName:initModuleName.process,//病程变化模板名称
-          processModule:[],//病程变化
-          processModuleName:'',//病程变化模板名称
-          saveProcess:initSaveText.process,
-          emptyData:formatContinueDots(initData.currentEmpty),//现病史空模板
-          saveEmpty:initSaveText.currentEmpty,
-        });
+        if(!chronicId){//普通病
+          dispatch({
+            type:SET_MAINSUIT,
+            data:fullfillText(initData.mainSuit).newArr,
+            addSymptom:fullfillText(initData.addSymptom).newArr,
+            // addModuleName:initModuleName.addSymptom,//模板名称
+            save:initSaveText.mainSuit
+          });
+          dispatch({
+            type:SET_CURRENT,
+            data:formatContinueDots(initData.current),
+            save:initSaveText.current,
+            processModule:formatContinueDots(initData.process),//病程变化
+            processModuleName:initModuleName.process,//病程变化模板名称
+            saveProcess:initSaveText.process,
+            emptyData:formatContinueDots(initData.currentEmpty),//现病史空模板
+            saveEmpty:initSaveText.currentEmpty,
+          });
+        }else{//慢病--没有主诉模板
+          dispatch({
+            type:SET_CURRENT,
+            data:formatContinueDots(initData.current),
+            save:initSaveText.current,
+            processModule:formatContinueDots(initData.process),//病程变化
+            processModuleName:initModuleName.process,//病程变化模板名称
+            // saveProcess:initSaveText.process,
+          });
+        }
+
         dispatch(getOtherHisRecord());          //获取其他史最近记录
       }
     })

+ 4 - 2
src/store/reducers/currentIll.js

@@ -2,10 +2,10 @@
 import {SET_CURRENT,CURRENT_CONFIRM,INSERT_PROCESS,SET_CURRENT_DATA,SET_LABEL_MODULE,SETMAINCHECKBOX,
   CURRENT_RADIO,CURRENT_NUMBER,CURRENT_TEXT_LABEL,CLEAR_CURRENT_ILL,SETTEXTMODEVALUE,CURRENT_GET_BIGDATAPUSH,CURRENT_CLEAR,
   SET_CURRENT_SEARCH,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,SELECT_SEARCHDATA,CLEAR_CURRENT_EDIT,CURRENTADDLABELITEM,
-  SETCURRENTINPUT,DEL_CURRENT,CURRENT_TEXT_LABEL_NUMBER,REMOVE_CURR_ID,CURRENT_MUL,DEL_CURRENT_LABLE,SET_RADIO_INPUT_VALUE} from '../types/currentIll';
+  SETCURRENTINPUT,DEL_CURRENT,CURRENT_TEXT_LABEL_NUMBER,REMOVE_CURR_ID,CURRENT_MUL,DEL_CURRENT_LABLE,SET_RADIO_INPUT_VALUE,CURRENT_CHRONIC} from '../types/currentIll';
 import {confirm,insertProcess,setData,setCheckBox,setRadioValue,setNumberValue,changeLabelVal,clearCurrentIll,
   setTextModeValue,setModule,bigDataSymptom,setCheckText,insertLabelData,clearCurrentEdit,addLabelItem,setInputLabel,
-  backspaceText,changeNumLabelVal,removeId,multipleComfirn,delSingleLable,setRadioInputValue} from '../actions/currentIll';
+  backspaceText,changeNumLabelVal,removeId,multipleComfirn,delSingleLable,setRadioInputValue,fillChronicModule} from '../actions/currentIll';
 
 const initState = {
   moduleData:[],
@@ -79,6 +79,8 @@ export default function(state=initState,action){
       return delSingleLable(state,action);
     case SET_RADIO_INPUT_VALUE:
       return setRadioInputValue(state,action);
+    case CURRENT_CHRONIC:
+      return fillChronicModule(state,action);
     default:
       return state;
   }

+ 7 - 1
src/store/reducers/mainSuit.js

@@ -2,7 +2,7 @@ import {COMM_SYMPTOMS,CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,
   SET_SEARCH,CLEAR_SEARCH,GET_BIGDATAPUSH,SET_MAINSUIT,MIX_CONFIRM,NUMBER_SELECT,
   RADIO_SELECT,COMM_CONFIRM,CHANGE_LABELVAL,SAVE_FREE,CLEAR_MAIN_SUIT,SET_DATA,
   INSERT_SEARCH,MAIN_FOCUS_INDEX,SETTEXTMODEVALUE,SETMAINTEXT,MAINADDLABELITEM,SETMAININPUT,DEL_MAIN,CHANGE_LABELVAL_NUMBER,
-  REMOVE_MAIN_ID,MAINSUIT_MUL,DEL_MAIN_LABLE,SET_FEATURE,SET_MS_RADIO_INPUT_VAL,SAVE_CHRONIC} from '../types/mainSuit'
+  REMOVE_MAIN_ID,MAINSUIT_MUL,DEL_MAIN_LABLE,SET_FEATURE,SET_MS_RADIO_INPUT_VAL,SAVE_CHRONIC,SHOW_HISTORY_BOX,HIDE_HISTORY_BOX} from '../types/mainSuit'
 import {getCommSymptoms,handleTailClick,insertMain,setSearch,getBigSymptom,setMainMoudle,confirm,
   setNumberValue,setRadioValue,commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,setCheckText,
   addLabelItem,setInputLabel,backspaceText,changeNumLabelVal,removeId,multipleComfirn,delSingleLable,
@@ -102,6 +102,12 @@ export default function(state=initState,action){
     case SAVE_CHRONIC:
       res.chronicDesease = action.data;
       return res;
+    case SHOW_HISTORY_BOX://显示是否引用历史病例弹窗
+      res.showHisBox = true;
+      return res;
+    case HIDE_HISTORY_BOX://关闭
+      res.showHisBox = false;
+      return res;
     default:
       return state;
   }

+ 1 - 0
src/store/types/currentIll.js

@@ -26,4 +26,5 @@ export const REMOVE_CURR_ID = 'REMOVE_CURR_ID';     //删除后移除id
 export const CURRENT_MUL = 'CURRENT_MUL';     //单列多选
 export const DEL_CURRENT_LABLE = 'DEL_CURRENT_LABLE';     //
 export const SET_RADIO_INPUT_VALUE = 'SET_RADIO_INPUT_VALUE';
+export const CURRENT_CHRONIC = 'CURRENT_CHRONIC';//慢病填充模板
 

+ 2 - 0
src/store/types/mainSuit.js

@@ -29,3 +29,5 @@ export const DEL_MAIN_LABLE = 'DEL_MAIN_LABLE';
 export const SET_FEATURE = 'SET_FEATURE';  //主诉分词
 export const SET_MS_RADIO_INPUT_VAL = 'SET_MS_RADIO_INPUT_VAL';
 export const SAVE_CHRONIC = 'SAVE_CHRONIC'; //储存慢病信息
+export const SHOW_HISTORY_BOX = 'SHOW_HISTORY_BOX'; //是否引用历史病例弹窗
+export const HIDE_HISTORY_BOX = 'HIDE_HISTORY_BOX'; //关闭是否引用历史病例弹窗

+ 2 - 1
src/utils/ajax.js

@@ -5,7 +5,8 @@ $.support.cors = true;
 const axios=require('axios');
 const qs=require('querystring');
 const isLocal = window.location.hostname.indexOf('localhost')!=-1;
-const qhost = isLocal?host+prefix:prefix;
+// const qhost = isLocal?host+prefix:prefix;
+const qhost = isLocal?host+prefix:host+prefix;
 axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
 //axios.defaults.baseURL = host;       //默认地址
 // axios.defaults.timeout = 60000;       //请求超时

+ 1 - 1
src/utils/config.js

@@ -3,7 +3,7 @@
 const host='http://192.168.2.236:5050';//后端接口访问地址
 // const host='http://192.168.3.11:5050';//王宇
 //const host='http://192.168.2.164:8080';
-// const host='http://192.168.3.117:8080'; //周铁刚
+// const host='http://192.168.3.117:5050'; //周铁刚
 // const newIcssVisitUrl = '223.93.170.82:13000';    //icss服务访问地址(跳转目的地),不能加http://
 const imageUrlPrefix = 'http://192.168.2.241:82'
 module.exports={

+ 23 - 2
src/utils/tools.js

@@ -241,7 +241,7 @@ const getAllDataStringList =(baseList) =>{           //获取所有模块文本
 const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清空所有的数据
     if(action == 'clear'){     //清空
       const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
-      store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[],clearAction:true,symptomFeature:[]});
+      store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[],clearAction:true,symptomFeature:[],chronicDesease:{}});
         store.dispatch({type: CLEAR_CURRENT_ILL,data:[],saveText:[],selecteds:[],editClear:true,symptomIds:[]});
         store.dispatch({type: CLEAROTHERHISTORY,data:[block],isEmpty:true,saveText:[],selecteds:[],editClear:true,yjs_1:'',yjs_2:'',yjs_3:'',yjs_4:''});
         store.dispatch({type: CLEARCHECKBODY,data:[block],isEmpty:true,saveText:[],selecteds:[]});
@@ -693,6 +693,26 @@ function isAllClear(jsonData,jsonStr,baseList){
     return true;
   }
 }
+//判断除主诉外页面数据是否为空--慢病模板
+function ifOtherClear(jsonData,jsonStr,baseList){
+  if (      //结构化和文本数据都为空
+    JSON.stringify(jsonData.advice) == '{}' &&
+    jsonData.present.length < 1 &&
+    (jsonData.other.length > 0 ? baseList.otherHistory.isEmpty : true) &&
+    (jsonData.vital.length > 0 ? baseList.checkBody.isEmpty : true) &&
+    jsonData.diag.length < 1 &&
+    jsonData.pacs.length < 1 &&
+    jsonData.lis.labelList.length < 1 &&
+    jsonData.lis.getExcelDataList.length < 1 &&
+    filterDataArr(JSON.parse(jsonStr.present)) == '' &&
+    filterDataArr(JSON.parse(jsonStr.other)) == '' &&           //这里都是filterDataArr不是filterArr,要去符号的
+    filterDataArr(JSON.parse(jsonStr.vital)) == ''
+  ) {
+    return false;
+  }else{
+    return true;
+  }
+}
 function normalVal(min,max){
   if((min-0) && (max-0)){
       return `正常值: (${min}~${max})`
@@ -844,5 +864,6 @@ module.exports = {
     timestampToTime,
     getPageLength,
     dragBox,
-    formatContinueDots
+    formatContinueDots,
+    ifOtherClear
 };