<commit_before><%@ include file="/WEB-INF/views/taglibs.jsp"%>

<html>
  <head>
	<style type="text/css">
		.divOther{
			font-size:8pt;
	 		border-color:#6E81A6;
	 		border-style:solid;
	 		border-width:1px 0px 0px 0px;
		}
		 div.row div.label { width: 15em; } 
		 div.summary div.row div.label { width: 10em; } 
		 div.summary div.row div.value, div.summary div.row div.extra {margin-left:11em;}
		 div.row div.value, div.row div.extra { margin-left: 16em; }
		 .tablecontent td {
		 	border : 0px;
		 }
		 
	</style>
	<tags:javascriptLink name="extremecomponents"/>
 	<tags:dwrJavascriptLink objects="createAE"/>
	<script type="text/javascript">
		var mHistory = null;
 		var mHistoryClass = Class.create();
 		Object.extend(mHistoryClass.prototype, {
 	 		initialize: function(){ 
 	 		},
 	 		addDetails : function(itemType, src, val, loc, options){
 	 	 		
 	 	 		src.disable();
 	 	 		
 	 	 		var container = $(loc);
 	 	 		var paramHash = new Hash(); //parameters to post to server
 	 	 		paramHash.set('task', 'add');
 	 	 		paramHash.set('currentItem', itemType);
				//add extra options to the parameter list
 	 	 		if(options){
 	 	 			paramHash.set('parentIndex', options.parentIndex);
 	 	 		}
 	 	 		paramHash.set(itemType,val);
 	 	 		this.populateDeafultParameters(itemType, paramHash);
 	 	 		
 	 	 		var url = $('command').action + "?subview"; //make the ajax request
				this.insertContent(container, url, paramHash, function() {
						src.enable();
						});
 	 		},
 	 		removeDetails :function(itemType,index, loc, options){
 	 	 		if(index < 0) return;

				var confirmation = confirm("Do you really want to delete?");
				if(!confirmation) return; //return if not agreed.
								
				var container = $(loc);
				
				var paramHash = new Hash(); //parameters to post to server
 	 	 		paramHash.set('task', 'remove');
 	 	 		paramHash.set('currentItem', itemType);
 	 	 		paramHash.set('index', index);
 	 	 		//add extra options to the parameter list
 	 	 		if(options){
 	 	 	 		if(options.parentIndex >= 0) paramHash.set('parentIndex', options.parentIndex);
 	 	 		}
 	 	 		this.populateDeafultParameters(itemType, paramHash);
 	 	 		
 	 	 		var url = $('command').action + "?subview"; //make the ajax request
 	 	 		var sectionHash = Form.serializeElements(this.formElementsInSection(container), true);
 	 	 		$(loc).innerHTML = '';
				this.insertContent(container, url, paramHash.merge(sectionHash));				
				
 	 	 		
 	 		},
 	 		populateDeafultParameters : function(itemType, paramHash){
 				//will populate the default parameters, to support ajax communication
 				var page = ${tab.number};
 				var target = '_target' + ${tab.number}; 
 				paramHash.set('_page', page);
 				paramHash.set(target, page);
 				paramHash.set('_asynchronous', true);
 				paramHash.set('decorator', 'nullDecorator');
 			},
 			insertContent : function(aContainer, url, params, onCompleteCallBack){
 				//helper method to insert content in a DIV
 				new Ajax.Updater(aContainer, url, {
 					parameters: params.toQueryString() , onComplete: onCompleteCallBack ,insertion: Insertion.Top, evalScripts : true
 				});
 			},
 			formElementsInSection : function(aContainer){
 	 			return aContainer.select('input', 'select', 'textarea');	
 			}
 		});

 		Event.observe(window, "load",setupPage);
		
		function setupPage(){
			mHistory = new mHistoryClass();//create a new mHistory object

			//--for metastatic diseases button 
			Element.observe('metastatic-diseases-btn', 'click', function(e){
			 	this.addDetails('metastaticDiseaseSite', e.element(), null, 'anchorMetastaticDiseases');

			 	//clear the fields
//			 	AE.resetAutocompleter('metastaticDiseaseSite');
		 	}.bind(mHistory));

			//--for pre-existing condition button
		 	Element.observe('pre-cond-btn', 'click', function(e){
/*
			 	var preCondField = $('preExistingCondition');
			    if(preCondField.selectedIndex < 1) {
                    alert('Select a value first.');
                    return
                }
*/
			    this.addDetails('preExistingCondition', e.element(), null, 'anchorPreExistingCondition');
			    preCondField.selectedIndex = 0;
			 	
		 	}.bind(mHistory));
		 	//-- for concomitant medication
		 	Element.observe('concomitantMedication-btn', 'click', function(e){
/*
			 	var conMedField = $('concomitantMedication');
			 	if(conMedField.value == '') {
                     alert('Type a value first.');
                     return
                 }
*/
			 	this.addDetails('concomitantMedication', e.element(), null, 'anchorConcomitantMedication');
			 	conMedField.value = '';
		 	}.bind(mHistory));
		 	
			//-- for prior therapy button
		 	Element.observe('priortherapy-btn','click', function(e){
/*
			 	var priorTherapyField = $('priorTherapy');
			 	if(priorTherapyField.selectedIndex < 1) {
                     alert('Select a value first.');
                     return
                 }
*/
			 	this.addDetails('priorTherapy', e.element(), null, 'anchorPriorTherapy');
			 	// priorTherapyField.selectedIndex = 0;
		 	}.bind(mHistory));

		 	Event.observe('command', 'submit', function(e){

				/* Below is a very ugly tweak did for IE7 if priorTherapyAgents[i]-input='begin', the value of priorTherapyAgents[i], is assumed by spring as its value 
				  But only happens in IE7
				  */
				// AE.resetAutocompleter('metastaticDiseaseSite');
				var i = 0;
				for(i = 0; i < 15; i++){
					var el = 	$('priorTherapyAgents[' + i + ']');
					if(el) el.value = '';
					if(el) $('priorTherapyAgents[' + i + ']-input').value = '';
				}
			});
		}
		function fireAction(type, index, loc, options, id){
			mHistory.removeDetails(type, index, loc, options);
		}
		
		        function showShowAllTable(el, baseName) {

            var parameterMap = getParameterMap('command');
            if (baseName == 'metastaticDiseaseSite' || baseName == 'codedPrimaryDiseaseSite') {
                createAE.buildAnatomicSiteTable(el, parameterMap, baseName, function(table) {
                    $('showAllDropDownContent').innerHTML = table;
//                    $('showAllDropDown').style.position = 'absolute';
                    try {
                        var _top = Position.cumulativeOffset($(el))[1];
                        var _left = Position.cumulativeOffset($(el))[0];

                        $('showAllDropDown').style.top = (_top-190) + "px";
                        $('showAllDropDown').style.left = (_left - 120) + "px";
                    } catch (e) {
//                        alert('2');
                    }
                    $('showAllDropDown').show();
                });
            } else {
                createAE.buildChemoAgentsTable(el, parameterMap, baseName, function(table) {
                    $('showAllDropDownContent').innerHTML = table;
                    try {
                        var _top = Position.cumulativeOffset($(el))[1];
                        var _left = Position.cumulativeOffset($(el))[0];

                        $('showAllDropDown').style.top = (_top-190) + "px";
                        $('showAllDropDown').style.left = (_left - 120) + "px";
                    } catch (e) {
//                        alert('2');
                    }<commit_msg>SHOW ALL fixed<commit_after><%@ include file="/WEB-INF/views/taglibs.jsp"%>

<html>
  <head>
	<style type="text/css">
		.divOther{
			font-size:8pt;
	 		border-color:#6E81A6;
	 		border-style:solid;
	 		border-width:1px 0px 0px 0px;
		}
		 div.row div.label { width: 15em; } 
		 div.summary div.row div.label { width: 10em; } 
		 div.summary div.row div.value, div.summary div.row div.extra {margin-left:11em;}
		 div.row div.value, div.row div.extra { margin-left: 16em; }
		 .tablecontent td {
		 	border : 0px;
		 }
		 
	</style>
	<tags:javascriptLink name="extremecomponents"/>
 	<tags:dwrJavascriptLink objects="createAE"/>
	<script type="text/javascript">
		var mHistory = null;
 		var mHistoryClass = Class.create();
 		Object.extend(mHistoryClass.prototype, {
 	 		initialize: function(){ 
 	 		},
 	 		addDetails : function(itemType, src, val, loc, options){
 	 	 		
 	 	 		src.disable();
 	 	 		
 	 	 		var container = $(loc);
 	 	 		var paramHash = new Hash(); //parameters to post to server
 	 	 		paramHash.set('task', 'add');
 	 	 		paramHash.set('currentItem', itemType);
				//add extra options to the parameter list
 	 	 		if(options){
 	 	 			paramHash.set('parentIndex', options.parentIndex);
 	 	 		}
 	 	 		paramHash.set(itemType,val);
 	 	 		this.populateDeafultParameters(itemType, paramHash);
 	 	 		
 	 	 		var url = $('command').action + "?subview"; //make the ajax request
				this.insertContent(container, url, paramHash, function() {
						src.enable();
						});
 	 		},
 	 		removeDetails :function(itemType,index, loc, options){
 	 	 		if(index < 0) return;

				var confirmation = confirm("Do you really want to delete?");
				if(!confirmation) return; //return if not agreed.
								
				var container = $(loc);
				
				var paramHash = new Hash(); //parameters to post to server
 	 	 		paramHash.set('task', 'remove');
 	 	 		paramHash.set('currentItem', itemType);
 	 	 		paramHash.set('index', index);
 	 	 		//add extra options to the parameter list
 	 	 		if(options){
 	 	 	 		if(options.parentIndex >= 0) paramHash.set('parentIndex', options.parentIndex);
 	 	 		}
 	 	 		this.populateDeafultParameters(itemType, paramHash);
 	 	 		
 	 	 		var url = $('command').action + "?subview"; //make the ajax request
 	 	 		var sectionHash = Form.serializeElements(this.formElementsInSection(container), true);
 	 	 		$(loc).innerHTML = '';
				this.insertContent(container, url, paramHash.merge(sectionHash));				
				
 	 	 		
 	 		},
 	 		populateDeafultParameters : function(itemType, paramHash){
 				//will populate the default parameters, to support ajax communication
 				var page = ${tab.number};
 				var target = '_target' + ${tab.number}; 
 				paramHash.set('_page', page);
 				paramHash.set(target, page);
 				paramHash.set('_asynchronous', true);
 				paramHash.set('decorator', 'nullDecorator');
 			},
 			insertContent : function(aContainer, url, params, onCompleteCallBack){
 				//helper method to insert content in a DIV
 				new Ajax.Updater(aContainer, url, {
 					parameters: params.toQueryString() , onComplete: onCompleteCallBack ,insertion: Insertion.Top, evalScripts : true
 				});
 			},
 			formElementsInSection : function(aContainer){
 	 			return aContainer.select('input', 'select', 'textarea');	
 			}
 		});

 		Event.observe(window, "load",setupPage);
		
		function setupPage(){
			mHistory = new mHistoryClass();//create a new mHistory object

			//--for metastatic diseases button 
			Element.observe('metastatic-diseases-btn', 'click', function(e){
			 	this.addDetails('metastaticDiseaseSite', e.element(), null, 'anchorMetastaticDiseases');

			 	//clear the fields
//			 	AE.resetAutocompleter('metastaticDiseaseSite');
		 	}.bind(mHistory));

			//--for pre-existing condition button
		 	Element.observe('pre-cond-btn', 'click', function(e){
/*
			 	var preCondField = $('preExistingCondition');
			    if(preCondField.selectedIndex < 1) {
                    alert('Select a value first.');
                    return
                }
*/
			    this.addDetails('preExistingCondition', e.element(), null, 'anchorPreExistingCondition');
			    preCondField.selectedIndex = 0;
			 	
		 	}.bind(mHistory));
		 	//-- for concomitant medication
		 	Element.observe('concomitantMedication-btn', 'click', function(e){
/*
			 	var conMedField = $('concomitantMedication');
			 	if(conMedField.value == '') {
                     alert('Type a value first.');
                     return
                 }
*/
			 	this.addDetails('concomitantMedication', e.element(), null, 'anchorConcomitantMedication');
			 	conMedField.value = '';
		 	}.bind(mHistory));
		 	
			//-- for prior therapy button
		 	Element.observe('priortherapy-btn','click', function(e){
/*
			 	var priorTherapyField = $('priorTherapy');
			 	if(priorTherapyField.selectedIndex < 1) {
                     alert('Select a value first.');
                     return
                 }
*/
			 	this.addDetails('priorTherapy', e.element(), null, 'anchorPriorTherapy');
			 	// priorTherapyField.selectedIndex = 0;
		 	}.bind(mHistory));

		 	Event.observe('command', 'submit', function(e){

				/* Below is a very ugly tweak did for IE7 if priorTherapyAgents[i]-input='begin', the value of priorTherapyAgents[i], is assumed by spring as its value 
				  But only happens in IE7
				  */
				// AE.resetAutocompleter('metastaticDiseaseSite');
				var i = 0;
				for(i = 0; i < 15; i++){
					var el = 	$('priorTherapyAgents[' + i + ']');
					if(el) el.value = '';
					if(el) $('priorTherapyAgents[' + i + ']-input').value = '';
				}
			});
		}
		function fireAction(type, index, loc, options, id){
			mHistory.removeDetails(type, index, loc, options);
		}
		
		        function showShowAllTable(el, baseName) {

            var parameterMap = getParameterMap('command');
            if (baseName.search("metastaticDiseaseSite")>=0  || baseName == 'codedPrimaryDiseaseSite') {
                createAE.buildAnatomicSiteTable(el, parameterMap, baseName, function(table) {
                    $('showAllDropDownContent').innerHTML = table;
//                    $('showAllDropDown').style.position = 'absolute';
                    try {
                        var _top = Position.cumulativeOffset($(el))[1];
                        var _left = Position.cumulativeOffset($(el))[0];

                        $('showAllDropDown').style.top = (_top-190) + "px";
                        $('showAllDropDown').style.left = (_left - 120) + "px";
                    } catch (e) {
//                        alert('2');
                    }
                    $('showAllDropDown').show();
                });
            } else {
                createAE.buildChemoAgentsTable(el, parameterMap, baseName, function(table) {
                    $('showAllDropDownContent').innerHTML = table;
                    try {
                        var _top = Position.cumulativeOffset($(el))[1];
                        var _left = Position.cumulativeOffset($(el))[0];

                        $('showAllDropDown').style.top = (_top-190) + "px";
                        $('showAllDropDown').style.left = (_left - 120) + "px";
                    } catch (e) {
//                        alert('2');
                    }
{'fraction_non_alphanumeric': 0.14038116282281451, 'fraction_numerical': 0.006697969893661096, 'mean_word_length': 2.353322528363047, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1567579', 'n_tokens_mistral': 5338, 'n_tokens_neox': 4354, 'n_words': 895}