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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
import { getDict } from '@/tumour/utils/dictionaries.js'
/**
* 1肺癌 2乳腺癌 3结直肠癌 4肝癌 5宫颈癌 6甲状腺癌 7胃癌 8食管癌 9前列腺癌 10肾癌 11黑色素癌
*/
/**
*
* @param {String} key 需要生成的问卷
* @param {Object} userInfo 患者信息
* @param {Object} detail 问卷选中的值
* @returns
*/
export function getQuestion(key, userInfo, detail) {
/**
* 设置问题title
* @param {String} text title文字
* @param {String} linkKey 关联的表单key
* @returns
*/
const setTitle = (text, linkKey) => {
return {
text,
linkKey
}
}
const questions = {
q1: {
title: '肺癌筛查量表',
issue: [{
key: 'question1',
title: setTitle('1、年龄介于45~74岁之间'),
answer: {
// radio单选 checkbox多选
type: 'radio',
// 选项中 其他选项 的value
other: null,
// 答案的选项 DC00001是否
cont: getDict('DC00001'),
// 禁用
disabled: true,
},
// 赋初始值
init: () => {
return userInfo.age >= 45 && userInfo.age <= 74 ? 1 : 2
}
}, {
title: setTitle('2、吸烟包年数≥20包年,包括曾经吸烟≥20包年,但戒烟不足15年'),
key: 'question2',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('3、与条件2共同生活或同室工作被动吸烟>20年'),
key: 'question3',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('4、患有慢性阻塞性肺疾病'),
key: 'question4',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('5、有职业暴露史≥1年,包括暴露于石棉、氡、铍、铬、镉、硅、煤烟和煤烟灰'),
key: 'question5',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('6、有一、二级亲属确诊肺癌'),
key: 'question6',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}],
// 高危判断条件
check() {
// console.log('question check', this.issue)
return this.issue[0].value === 1 &&
this.issue.filter(e => e.value === 1).length >= 2
},
remark: '肺癌高风险人群建议:每年进行胸部低剂量CT平扫检查。如发现肺部结节,建议到胸外科、呼吸内科、肿瘤科等专科进行就诊。',
sub: '肺癌高风险人群介于45~74岁,且2-6至少满足一项'
},
q2: {
title: '乳腺癌筛查量表',
issue: [{
title: setTitle('1、既往乳腺3类及以上结节病史'),
key: 'question4',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('2、既往有乳腺导管或小叶中重度不典型增生或小叶原位癌患者'),
key: 'question2',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('3、既往有胸部放疗史的患者'),
key: 'question3',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('4、一级亲属或本人携带有 BRCA1/BRCA2 基因突变'),
key: 'question5',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('5、有2个或2个以上≤50岁二级亲属诊断为乳腺癌或卵巢癌或原发性腹膜癌'),
key: 'question6',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}],
check() {
return this.issue.filter(e => e.value === 1).length >= 1
},
remark: `一般风险人群建议:一、20~39岁:(1)每月1次乳腺自我检查;(2)每1—3年1次临床检查。
二、40~69岁:(1)每1~2年1次乳腺彩超或乳腺钼靶检查;(2)每月1次乳腺自我检查; (3)每年1次临床检查。
三、70岁以上:(1)有症状或可疑体征时进行影像学检查;(2)每月1次乳腺自我检查;(3)每年1次临床检查。\n乳腺癌高危人群建议:临床体检、B 超、乳腺钼靶检查、乳腺MRI、肿瘤标志物。`,
sub: '满足任意一项乳腺癌高危人群'
},
q3: {
title: '结直肠癌筛查量表',
issue: [{
title: setTitle('1、大便潜血阳性'),
key: 'question1',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('2、一级亲属有结直肠癌病史'),
key: 'question2',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('3、以往有肠道腺瘤史'),
key: 'question3',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('4、本人有癌症史'),
key: 'question4',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('5、有大便习惯的改变'),
key: 'question5',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('6、符合以下任意2项者:', 'question7'),
key: 'question6',
answer: {
type: 'radio',
cont: getDict('DC00001'),
// 禁用
disabled: true,
},
// 赋初始值
init: () => {
return 2
}
}, {
key: 'question7',
index: 7,
answer: {
type: 'checkbox',
cont: getDict('DC00096')
},
change: (that) => {
if (!that) return
console.log('that', that)
const item1 = that.getIssue('question7') || {}
const item2 = that.getIssue('question6') || {}
if (!item1 || !item2) return
const val = item1.value || []
item2.value = val.length >= 2 ? 1 : 2
}
}],
check() {
return this.issue.filter(e => e.value === 1 && e.title).length >= 1
},
remark: '一般风险人群建议:随访观察。\n结直肠癌高危人群建议:进一步进行生化全套、结直肠镜检查、腹部 CT、肿瘤标志物。',
sub: '有任意一条者视为结直肠癌高危人群',
},
q4: {
title: '肝癌筛查量表',
issue: [{
title: setTitle('1、年龄大于40岁'),
key: 'question1',
answer: {
type: 'radio',
cont: getDict('DC00001'),
// 禁用
disabled: true,
},
// 赋初始值
init: () => {
return userInfo.age > 40 ? 1 : 2
}
}, {
title: setTitle('2、慢性乙型肝炎或者慢性丙型肝炎史'),
key: 'question2',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('3、肝硬化病史'),
key: 'question3',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('4、长期酗酒史(每日饮酒大于2两,饮酒史超过1年)'),
key: 'question4',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('5、出血史:(出血倾向:鼻出血、牙龈及皮下瘀斑)'),
key: 'question5',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('6、直系属亲属(父母、兄弟姐妹、子女)有肝癌病史'),
key: 'question6',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('7、长期进食霉变食物或进食烟熏或盐腌的肉制品'),
key: 'question7',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('8、有肝区疼痛史:(肝区疼痛:右上腹或中上腹持续性或间歇性钝痛、刺痛或胀痛,夜间或劳累后加重)'),
key: 'question8',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('9、符合以下任意2项者:', 'question10'),
key: 'question9',
answer: {
type: 'radio',
cont: getDict('DC00001'),
// 禁用
disabled: true,
},
// 赋初始值
init: () => {
return 2
}
}, {
key: 'question10',
index: 10,
answer: {
type: 'checkbox',
cont: getDict('DC00095')
},
change: (that) => {
if (!that) return
const item1 = that.getIssue('question10')
const item2 = that.getIssue('question9')
if (!item1 || !item2) return
const val = item1.value || []
item2.value = val.length >= 2 ? 1 : 2
}
}],
check() {
return this.issue[0].value === 1 &&
this.issue.filter(e => e.value === 1 && e.title).length >= 2
},
remark: '一般风险人群建议:随访观察。\n肝癌高危人群建议:进一步检查彩色多普勒腹部超声、甲胎蛋白测定。',
sub: '肝癌高风险人群年龄40岁以上,且2-9至少满足一项'
},
q5: {
title: '宫颈癌筛查量表',
issue: [{
title: setTitle('1、已婚或有性生活史3年及以上的女性'),
key: 'question1',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('2、家族中有人患有宫颈癌或其他妇科癌症'),
key: 'question2',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('3、曾经被诊断为宫颈炎症、宫颈糜烂或宫颈息肉'),
key: 'question3',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('4、有阴异常道分泌物增多,非经期流血'),
key: 'question4',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('5、感染过人类乳头瘤病毒(HPV)'),
key: 'question5',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('6、同房后阴道出血或非经期流血'),
key: 'question6',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}],
check() {
return this.issue[0].value === 1 &&
this.issue.filter(e => e.value === 1).length >= 2
},
remark: '宫颈癌高风险人群建议:行阴道超声、宫颈涂片、HPV检查。',
sub: '已婚或有性生活史3年及以上的女性,且至少符合条件之一'
},
q6: {
title: '甲状腺癌筛查量表',
issue: [{
title: setTitle('1、年龄40岁以上'),
key: 'question1',
answer: {
type: 'radio',
cont: getDict('DC00001'),
// 禁用
disabled: true
},
// 赋初始值
init: () => {
return userInfo.age > 40 ? 1 : 2
}
}, {
title: setTitle('2、有甲状腺疾病:甲状腺炎、甲状腺结节'),
key: 'question2',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('3、有甲状腺癌家族史'),
key: 'question3',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('4、长期接触辐射或化学物质'),
key: 'question4',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('5、颈部放疗史'),
key: 'question5',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('6、有其他身体不适或异常表现,如体重变化、颈部增粗'),
key: 'question6',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}],
check() {
return this.issue[0].value === 1 &&
this.issue.filter(e => e.value === 1).length >= 2
},
remark: '甲状腺高风险人群:建议行甲状腺超声、甲状腺功能',
sub: '40岁以上的人群,且至少符合条件之一'
},
q7: {
title: '胃癌筛查量表',
issue: [{
title: setTitle('1、年龄40岁以上,男女不限'),
key: 'question1',
answer: {
type: 'radio',
cont: getDict('DC00001'),
disabled: true
},
// 赋初始值
init: () => {
return userInfo.age > 40 ? 1 : 2
}
}, {
title: setTitle('2、胃癌高发地区人群'),
key: 'question2',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('3、幽门螺杆菌(H.pylori)感染者'),
key: 'question3',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('4、既往患有慢性萎缩性胃炎、胃溃疡、胃息肉、手术后残胃、肥厚性胃炎、恶性贫血等胃癌前疾病'),
key: 'question4',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('5、胃癌患者一级亲属'),
key: 'question5',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
title: setTitle('6、存在胃癌其他高危因素(高盐、腌制饮食、吸烟、过度饮酒等)'),
key: 'question6',
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}],
check() {
return this.issue[0].value === 1 &&
this.issue.filter(e => e.value === 1).length >= 2
},
remark: '一般风险人群建议:随访观察。\n胃癌筛查高危人群建议:进一步进行胃十二指肠镜检查、肿瘤标志物、腹部CT。',
sub: '胃癌高风险人群年龄40岁以上,且2-6至少满足一项'
},
q8: {
title: '食管癌筛查量表',
issue: [{
key: 'question1',
title: setTitle('1、年龄40岁以上'),
answer: {
type: 'radio',
cont: getDict('DC00001'),
// 禁用
disabled: true
},
// 赋初始值
init: () => {
return userInfo.age > 40 ? 1 : 2
}
}, {
key: 'question2',
title: setTitle('2、经常食用过烫、粗硬或腌制的食物,吃饭吞食快、暴饮暴食或经常吸烟 与饮酒等不良生活习惯'),
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
key: 'question3',
title: setTitle('3、被HIV、HPV、单纯疱疹等病毒感染'),
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
key: 'question4',
title: setTitle('4、生活在食管癌高发地区的人群:如河北、山西、河南等地'),
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
key: 'question5',
title: setTitle('5、近期有吞咽困难、胸背部疼痛、食管异物感等症状'),
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
key: 'question6',
title: setTitle('6、食管癌家族史'),
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}, {
key: 'question7',
title: setTitle('7、行胃镜检查诊断为肠上皮化生的Barrett食管的患者'),
answer: {
type: 'radio',
cont: getDict('DC00001')
}
}],
check() {
return this.issue[0].value === 1 &&
this.issue.filter(e => e.value === 1).length >= 2
},
remark: '一般人群建议:随访观察。\n食管癌高危人群建议:进一步行胃镜、食管内镜超声、肿瘤标记物或食管CT扫描、胸部增强CT检查。',
sub: '40岁以上的人群,且至少符合2项'
},
q9: {
title: '前列腺癌筛查量表',
issue: [{
title: setTitle(`1、尿频或排尿困难`),
key: 'question10',
answer: {
type: 'radio',
cont: getDict('DC00001'),
score: { 1: 1 }
}
}, {
title: setTitle(`2、尿流变小或中断`),
key: 'question11',
answer: {
type: 'radio',
cont: getDict('DC00001'),
score: { 1: 1 }
}
}, {
title: setTitle(`3、尿液中出现血丝`),
key: 'question12',
answer: {
type: 'radio',
cont: getDict('DC00001'),
score: { 1: 1 }
}
}, {
title: setTitle(`4、尿液浑浊或有异味`),
key: 'question13',
answer: {
type: 'radio',
cont: getDict('DC00001'),
score: { 1: 1 }
}
}, {
title: setTitle(`5、阴茎勃起困难或全`),
key: 'question14',
answer: {
type: 'radio',
cont: getDict('DC00001'),
score: { 1: 1 }
}
}, {
title: setTitle(`6、疼痛或不适感`),
key: 'question15',
answer: {
type: 'radio',
cont: getDict('DC00001'),
score: { 1: 1 }
}
}, {
title: setTitle('7、您是否有家族中有人患有前列腺癌'),
key: 'question2',
answer: {
type: 'radio',
cont: getDict('DC00001'),
score: { 1: 1 }
}
}, {
title: setTitle('8、你是否曾经被诊断为前列腺疾病'),
key: 'question3',
answer: {
type: 'radio',
cont: getDict('DC00001'),
score: { 1: 1 }
}
}, {
title: setTitle('9、你是否常食用高脂食品?(如肥肉、蛋黄、猪脑,蟹黄等高脂食品)'),
key: 'question5',
answer: {
type: 'radio',
cont: getDict('DC00001'),
score: { 1: 1 }
}
}, {
title: setTitle('10、您是否长期坐着工作或生活'),
key: 'question8',
answer: {
type: 'radio',
cont: getDict('DC00001'),
score: { 1: 1 }
}
}],
check() {
let score = 0
this.issue.forEach(e => {
score = score + (e.answer.score[e.value] || 0)
})
this.score = score
return score > 4
},
remark: '一般人群建议:随访观察\n高危人群建议:进一步检查前列腺特异性抗原、前列腺B超、盆腔磁共振成像(MRI)',
sub: '计分方式:每个条目1分,结果以总分计算,也就是以十个条目的分值相加,总分范围是0—10分。0-4分属于一般人群,5-10分属于高危人群'
},
q10: {
title: '肾癌筛查量表',
issue: [{
key: 'question1',
title: setTitle('1、近期出现血尿,肾区疼痛等症状(5分)'),
answer: {
type: 'radio',
cont: getDict('DC00001'),
score: { 1: 5 }
}
}, {
key: 'question2',
title: setTitle('2、长期吸烟、酗酒及长期熬夜(1分)'),
answer: {
type: 'radio',
cont: getDict('DC00001'),
score: { 1: 1 }
}
}, {
key: 'question3',
title: setTitle('3、家族有肾癌患者(2分)'),
answer: {
type: 'radio',
cont: getDict('DC00001'),
score: { 1: 2 }
}
}, {
key: 'question4',
title: setTitle('4、患有高血压、糖尿病、肥胖症等慢性病(1分)'),
answer: {
type: 'radio',
cont: getDict('DC00001'),
score: { 1: 1 }
}
}, {
key: 'question5',
title: setTitle('5、职业因素:长期接触石油、金属等产品(1分)'),
answer: {
type: 'radio',
cont: getDict('DC00001'),
score: { 1: 1 }
}
}],
check() {
let score = 0
this.issue.forEach(e => {
score = score + (e.answer.score[e.value] || 0)
})
this.score = score
return score > 2
},
remark: '0-2分一般人群建议:随访观察。\n3-10分高危群建议:进一步行尿常规、肝功能、肾功能、肿瘤标记物、泌尿系彩超、CT等检查。',
sub: '计分方式:总分范围是0—10分。 0-2分一般人群,3-10分高危群'
}
}
const result = questions['q' + key]
return result ? new Question(result, detail) : {}
}
class Question {
issue = []
check = null
result = null
remark = null
sub = null
highRisk = null
highRiskTrans = null
score = null
constructor({
title = '',
remark = '',
sub = '',
issue = [],
check = () => {}
} = {}, detail = {}) {
console.log('class Question', detail)
this.issue = issue.map(e => {
let value = detail[e.key] || (e.init && e.init())
if (!e.title && value) {
value = value.split(',').map(i => +i)
}
return {
...e,
value,
valueTrans: detail[e.key + 'Trans'],
valueOther: null,
}
})
// 处理title中有选项的
console.log('this.issue', this.issue)
const arr = this.issue.filter(e => e.title && e.title.linkKey)
arr.forEach(e => {
const linkKey = e.title.linkKey
e.titleExtend = this.getIssue(linkKey)
})
this.title = title
this.remark = remark
this.sub = sub
this.check = check
this.highRisk = detail?.highRisk
this.highRiskTrans = detail?.highRiskTrans
this.score = detail?.score
}
getIssue(key) {
return this.issue.find(e => e.key === key)
}
}