-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathindex.js
More file actions
86 lines (85 loc) · 3.48 KB
/
index.js
File metadata and controls
86 lines (85 loc) · 3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import './style.css';
const div_grouper = document.createElement('div');
const div_input = document.createElement('div');
div_input.innerHTML = '病案信息:';
const input = document.createElement('input');
input.size = 150;
input.value = '22139971,1.0,73.0,27006.0,,13030305.0,8.0,1.0,"G20.x03,R90.803,F41.101,I10.x00x002,N39.000,E77.801,E87.600",,';
const select = document.createElement('select');
select.add(new Option('CHS-DRG 1.1标准版/铜川/临沂', 'chs_drg_11'));
select.add(new Option('CHS-DRG 1.0修订版/西安/成都', 'chs_drg_10'));
select.add(new Option('盐城2022细分组', 'yancheng_2022'));
select.add(new Option('苏州2022细分组', 'suzhou_2022'));
select.add(new Option('泰州2022细分组', 'taizhou_2022'));
select.add(new Option('无锡2022细分组', 'wuxi_2022'));
select.add(new Option('武汉2022细分组', 'wuhan_2022'));
select.add(new Option('北京2022细分组', 'beijing_2022'));
select.add(new Option('兰州2022细分组', 'lanzhou_2022'));
select.add(new Option('福州2022细分组', 'fuzhou_2022'));
select.add(new Option('ZJ-DRG 1.1浙江2022细分组', 'zhejiang_2022'));
select.add(new Option('长株潭衡区域2023细分组', 'changsha_2023'));
select.add(new Option('烟台2023细分组', 'yantai_2023'));
select.add(new Option('常州2022细分组', 'changzhou_2022'));
select.add(new Option('青岛2023细分组', 'qingdao_2023'));
select.add(new Option('临汾2022细分组', 'linfen_2022'));
select.add(new Option('周口2023细分组', 'zhoukou_2023'));
const btn = document.createElement('button');
btn.innerHTML = '提交';
btn.onclick = click;
div_input.appendChild(document.createElement('br'));
div_input.appendChild(input);
div_input.appendChild(document.createElement('br'));
div_input.appendChild(select);
div_input.appendChild(document.createElement('br'));
div_input.appendChild(btn);
const div_result = document.createElement('div');
const div_record = document.createElement('div');
const div_drg = document.createElement('div');
div_drg.classList.add('red');
const div_pay = document.createElement('div');
const div_msg = document.createElement('div');
div_result.appendChild(document.createElement('br'));
div_result.appendChild(div_record);
div_result.appendChild(div_msg);
div_result.appendChild(div_drg);
div_result.appendChild(div_pay);
div_grouper.appendChild(div_input);
div_grouper.appendChild(div_result);
document.body.appendChild(div_grouper);
async function group(record_str, type) {
const { GroupProxy } = await import('./drg_group/' + type + '/GroupProxy.js');
let grouper = new GroupProxy();
let result = grouper.group_record_str(record_str);
return result;
}
async function get_DRG(type) {
const DRG = await import('./drg_group/' + type + '/DATA/DRG.json');
return DRG;
}
function click() {
let result = group(input.value, select.value);
result.then(x => {
let record,result;
if (x instanceof Array){
[record,result]=x;
}else{
[record,result]=[x.record,x];
}
div_record.innerHTML = 'record=' + JSON.stringify(record);
buildList(div_msg,result.messages);
get_DRG(select.value).then(y =>div_drg.innerHTML = result.drg + '-' + y[result.drg]);
});
}
function buildList(div,data){
let obj;
if(obj=div.firstElementChild){
obj.remove();
}
const ul = document.createElement('ul');
div.appendChild(ul);
data.forEach(i => {
let li = document.createElement('li');
li.innerHTML = i;
ul.appendChild(li);
});
}