|
@@ -222,33 +222,32 @@ class MainSuit extends Component{
|
|
|
const {freeText,saveText,datas,clearSearch,getSymptomFeature,currentData,saveChronic} = this.props;
|
|
|
const that = this;
|
|
|
let data = this.state.inpText;
|
|
|
+ const inner = e.target.innerText;
|
|
|
//分词-现病史没有模板的时候才去获取
|
|
|
- if(currentData&¤tData.length==0){
|
|
|
- const me = getFeature(e.target.innerText);
|
|
|
- me.then((res)=>{
|
|
|
- // console.log(222,res)
|
|
|
+ if(inner.trim() && currentData&¤tData.length==0){
|
|
|
+ getFeature(inner).then((res)=>{
|
|
|
if(res.data.code==0){
|
|
|
const result = res.data.data;
|
|
|
- getSymptomFeature && getSymptomFeature(result);
|
|
|
- // 判断是否为慢病复诊-请求慢病模板
|
|
|
- /*let flg = this.ifClear();
|
|
|
- if(result.? && !flg){
|
|
|
- saveChronic && saveChronic({name:'糖尿病',id:21773});
|
|
|
- }*/
|
|
|
+ // 慢病
|
|
|
+ if(result && result[0].chronicLabel==1){
|
|
|
+ let flg = this.ifClear();
|
|
|
+ if(!flg){
|
|
|
+ saveChronic && saveChronic(result[0]);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ getSymptomFeature && getSymptomFeature(result);
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
if(!isIE()){
|
|
|
- /*if(currentData&¤tData.length==0){//现病史没有模板的时候才去获取
|
|
|
- getSymptomFeature && getSymptomFeature(e.target.innerText);
|
|
|
- } */
|
|
|
- e.target.innerText?(e.target.innerText=""):(e.target.innerHTML="")
|
|
|
+ inner?(e.target.innerText=""):(e.target.innerHTML="")
|
|
|
freeText && freeText(data.trim());
|
|
|
// 慢病模板获取:精确匹配"糖尿病复诊",储存慢病字段
|
|
|
- let flg = this.ifClear();
|
|
|
+ /*let flg = this.ifClear();
|
|
|
if((data.trim()=='糖尿病复诊'||data.trim()=='糖尿病(复诊)'||data.trim()=='糖尿病(复诊)') && !flg){
|
|
|
- saveChronic && saveChronic({name:'糖尿病',id:21773});
|
|
|
- }
|
|
|
+ saveChronic && saveChronic({name:'糖尿病',conceptId:21773});
|
|
|
+ }*/
|
|
|
}else{
|
|
|
if(datas.length==0){
|
|
|
const ev = e || window.event;
|