|
@@ -97,7 +97,7 @@ 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.saveText = fullfillText(res.data).saveText;console.log(111,"慢病",res)
|
|
|
res.update=Math.random();
|
|
|
return res;
|
|
|
}
|
|
@@ -220,16 +220,10 @@ export const setData = (state,action) =>{
|
|
|
if(items.length==0){//没有尾巴时给症状后加逗号(3.5)
|
|
|
for(let j=0; j<newMainCopy.length; j++){
|
|
|
if(newMainCopy[j].id==mainCopy[k].id){
|
|
|
- // newMainCopy[j].value = newMainCopy[j].name = mainCopy[k].value+',';
|
|
|
- newMainCopy[j].value = newMainCopy[j].name = mainCopy[k].value||mainCopy[k].name+',';
|
|
|
+ newMainCopy[j].value = newMainCopy[j].name = (mainCopy[k].value||mainCopy[k].name)+',';
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- /*if(ind==1){
|
|
|
- preLength = items.length;
|
|
|
- }else{
|
|
|
- insertInd += preLength;
|
|
|
- }*/
|
|
|
+ }
|
|
|
if(ind>1){
|
|
|
insertInd += lengArr[k-1];
|
|
|
}
|
|
@@ -265,17 +259,11 @@ export const setData = (state,action) =>{
|
|
|
let items = v.questionMapping.filter((item)=>{
|
|
|
return item.symptomType==0||item.symptomType==2;
|
|
|
})
|
|
|
- /*if(withInd==1){
|
|
|
- withPreLength = items.length;
|
|
|
- }else{
|
|
|
- withInsertInd += withPreLength;
|
|
|
- }*/
|
|
|
withLengArr[d] = items.length;
|
|
|
if(items.length==0){//没有尾巴时给症状后加逗号(3.5)
|
|
|
for(let j=0; j<newWiths.length; j++){
|
|
|
if(newWiths[j].id==withs[d].id){
|
|
|
- // newWiths[j].value = newWiths[j].name = withs[d].value+',';
|
|
|
- newWiths[j].value = newWiths[j].name = withs[d].value||withs[d].name+',';
|
|
|
+ newWiths[j].value = newWiths[j].name = (withs[d].value||withs[d].name)+',';
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -289,18 +277,21 @@ export const setData = (state,action) =>{
|
|
|
}
|
|
|
|
|
|
let symptomArr = newMainCopy.concat(manInput,newWiths,manWithInput);
|
|
|
- let newSymptomArr = formatContinueDots(JSON.parse(JSON.stringify(symptomArr))); //过来连续标点
|
|
|
- //组装好的主症状和伴随症状插入现病史模板(flag=4前)
|
|
|
- let insertIdx = null;
|
|
|
- for(let j=0; j<current.length; j++){
|
|
|
+ let newSymptomArr = formatContinueDots(JSON.parse(JSON.stringify(symptomArr))); //过滤连续标点
|
|
|
+ //组装好的主症状和伴随症状插入现病史模板(flag=4前)--现病史是否有模板
|
|
|
+ if(moduleData&&moduleData.length>0){
|
|
|
+ let insertIdx = null;
|
|
|
+ for(let j=0; j<current.length; j++){
|
|
|
if(current[j].flag && current[j].flag==4){
|
|
|
insertIdx = j;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- for(let k=0; k<newSymptomArr.length; k++){
|
|
|
- let pos = insertIdx+k;
|
|
|
- current.splice(pos,0,newSymptomArr[k]);
|
|
|
+ for(let k=0; k<newSymptomArr.length; k++){
|
|
|
+ let pos = insertIdx+k;
|
|
|
+ current.splice(pos,0,newSymptomArr[k]);
|
|
|
+ }
|
|
|
+ }else{//现病史没有模板
|
|
|
+ current = newSymptomArr;
|
|
|
}
|
|
|
let currentData = JSON.parse(JSON.stringify(current));
|
|
|
res.data = fullfillText(currentData).newArr;
|
|
@@ -335,16 +326,19 @@ export const setData = (state,action) =>{
|
|
|
}
|
|
|
//组装好的主症状和伴随症状插入现病史模板(flag=4前)
|
|
|
let endFeatureData = JSON.parse(JSON.stringify(featureData));
|
|
|
- let insertIdx = null;
|
|
|
- for(let j=0; j<current.length; j++){
|
|
|
+ if(moduleData&&moduleData.length>0){
|
|
|
+ let insertIdx = null;
|
|
|
+ for(let j=0; j<current.length; j++){
|
|
|
if(current[j].flag && current[j].flag==4){
|
|
|
insertIdx = j;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- for(let k=0; k<endFeatureData.length; k++){
|
|
|
- let pos = insertIdx+k;
|
|
|
- current.splice(pos,0,endFeatureData[k]);
|
|
|
+ for(let k=0; k<endFeatureData.length; k++){
|
|
|
+ let pos = insertIdx+k;
|
|
|
+ current.splice(pos,0,endFeatureData[k]);
|
|
|
+ }
|
|
|
+ }else{//现病史没有模板
|
|
|
+ current = endFeatureData;
|
|
|
}
|
|
|
let currentData = JSON.parse(JSON.stringify(current));
|
|
|
res.data = fullfillText(currentData).newArr;
|