ソースを参照

Merge branch 'chronicTreat' into dev/new1

zhangxc 5 年 前
コミット
3cc396e35c

+ 71 - 0
src/common/components/HasInfoItem/index.jsx

@@ -0,0 +1,71 @@
+import React,{Component} from 'react';
+import style from './index.less';
+import infoShow from '@common/images/info-show.png';
+import infoMove from '@common/images/info-move.png';
+import $ from 'jquery';
+
+class HasInfoItem extends Component {
+    constructor(props) {
+        super(props)
+        this.state = {
+            hasEnterItem: false,
+            hasEnterImg: false
+        }
+    }
+    handleMouseEnterDrug(){
+        this.setState({
+            hasEnterItem: true
+        })
+    }
+    handleMouseLeaveDrug(){
+        this.setState({
+            hasEnterItem: false
+        })
+    }
+    handleMouseEnterImg(){
+        this.setState({
+            hasEnterImg: true
+        })
+    }
+    handleMouseLeaveImg(){
+        this.setState({
+            hasEnterImg: false
+        })
+    }
+    setDrugInfo(item){
+        const{ setDrugInfo } = this.props
+        setDrugInfo && setDrugInfo(item)
+    }
+    handleSelect(){
+        const{ handleSelect, position } = this.props
+        handleSelect && handleSelect(position)
+    }
+
+    render(){
+        const { item } = this.props
+        const { hasEnterItem, hasEnterImg} = this.state
+        return (<span className={style['drug-name-wrapper']} >
+            <span className={`${style['drug-name']} ${item.forbidden === '2' ? style['disabled']: item.selected ?  style['selected'] : ''}`}  
+                // onDoubleClick={() =>{this.setDrugInfo(it);showDrugInfo();}}  //药品说明双击显示(现在为点击图标显示)
+                onClick={()=>{item.forbidden === '2' ? '' : this.handleSelect()}} 
+                onMouseEnter={this.handleMouseEnterDrug.bind(this)}
+                onMouseLeave = {this.handleMouseLeaveDrug.bind(this)}
+                >
+                {item.medicitionName}
+                {<img className={`${style['info-img']} ${hasEnterItem?style['show-content']:style['hide-content']}`}  
+                title='点击i图标可查看详细说明'
+                src={hasEnterImg?infoMove:infoShow} 
+                onMouseEnter={this.handleMouseEnterImg.bind(this)}
+                onMouseLeave = {this.handleMouseLeaveImg.bind(this)}
+                onClick={this.setDrugInfo.bind(this,item)}/>}
+            </span>
+            {(item.forbidden === '1'||item.forbidden === '2') && <span className={`${style['info-flag']} ${item.forbidden === '1' ? style['cautious']:item.forbidden === '2'?style['disabled']:''}`}>
+                {item.forbidden === '1' ? "慎用":item.forbidden === '2'? "禁用":""} 
+            </span>}
+        {/*<span  style={item.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)'} : ''}> 使用率{item.rate}</span>*/}
+
+    </span>)
+    }
+}
+
+export default HasInfoItem;

+ 62 - 0
src/common/components/HasInfoItem/index.less

@@ -0,0 +1,62 @@
+
+
+.drug-name-wrapper {
+    position: relative;
+    margin-right: 6px;
+    &:not(:last-child):after{
+        display: inline;
+        content: ' ,';
+    }
+}
+.drug-name {
+    border-bottom: 1px solid #666;
+    display: inline-block;
+    height: 30px;
+    cursor: pointer;
+    position: relative;
+}
+.info-img, .info-img-more {
+    width: 12px;
+    margin: 0 3px -1px;
+    cursor: pointer;
+}
+.info-img {
+    width: 15px;
+    position: absolute;
+    top: -5px;
+    left: 50%;
+    margin-left: -7px;
+    cursor: pointer;
+}
+.info-flag {
+    display: inline-block;
+    width: 34px;
+    height: 16px;
+    line-height: 16px;
+    border-radius: 4px;
+    text-align: center;
+    margin: 0 0 0 5px;
+    border: 1px solid #000;
+    position: relative;
+    top: 2px;
+}
+.show-content {
+    display: inline-block;
+}
+.hide-content{
+    display: none;
+}
+.disabled{
+    opacity: 0.3;
+    filter:alpha(opacity=30);
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=30);";
+}
+.selected {
+    color: #3B9ED0;
+    border-bottom: 1px solid #3B9ED0;
+}
+.cautious {
+    border: 1px solid #F4C051;
+    background: #F4C051;
+}
+

+ 26 - 12
src/components/Advice/index.jsx

@@ -67,19 +67,33 @@ class Advice extends Component{
   render(){
     const {advice} = this.props.pushMessage;
     const {isRead, isFirstMainDiag, followUp, hasFollowUp, saveFollowUp, typeConfig} = this.props
-    let scheme = advice.scheme && advice.scheme.map((item, index) => {
-      return <p>{item.treatment.map((it,ii) =>{
-        return(it.treatmentStr && it.treatmentStr.length > 0 ? 
-          <div>
-            { it.treatmentStr }
-            {/* <input className={style['treat-input']} ref={this.treatInput} onInput={(e)=>{this.handleTreatInput(e, index, ii)}} type='text' value={ it.treatmentStr }/>  */}
-          </div>: '') 
-
-        // return <div>{it.drugs.length > 0 ? it.name : ''}: {it.drugs.map((drug, drugIndex) =>{
-        //   return(<span>{drug.selected ? (drugIndex === 0 ? drug.name : '  ' + drug.name) : ''}</span>)
-        // })}</div>
-      })}</p>
+    let scheme = advice.scheme && advice.scheme.map((item0, index0) => {
+      return <p>
+        {item0.treatment.map((item1, index1) => {
+          return item1.meditionDetails.map((item2, index2) => {
+              return item2.treatment.map((item3, index3) => {
+                return(item3.treatmentStr && item3.treatmentStr.length > 0 ?
+                  <div>
+                    { item3.treatmentStr }
+                  </div>: '')
+              })
+          })
+        })}
+      </p>
     })
+    // let scheme = advice.scheme && advice.scheme.map((item, index) => {
+    //   return <p>{item.treatment.map((it,ii) =>{
+    //     return(it.treatmentStr && it.treatmentStr.length > 0 ? 
+    //       <div>
+    //         { it.treatmentStr }
+    //         {/* <input className={style['treat-input']} ref={this.treatInput} onInput={(e)=>{this.handleTreatInput(e, index, ii)}} type='text' value={ it.treatmentStr }/>  */}
+    //       </div>: '') 
+
+    //     // return <div>{it.drugs.length > 0 ? it.name : ''}: {it.drugs.map((drug, drugIndex) =>{
+    //     //   return(<span>{drug.selected ? (drugIndex === 0 ? drug.name : '  ' + drug.name) : ''}</span>)
+    //     // })}</div>
+    //   })}</p>
+    // })
 
     return  <div id="adviceBox" className={`${'mainsuit-box'} ${style['main-suit']}`}>
       <ItemBox title='医嘱' editable={false} border={true} marginTop="10px">

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

@@ -288,7 +288,7 @@ class DiagnosticList extends Component {
                     {list && (list.length > 0) && list.map((item, index) => {
                         const hasTreat = item.treat && ((item.treat.commonTreatment&&item.treat.commonTreatment.content) || (item.treat.surgeryTreatment&&item.treat.surgeryTreatment.content) || item.treat.treatment.length>0 ||(item.adverseReactions&&item.adverseReactions.length > 0)
                            || (item.drugHistory && item.drugHistory['慢病用药内容'] &&  item.drugHistory['慢病用药内容'].length > 0) || (item.drugHistory &&item.drugHistory['普通病用药内容'] &&  item.drugHistory['普通病用药内容'].length > 0) ||item.follow)
-                        isChronic = chronicMagItem&&item.type==2&&chronicList.findIndex((it)=>it.conceptId==item.conceptId)!=-1;
+                        isChronic = chronicMagItem&&item.type==2&&chronicList&&chronicList.findIndex((it)=>it.conceptId==item.conceptId)!=-1;
                         return (<div draggable={true} className={style['diag-box'] + ' clearfix'} id="diagListBox" key={item.conceptId} >
                                     {index === 0 ? '' : <span className={style['diag-up']} onClick={() => {this.upDiagnostic(index)}}><img className={style["diag-up"]} src={diagUp}/></span>}
                                     {list.length === 1 ? '' : index !== 0 ? '' : <span onClick={() => {this.downDiagnostic(index)}} className={style['diag-down']}><img className={style["diag-down"]} src={diagDown}/></span>}

+ 37 - 35
src/components/Treat/DrugTreat/index.jsx

@@ -6,6 +6,7 @@ import info2 from './../img/info2.png';
 import info3 from './../img/info3.png';
 import drugIcon from './../img/drug.png';
 import more from '@common/images/addItem1.png';
+import HasInfoItem from '@common/components/HasInfoItem'
 import $ from "jquery";
 
 class DrugTreat extends Component {
@@ -22,10 +23,9 @@ class DrugTreat extends Component {
         this.handleMouseLeaveImg = this.handleMouseLeaveImg.bind(this);
         this.getImg = this.getImg.bind(this);
     }
-
-    handleSelect(index,ii) {
+    handleSelect(position) {
         const { selectDrug } = this.props;
-        selectDrug && selectDrug(index,ii);
+        selectDrug && selectDrug(position);
     }
     handleMouseEnterDrug(ii, index, it) {
         this.setState({
@@ -48,10 +48,10 @@ class DrugTreat extends Component {
             hasEnterImg: false
         })
     }
-    setOtherRecommend(item, index) {
+    setOtherRecommend( position) {
         this.showTreatDesc();
         const { setOtherRecommend } = this.props;
-        setOtherRecommend && setOtherRecommend(item, index);
+        setOtherRecommend && setOtherRecommend(position);
     }
     setDrugInfo(item) {
         const { setDrugInfo } = this.props;
@@ -79,47 +79,49 @@ class DrugTreat extends Component {
     }
 
     render(){
-        const { treatment,showDrugInfo } = this.props
+        const { treatmentPlan,showDrugInfo } = this.props
         const { currentImg, currentIndex, hasEnterImg } = this.state
         return(
-            treatment && treatment.length > 0 && <div className={style['drug-box']}>
+            treatmentPlan && treatmentPlan.length > 0 && <div className={style['drug-box']}>
                 <h3 className={style['drug-title']}><img className={style['drug-icon']} src={drugIcon}/> 常用药物治疗</h3>
                 {/* 查看药物说明书 (添加数据查看数据用)*/}
                 {/* <div> <input onInput={this.handleInputDrug.bind(this)} style={{border:'1px solid #000'}} type="text"/><button onClick = {this.searchDrug.bind(this)}>搜索药品说明</button></div> */}
-                {treatment.map((item, index) => {
-                    return(<div className={style['drug-content']}>
-                        <div  className={style['drug-name-box']}>
-                            <span style={item.drugsForbidden === '2'? {opacity: '0.3', filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)'} : ''}>{index + 1 + '. ' }{item.bigdrugsName}<span>{item.subdrugsName && '('+item.subdrugsName+')'}</span>:&nbsp;</span>
-                            {item.medicitionsList.map((it, ii) => {
-                                return ((it.isShow == 1 || it.selected) &&<span onMouseEnter={this.handleMouseEnterDrug.bind(this, ii , index, it)}
-                                              onMouseLeave = {this.handleMouseLeaveDrug}
-                                              className={style['drug-name-wrapper']} 
-                                        >
-                                            <span className={style['drug-name']}  
-                                                // onDoubleClick={() =>{this.setDrugInfo(it);showDrugInfo();}}  //药品说明双击显示(现在为点击图标显示)
-                                                onClick={()=>{it.forbidden === '2' ? '' : this.handleSelect(index,ii)}} 
-                                                style={it.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)'} : it.selected ? {color: '#3B9ED0', borderBottom: '1px solid #3B9ED0'}:''}
+                {treatmentPlan.map((item0, index0) =>{
+                    return(<div className={`${style['diag-content-box']} clearfix`}>
+                        <div className={style['diag-content-title']}><i  className={style['diag-content-circle']}></i>{item0.title}</div>
+                        {item0.meditionDetails.map((item1,index1) => {
+                            return (<div  className={`${style['diag-content']} clearfix`}>
+                                {item1.description&&<div className={style['diag-content-description']}>{item1.description}</div>}
+                                
+                                {item1.treatment.map((item2,index2)=>{
+                                    return (<div className={`${style['drug-item']} clearfix`}>
+                                        <div  className={style['drug-name-box']}>
+                                            <span style={item2.drugsForbidden === '2'? {opacity: '0.3', filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)'} : ''}>{index2 + 1 + '. ' }<span>{item2.subdrugsName}</span>:&nbsp;</span>
+                                            {item2.medicitionsList.map((item3, index3) => {
+                                                return ((item3.isShow == 1 || item3.selected) &&  <HasInfoItem 
+                                                    item = {item3}
+                                                    setDrugInfo = {this.setDrugInfo}
+                                                    position = {[index0, index1, index2, index3]}
+                                                    handleSelect = {this.handleSelect}
                                                 >
-                                                {it.medicitionName}
-                                            </span>
-                                            {<img className={style['info-img']}  
-                                              title='点击i图标可查看详细说明'
-                                              style ={currentIndex === index ? (ii === currentImg ? {display: "inline-block"} : {display: "none"}) : {display: "none"}}
-                                              src={currentIndex === index ? (ii === currentImg ? (hasEnterImg ? info3 : info2) : info2): info2} 
-                                              onMouseEnter={this.handleMouseEnterImg.bind(this, ii, index)}
-                                              onMouseLeave = {this.handleMouseLeaveImg}
-                                              onClick={this.setDrugInfo.bind(this,it)}/>}
-                                        {it.forbidden === '1' ? <span className={style['info-flag']} style={{border: '1px solid #F4C051', background: '#F4C051',marginLeft: '5px'}}>慎用</span>: it.forbidden === '2' ? <span className={style['info-flag']} style={{opacity: '0.3',filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)',border: '1px solid #000',marginLeft: '5px'}}>禁用</span> : ''}
-                                        {/*<span  style={it.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)'} : ''}> 使用率{it.rate}</span>*/}
 
-                                    </span>)
+                                                </HasInfoItem>
+                                                )
+
+                                            })}
+                                        </div>
+                                        {<div className={style['drug-more']} onClick={this.setOtherRecommend.bind(this, [index0,index1,index2])} ><img className={style['info-img-more']} src={more} />更多同类药</div> }
+                                </div>)
                             })}
 
-                        </div>
-                        {<div className={style['drug-more']} onClick={() =>this.setOtherRecommend(item, index)} ><img className={style['info-img-more']} src={more} />更多同类药</div> }
-                        
+
+                            </div>)
+
+                        })}
                     </div>)
                 })}
+                
+                
             </div>
         )
     }

+ 31 - 1
src/components/Treat/DrugTreat/index.less

@@ -12,7 +12,7 @@
     float: left;
     margin: 10px;
 }
-.drug-content {
+.drug-item {
     position: relative;
     line-height: 36px;
     border-bottom: 1px dashed #D2D2D2;
@@ -68,4 +68,34 @@
 .drug-content{zoom:1}
 .drug-more:hover {
     color: #3B9ED0;
+}
+
+.diag-content-box{
+    border:1px solid #D2D2D2;
+    margin: 10px 0;
+    padding: 10px 10px 0 10px;
+}
+.diag-content-title{
+    color: #3B9ED0;
+    line-height: 16px;
+    position: relative;
+    margin: 0 0 10px 0;
+}
+.diag-content-circle{
+    position: relative;
+    display: inline-block;
+    width:4px;
+    height:4px;
+    background: #3B9ED0;
+    border-radius: 50%;
+    top: -4px;
+    margin-right: 6px;
+}
+.diag-content {
+    margin: 10px 0 20px 0;
+}
+.diag-content-description{
+    color: #333333;
+    font-weight: 600;
+    margin: 5px 0 10px 0;
 }

+ 24 - 3
src/components/Treat/GeneralTreat/index.jsx

@@ -1,18 +1,39 @@
 import React, { Component } from 'react';
 import style from './index.less';
+import up from '@common/images/slide-up.png';
+import down from '@common/images/slide-down.png';
+import $ from 'jquery';
+import config from '@config/index';
 
 class GeneralTreat extends Component {
     constructor(props){
         super(props);
+        this.state = {
+            slideUp: false
+        }
+        this.$content = React.createRef();
     }
 
+    slideToggle() {
+        const { slideUp } = this.state
+        $(this.$content.current).slideToggle(config.slideTime);
+        this.setState({
+            slideUp: !slideUp
+        })
+    }
     render() {
-        const { icon, titleStyle,titleBg, filter, title, generalTreat } = this.props
+        const { icon, titleStyle,titleBg, filter, title, generalTreat,hasFold } = this.props
+        const { slideUp } = this.state
         return(
+           
             generalTreat && generalTreat.content && generalTreat.content.length > 0 && <div className={style['general-wrapper']}>
                 <div className={style['general-title-box']} style={titleStyle}></div>
-                <div className={style['general-title']} ><img className={style['general-icon']} src={icon}/>{title}</div>
-                <div className={style['general-item']} dangerouslySetInnerHTML={{__html: generalTreat.content}}>
+                <div className={`${style['general-title']} ${'clearfix'}`}  onClick={hasFold?this.slideToggle.bind(this):''}>
+                    <img className={style['general-icon']} src={icon}/>
+                    {title}
+                    {hasFold && <img  className={style['slide-toggle']} src={slideUp?up:down} alt="展开/收起"/>}
+                </div>
+                <div ref={this.$content} className={hasFold?style['general-item-hide']:style['general-item-show']}  dangerouslySetInnerHTML={{__html: generalTreat.content}}>
                 </div>
 
             </div>

+ 12 - 2
src/components/Treat/GeneralTreat/index.less

@@ -23,7 +23,17 @@
     float: left;
     margin: 10px;
 }
-.general-item {
-    
+.general-item-hide {
+    display: none;
     line-height: 36px;
+}
+.general-item-show {
+    display: block;
+    line-height: 36px;
+}
+.slide-toggle {
+    position: relative;
+    float: right;
+    top: 8px;
+    right: 10px;
 }

+ 3 - 3
src/components/Treat/index.jsx

@@ -82,7 +82,7 @@ class Treat extends Component {
                     <div onMouseDown={this.setTreatBox} id="dragModalTitle" className={style['treat-title']}>治疗方案 ({treatItem.name})</div>
 
                     <div className={style['treat-inner-box']}>
-                        <GeneralTreat icon={generalIcon} title='一般治疗'   generalTreat={generalTreat}></GeneralTreat>
+                        <GeneralTreat icon={generalIcon} title='一般治疗' hasFold="true"  generalTreat={generalTreat}></GeneralTreat>
                         {hasFollowUp && <FollowUp icon={followUpIcon} title='回访时间' noTitle='true'  setFollowUp={setFollowUp} followUp = {followUp} isRead={isRead}></FollowUp>}
                         {/* 回访时间 */}
                         {/* {followUp && <div>回访时间: 
@@ -106,7 +106,7 @@ class Treat extends Component {
                             showDrugInfo = {showDrugInfo} 
                             setDrugInfo={ setDrugInfo }>
                         </AdverseReactions>}
-                        <DrugTreat treatment={ treatment } 
+                        <DrugTreat treatmentPlan={ treatment } 
                                 selectDrug={selectDrug} 
                                 setOtherRecommend={ setOtherRecommend } 
                                 showDrugInfo = {showDrugInfo}
@@ -119,7 +119,7 @@ class Treat extends Component {
                     <div className={style['bottom']}>
                         <span className={style['prescription-btn']} onClick={this.handlePrescription}>开处方</span> <span className={style['determine-btn']} onClick={this.handleDetermine}>确定</span>
                     </div>
-                    {treatDesc && <TreatDesc 
+                    {<TreatDesc 
                     treatment={treatment} 
                     treatDesc={treatDesc} 
                     selectDrug={selectDrug} 

+ 27 - 36
src/components/TreatDesc/index.jsx

@@ -7,6 +7,7 @@ import info1 from './img/info1.png';
 import info2 from './img/info2.png';
 import info3 from './img/info3.png';
 import packUp from './img/packUp.png';
+import HasInfoItem from '@common/components/HasInfoItem'
 
 class TreatDesc extends Component {
     constructor(props){
@@ -21,6 +22,7 @@ class TreatDesc extends Component {
         this.handleMouseLeaveDrug = this.handleMouseLeaveDrug.bind(this)
         this.handleMouseEnterImg = this.handleMouseEnterImg.bind(this)
         this.handleMouseLeaveImg = this.handleMouseLeaveImg.bind(this)
+        this.getPosition = this.getPosition.bind(this)
 
     }
 
@@ -51,21 +53,33 @@ class TreatDesc extends Component {
             hasEnterImg: false
         })
     }
-    handleSelect(index,ii) {
+    handleSelect(position) {
+
         const { selectDrug } = this.props;
-        selectDrug && selectDrug(index,ii);
+        selectDrug && selectDrug(position);
     }
     hideTreatDesc() {
         $('#treatDescBox').css({'display': 'none'});
         $('#treatDescBox').animate({'display': 'none'}, 500);
         $('#dragModalWrap').animate({'margin-left': '-340px','left':'50%'}, 500);
     }
+    getPosition(index) {
+        const {position} =this.props.treatDesc
+       const newPos = position.slice()
+       newPos.push(index)
+        return newPos
+    }
 
     render(){
         const  { treatment, treatDesc, setDrugInfo} = this.props
-        const { title, basic, otherDrugIndex, drugDesc} = treatDesc
+        const { title, basic, position, drugDesc} = treatDesc
         const { currentIndex, hasEnterImg } = this.state
+        let treatmentItem
+        if(position) {
+           treatmentItem = treatment[position[0]].meditionDetails[position[1]].treatment[position[2]]
+        }
         return (treatment && treatment.length >0 && <div  className={style['treat-desc-box']+" "+"clearfix" }>
+
             {title && title === '药品推荐' ? <div className={style['similar-drug-box']} id='treatDescBox'>
                 {/* { basic && basic.length > 0 && <div> //推荐依据不需要展示
                     <h3 className={style['recommend-title']}>推荐依据</h3>
@@ -74,41 +88,18 @@ class TreatDesc extends Component {
                         </div>)
                     })}
                 </div> } */}
-                { otherDrugIndex > -1 && <div  className={style['similar-drug-wrapper'] +" "+"clearfix" }>
-                        <h3 className={style['drug-desc-title']}><span className={style['drug-desc-class-title']} title={'同类药物(' + treatment[otherDrugIndex].bigdrugsName + ')'}>同类药物({treatment[otherDrugIndex].bigdrugsName})</span>  <img src={packUp} onClick={this.hideTreatDesc} className={style['close-drug-desc']} /></h3>
+                {position&&<div  className={style['similar-drug-wrapper'] +" "+"clearfix" }>
+                        <h3 className={style['drug-desc-title']}><span className={style['drug-desc-class-title']} title={treatmentItem.subdrugsName}>{treatmentItem.subdrugsName}</span>  <img src={packUp} onClick={this.hideTreatDesc} className={style['close-drug-desc']} /></h3>
                         <div  className={style['similar-drug'] +" "+"clearfix" }>
-                        {treatment[otherDrugIndex].medicitionsList.map((item, index) =>{
-                            return (<span className={style['drug-name-box']}
-                                onMouseEnter={this.handleMouseEnterDrug.bind(this, index, item )}
-                                onMouseLeave = {this.handleMouseLeaveDrug}
-                                id={item.medicitionName}
-                            >
-                                <span className={style['drug-name']} 
-                                    // onDoubleClick={() =>{setDrugInfo(item);showDrugInfo();}} 
-                                    onClick={()=>{item.forbidden === '2' ? '' : this.handleSelect(otherDrugIndex,index)}} 
-                                    style={item.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)'} : item.selected ? {color: '#3B9ED0'}:''}
-                                    >
-                                    {item.medicitionName}
-                                </span>
-                                {<img className={style['info-img']}  
-                                    title='点击i图标可查看详细说明'
-                                    style ={currentIndex === index ? {display: "inline-block"} : {display: "none"}}
-                                    src={currentIndex === index ?  (hasEnterImg ? info3 : info2) : info2} 
-                                    onMouseEnter={this.handleMouseEnterImg.bind(this, index)}
-                                    onMouseLeave = {this.handleMouseLeaveImg}
-                                    onClick={() =>{setDrugInfo({name: item.medicitionName, type: 8, position: 5})}}
-                                    />}
+                        {treatmentItem.medicitionsList.map((item, index) =>{
+                            return  <HasInfoItem 
+                            item = {item}
+                            setDrugInfo = {this.setDrugInfo}
+                            position = {this.getPosition(index)}
+                            handleSelect = {this.handleSelect}
+                        >
 
-                            {/* {<img className={style['info-img']}
-                                title='点击i图标可查看详细说明'
-                                src={currentIndex === index ? info1 : info}
-                                onMouseEnter={this.handleMouseEnterImg.bind(this, index)}
-                                onMouseLeave = {this.handleMouseLeaveImg}
-                                onClick={() =>{setDrugInfo(item,8,5);showDrugInfo();}}/>} */}
-                            {item.forbidden === '1' ? <span className={style['info-flag']} style={{border: '1px solid #F4C051', background: '#F4C051',marginLeft: '5px'}}>慎用</span>: item.forbidden === '2' ? <span className={style['info-flag']} style={{opacity: '0.3', filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)',border: '1px solid #000',marginLeft: '5px'}}>禁用</span> : ''}
-                            {/*<span  style={item.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)'} : ''}> 使用率{item.rate}</span>*/}
-                            
-                        </span>)
+                        </HasInfoItem>
                         })}
                     </div> 
                 </div>}

+ 1 - 1
src/components/TreatDesc/index.less

@@ -38,7 +38,6 @@
 }
 .similar-drug-wrapper {
     position: absolute;
-    
     width: 260px;
     left: 680px;
     height: 100%;
@@ -46,6 +45,7 @@
     background: #fff;
     padding: 40px  0px 20px 20px;
     box-shadow: 2px 0px 5px -2px #7d7c7c;
+    line-height: 36px;
 }
 .similar-drug {
     padding: 20px 20px 0 0;

+ 6 - 1
src/config/index.js

@@ -39,5 +39,10 @@ export default {
     textReg:new RegExp("([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9])"), //包含中英文或数字
     slideTime:400,      //右侧指标推送展开/收起动画时间
     recoverTagNum:3,    //可回退标签的个数
-    regPreAndAft:/[^\u4e00-\u9fa5|0-9|a-z|A-Z|Ⅰ|Ⅱ|Ⅲ|Ⅳ|Ⅴ|Ⅵ|Ⅶ|Ⅷ|Ⅸ|Ⅹ]+$|^[^\u4e00-\u9fa5|0-9|a-z|A-Z|Ⅰ|Ⅱ|Ⅲ|Ⅳ|Ⅴ|Ⅵ|Ⅶ|Ⅷ|Ⅸ|Ⅹ]+/g  //搜索去掉前后的标点
+    regPreAndAft:/[^\u4e00-\u9fa5|0-9|a-z|A-Z|Ⅰ|Ⅱ|Ⅲ|Ⅳ|Ⅴ|Ⅵ|Ⅶ|Ⅷ|Ⅸ|Ⅹ]+$|^[^\u4e00-\u9fa5|0-9|a-z|A-Z|Ⅰ|Ⅱ|Ⅲ|Ⅳ|Ⅴ|Ⅵ|Ⅶ|Ⅷ|Ⅸ|Ⅹ]+/g,  //搜索去掉前后的标点
+    ruleTypeMap:{     //大数据推送参数featureType对应
+      '22':'1,2',
+      '11':'3',
+      '8':'4,5'
+    }
 };

+ 4 - 6
src/containers/Treat.js

@@ -35,18 +35,16 @@ function mapDispatchToProps(dispatch) {
             dispatch({type: CHANGE_REACT, it, index})
         },
       
-        selectDrug: (index, ii)=>{
+        selectDrug: (position)=>{
             dispatch ({
                 type: SELECT_DRUG,
-                index: index,
-                ii: ii
+                indexList: position,
             })
         },
-        setOtherRecommend: (item, index) => {
+        setOtherRecommend: (position) => {
             dispatch ({
                 type: SET_OTHER_DRUG,
-                item: item,
-                index: index,
+                position
             })
             //推荐依据不展示
             // dispatch(getRecommendBasic(item))

+ 125 - 32
src/store/actions/pushMessage.js

@@ -45,7 +45,6 @@ function getAdviceStr(advice) {
 	const check = advice.check || '';
 	const followUp = advice.followUp || '';
 	let AdviceStr = advice.AdviceStr || '';
-
 	if(assay || check) {
 		AdviceStr = assay + check  +'; ' + AdviceStr;
 	}
@@ -56,13 +55,35 @@ function getAdviceStr(advice) {
 		AdviceStr = AdviceStr + '回访时间:'+followUp + '后回访,不适随诊' + ';';
 	}
 	for (let i = 0; i < scheme.length; i++) {
-		for (let j = 0; j < scheme[i].treatment.length; j++) {
-			if(scheme[i].treatment[j].treatmentStr === '') {
-				AdviceStr = AdviceStr + scheme[i].treatment[j].treatmentStr
-			} else {
-				AdviceStr = AdviceStr  + scheme[i].treatment[j].treatmentStr + ', '
+		for(let j = 0; j < scheme[i].treatment.length; j++){
+			for(let k = 0; k < scheme[i].treatment[j].meditionDetails.length; k++) {
+				for(let l = 0; l < scheme[i].treatment[j].meditionDetails[k].treatment.length; l++) {
+					const treatmentItem = scheme[i].treatment[j].meditionDetails[k].treatment[l]
+					if(treatmentItem.treatmentStr === '') {
+						AdviceStr += treatmentItem.treatmentStr
+					}else {
+						AdviceStr += treatmentItem.treatmentStr + ', '
+					}
+				}
 			}
+
 		}
+
+
+
+
+
+
+
+		// for (let j = 0; j < scheme[i].treatment.length; j++) {
+		// 	if(scheme[i].treatment[j].treatmentStr === '') {
+		// 		AdviceStr = AdviceStr + scheme[i].treatment[j].treatmentStr
+		// 	} else {
+		// 		AdviceStr = AdviceStr  + scheme[i].treatment[j].treatmentStr + ', '
+		// 	}
+		// }
+
+
 	}
 	if(AdviceStr.slice(AdviceStr.length-2) == ', ') {
 		AdviceStr = AdviceStr.slice(0, AdviceStr.length-2)
@@ -84,22 +105,29 @@ export const addScheme = (state, action) => {
   const treatment = action.treatment;
   const treatItem = {};
   treatItem.name = action.title;
-  const scheme = res.advice.scheme || [];
+  let scheme = res.advice.scheme || [];
   let isRepeat = false; 
   let RepeatIndex;
   let SelectedDrugNum = 0 	//选中的药品数量
   for (let i = 0; i < treatment.length; i++) {
-		let treatmentStr = '';
-		let drugList = []
-    for (let j = 0; j < treatment[i].medicitionsList.length; j++) {
-      if(treatment[i].medicitionsList[j].selected) {
-				treatmentStr = treatmentStr + treatment[i].medicitionsList[j].medicitionName + ', '
-				drugList.push({conceptId: treatment[i].medicitionsList[j].conceptId, conceptName: treatment[i].medicitionsList[j].medicitionName })
-				SelectedDrugNum++
+		for(let j = 0; j < treatment[i].meditionDetails.length; j++) {
+			for(let k = 0; k < treatment[i].meditionDetails[j].treatment.length; k++) {
+				let treatmentStr = '';
+				let drugList = []
+				for(let l = 0; l < treatment[i].meditionDetails[j].treatment[k].medicitionsList.length; l++) {
+					const drugItem = treatment[i].meditionDetails[j].treatment[k].medicitionsList[l]
+					if(drugItem.selected) {
+						treatmentStr = treatmentStr + drugItem.medicitionName + ', '
+						drugList.push({conceptId: drugItem.conceptId, conceptName: drugItem.medicitionName })
+						SelectedDrugNum++
+					}
+					
+				}
+				treatment[i].meditionDetails[j].treatment[k].treatmentStr = treatmentStr.substring(0,treatmentStr.length-2)
+				treatment[i].meditionDetails[j].treatment[k].drugList = drugList
 			}
-	}
-	treatment[i].treatmentStr = treatmentStr.substring(0,treatmentStr.length-2)
-	treatment[i].drugList = drugList
+		}
+	
   }
   if(SelectedDrugNum > 0) { //如果有选中的药品,滚动到医嘱框
 	document.getElementById("adviceBox").scrollIntoView(true)
@@ -119,22 +147,76 @@ export const addScheme = (state, action) => {
   })
   if (isRepeat) {
 	 //将同类药添加到一起
-	for (let i = 0; i < scheme[RepeatIndex].treatment.length; i++) {
-		for (let j = 0; j < treatment.length; j++) {
-			if (scheme[RepeatIndex].treatment[i].id === treatment[j].id && scheme[RepeatIndex].treatment[i].bigdrugsName === treatment[j].bigdrugsName && scheme[RepeatIndex].treatment[i].subdrugsName === treatment[j].subdrugsName) {
-				for(let z = 0; z < treatment[j].medicitionsList.length; z++) {
-					if(treatment[j].medicitionsList[z].selected) {
-						if(scheme[RepeatIndex].treatment[i].treatmentStr !== '') {
-							scheme[RepeatIndex].treatment[i].treatmentStr = scheme[RepeatIndex].treatment[i].treatmentStr + ', ' + treatment[j].medicitionsList[z].medicitionName 
-						} else {
-							scheme[RepeatIndex].treatment[i].treatmentStr = scheme[RepeatIndex].treatment[i].treatmentStr + '' + treatment[j].medicitionsList[z].medicitionName
+	const schemeTreatmentCopy = scheme[RepeatIndex].treatment.slice()
+	 for (let i = 0; i < scheme[RepeatIndex].treatment.length; i++) {
+		for(let x = 0; x < treatment.length; x++) {
+			const hasNoCont = scheme[RepeatIndex].treatment.findIndex(item => item.title === treatment[x].title) 
+			if(hasNoCont === -1) {
+				if(treatment[x].title != scheme[RepeatIndex].treatment[i].title) {
+					const treatmentCopy = JSON.parse(JSON.stringify(treatment[x]))
+					for(let o = 0; o < treatmentCopy.meditionDetails.length; o++) {
+						for(let p = 0; p < treatmentCopy.meditionDetails[o].treatment.length; p++) {
+							treatmentCopy.meditionDetails[o].treatment[p].treatmentStr = ""
+						}
+
+					}
+					schemeTreatmentCopy.splice(x, 0, treatmentCopy)
+				}
+			}
+		}
+			
+	 }
+	 scheme[RepeatIndex].treatment = schemeTreatmentCopy
+	 for (let i = 0; i < scheme[RepeatIndex].treatment.length; i++) {
+		const schemeTreatmentCopy2 = scheme[RepeatIndex].treatment[i].meditionDetails.slice()
+
+			for(let x = 0; x < treatment.length; x++) {
+				if(treatment[x].title === scheme[RepeatIndex].treatment[i].title) {
+				for(let j = 0; j < scheme[RepeatIndex].treatment[i].meditionDetails.length; j++) {
+					for(let y = 0; y < treatment[x].meditionDetails.length;y++) {
+							const hasNoCont =  scheme[RepeatIndex].treatment[i].meditionDetails.findIndex(item => item.description === treatment[x].meditionDetails[y].description)  
+							if(hasNoCont === -1) {
+								schemeTreatmentCopy2.splice(y, 0, treatment[x].meditionDetails[y])
+							}
 						}
-						scheme[RepeatIndex].treatment[i].drugList.push({conceptId: treatment[j].medicitionsList[z].conceptId, conceptName: treatment[j].medicitionsList[z].medicitionName })
+				}
 
+			}
+		}
+		scheme[RepeatIndex].treatment[i].meditionDetails = schemeTreatmentCopy2
+
+	 }
+	for (let i = 0; i < scheme[RepeatIndex].treatment.length; i++) {
+		for(let j = 0; j < scheme[RepeatIndex].treatment[i].meditionDetails.length; j++) {
+			for(let k = 0; k < scheme[RepeatIndex].treatment[i].meditionDetails[j].treatment.length; k++) {
+				const schemeItem = scheme[RepeatIndex].treatment[i].meditionDetails[j].treatment[k]
+
+				for(let x = 0; x < treatment.length; x++) {
+					for(let y = 0; y < treatment[x].meditionDetails.length;y++) {
+						for(let z = 0; z < treatment[x].meditionDetails[y].treatment.length; z++) {
+							let treatItem = treatment[x].meditionDetails[y].treatment[z]
+							if(schemeItem.id === treatItem.id && schemeItem.bigdrugsName === treatItem.bigdrugsName && schemeItem.subdrugsName === treatItem.subdrugsName) {
+								for(let w = 0; w < treatItem.medicitionsList.length; w++) {
+									const medicitionsItem = treatItem.medicitionsList[w]
+									if(medicitionsItem.selected) {
+										if(schemeItem.treatmentStr !== '') {
+											schemeItem.treatmentStr += ', ' +medicitionsItem.medicitionName
+										} else {
+											schemeItem.treatmentStr += '' +medicitionsItem.medicitionName
+										}
+										schemeItem.drugList.push({conceptId: medicitionsItem.conceptId, conceptName: medicitionsItem.medicitionName })
+									}
+								}
+							}
+						}
 					}
 				}
+
+
+				
 			}
 		}
+
 	}
 
 //    let repeatDiag = res.advice.scheme[RepeatIndex].treatment
@@ -147,10 +229,16 @@ export const addScheme = (state, action) => {
 //    }
 //    repeatDiag = repeatDiag.concat(action.treatment)
   } else {
+	  	loop: 
 		for (let i = 0; i < treatItem.treatment.length; i++) {
-			for (let j = 0; j < treatItem.treatment[i].medicitionsList.length; j++) {
-				if(treatItem.treatment[i].medicitionsList[j].selected) {
-					res.advice.scheme = scheme.concat(treatItem)
+			for(let j = 0; j < treatItem.treatment[i].meditionDetails.length; j++) {
+				for(let k = 0; k < treatItem.treatment[i].meditionDetails[j].treatment.length; k++) {
+					for(let l = 0; l < treatItem.treatment[i].meditionDetails[j].treatment[k].medicitionsList.length; l++) {
+						if(treatItem.treatment[i].meditionDetails[j].treatment[k].medicitionsList[l].selected) {
+							res.advice.scheme = scheme.concat(treatItem)
+							break loop;
+						}
+					}
 				}
 			}
 		}
@@ -164,13 +252,18 @@ export const addScheme = (state, action) => {
   return res;
 }
 
+
 //获取开单到医嘱的药品列表
 function getDrugList(scheme) {
 	const drugList = [];
 	for(let i = 0 ;  i < scheme.length; i++) {
 		for(let j = 0; j <scheme[i].treatment.length; j++ ) {
-			for (let z = 0; z < scheme[i].treatment[j].drugList.length; z++) {
-				drugList.push(scheme[i].treatment[j].drugList[z]);
+			for(let k = 0; k < scheme[i].treatment[j].meditionDetails.length; k++) {
+				for(let l = 0; l < scheme[i].treatment[j].meditionDetails[k].treatment.length; l++) {
+					for (let m = 0; m < scheme[i].treatment[j].meditionDetails[k].treatment[l].drugList.length; m++) {
+						drugList.push(scheme[i].treatment[j].meditionDetails[k].treatment[l].drugList[m]);
+					}
+				}
 			}
 		}
 	}

+ 6 - 4
src/store/actions/treat.js

@@ -17,10 +17,12 @@ export const clearTreat = (state, action) => {
     res.generalTreat = '';
     res.surgeryTreat = '';
     res.drugHistory = {};
+    res.treatDesc = {title: "药品推荐"}
     res.treatment = [];
     res.adversReactionList=[];
     res.hasFollowUp = false;
     res.followUp = '';
+    console.log('res', res)
     return res
 }
 
@@ -32,6 +34,7 @@ export const clearAllTreat = (state, action) => {
     res.drugHistory = {};
     res.treatment = [];
     res.adversReactionList=[];
+    res.treatDesc = {title: "药品推荐"}
     res.hasFollowUp = false;
     res.followUp = '';
     res.followUpList = [];
@@ -54,9 +57,8 @@ export const setTreatment = (state, action) => {
 export const selectDrug = (state, action) => {
     const res = JSON.parse(JSON.stringify(state));
     const drugTreat = res.treatment.slice();
-    const index = action.index  //药品类的索引
-    const ii = action.ii   //药品索引
-    const selectItem = drugTreat[index].medicitionsList[ii]
+    const indexList = action.indexList  //药品索引列表
+    const selectItem = drugTreat[indexList[0]].meditionDetails[indexList[1]].treatment[indexList[2]].medicitionsList[indexList[3]]
     const selected =  selectItem.selected//所选择药品的选择状态
     selectItem.selected = !selected;
     return res
@@ -68,7 +70,7 @@ export const setOtherDrug = (state, action) => {
     const res = JSON.parse(JSON.stringify(state));
     res.treatDesc = {};
     res.treatDesc.title = '药品推荐';
-    res.treatDesc.otherDrugIndex = action.index;
+    res.treatDesc.position = action.position;
     return res
 }
 

+ 4 - 1
src/store/async-actions/fetchModules.js

@@ -245,8 +245,11 @@ export function getAssessData(disId,disName){
       disType:1,
       diag:disName,
       diseaseName:disName,
-      featureType:11,
+      featureType:'11',
+      ruleType:config.ruleTypeMap['11'],
       lis:emrData.lis,
+      other: emrData.other,
+      pasts: emrData.other,
       sex:emrData.sex,
       age:emrData.age,
       pacs:emrData.pacs,

+ 1 - 0
src/store/async-actions/mainSuit.js

@@ -50,6 +50,7 @@ export async function getCommSymptomPush(){//获取大数据推送症状
         "diag": emrData.dis,
         "lis": emrData.lis,
         "other": emrData.other,
+        "pasts": emrData.other,
         "pacs": emrData.pacs,
         "sex": emrData.sex,
         "vital":emrData.vital,

+ 66 - 118
src/store/async-actions/treat.js

@@ -9,107 +9,14 @@ import { SAVE_FOLLOW_UP } from "@store/types/pushMessage";
 import {MODI_LOADING} from '@store/types/homePage.js';
 import { SHOW_TREAT} from '@store/types/treat.js';
 import Notify from '@commonComp/Notify';
+import {getChronic} from '@store/async-actions/homePage.js';
+import config from "@config/index";
 
 const api={
     pushTreatment:'/push/pushTreatment',
     getConceptDetail:'/conceptDetail/getConceptDetail'
 }
 
-// export const addDiagnostic = (item) => {
-//         return (dispatch, getState) => {
-//             const state = getState();
-//             let url = api.pushTreatment;
-//             const emrData = getEMRParams();
-//             const diagnosticList = state.diagnosticList.diagnosticList;
-//             let diag = '';
-//             if(diagnosticList) {
-//                 for (let i = 0; i < diagnosticList.length; i++ ) {
-//                     if(i ===0 ) {
-//                         diag = diag + diagnosticList[i].name;
-//                     } else {
-//                         diag = diag + ',' + diagnosticList[i].name;
-//                     }
-
-//                 }
-//             }
-//             if (item.type === 1) {
-//                 diag = diag + ',' + item.name
-//             } else {
-//                 diag = diag + ',' + item.name
-//             }
-//             const params = {
-//                 "age": emrData.age,
-//                 "featureType": "8",
-//                 "diag": diag,
-//                 "diseaseName":  item.name,
-//                 "lis": emrData.lis,
-//                 "other": emrData.other,
-//                 "pacs": emrData.pacs,
-//                 "sex": emrData.sex,
-//                 "symptom": emrData.current + emrData.main,
-//                 "vital": emrData.vital,
-//                 "patientId": emrData.patientId,
-//                 "hosCode": emrData.hosCode,
-//                 "adverseReactions": "string",
-//                 "scaleName": "string",
-//             };
-//             //判断是否走慢病系统
-//             const isChronic = state.diagnosticList.chronicMagItem ||state.mainSuit.chronicDesease;
-//             // const isChronic = true
-//             if (isChronic) {
-//                 let chronicList = JSON.parse(storageLocal.get('chronic'));
-//                 if(!chronicList){
-//                     getChronic().then(() =>{
-//                     chronicList = JSON.parse(storageLocal.get('chronic'));
-//                         for(let i=0; i<chronicList.length; i++){
-//                             if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){ //判断某个病是否为慢病
-//                                 params.disType = 1
-//                             }
-//                         }
-//                         hasTreatment(dispatch, state,item,url,params)
-
-//                     });
-//                 } else {
-//                     for(let i=0; i<chronicList.length; i++){
-//                         if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){
-//                             params.disType = 1
-//                         }
-//                     }
-//                     hasTreatment(dispatch, state, item,url,params)
-//                 }
-//             } else {
-//                 hasTreatment(dispatch, state, item,url,params)
-//             }
-            
-            
-//         }
-
-// }
-
-// //判断是否存在治疗方案
-// function hasTreatment(dispatch, state,item,url, params) {
-//     const itemTreat = JSON.parse(JSON.stringify(item))
-//     json(url, params).then((data) =>{
-//         if (data.data.data) {
-//             itemTreat.treat = data.data.data
-//             dispatch({
-//                 type: ADD_TREAT,
-//                 item: itemTreat
-//             })
-//         } else {
-//             item.treat = null
-//             dispatch({
-//                 type: ADD_TREAT,
-//                 item: itemTreat
-//             })
-//         }
-        
-
-//     }).catch((e) =>{
-//         console.log(e)
-//     })
-// }
-
 export const getTreatResult = (item) =>{
     return (dispatch, getState) => {
         dispatch({
@@ -136,10 +43,12 @@ export const getTreatResult = (item) =>{
         const params = {
             "age": emrData.age,
             "featureType": "8",
+            "ruleType":config.ruleTypeMap["8"],
             "diag": diag,
             "diseaseName":  item.name,
             "lis": emrData.lis,
             "other": emrData.other,
+            "pasts": emrData.other,
             "pacs": emrData.pacs,
             "sex": emrData.sex,
             "symptom": emrData.current + emrData.main,
@@ -148,17 +57,56 @@ export const getTreatResult = (item) =>{
             "hosCode": emrData.hosCode
         };
         // const params = {
-        //         "age": 20,
-        //         "diag": ",糖尿病",
-        //         "disType": 1,
-        //         "diseaseId":21773,
-        //         "featureType": "8",
-        //         "lis": [
-                  
-        //         ],
-        //         "sex": 3,
-        //         "symptom": "恶心,呕吐",
-        //         "vital": ""
+        //     "disType":"1",
+        //     "age":28,
+        //     "diag":"2型糖尿病性肾病,1型糖尿病,糖尿病肾病",
+        //     "diseaseName":"2型糖尿病",
+        //     "featureType":"8",
+        //     "hosCode":"A001",
+        //     "lis":[
+        //         {
+        //             "name":"糖化血红蛋白测定",
+        //             "detailName":"糖化血红蛋白(HbA1c)",
+        //             "uniqueName":"糖化血红蛋白测定--糖化血红蛋白(HbA1c)",
+        //             "source":"0",
+        //             "minValue":4,
+        //             "otherValue":"",
+        //             "maxValue":6,
+        //             "units":"%",
+        //             "value":"5"
+        //         },
+        //         {
+        //             "name":"空腹葡萄糖测定",
+        //             "detailName":"葡萄糖(GLU)",
+        //             "uniqueName":"空腹葡萄糖测定--葡萄糖(GLU)",
+        //             "source":"0",
+        //             "minValue":3.9,
+        //             "otherValue":"",
+        //             "maxValue":6.1,
+        //             "units":"mmol/L",
+        //             "value":"5"
+        //         },
+        //         {
+        //             "name":"肝功能测定",
+        //             "detailName":"谷丙转氨酶(ALT)",
+        //             "uniqueName":"肝功能测定--谷丙转氨酶(ALT)",
+        //             "source":"0",
+        //             "minValue":5,
+        //             "otherValue":"",
+        //             "maxValue":40,
+        //             "units":"U/L",
+        //             "value":"180"
+        //         }
+        //     ],
+        //     "lisOrder":"",
+        //     "lisString":"",
+        //     "other":"",
+        //     "otherOrder":"",
+        //     "pacs":"",
+        //     "pacsOrder":"",
+        //     "sex":1,
+        //     "symptom":"患者患有2型糖尿病近来出现泡沫尿",
+        //     "vital":"体温40℃"
         // }
         const isChronic = state.diagnosticList.chronicMagItem ||state.mainSuit.chronicDesease;
         // const isChronic = true
@@ -203,11 +151,11 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
                 treat = data.data.data || {}
             }
             if(treat) {
-                let { treatment, commonTreatment, surgeryTreatment, drugHistory, adverseReactions, followUp} = treat
+                let { treatmentPlan, commonTreatment, surgeryTreatment, drugHistory, adverseEvent, followUp} = treat
                 if(!(commonTreatment || surgeryTreatment ||
-                    ( treatment &&treatment.length >0 ||
+                    ( treatmentPlan &&treatmentPlan.length >0 ||
                         drugHistory&&drugHistory.length >0 || 
-                        adverseReactions&&adverseReactions.length >0 ||
+                        adverseEvent&&adverseEvent.length >0 ||
                         !!followUp ||treatment&&treatment.length >0))) {
                             Notify.info('暂无数据'); 
                             return
@@ -215,23 +163,23 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
                 dispatch({type: SHOW_TREAT})
                 dispatch({
                      type: SET_TREATMENT,
-                     treatment: treatment,
+                     treatment: treatmentPlan,
                      generalTreat: commonTreatment,
                      surgeryTreat: surgeryTreatment,
                      drugHistory: drugHistory,
                  })
-                 if (adverseReactions) { //如何之前存过不良反应,则替换成之前的不良反应
+                 if (adverseEvent) { //如何之前存过不良反应,则替换成之前的不良反应
                      const allAdversReactionList = state.treat.allAdversReactionList
                      if(allAdversReactionList) {
                          for(let i = 0; i < allAdversReactionList.length; i++) {
                              if(item.conceptId == allAdversReactionList[i].conceptId) {    //判断是否存过不良反应
-                                 for (let j = 0; j < adverseReactions.length; j++) { //判断不良反应是否有相同的不良反应,如果有,替换
+                                 for (let j = 0; j < adverseEvent.length; j++) { //判断不良反应是否有相同的不良反应,如果有,替换
                                      for(let z = 0; z < allAdversReactionList[i].adversReactionList.length; z++) {
-                                         if(adverseReactions[j].conceptId == allAdversReactionList[i].adversReactionList[z].conceptId && adverseReactions[j].name == allAdversReactionList[i].adversReactionList[z].name) {
+                                         if(adverseEvent[j].conceptId == allAdversReactionList[i].adversReactionList[z].conceptId && adverseEvent[j].name == allAdversReactionList[i].adversReactionList[z].name) {
                                              for(let x = 0; x < allAdversReactionList[i].adversReactionList[z].details.length; x++) {
-                                                 for(let y = 0; y < adverseReactions[j].details.length; y++) {//判断每一项是否选择过
-                                                     if(allAdversReactionList[i].adversReactionList[z].details[x].name == adverseReactions[j].details[y].name && allAdversReactionList[i].adversReactionList[z].details[x].select) {
-                                                         adverseReactions[j].details[y].select = allAdversReactionList[i].adversReactionList[z].details[x].select
+                                                 for(let y = 0; y < adverseEvent[j].details.length; y++) {//判断每一项是否选择过
+                                                     if(allAdversReactionList[i].adversReactionList[z].details[x].name == adverseEvent[j].details[y].name && allAdversReactionList[i].adversReactionList[z].details[x].select) {
+                                                        adverseEvent[j].details[y].select = allAdversReactionList[i].adversReactionList[z].details[x].select
                                                      }
                                                  }
                                              }
@@ -243,7 +191,7 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
                      }
                      
                  } else {
-                     adverseReactions = []
+                    adverseEvent = []
                  }
                  if(isChronic) {
                      let chronicList = JSON.parse(storageLocal.get('chronic'));
@@ -277,7 +225,7 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
                  }
                  dispatch({
                      type: SET_ADVERSE_REACTIONS,
-                     adversReactionList: adverseReactions
+                     adversReactionList: adverseEvent
                  })
             } else {
                 Notify.info('暂无数据');

+ 2 - 2
src/utils/config.js

@@ -1,8 +1,8 @@
 // const host='http://192.168.3.1:5050';//赵
 // const host='http://192.168.3.100:5050';//王峰
 // const host='http://192.168.2.121:5050';//后端接口访问地址
-// const host='http://192.168.2.236:5050';//后端接口访问地址
-const host='http://192.168.2.241:5050';//后端接口访问地址
+const host='http://192.168.2.236:5050';//后端接口访问地址
+// const host='http://192.168.2.241:5050';//后端接口访问地址
 // const host='http://192.168.3.11:5050';//王宇
 //const host='http://192.168.2.164:8080';
 // const host='http://192.168.3.117:5050'; //周铁刚

+ 2 - 0
src/utils/utils.js

@@ -218,9 +218,11 @@ export async function getBigPush(type,symData,save){
     "age": emrData.age,
     "hosCode": emrData.hosCode,
     "featureType": type,  //类型1:症状,4:查体,5:化验,6:辅检,7:诊断
+    "ruleType":config.ruleTypeMap[type],
     "diag": emrData.dis,
     "lis": emrData.lis,
     "other": emrData.other,
+    "pasts": emrData.pasts,
     "pacs": emrData.pacs,
     "sex": emrData.sex,
     "vital":emrData.vital,