Browse Source

治疗方案常用药物修改(未完成)

zhangxc 5 years ago
parent
commit
3dc62aaaec

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

@@ -0,0 +1,52 @@
+import React,{Component} from 'react';
+import style from './index.less';
+import $ from 'jquery';
+
+class HasInfoItem extends Component {
+    constructor(props) {
+        super(props)
+    }
+    handleMouseEnterDrug(){
+
+    }
+    handleMouseLeaveDrug(){
+
+    }
+    handleMouseEnterImg(){
+
+    }
+    onMouseLeave(){
+
+    }
+    setDrugInfo(){
+
+    }
+
+    render(){
+        const { item } = this.props
+        return (<span onMouseEnter={this.handleMouseEnterDrug.bind(this,item)}
+            onMouseLeave = {this.handleMouseLeaveDrug}
+            className={style['drug-name-wrapper']} 
+        >
+            <span className={style['drug-name']}  
+                // onDoubleClick={() =>{this.setDrugInfo(it);showDrugInfo();}}  //药品说明双击显示(现在为点击图标显示)
+                onClick={()=>{item.forbidden === '2' ? '' : this.handleSelect(index2,index3)}} 
+                style={item.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)'} : item.selected ? {color: '#3B9ED0', borderBottom: '1px solid #3B9ED0'}:''}
+                >
+                {item.medicitionName}
+            </span>
+            {/* {<img className={style['info-img']}  
+            title='点击i图标可查看详细说明'
+            style ={currentIndex === index2 ? (index3 === currentImg ? {display: "inline-block"} : {display: "none"}) : {display: "none"}}
+            src={currentIndex === index2 ? (index3 === currentImg ? (hasEnterImg ? info3 : info2) : info2): info2} 
+            onMouseEnter={this.handleMouseEnterImg.bind(this, index3, index2)}
+            onMouseLeave = {this.handleMouseLeaveImg}
+            onClick={this.setDrugInfo.bind(this,item)}/>} */}
+        {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>)
+    }
+}
+
+export default HasInfoItem;

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

@@ -0,0 +1,101 @@
+.drug-box {
+    padding: 10px 0 0 0;
+}
+.drug-title{
+    background: #EAF7FA;
+    height: 36px;
+    line-height: 36px;
+    font-weight: bold;
+}
+.drug-icon {
+    width: 16px;
+    float: left;
+    margin: 10px;
+}
+.drug-item {
+    position: relative;
+    line-height: 36px;
+    border-bottom: 1px dashed #D2D2D2;
+}
+.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;
+}
+.info-img, .info-img-more {
+    width: 12px;
+    margin: 0 3px -1px;
+    cursor: pointer;
+}
+.info-img {
+    width: 15px;
+    position: absolute;
+    top: -15px;
+    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;
+}
+.drug-more {
+    cursor: pointer;
+    color: #3B9ED0;
+    position: absolute;
+    right: 0;
+    top: 50%;
+    margin-top: -18px;
+}
+.drug-name-box {
+    float: left;
+    width: 530px;
+}
+.drug-content:after{display:block;clear:both;content:"";visibility:hidden;height:0}
+.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;
+}

+ 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>}

+ 27 - 31
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 {
@@ -79,47 +80,42 @@ 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'}:''}
-                                                >
-                                                {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>*/}
+                {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}></HasInfoItem>
+                                                )
 
-                                    </span>)
+                                            })}
+                                        </div>
+                                        {<div className={style['drug-more']} onClick={() =>this.setOtherRecommend(item, index)} ><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;
 }

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

@@ -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}

+ 63 - 24
src/store/async-actions/treat.js

@@ -9,7 +9,7 @@ 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';
 const api={
     pushTreatment:'/push/pushTreatment',
     getConceptDetail:'/conceptDetail/getConceptDetail'
@@ -148,17 +148,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 +242,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 +254,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 +282,7 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
                      }
                      
                  } else {
-                     adverseReactions = []
+                    adverseEvent = []
                  }
                  if(isChronic) {
                      let chronicList = JSON.parse(storageLocal.get('chronic'));
@@ -277,7 +316,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'; //周铁刚