finish edit content of tools before 2019/12/21(include the user choices)

This commit is contained in:
BOHUNG 2019-12-21 23:50:17 +08:00
parent 74fff06818
commit e2bc83ec2e
5 changed files with 141 additions and 33 deletions

View File

@ -4,6 +4,7 @@ $(document).ready(function(){
$('.header-nav').html(head_images.responseJSON['head_images']); $('.header-nav').html(head_images.responseJSON['head_images']);
$('.navbar-brand').html(head_images.responseJSON['title']) $('.navbar-brand').html(head_images.responseJSON['title'])
}); });
$('#font_size_choices .cancer_table_btn').eq(0).addClass('active');
Array.prototype.remove_item_from_array = function(){ Array.prototype.remove_item_from_array = function(){
var result_array = this; var result_array = this;
for(var i=0;i<arguments.length;i++){ for(var i=0;i<arguments.length;i++){
@ -191,7 +192,7 @@ $(document).ready(function(){
} }
if($('.cancertable_empty').length != 0){ if($('.cancertable_empty').length != 0){
flag = 0; flag = 0;
$('#cancer_table_submit').parent().before('<a id="danger_texts" style="color:red;">請注意紅框的輸入資料是否符合要求</a>'); ($('#danger_texts').length == 0) ? $('#cancer_table_submit').parent().before('<a id="danger_texts" style="color:red;">請注意紅框的輸入資料是否符合要求</a>') : null;
$('#danger_texts').css('margin-left',$(window).width()/2-$('#danger_texts').width()/2); $('#danger_texts').css('margin-left',$(window).width()/2-$('#danger_texts').width()/2);
}else{ }else{
$('#danger_texts').remove(); $('#danger_texts').remove();
@ -216,7 +217,7 @@ $(document).ready(function(){
if(result.responseJSON.lpv != "error"){ if(result.responseJSON.lpv != "error"){
var load_heml = $('#result_table_content').html(result.responseJSON.table); var load_heml = $('#result_table_content').html(result.responseJSON.table);
load_heml.ready(function(){ load_heml.ready(function(){
$('#result_table_content .cancer_years').eq(0).addClass('active'); $('#result_table_content .cancer_years').eq(-1).addClass('active');
for(var i = 0;i < $('#result_table_content .cancer_years').length;i++){ for(var i = 0;i < $('#result_table_content .cancer_years').length;i++){
$('#result_table_content .cancer_years').eq(i).attr('index',i) $('#result_table_content .cancer_years').eq(i).attr('index',i)
}; };
@ -232,7 +233,7 @@ $(document).ready(function(){
}); });
load_heml = $('#result_text_content').html(result.responseJSON.texts); load_heml = $('#result_text_content').html(result.responseJSON.texts);
load_heml.ready(function(){ load_heml.ready(function(){
$('#result_text_content .cancer_years').eq(0).addClass('active'); $('#result_text_content .cancer_years').eq(-1).addClass('active');
for(var i = 0;i < $('#result_text_content .cancer_years').length;i++){ for(var i = 0;i < $('#result_text_content .cancer_years').length;i++){
$('#result_text_content .cancer_years').eq(i).attr('index',i) $('#result_text_content .cancer_years').eq(i).attr('index',i)
}; };
@ -252,8 +253,8 @@ $(document).ready(function(){
$('#cancer_table_right_result .cancer-btn-group .cancer_table_btn').removeClass('active'); $('#cancer_table_right_result .cancer-btn-group .cancer_table_btn').removeClass('active');
$('#cancer_table_right_result .cancer-btn-group >input').attr('value',"0"); $('#cancer_table_right_result .cancer-btn-group >input').attr('value',"0");
for(var i = 0;i < $('#cancer_table_left_result .cancer-btn-group').length;i++){ for(var i = 0;i < $('#cancer_table_left_result .cancer-btn-group').length;i++){
$('#cancer_table_right_result .cancer-btn-group').eq(i).find('.cancer_table_btn').eq(0).addClass('active'); $('#cancer_table_left_result .cancer-btn-group').eq(i).find('.cancer_table_btn').eq(0).addClass('active');
$('#cancer_table_right_result .cancer-btn-group').eq(i).find('>input').eq(0).attr('value',"1"); $('#cancer_table_left_result .cancer-btn-group').eq(i).find('>input').eq(0).attr('value',"1");
}; };
for(var i = 0;i < $('#cancer_table_right_result .cancer-btn-group').length;i++){ for(var i = 0;i < $('#cancer_table_right_result .cancer-btn-group').length;i++){
$('#cancer_table_right_result .cancer-btn-group').eq(i).find('.cancer_table_btn').eq(0).addClass('active'); $('#cancer_table_right_result .cancer-btn-group').eq(i).find('.cancer_table_btn').eq(0).addClass('active');
@ -487,7 +488,52 @@ $(document).ready(function(){
result['age1'] = Math.pow((Number(result_json['age'])/100),0.5); result['age1'] = Math.pow((Number(result_json['age'])/100),0.5);
result['age2'] = Math.pow((Number(result_json['age'])/100),0.5)*Math.log(result_json['age']/100); result['age2'] = Math.pow((Number(result_json['age'])/100),0.5)*Math.log(result_json['age']/100);
result['size1'] = Math.log(Number(result_json['size'])/10); result['size1'] = Math.log(Number(result_json['size'])/10);
result['nposit'] = Math.pow(((Number(result_json['ratio'])+0.1)/0.1),0.5); try{result['ratio'] = Number(result_json['lymph_nodes_positive'])/Number(result_json['lymph_nodes_examined'])}catch{result['ratio'] = 0}
if(result['ratio'] > 1)
result['ratio'] = 1
result['nposit'] = Math.pow(((Number(result['ratio'])+0.1)/0.1),0.5);
var T = '';
if(Number(result_json['tumor_direct_extension']) != 1){
if(Number(result_json['size']) <= 20)
T = 'T1';
else if(Number(result_json['size']) > 20 && Number(result_json['size']) <= 50)
T = 'T2';
else if(Number(result_json['size']) > 50)
T = 'T3';
}else{
T = 'T4';
};
var N = '';
if(Number(result_json['lymph_nodes_positive']) == 0)
N = 'N0';
else if(Number(result_json['lymph_nodes_positive']) >= 1 && Number(result_json['lymph_nodes_positive']) <= 3 && Number(result_json['micrometastasis']) != 1)
N = 'N1';
else if(Number(result_json['lymph_nodes_positive']) >= 1 && Number(result_json['lymph_nodes_positive']) <= 3 && Number(result_json['micrometastasis']) == 1)
N = 'N1mi';
else if(Number(result_json['lymph_nodes_positive']) >= 4 && Number(result_json['lymph_nodes_positive']) <= 9)
N = 'N2';
else if(Number(result_json['lymph_nodes_positive']) >= 10)
N = 'N3';
M = '';
if(Number(result_json['Distant_Metastasis']) != 1)
M = 'M0';
else
M = 'M1';
if(Number(M == 'M0'))
if(T == 'T1' && (N == 'N0' || N == 'N1mi'))
result['pstage'] = 1;
else if(((T == 'T2' || T == 'T3') && (N == 'N0')) || ((T == 'T1' || T == 'T2') && (N == 'N1')))
result['pstage'] = 2;
else if((T == 'T4' && N == 'N0') || ((T == 'T3' || T == 'T4') && N == 'N1') || (N == 'N2' || N == 'N3'))
result['pstage'] = 3;
else
result['pstage'] = 4
if((Number(result_json['ER_status']) != 2 || Number(result_json['PR_status']) != 2) && (Number(result_json['HER2_status']) != 1))
result['subtype'] = 1;
else if(Number(result_json['ER_status']) == 2 && Number(result_json['PR_status']) == 2 && (Number(result_json['HER2_status']) == 1))
result['subtype'] = 2;
else if(Number(result_json['ER_status']) == 2 && Number(result_json['PR_status']) == 2 && (Number(result_json['HER2_status']) != 1))
result['subtype'] = 3;
if( Number(result_json['grade']) == 2) if( Number(result_json['grade']) == 2)
result['grade_2'] = 1; result['grade_2'] = 1;
else else
@ -496,23 +542,23 @@ $(document).ready(function(){
result['grade_3'] = 1; result['grade_3'] = 1;
else else
result['grade_3'] = 0; result['grade_3'] = 0;
if( Number(result_json['subtype']) == 2) if( Number(result['subtype']) == 2)
result['subtype_HER2'] = 1; result['subtype_HER2'] = 1;
else else
result['subtype_HER2'] = 0; result['subtype_HER2'] = 0;
if( Number(result_json['subtype']) == 3) if( Number(result['subtype']) == 3)
result['subtype_triple'] = 1; result['subtype_triple'] = 1;
else else
result['subtype_triple'] = 0; result['subtype_triple'] = 0;
if( Number(result_json['pstage']) == 2) if( Number(result['pstage']) == 2)
result['pstage_2'] = 1; result['pstage_2'] = 1;
else else
result['pstage_2'] = 0; result['pstage_2'] = 0;
if( Number(result_json['pstage']) == 3) if( Number(result['pstage']) == 3)
result['pstage_3'] = 1; result['pstage_3'] = 1;
else else
result['pstage_3'] = 0; result['pstage_3'] = 0;
if( Number(result_json['pstage']) == 4) if( Number(result['pstage']) == 4)
result['pstage_4'] = 1; result['pstage_4'] = 1;
else else
result['pstage_4'] = 0; result['pstage_4'] = 0;

View File

@ -2,7 +2,6 @@
padding: 0.375em 0; padding: 0.375em 0;
} }
.head_logo{ .head_logo{
float:left;
height: 4em; height: 4em;
} }
@media screen and (max-width: 48em) .navbar-brand{ @media screen and (max-width: 48em) .navbar-brand{
@ -158,6 +157,7 @@ input.float_num{
padding: 0.125em 0.5em; padding: 0.125em 0.5em;
border-radius: 0.5em; border-radius: 0.5em;
font-size: 1.25em; font-size: 1.25em;
float: left;
} }
.result_tab{ .result_tab{
background: #023d79; background: #023d79;
@ -276,6 +276,9 @@ input.float_num{
#cancer_predict_result_block{ #cancer_predict_result_block{
display:none; display:none;
font-size: 0.825em; font-size: 0.825em;
margin-top: 3em;
border-top: #666 solid;
padding-top: 2em;
} }
p.texts_show{ p.texts_show{
display: list-item; display: list-item;
@ -327,4 +330,7 @@ div.texts_show{
width: 50%; width: 50%;
float: left; float: left;
} }
.result_title{
margin-top: 1em;
}
} }

View File

@ -118,7 +118,7 @@ class Admin::CancerpredictsController < OrbitAdminController
end end
else else
@file_name = image['temp_file'].original_filename.gsub('(','_').gsub(')','_').gsub(' ','_') rescue next @file_name = image['temp_file'].original_filename.gsub('(','_').gsub(')','_').gsub(' ','_') rescue next
@headimages = Headimages.new(:cancerpredictfields_id => @form_to_show.id,:title => @app_title) @headimages = Headimages.new(:cancerpredictfields_id => @form_to_show.id,:title => @app_title+'head_images')
@headimages.temp_file = image['temp_file'] @headimages.temp_file = image['temp_file']
@headimages.sort_number = image['sort_number'].to_i if !image['sort_number'].nil? @headimages.sort_number = image['sort_number'].to_i if !image['sort_number'].nil?
@headimages.save @headimages.save
@ -155,7 +155,7 @@ class Admin::CancerpredictsController < OrbitAdminController
end end
else else
@file_name = image['temp_file'].original_filename.gsub('(','_').gsub(')','_').gsub(' ','_') rescue next @file_name = image['temp_file'].original_filename.gsub('(','_').gsub(')','_').gsub(' ','_') rescue next
@headimages = Headimages.new(:cancerpredictfields_id => @form_to_show.id,:title => @app_title) @headimages = Headimages.new(:cancerpredictfields_id => @form_to_show.id,:title => @app_title+'title_images' )
@headimages.temp_file = image['temp_file'] @headimages.temp_file = image['temp_file']
@headimages.sort_number = image['sort_number'].to_i if !image['sort_number'].nil? @headimages.sort_number = image['sort_number'].to_i if !image['sort_number'].nil?
@headimages.save @headimages.save

View File

@ -44,7 +44,57 @@ class CancerpredictsController < ApplicationController
result['age1'] = (params['data']['age'].to_f/100)**(0.5) result['age1'] = (params['data']['age'].to_f/100)**(0.5)
result['age2'] = ((params['data']['age'].to_f/100)**(0.5))*Math.log(params['data']['age'].to_f/100,Math.exp(1)) result['age2'] = ((params['data']['age'].to_f/100)**(0.5))*Math.log(params['data']['age'].to_f/100,Math.exp(1))
result['size1'] = Math.log(params['data']['size'].to_f/10,Math.exp(1)) result['size1'] = Math.log(params['data']['size'].to_f/10,Math.exp(1))
result['nposit'] = ((params['data']['ratio'].to_f+0.1)/0.1)**0.5 result['ratio'] = params['data']['lymph_nodes_positive'].to_f/params['data']['lymph_nodes_examined'].to_f rescue 0
result['ratio'] = 1 if result['ratio'] > 1
result['nposit'] = ((result['ratio'].to_f+0.1)/0.1)**0.5
@T = ''
if params['data']['tumor_direct_extension'].to_i != 1
if params['data']['size'].to_i <= 20
@T = 'T1'
elsif params['data']['size'].to_i > 20 && params['data']['size'].to_i <= 50
@T = 'T2'
elsif params['data']['size'].to_i > 50
@T = 'T3'
end
else
@T = 'T4'
end
@N = ''
if params['data']['lymph_nodes_positive'].to_i == 0
@N = 'N0'
elsif params['data']['lymph_nodes_positive'].to_i >= 1 && params['data']['lymph_nodes_positive'].to_i <= 3 && params['data']['micrometastasis'].to_i != 1
@N = 'N1'
elsif params['data']['lymph_nodes_positive'].to_i >= 1 && params['data']['lymph_nodes_positive'].to_i <= 3 && params['data']['micrometastasis'].to_i == 1
@N = 'N1mi'
elsif params['data']['lymph_nodes_positive'].to_i >= 4 && params['data']['lymph_nodes_positive'].to_i <= 9
@N = 'N2'
elsif params['data']['lymph_nodes_positive'].to_i >= 10
@N = 'N3'
end
@M = ''
if params['data']['Distant_Metastasis'].to_i != 1
@M = 'M0'
else
@M = 'M1'
end
if @M == 'M0'
if @T == 'T1' && (@N == 'N0' || @N == 'N1mi')
result['pstage'] = 1
elsif ((@T == 'T2' || @T == 'T3') && (@N == 'N0')) || ((@T == 'T1' || @T == 'T2') && (@N == 'N1'))
result['pstage'] = 2
elsif (@T == 'T4' && @N == 'N0') || ((@T == 'T3' || @T == 'T4') && @N == 'N1') || (@N == 'N2' || @N == 'N3')
result['pstage'] = 3
end
else
result['pstage'] = 4
end
if (params['data']['ER_status'].to_i != 2 || params['data']['PR_status'].to_i != 2) && (params['data']['HER2_status'].to_i != 1)
result['subtype'] = 1
elsif params['data']['ER_status'].to_i == 2 && params['data']['PR_status'].to_i == 2 && (params['data']['HER2_status'].to_i == 1)
result['subtype'] = 2
elsif params['data']['ER_status'].to_i == 2 && params['data']['PR_status'].to_i == 2 && (params['data']['HER2_status'].to_i != 1)
result['subtype'] = 3
end
if params['data']['grade'].to_i == 2 if params['data']['grade'].to_i == 2
result['grade_2'] = 1 result['grade_2'] = 1
else else
@ -55,27 +105,27 @@ class CancerpredictsController < ApplicationController
else else
result['grade_3'] = 0 result['grade_3'] = 0
end end
if params['data']['subtype'].to_i == 2 if result['subtype'].to_i == 2
result['subtype_HER2'] = 1 result['subtype_HER2'] = 1
else else
result['subtype_HER2'] = 0 result['subtype_HER2'] = 0
end end
if params['data']['subtype'].to_i == 3 if result['subtype'].to_i == 3
result['subtype_triple'] = 1 result['subtype_triple'] = 1
else else
result['subtype_triple'] = 0 result['subtype_triple'] = 0
end end
if params['data']['pstage'].to_i == 2 if result['pstage'].to_i == 2
result['pstage_2'] = 1 result['pstage_2'] = 1
else else
result['pstage_2'] = 0 result['pstage_2'] = 0
end end
if params['data']['pstage'].to_i == 3 if result['pstage'].to_i == 3
result['pstage_3'] = 1 result['pstage_3'] = 1
else else
result['pstage_3'] = 0 result['pstage_3'] = 0
end end
if params['data']['pstage'].to_i == 4 if result['pstage'].to_i == 4
result['pstage_4'] = 1 result['pstage_4'] = 1
else else
result['pstage_4'] = 0 result['pstage_4'] = 0
@ -89,7 +139,7 @@ class CancerpredictsController < ApplicationController
result['grade_2']*0.4795+result['grade_3']*0.818+result['subtype_HER2']*0.1806+result['subtype_triple']*0.6457+result['pstage_2']*0.5311+ result['grade_2']*0.4795+result['grade_3']*0.818+result['subtype_HER2']*0.1806+result['subtype_triple']*0.6457+result['pstage_2']*0.5311+
result['pstage_3']*1.134+result['pstage_4']*2.172+result['lvi_yes']*0.3321-0.04 rescue 'error') result['pstage_3']*1.134+result['pstage_4']*2.172+result['lvi_yes']*0.3321-0.04 rescue 'error')
@years = ['1','3','5'] @years = ['1','3','5']
result['table'] = '<input id="current_year" type="hidden" value="'+@years[0]+'" index="0"/><p id="cancer_table_texts">此分析微針對已接受手術後病人下表為此病人分別在第1年、3及5年下根據選定的術後治療所估計的存活率</p>' result['table'] = '<input id="current_year" type="hidden" value="'+@years[-1]+'" index="0"/><p id="cancer_table_texts">此分析微針對已接受手術後病人下表為此病人分別在第1年、3及5年下根據選定的術後治療所估計的存活率</p>'
result['table'] += '<a>第</a>' result['table'] += '<a>第</a>'
result['years'] = @years result['years'] = @years
@years.each{|year| result['table'] += ('<button class="cancer_years cancer_table_btn btn btn-default btn-sm">'+year+'</button>')} @years.each{|year| result['table'] += ('<button class="cancer_years cancer_table_btn btn btn-default btn-sm">'+year+'</button>')}
@ -114,8 +164,9 @@ class CancerpredictsController < ApplicationController
result['texts'] = '<a>此研究分析來自已接受根除性手術後之婦女所得之結果,根據您所輸入的資訊以及治療方式,</a>'+'<div style="clear:both;"></div>'+'<a>在術後第</a>' result['texts'] = '<a>此研究分析來自已接受根除性手術後之婦女所得之結果,根據您所輸入的資訊以及治療方式,</a>'+'<div style="clear:both;"></div>'+'<a>在術後第</a>'
@years.each{|year| result['texts'] += ('<button class="cancer_years cancer_table_btn btn btn-default btn-sm">'+year+'</button>')} @years.each{|year| result['texts'] += ('<button class="cancer_years cancer_table_btn btn btn-default btn-sm">'+year+'</button>')}
result['texts'] += '<a>年</a>' result['texts'] += '<a>年</a>'
@servive_ratio = ((Math.exp(-0.001476145)**(Math.exp(result['lpv'])))*100).round @lpv_calc = [-0.001476145,-0.01261639,-0.02519608]
result['texts'] += ('<p class="show"><a>100 位只接受根除性手術的婦女中,有 '+ '<a class="'+@therapy_names[0]+' Overall_Survival">'+@servive_ratio.round.to_s+'</a>'+'<a> 位婦女,術後 </a>'+'<a class="surgery_year">'+@years[0].to_s+'</a>'+'<a>年仍為存活</a></p>') @servive_ratio = ((Math.exp(@lpv_calc[-1])**(Math.exp(result['lpv'])))*100).round
result['texts'] += ('<p class="show"><a>100 位只接受根除性手術的婦女中,有 '+ '<a class="'+@therapy_names[0]+' Overall_Survival">'+@servive_ratio.round.to_s+'</a>'+'<a> 位婦女,術後 </a>'+'<a class="surgery_year">'+@years[-1].to_s+'</a>'+'<a>年仍為存活</a></p>')
result['texts'] += '<a class="addition">'+',此外</a><div class="extra-text" style="display:none;"><div class="texts_show" style="clear:both;"></div>' result['texts'] += '<a class="addition">'+',此外</a><div class="extra-text" style="display:none;"><div class="texts_show" style="clear:both;"></div>'
result['texts'] += '</div>' result['texts'] += '</div>'
result['servive_ratio'] = @servive_ratio result['servive_ratio'] = @servive_ratio

View File

@ -9,28 +9,33 @@ class Cancerpredictfields
field :title ,type:String ,default:"" field :title ,type:String ,default:""
field :form_show , :type=> Hash ,default:{0=>{:variable=>"age",:name=>{"zh_tw"=>"年齡<br/>(age)","en"=>"age"},:is_num=>1, :hint=>{'zh_tw'=>'從 18 歲(含)開始至 93 歲','en'=>''} , :comment_text=>{'zh_tw'=>'年齡為該婦女於確診罹患乳癌時之年齡','en'=>''}, :choice_fields=> {"zh_tw"=>[],"en"=>[]},:range=>[18,93],:right=>0,:is_float=>0}, field :form_show , :type=> Hash ,default:{0=>{:variable=>"age",:name=>{"zh_tw"=>"年齡<br/>(age)","en"=>"age"},:is_num=>1, :hint=>{'zh_tw'=>'從 18 歲(含)開始至 93 歲','en'=>''} , :comment_text=>{'zh_tw'=>'年齡為該婦女於確診罹患乳癌時之年齡','en'=>''}, :choice_fields=> {"zh_tw"=>[],"en"=>[]},:range=>[18,93],:right=>0,:is_float=>0},
1=>{:variable=>"size",:name=>{"zh_tw"=>"腫瘤大小<br/>(tumor size)","en"=>"tumor size"},:is_num=>1,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'若有多個原發腫瘤,請輸入最大尺寸之原發腫瘤','en'=>''}, :choice_fields=> {"zh_tw"=>[],"en"=>[]},:range=>[1,300],:right=>0,:is_float=>0}, 1=>{:variable=>"size",:name=>{"zh_tw"=>"腫瘤大小<br/>(tumor size)","en"=>"tumor size"},:is_num=>1,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'若有多個原發腫瘤,請輸入最大尺寸之原發腫瘤','en'=>''}, :choice_fields=> {"zh_tw"=>[],"en"=>[]},:range=>[1,300],:right=>0,:is_float=>0},
2=>{:variable=>"ratio",:name=>{"zh_tw"=>"淋巴結陽性比例<br/>(node-positive ratio)","en"=>"node-positive ratio"},:is_num=>1,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'','en'=>''}, :choice_fields=> {"zh_tw"=>[],"en"=>[]},:range=>[0,1],:right=>0,:is_float=>1}, 2=>{:variable=>"lymph_nodes_examined",:name=>{"zh_tw"=>"區域淋巴結檢查數目<br/>(Regional lymph nodes examined)","en"=>"Regional lymph nodes examined"},:is_num=>1,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'','en'=>''}, :choice_fields=> {"zh_tw"=>[],"en"=>[]},:range=>[0,90],:right=>0,:is_float=>0},
3=>{:variable=>"grade",:name=>{"zh_tw"=>"腫瘤級數<br/>(tumor grade)","en"=>"tumor grade"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'腫瘤級數代表腫瘤組織與正常組織間的分化程度,若無分化級數資訊,請選擇“未知”選項,將以級數 1 進行預測。','en'=>''}, :choice_fields=> {"zh_tw"=>['1','2','3','未知'],"en"=>['1','2','3','unknown']},:range=>[],:right=>0,:is_float=>0}, 3=>{:variable=>"lymph_nodes_positive",:name=>{"zh_tw"=>"區域淋巴結侵犯數目<br/>(Regional lymph nodes positive)","en"=>"Regional lymph nodes positive"},:is_num=>1,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'','en'=>''}, :choice_fields=> {"zh_tw"=>[],"en"=>[]},:range=>[0,90],:right=>0,:is_float=>0},
4=>{:variable=>"subtype",:name=>{"zh_tw"=>"乳癌分型<br/>(breast cancer subtype)","en"=>"breast cancer subtype"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'<p>HER2第二型人類上皮成長因子接受器蛋白(HER2-enriched)過度表現型</p><p>若無分型資訊,請選擇“未知”選項,將以佔多數比例的管腔類進行預測。</p>','en'=>''}, :choice_fields=> {"zh_tw"=>['管腔類','HER2','三陰性','未知'],"en"=>['Luminal-like','HER2','Triple negative','unknown']},:range=>[],:right=>1,:is_float=>0}, 4=>{:variable=>"grade",:name=>{"zh_tw"=>"腫瘤級數<br/>(tumor grade)","en"=>"tumor grade"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'腫瘤級數代表腫瘤組織與正常組織間的分化程度,若無分化級數資訊,請選擇“未知”選項,將以級數 1 進行預測。','en'=>''}, :choice_fields=> {"zh_tw"=>['1','2','3','未知'],"en"=>['1','2','3','unknown']},:range=>[],:right=>0,:is_float=>0},
5=>{:variable=>"pstage",:name=>{"zh_tw"=>"病理分期<br/>(pathologic stage)","en"=>"pathologic stage"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'若無分期資訊,請選擇“未知”選項,將以病理分期第 1 期進行預測。','en'=>''}, :choice_fields=> {"zh_tw"=>['1','2','3','4','未知'],"en"=>['1','2','3','4','unknown']},:range=>[],:right=>1,:is_float=>0}, 5=>{:variable=>"ER_status",:name=>{"zh_tw"=>"ER 狀態<br/>(ER status)","en"=>"ER status"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'ER:雌激素受體,若無 ER 資訊請選擇未知,將以佔多數比例陽性作為後續預測。','en'=>''}, :choice_fields=> {"zh_tw"=>['陽性','陰性','未知'],"en"=>['positive','negative','unknown']},:range=>[],:right=>1,:is_float=>0},
6=>{:variable=>"lvi",:name=>{"zh_tw"=>"淋巴管或血管侵犯<br/>(lymph vessel or vascular invasion, LVI)","en"=>"lymph vessel or vascular invasion, LVI"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'若無淋巴管或血管侵犯資訊,請選擇“未知”選項,將以佔多數比例的淋巴管或血管未侵犯進行預測','en'=>''}, :choice_fields=> {"zh_tw"=>['是','否','未知'],"en"=>['yes','no','unknown']},:range=>[],:right=>1,:is_float=>0} 6=>{:variable=>"PR_status",:name=>{"zh_tw"=>"PR 狀態<br/>(PR status)","en"=>"PR status"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'PR:黃體素受體,若無 PR 資訊請選擇未知,將以佔多數比例陽性作為後續預測。','en'=>''}, :choice_fields=> {"zh_tw"=>['陽性','陰性','未知'],"en"=>['positive','negative','unknown']},:range=>[],:right=>1,:is_float=>0},
7=>{:variable=>"HER2_status",:name=>{"zh_tw"=>"HER2 狀態<br/>(HER2 status)","en"=>"HER2 status"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'HER2:第二型人類上皮成長因子接受器蛋白,若無 HER2 資訊請選擇未知,將以佔多數比例陰性作為後續預測。','en'=>''}, :choice_fields=> {"zh_tw"=>['陽性','陰性','未知'],"en"=>['positive','negative','unknown']},:range=>[],:right=>1,:is_float=>0},
8=>{:variable=>"Distant_Metastasis",:name=>{"zh_tw"=>"遠端轉移<br/>(DistantMetastasis)","en"=>"pathologic stage"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'若無遠轉移資訊請選擇未知,將以佔多數比例未遠端轉移作為後續預測。','en'=>''}, :choice_fields=> {"zh_tw"=>['是','否','未知'],"en"=>['yes','no','unknown']},:range=>[],:right=>1,:is_float=>0},
9=>{:variable=>"micrometastasis",:name=>{"zh_tw"=>"顯微轉移<br/>(micrometastasis)","en"=>"pathologic stage"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'若無顯微移資訊請選擇未知,將以無顯微轉移作為後續預測。','en'=>''}, :choice_fields=> {"zh_tw"=>['是','否','未知'],"en"=>['yes','no','unknown']},:range=>[],:right=>1,:is_float=>0},
10=>{:variable=>"tumor_direct_extension",:name=>{"zh_tw"=>"腫瘤浸潤至胸壁和/或皮膚<br/>(tumor direct extension to the chest wall and/or to the skin)","en"=>"tumor direct extension to the chest wall and/or to the skin"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'若無腫瘤浸潤至胸壁或皮膚資訊請選擇未知,將以佔多數比例無腫瘤浸潤至胸壁作為後續預測。','en'=>''}, :choice_fields=> {"zh_tw"=>['是','否','未知'],"en"=>['yes','no','unknown']},:range=>[],:right=>1,:is_float=>0},
11=>{:variable=>"lvi",:name=>{"zh_tw"=>"淋巴管或血管侵犯<br/>(lymph vessel or vascular invasion, LVI)","en"=>"lymph vessel or vascular invasion, LVI"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'若無淋巴管或血管侵犯資訊,請選擇“未知”選項,將以佔多數比例的淋巴管或血管未侵犯進行預測','en'=>''}, :choice_fields=> {"zh_tw"=>['是','否','未知'],"en"=>['yes','no','unknown']},:range=>[],:right=>1,:is_float=>0}
} }
field :form_show_in_result , :type=> Hash ,default:{0=>{:variable=>"hormone_therapy",:name=>{"zh_tw"=>"賀爾蒙治療","en"=>"Hormone/steroid therapy"},:is_num=>0, :hint=>{'zh_tw'=>'賀爾蒙治療適用於ER狀態為陽性之病人','en'=>'Hormone (endocrine) therapy is available when ER-status is positive'} , :comment_text=>{'zh_tw'=>'','en'=>'<p>Hormone therapy, or endocrine therapy, involves a woman taking drugs to prevent the growth of tumour cells that are boosted by the hormone oestrogen. Drugs of this kind include tamoxifen (brand names include Nolvadex, Istabul, Valodex, and Soltamox) and aromatase inhibitors such as anastrozole, exemestane, and letrozole (brand names Arimidex, Aromasin, and Femara).</p>'+ field :form_show_in_result , :type=> Hash ,default:{0=>{:variable=>"hormone_therapy",:name=>{"zh_tw"=>"賀爾蒙治療","en"=>"Hormone/steroid therapy"},:is_num=>0, :hint=>{'zh_tw'=>'適用賀爾蒙受體陽性病人','en'=>'Hormone (endocrine) therapy is available when ER-status is positive'} , :comment_text=>{'zh_tw'=>'','en'=>'<p>Hormone therapy, or endocrine therapy, involves a woman taking drugs to prevent the growth of tumour cells that are boosted by the hormone oestrogen. Drugs of this kind include tamoxifen (brand names include Nolvadex, Istabul, Valodex, and Soltamox) and aromatase inhibitors such as anastrozole, exemestane, and letrozole (brand names Arimidex, Aromasin, and Femara).</p>'+
'<p>Some hormone therapy drugs act by blocking the action of oestrogen on the cells and some work by lowering the amount of oestrogen in the body (NB hormone therapy for breast cancer is the opposite of hormone replacement therapy or HRT, which is taken by women to help INCREASE oestrogen levels to help deal with side-effects of the menopause).</p>'+ '<p>Some hormone therapy drugs act by blocking the action of oestrogen on the cells and some work by lowering the amount of oestrogen in the body (NB hormone therapy for breast cancer is the opposite of hormone replacement therapy or HRT, which is taken by women to help INCREASE oestrogen levels to help deal with side-effects of the menopause).</p>'+
'<p>Treatments usually have the potential to cause harm as well as benefit. It is important to weigh up the risks of potential harm against the potential benefits of treatment in order to reach a decision. Some may cause more harm than benefit to some people.</p>'+ '<p>Treatments usually have the potential to cause harm as well as benefit. It is important to weigh up the risks of potential harm against the potential benefits of treatment in order to reach a decision. Some may cause more harm than benefit to some people.</p>'+
'<p>It is useful to switch between 1 and 5 years hormone therapy to compare the survival outcomes.</p>'}, :choice_fields=> {"zh_tw"=>['否','是'],"en"=>['No','Yes']},:range=>[]}, '<p>It is useful to switch between 1 and 5 years hormone therapy to compare the survival outcomes.</p>'}, :choice_fields=> {"zh_tw"=>['否','是'],"en"=>['No','Yes']},:range=>[]},
1=>{:variable=>"Chemotherapy",:name=>{"zh_tw"=>"化學治療","en"=>"Chemotherapy"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'','en'=>''}, :choice_fields=> {"zh_tw"=>['否','是'],"en"=>['No','Yes']},:range=>[]}, 1=>{:variable=>"Chemotherapy",:name=>{"zh_tw"=>"化學治療","en"=>"Chemotherapy"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'','en'=>''}, :choice_fields=> {"zh_tw"=>['否','是'],"en"=>['No','Yes']},:range=>[]},
2=>{:variable=>"Radiotherapy",:name=>{"zh_tw"=>"放射治療","en"=>"Radiotherapy"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'','en'=>''}, :choice_fields=> {"zh_tw"=>['否','是'],"en"=>['No','Yes']},:range=>[]}, 2=>{:variable=>"Radiotherapy",:name=>{"zh_tw"=>"放射治療","en"=>"Radiotherapy"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'','en'=>''}, :choice_fields=> {"zh_tw"=>['否','是'],"en"=>['No','Yes']},:range=>[]},
3=>{:variable=>"Targeted_therapy",:name=>{"zh_tw"=>"標靶治療","en"=>"Targeted therapy"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'','en'=>''}, :choice_fields=> {"zh_tw"=>['否','是'],"en"=>['No','Yes']},:range=>[]} 3=>{:variable=>"Targeted_therapy",:name=>{"zh_tw"=>"標靶治療","en"=>"Targeted therapy"},:is_num=>0,:hint=>{'zh_tw'=>'抗HER2治療','en'=>''}, :comment_text=>{'zh_tw'=>'','en'=>''}, :choice_fields=> {"zh_tw"=>['否','是'],"en"=>['No','Yes']},:range=>[]}
} }
field :form_result_is_right , :type=> Integer ,default: 1 field :form_result_is_right , :type=> Integer ,default: 0
field :text_descibe ,type:Hash ,default:{"zh_tw"=>"歡迎使用台灣準備乳癌癒後系統!<br/>若要開始 請在下方輸入相關資訊","en"=>" Welcome to The after breast cancer healing system of Taiwanprepare!\nTo start, please enter the relevant information below."} field :text_descibe ,type:Hash ,default:{"zh_tw"=>"歡迎使用台灣準備乳癌癒後系統!<br/>若要開始 請在下方輸入相關資訊","en"=>" Welcome to The after breast cancer healing system of Taiwanprepare!\nTo start, please enter the relevant information below."}
field :small ,type:String ,default:"0.825em" field :small ,type:String ,default:"0.825em"
field :medium ,type:String ,default:"1em" field :medium ,type:String ,default:"1em"
field :large ,type:String ,default:"1.25em" field :large ,type:String ,default:"1.25em"
field :image_path ,type:String ,default:"1.25em" field :image_path ,type:String ,default:"1.25em"
field :head_images_id ,type:Array , default: [] field :head_images_id ,type:Array , default: [BSON::ObjectId('5df62cfc8cd8924e79000009'), BSON::ObjectId('5df745a58cd8924491000006'), BSON::ObjectId('5df745a58cd8924491000007'), BSON::ObjectId('5df745a58cd8924491000008'), BSON::ObjectId('5df745a58cd8924491000009')]
field :title_images_id ,type:Array , default: [] field :title_images_id ,type:Array , default: [BSON::ObjectId('5df87cd88cd8924491000036')]
field :title_texts ,type:String ,default:"" field :title_texts ,type:String ,default:""
#field :image_uploader ,type:Object #field :image_uploader ,type:Object
scope :can_display, ->{where(:is_hidden=>false,:is_preview => false).any_of({:postdate.lt=>Time.now, :deadline.gt=>Time.now},{:postdate.lt=>Time.now, :deadline=>nil}).order_by([:is_top, :desc],[:postdate, :desc])} scope :can_display, ->{where(:is_hidden=>false,:is_preview => false).any_of({:postdate.lt=>Time.now, :deadline.gt=>Time.now},{:postdate.lt=>Time.now, :deadline=>nil}).order_by([:is_top, :desc],[:postdate, :desc])}