<div class="modal fade" tabindex="-1" role="dialog" id="modal-icd10-dialog">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title"><?php echo _('ICD-10'); ?></h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
	      <div class="card margin-bottom-20">
		      <div class="card-body">
				  	
				  	<div class="form-group">
					  	<input type="text" class="form-control" id="icd10-search" placeholder="">
				  	</div>
				  	
				  	<?php foreach($this->view->languages as $lang): ?>
				  		<?php
					  		$checked = $lang['lang_code'] == $this->user->getUserLang() ? 'checked' : '';
					  	?>
					  	<div class="form-check form-check-inline">
						  	<input class="form-check-input search-langs" name="search-lang" type="radio" id="search-lang-<?php echo $lang['lang_code']; ?>" value="<?php echo $lang['lang_code']; ?>" <?php echo $checked; ?>>
						  	<label class="form-check-label" for="search-lang-<?php echo $lang['lang_code']; ?>"><?php echo $lang['name_string']; ?></label>
					  	</div>
				  	<?php endforeach; ?>
				  	
				  	<div id="icd10-search-results" class="margin-top-20">
					  	
				  	</div>
					  <!--<div class="clearfix">
				      	<button type="button" class="btn btn-primary float-right"><?php //echo _('Search'); ?></button>
				      </div>-->
				      
		      </div>
	      </div>
	  		<div id="request-icd10-content">
		  		<?php if(!empty($this->view->icd10)): ?>
			  		<div>
				  		<div class="margin-bottom-10"><b><?php echo _('Previously saved selections'); ?></b></div>
				  		<?php echo $this->partial('Request/icd10-deseases-list', ['deseases'=>$this->view->icd10, 'checked'=>true]); ?>
			  		</div>
		  		<?php endif; ?>
		  		<div id="icd10-accordion">
			  		<?php if(isset($this->view->icd10Categories) && is_array($this->view->icd10Categories)): ?>
			  			<?php foreach($this->view->icd10Categories as $index => $category): ?>
					  		 <div class="card margin-bottom-5">
						  		 <div class="card-header" id="heading-0">
							  		 <div class="mb-0">
								  		 <a href="#" <?php echo empty($category['subcategories']) ? 'class="icd10-get-list icd10-list-empty" data-icd10id="'.$category['id'].'"' : ''; ?> data-toggle="collapse" data-target="#collapse-<?php echo $index; ?>" aria-expanded="true" aria-controls="collapse-<?php echo $index; ?>"><!--<input type="checkbox" class="icd10-checkbox" value="<?php echo $category['id']; ?>">--><?php echo $category['label']; ?></a>
							  		 </div>
						  		 </div>
						  		 
						  		 <div id="collapse-<?php echo $index; ?>" class="collapse" aria-labelledby="heading-<?php echo $index; ?>" data-parent="#accordion">
							  		 <div class="card-body">
								  		 <?php if(is_array($category['subcategories']) && !empty($category['subcategories'])): ?>
								  		 	<ul>
									  		 	<?php foreach($category['subcategories'] as $subId => $subLabel): ?>
									  		 		<li class="list-no-type">
									  		 			<div class="card margin-bottom-5">
										  		 			<div class="card-header">
										  		 				<a href="#" class="icd10-get-list icd10-list-empty" data-icd10id="<?php echo $subId; ?>"><?php echo $subLabel; ?></a>
										  		 			</div>
										  		 			
										  		 			<div class="card-body card-body-hidden" id="card-body-<?php echo $subId; ?>">
											  		 			<div class="deseases-list" id="desease-list-<?php echo $subId; ?>">
											  		 				<div class="dialog-loader text-center" id="dialog-loader-<?php echo $subId; ?>"><img src="<?php echo $this->layout->getPublicUri(); ?>images/ajaxloader.svg" width="50"></div>
										  		 				</div>
										  		 			</div>
										  		 		</div>

									  		 		</li>
									  		 	<?php endforeach; ?>
								  		 	</ul>
								  		 <?php else: ?>
								  		 	<div class="deseases-list" id="desease-list-<?php echo $category['id']; ?>">
									  		 	<div class="dialog-loader text-center" id="dialog-loader-<?php echo $category['id']; ?>"><img src="<?php echo $this->layout->getPublicUri(); ?>images/ajaxloader.svg" width="50"></div>
								  		 	</div>
								  		 <?php endif; ?>
							  		 </div>
						  		 </div>
					  		 </div>
				  		 <?php endforeach; ?>
			  		 <?php endif; ?>
		  		</div>
	  		</div>
      </div>
      <div class="modal-footer">
      	<button type="button" class="btn btn-primary" data-dismiss="modal"><?php echo _('Done'); ?></button>
      </div>
    </div>
  </div>
</div>