let obj = {
"functionResultEnum": 1,
"resultMessage": {
"STK-1-1-2": "未实施神经功能缺损NIHSS评估",
"STK-1-1-6": "无法确定或无记录"
},
"funcMap": {
"STK-1-1-1": 2,
"STK-1-1-2": 1,
"STK-1-1-3": 2,
"STK-1-1-4": 0,
"STK-1-1-5": 0,
"STK-1-1-6": 1,
"STK-1-1-7": 0,
"STK-1-1-8": 0
},
"funcComposeMap": {
"STK-1-1-f-1": 1,
"STK-1-1": 1
},
"funcDenominatorMap": {
"STK-1-2-1": 0
},
"funcDenominatorComposeMap": {
"STK-1-2-f-1": 0,
"STK-1-2": 0
},
"funcTitleMap": {
"STK-1-1-2": "入院后首次实施神经功能缺损NIHSS评估",
"STK-1-1-1": "急诊/门诊 首次实施神经功能缺损NIHSS评估",
"STK-1-1-8": "急诊/门诊 或入院后是首次实施心电图(ECG)检查",
"STK-1-1-7": "有生化检验项目",
"STK-1-1-f-1": "STK-1 患者入院病情评估★ 分子项",
"STK-1-1-6": "有凝血功能检查项目",
"STK-1-1-5": "急诊/门诊 或入院后24小时内首次临床检验检查",
"STK-1-1-4": "全血细胞计数",
"STK-1-1-3": "实施首次头部影像学检查"
},
"colAlgorithm": "#{STK-1-1-1}and#{STK-1-1-2}and#{STK-1-1-3}and#{STK-1-1-4}and#{STK-1-1-5}and#{STK-1-1-6}and#{STK-1-1-7}and#{STK-1-1-8}",
"phase": "入院",
"type": "评估",
"indexLevel": "1.1",
"title": "STK-1 患者入院病情评估★",
"sort": 1
};
function getItemList(obj){
let data={};
// let item={
// code:'',
// name:'',
// status:'',
// remark:'',
// }
for(let code of Object.keys(obj.funcMap)){
// console.log(code);
data[code]={
code:code,
status:obj.funcMap[code]
}
}
for(let code of Object.keys(data)){
data[code]['name']=obj.funcTitleMap[code] || ''
}
for(let code of Object.keys(data)){
data[code]['remark']=obj.resultMessage[code] || ''
}
let list=[]
for(let code of Object.keys(data)){
list.push(data[code])
}
// console.log(data);
console.log(list)
}
getItemList(obj);
//var c='#{STK-1-1-1}and#{STK-1-1-2}and#{STK-1-1-3}and#{STK-1-1-4}and#{STK-1-1-5}and#{STK-1-1-6}and#{STK-1-1-7}and#{STK-1-1-8}';
var c='#{PT-2-1-1}and#{PT-2-1-2}and(#{PT-2-1-3}or#{PT-2-1-4})and#{PT-2-1-5}and#{PT-2-1-6}'
let clist=[]
// for(let i=0;i<c.length;i++){
// console.log('i',c[i])
// }
var re = /<td[^>]*?>([\s\S]*?)<\/td>/,
reg = /<td[^>]*?>([\s\S]*?)<\/td>/g;
var cc=/\#{(.+?)\}/g
let arr=c.match(cc);
//let arr=cc.exec(c)
console.log(c)
console.log(arr);
//去除变量
arr.map(i=>{
console.log(typeof c ,c,i)
c=c.replace(i,'X')
})
//去除or and
c=c.replace(/and/g,'A');
c.repeat
c=c.replace(/or/g,'O');
console.log(c);
c.split('')
console.log(c.split(''))
console