<?php

use app\base\Common;
use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use yii\widgets\ActiveForm;
use kartik\select2\Select2;
use app\base\Converter;
use kartik\widgets\DepDrop;
use yii\helpers\Url;

/* @var $this yii\web\View */
/* @var $model app\models\healthcareutilization */
/* @var $form yii\widgets\ActiveForm */


$Surveys = Common::getSurvey();
$PIDs = Common::getEnrollPIDs("hcu");
$today = strtotime(date("Y/m/d"));
$pastdate = strtotime("-180 Days", $today);
$past180 = Converter::toDisplay($pastdate);
$Visits = Common::getCohortVisits();

if(Yii::$app->params['SURVEY'] != '') {
	$Locations = Common::getSurlocations(Yii::$app->params['SURVEY']);
}
if(Yii::$app->params['SURVEY'] != '' && Yii::$app->params['LOCATION'] != '') {
	$Locations = Common::getSurlocations(Yii::$app->params['SURVEY']);
	$PIDs = Common::getEnrollPIDs("hcu",Yii::$app->params['SURVEY'], Yii::$app->params['LOCATION']);
}
if(!$model->isNewRecord) {
	$Visits = Common::getPIDsVisit($model->health_care_utilization_survey, $model->health_care_utilization_loc, $model->health_care_utilization_part_id);
}

$JS="
$('#healthcareutilization-health_care_utilization_part_id').on('select2:select', function (evt) {
		var pid = $(this)[0].value;		
		if(pid != '') {
			var link = $('#pid-info').data('link') + pid;			
			$.ajax({
				type: 'post',
				url: 'visit',
				data: 'pid='+$(this)[0].value,
				success: function(response) {	
                    			
					if(response.visit != null) {
						
						$('#healthcareutilization-visit_code').val(response.visit);
						$('#healthcareutilization-visit').val(response.visit);
						
					} else {
						$('#healthcareutilization-visit_code').val('');
						$('#healthcareutilization-visit').val('');
						
					}
					
				}
			});
		}
	});
		
	
	$('#healthcareutilization-health_care_utilization_part_id').on('select2:unselect', function (evt) {
		$('#healthcareutilization-visit_code').val('');
		$('#healthcareutilization-visit').val('');
	});
	
  

        $('#healthcareutilization-health_care_utilization_q1a,#healthcareutilization-health_care_utilization_q2a,#healthcareutilization-health_care_utilization_q3a,#healthcareutilization-health_care_utilization_q4a,#healthcareutilization-health_care_utilization_q5a,#healthcareutilization-health_care_utilization_q6a').change(function(){
		if($(this).val() > 24  && $(this).val() != 997 && $(this).val() != 998) 
			$('#modal').modal('show').find('.modal-body').html('Acceptable range (Number of visits): 0-24, 997, 998. Please double check your answer.');
	});		
	
	$('#healthcareutilization-health_care_utilization_q1a').change(function(){
		$('div.help-block').html('');
		$('div.error-summary').hide();
		$('div.form-group').removeClass('has-success').removeClass('has-error');
		if($(this).val() !='' && ($(this).val() =='0' || $(this).val() =='997' || $(this).val() =='998')) {
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q1b,div.form-group.field-healthcareutilization-health_care_utilization_q1c,div.form-group.field-healthcareutilization-health_care_utilization_q1d').removeClass('required').hide();
			 $('#healthcareutilization-health_care_utilization_q1b,#healthcareutilization-health_care_utilization_q1c,#healthcareutilization-health_care_utilization_q1d').val('');
		} else {		   
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q1b,div.form-group.field-healthcareutilization-health_care_utilization_q1c,div.form-group.field-healthcareutilization-health_care_utilization_q1d').addClass('required').show();	
		}
	});	
	
	
	
	
$('#healthcareutilization-health_care_utilization_q2a').change(function(){
		$('div.help-block').html('');
		$('div.error-summary').hide();
		$('div.form-group').removeClass('has-success').removeClass('has-error');
		if($(this).val() !='' && ($(this).val() =='0' || $(this).val() =='997' || $(this).val() =='998')) {
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q2b,div.form-group.field-healthcareutilization-health_care_utilization_q2c,div.form-group.field-healthcareutilization-health_care_utilization_q2d').removeClass('required').hide();
			 $('#healthcareutilization-health_care_utilization_q2b,#healthcareutilization-health_care_utilization_q2c,#healthcareutilization-health_care_utilization_q2d').val('');
		} else {		   
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q2b,div.form-group.field-healthcareutilization-health_care_utilization_q2c,div.form-group.field-healthcareutilization-health_care_utilization_q2d').addClass('required').show();	
		}
	});	
	
	

	
$('#healthcareutilization-health_care_utilization_q3a').change(function(){
		$('div.help-block').html('');
		$('div.error-summary').hide();
		$('div.form-group').removeClass('has-success').removeClass('has-error');
		if($(this).val() !='' && ($(this).val() =='0' || $(this).val() =='997' || $(this).val() =='998')) {
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q3b,div.form-group.field-healthcareutilization-health_care_utilization_q3c,div.form-group.field-healthcareutilization-health_care_utilization_q3d').removeClass('required').hide();
			 $('#healthcareutilization-health_care_utilization_q3b,#healthcareutilization-health_care_utilization_q3c,#healthcareutilization-health_care_utilization_q3d').val('');
		} else {		   
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q3b,div.form-group.field-healthcareutilization-health_care_utilization_q3c,div.form-group.field-healthcareutilization-health_care_utilization_q3d').addClass('required').show();	
		}
	});		


	
	
$('#healthcareutilization-health_care_utilization_q4a').change(function(){
		$('div.help-block').html('');
		$('div.error-summary').hide();
		$('div.form-group').removeClass('has-success').removeClass('has-error');
		if($(this).val() !='' && ($(this).val() =='0' || $(this).val() =='997' || $(this).val() =='998')) {
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q4b,div.form-group.field-healthcareutilization-health_care_utilization_q4c,div.form-group.field-healthcareutilization-health_care_utilization_q4d').removeClass('required').hide();
			 $('#healthcareutilization-health_care_utilization_q4b,#healthcareutilization-health_care_utilization_q4c,#healthcareutilization-health_care_utilization_q4d').val('');
		} else {		   
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q4b,div.form-group.field-healthcareutilization-health_care_utilization_q4c,div.form-group.field-healthcareutilization-health_care_utilization_q4d').addClass('required').show();	
		}
	});	
	
		
	
$('#healthcareutilization-health_care_utilization_q5a').change(function(){
		$('div.help-block').html('');
		$('div.error-summary').hide();
		$('div.form-group').removeClass('has-success').removeClass('has-error');
		if($(this).val() !='' && ($(this).val() =='0' || $(this).val() =='997' || $(this).val() =='998')) {
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q5b,div.form-group.field-healthcareutilization-health_care_utilization_q5c,div.form-group.field-healthcareutilization-health_care_utilization_q5d').removeClass('required').hide();
			 $('#healthcareutilization-health_care_utilization_q5b,#healthcareutilization-health_care_utilization_q5c,#healthcareutilization-health_care_utilization_q5d').val('');
		} else {		   
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q5b,div.form-group.field-healthcareutilization-health_care_utilization_q5c,div.form-group.field-healthcareutilization-health_care_utilization_q5d').addClass('required').show();	
		}
	});	
	

	$('#healthcareutilization-health_care_utilization_q6a').change(function(){
		$('div.help-block').html('');
		$('div.error-summary').hide();
		$('div.form-group').removeClass('has-success').removeClass('has-error');
		if($(this).val() !='' && ($(this).val() =='0' || $(this).val() =='997' || $(this).val() =='998')) {
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q6b,div.form-group.field-healthcareutilization-health_care_utilization_q6c,div.form-group.field-healthcareutilization-health_care_utilization_q6d').removeClass('required').hide();
			 $('#healthcareutilization-health_care_utilization_q6b,#healthcareutilization-health_care_utilization_q6c,#healthcareutilization-health_care_utilization_q6d').val('');
		} else {		   
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q6b,div.form-group.field-healthcareutilization-health_care_utilization_q6c,div.form-group.field-healthcareutilization-health_care_utilization_q6d').addClass('required').show();	
		}
	});	
	
	$('#healthcareutilization-health_care_utilization_q1a,#healthcareutilization-health_care_utilization_q2a,#healthcareutilization-health_care_utilization_q3a,#healthcareutilization-health_care_utilization_q4a,#healthcareutilization-health_care_utilization_q5a,#healthcareutilization-health_care_utilization_q6a').trigger('change');  
	
/*

    $('#healthcareutilization-health_care_utilization_q14').change(function(){
		if($(this).val()!=1 ) 
			$('#modal').modal('show').find('.modal-body').html('Please double-check your answer with the participant. Once you select this option the survey will end.');
	});		
	
	 $('#healthcareutilization-health_care_utilization_q18').change(function(){
		 if($(this).val()!='' ) 
			$('#modal').modal('show').find('.modal-body').html('Please double check your answer. The survey will end and you will not be able to modify your answer.');
	});		
	
*/	
				
	 
 $('#healthcareutilization-health_care_utilization_q1c').change(function(){
		if($(this).val() > 5000) 
			$('#modal').modal('show').find('.modal-body').html('Acceptable range (Rupees spent): 0-5000. Please double check your answer.');
	});	

	$('#healthcareutilization-health_care_utilization_q1d').change(function(){
		if($(this).val() > 5000) 
			$('#modal').modal('show').find('.modal-body').html('Acceptable range (Rupees spent): 0-5000. Please double check your answer.');
	});	
	$('#healthcareutilization-health_care_utilization_q2c').change(function(){
		if($(this).val() > 5000) 
			$('#modal').modal('show').find('.modal-body').html('Acceptable range (Rupees spent): 0-5000. Please double check your answer.');
	});	

	$('#healthcareutilization-health_care_utilization_q2d').change(function(){
		if($(this).val() > 5000) 
			$('#modal').modal('show').find('.modal-body').html('Acceptable range (Rupees spent): 0-5000. Please double check your answer.');
	});	
	$('#healthcareutilization-health_care_utilization_q3c').change(function(){
		if($(this).val() > 5000) 
			$('#modal').modal('show').find('.modal-body').html('Acceptable range (Rupees spent): 0-5000. Please double check your answer.');
	});	

	$('#healthcareutilization-health_care_utilization_q3d').change(function(){
		if($(this).val() > 5000) 
			$('#modal').modal('show').find('.modal-body').html('Acceptable range (Rupees spent): 0-5000. Please double check your answer.');
	});	
	$('#healthcareutilization-health_care_utilization_q4c').change(function(){
		if($(this).val() > 5000) 
			$('#modal').modal('show').find('.modal-body').html('Acceptable range (Rupees spent): 0-5000. Please double check your answer.');
	});	

	$('#healthcareutilization-health_care_utilization_q4d').change(function(){
		if($(this).val() > 5000) 
			$('#modal').modal('show').find('.modal-body').html('Acceptable range (Rupees spent): 0-5000. Please double check your answer.');
	});	
	$('#healthcareutilization-health_care_utilization_q5c').change(function(){
		if($(this).val() > 5000) 
			$('#modal').modal('show').find('.modal-body').html('Acceptable range (Rupees spent): 0-5000. Please double check your answer.');
	});	

	$('#healthcareutilization-health_care_utilization_q5d').change(function(){
		if($(this).val() > 5000) 
			$('#modal').modal('show').find('.modal-body').html('Acceptable range (Rupees spent): 0-5000. Please double check your answer.');
	});	
	$('#healthcareutilization-health_care_utilization_q6c').change(function(){
		if($(this).val() > 5000) 
			$('#modal').modal('show').find('.modal-body').html('Acceptable range (Rupees spent): 0-5000. Please double check your answer.');
	});	

	$('#healthcareutilization-health_care_utilization_q6d').change(function(){
		if($(this).val() > 5000) 
			$('#modal').modal('show').find('.modal-body').html('Acceptable range (Rupees spent): 0-5000. Please double check your answer.');
	});	
	
	$('#healthcareutilization-health_care_utilization_q1b').change(function(){
		if($(this).val() > 24) 
			$('#modal').modal('show').find('.modal-body').html('Range (Time for visits): 0.25-24. Please double check your answer.');
	});	
	
	$('#healthcareutilization-health_care_utilization_q2b').change(function(){
		if($(this).val() > 24) 
			$('#modal').modal('show').find('.modal-body').html('Range (Time for visits): 0.25-24. Please double check your answer.');
	});	
	$('#healthcareutilization-health_care_utilization_q3b').change(function(){
		if($(this).val() > 24) 
			$('#modal').modal('show').find('.modal-body').html('Range (Time for visits): 0.25-24. Please double check your answer.');
	});	
	
	$('#healthcareutilization-health_care_utilization_q4b').change(function(){
		if($(this).val() > 24) 
			$('#modal').modal('show').find('.modal-body').html('Range (Time for visits): 0.25-24. Please double check your answer.');
	});	
	$('#healthcareutilization-health_care_utilization_q5b').change(function(){
		if($(this).val() > 24) 
			$('#modal').modal('show').find('.modal-body').html('Range (Time for visits): 0.25-24. Please double check your answer.');
	});	
	$('#healthcareutilization-health_care_utilization_q6b').change(function(){
		if($(this).val() > 24) 
			$('#modal').modal('show').find('.modal-body').html('Range (Time for visits): 0.25-24. Please double check your answer.');
	});	
	
	$('#healthcareutilization-health_care_utilization_q7').change(function(){
		if($(this).val() > 24 && $(this).val() != 997 && $(this).val() !=998) 
			$('#modal').modal('show').find('.modal-body').html('Acceptable range: 0-24, 997, 998. Please double check your answer.');
	});	
	
	
	
 $('#healthcareutilization-health_care_utilization_q8a input[type=radio]').change(function(){	
		$('div.help-block').html('');
		$('div.error-summary').hide();
		$('div.form-group').removeClass('has-success').removeClass('has-error');
		if($(this).prop('checked')) {
			if($(this).val() != '1') {
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q8b').removeClass('required').hide();
			 $('#healthcareutilization-health_care_utilization_q8b').val('');
			
		} else {		  
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q8b').addClass('required').show();	
		}
		}
	});	
		
	
	$('#healthcareutilization-health_care_utilization_q9a input[type=radio]').change(function(){	
		$('div.help-block').html('');
		$('div.error-summary').hide();
		$('div.form-group').removeClass('has-success').removeClass('has-error');
		if($(this).prop('checked')) {
			if($(this).val() != '1') {
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q9b').removeClass('required').hide();
			  $('#healthcareutilization-health_care_utilization_q9b').val('');
		} else {		  
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q9b').addClass('required').show();	
		}
		}
	});	
	
		
		
	$('#healthcareutilization-health_care_utilization_q10a input[type=radio]').change(function(){	
		$('div.help-block').html('');
		$('div.error-summary').hide();
		$('div.form-group').removeClass('has-success').removeClass('has-error');
		if($(this).prop('checked')) {
			if($(this).val() != '1') {
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q10b').removeClass('required').hide();
			  $('#healthcareutilization-health_care_utilization_q10b').val('');
		} else {		  
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q10b').addClass('required').show();	
		}
		}
	});	
	
	
	$('#healthcareutilization-health_care_utilization_q11a input[type=radio]').change(function(){	
		$('div.help-block').html('');
		$('div.error-summary').hide();
		$('div.form-group').removeClass('has-success').removeClass('has-error');
		if($(this).prop('checked')) {
			if($(this).val() != '1') {
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q11b').removeClass('required').hide();
			  $('#healthcareutilization-health_care_utilization_q11b').val('');
		} else {		  
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q11b').addClass('required').show();	
		}
		}
	});	
	
	
	$('#healthcareutilization-health_care_utilization_q12a input[type=radio]').change(function(){	
		$('div.help-block').html('');
		$('div.error-summary').hide();
		$('div.form-group').removeClass('has-success').removeClass('has-error');
		if($(this).prop('checked')) {
			if($(this).val() != '1') {
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q12b').removeClass('required').hide();
			 $('#healthcareutilization-health_care_utilization_q12b').val('');
		} else {		  
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q12b').addClass('required').show();	
		}
		}
	});	
	
	$('#healthcareutilization-health_care_utilization_q8a input[type=radio],#healthcareutilization-health_care_utilization_q9a input[type=radio],#healthcareutilization-health_care_utilization_q10a input[type=radio],#healthcareutilization-health_care_utilization_q11a input[type=radio],#healthcareutilization-health_care_utilization_q12a input[type=radio]').trigger('change'); 
	
				
  $('#healthcareutilization-health_care_utilization_q13').change(function(){
		if($(this).val() > 6 && $(this).val() != 997 && $(this).val() !=998) 
			$('#modal').modal('show').find('.modal-body').html('Acceptable range: 0-6, 997, 998. Please double check your answer.');
	});	
	
 $('#healthcareutilization-health_care_utilization_q14').change(function(){
		$('div.help-block').html('');
		$('div.error-summary').hide();
		$('div.form-group').removeClass('has-success').removeClass('has-error');
		if($(this).val() !=1 ) {
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q15,div.form-group.field-healthcareutilization-health_care_utilization_q16,div.form-group.field-healthcareutilization-health_care_utilization_q17,div.form-group.field-healthcareutilization-health_care_utilization_q18').removeClass('required').hide();
			 $('#healthcareutilization-health_care_utilization_q15,#healthcareutilization-health_care_utilization_q16,#healthcareutilization-health_care_utilization_q17,#healthcareutilization-health_care_utilization_q18').val('');
		} else {		  
			 $('div.form-group.field-healthcareutilization-health_care_utilization_q15,div.form-group.field-healthcareutilization-health_care_utilization_q16,div.form-group.field-healthcareutilization-health_care_utilization_q17,div.form-group.field-healthcareutilization-health_care_utilization_q18').addClass('required').show();	
		}
	});	
	
	$('#healthcareutilization-health_care_utilization_q14').trigger('change');  
	
	
	$('#healthcareutilization-health_care_utilization_q15,#healthcareutilization-health_care_utilization_q16').change(function(){
		if($(this).val() > 10 && $(this).val() != 997 && $(this).val() !=998) 
			$('#modal').modal('show').find('.modal-body').html('Acceptable range: 0-10, 997, 998. Please double check your answer.');
	});	
	
	$('#healthcareutilization-health_care_utilization_q17').change(function(){
		if($(this).val() > 5000 && $(this).val() != 9997 && $(this).val() !=9998) 
			$('#modal').modal('show').find('.modal-body').html('Acceptable range: 0-5000, 9997, 9998. Please double check your answer.');
	});	
	
	$('#healthcareutilization-health_care_utilization_q18').change(function(){
		if($(this).val() > 12 && $(this).val() != 997 && $(this).val() !=998) 
			$('#modal').modal('show').find('.modal-body').html('Acceptable range: 0-12, 997, 998. Please double check your answer.');
	});	
	
	$('#healthcareutilization-health_care_utilization_q8b,#healthcareutilization-health_care_utilization_q9b,#healthcareutilization-health_care_utilization_q10b,#healthcareutilization-health_care_utilization_q11b,#healthcareutilization-health_care_utilization_q12b').change(function(){
		if($(this).val() < 1 || $(this).val() > 180) 
			$('#modal').modal('show').find('.modal-body').html('Range 1-180 (Number of days). Please double check your answer.');
	});		
	

	  
		
";
$this->registerJs($JS);


?>

<div class="health_care_utilization-form">
	<div class="panel panel-default">
		<div class="panel-heading">
			Form Elements
		</div>
		<div class="panel-body">
			<div class="row">
				<div class="col-lg-12">
					<?php
						$form = ActiveForm::begin(['options' => ['class' => 'form-horizontal']]);
						$template = [
							'labelOptions' => ['class' => 'form-label'],
							'template' => '<div class="col-sm-5">{label}{hint}</div><div class="col-sm-4">{input}{error}</div>',
						];
						$chklist_template = [
							'labelOptions' => ['class' => 'form-label'],
							'template' => '<div class="col-sm-5">{label}{hint}</div><div class="col-sm-7 checkbox-list">{input}{error}</div>',
						];
						$htemplate = [
							'options' => ['tag' => false],
							'template' => '{input}'
						];
					?>
					
				
                    <?= Common::generateControl($form, $model, $template, 'health_care_utilization_survey', $Surveys, 'survey', 'getEnrollPIDs','hcu') ?>
					<?= Common::generateControl($form, $model, $template, 'health_care_utilization_loc', $Locations, 'location', '', [Html::getInputId($model, 'health_care_utilization_survey')]) ?>
					<?= Common::generateControl($form, $model, $template, 'health_care_utilization_part_id', $PIDs, 'pid', '', [Html::getInputId($model, 'health_care_utilization_survey'), Html::getInputId($model, 'health_care_utilization_loc')]) ?>
					
					 
                     <?php  if($model->isNewRecord) : ?>					 
                     <?= $form->field($model, 'visit', $template)->dropDownList($Visits,['prompt' => 'Select','disabled' => true]) ?>	
                     <?php  else: ?>	
                      <?= $form->field($model, 'visit_code', $template)->widget(DepDrop::classname(), ['data'=>$Visits, 'options'=>['prompt'=>$model->getAttributeLabel('visit_code')],'disabled' => true, 'pluginOptions'=>['depends'=>[Html::getInputId($model, 'health_care_utilization_survey'), Html::getInputId($model, 'health_care_utilization_loc'), Html::getInputId($model, 'health_care_utilization_part_id')], 'placeholder'=>$model->getAttributeLabel('visit_code'), 'url'=>Url::to(['/dashboard/getids']), 'params'=>['common-method1', Html::getInputId($model, 'health_care_utilization_part_id')]]]) ?>						 
					 <?php  endif; ?>  					 
					
                     <?= $form->field($model, 'visit_code', $htemplate)->hiddenInput()->label() ?>
					 
					<div class="form-group">
					 <div class="col-sm-5">
					 <?= Html::label('INTERVIEWER READ: The following questions ask about medical care you have had in the past 6 months. This period covers the time from ' .$past180 .' to today. Please consider all medical care you received during this time. The first group of questions refers to visits you may have made to medical clinics, not including emergency ward visits or hospital stays. By doctor, I mean doctor, nurse or other health care professional.') ?>
					 </div>
					</div>
										
								
					<?= $form->field($model, 'health_care_utilization_q1a', Common::convertTemplate($template,"after","visits"))->textInput(['maxlength' => true])->hint("<strong>INTERVIEWER INSTRUCTION : </strong> Code 997 for Don’t Know; 998 for Refused <br />") ?>
                    <?= $form->field($model, 'health_care_utilization_q1b', Common::convertTemplate($template,"after","hours"))->textInput(['maxlength' => true])->hint("<strong>INTERVIEWER INSTRUCTION : </strong> Record time estimates in hours to the nearest quarter hour: 15 minutes = .25 hour; 30 minutes = .5 hour; 45 minutes = .75 hour; 2½ hours = 2.5 etc., If the participant says 1 day or 1/2 day, clarify this in hours (e.g., half day = 12 hours; full day = 24 hours)  <br /> ")  ?>		
                    <?= $form->field($model, 'health_care_utilization_q1c', Common::convertTemplate($template,"after","rupees"))->textInput(['maxlength' => true]) ?>	
                    <?= $form->field($model, 'health_care_utilization_q1d', Common::convertTemplate($template,"after","rupees"))->textInput(['maxlength' => true]) ?>	
					<?= $form->field($model, 'health_care_utilization_q2a', Common::convertTemplate($template,"after","visits"))->textInput(['maxlength' => true])->hint("<strong>INTERVIEWER INSTRUCTION : </strong> Code 997 for Don’t Know; 998 for Refused <br />") ?>	
                    <?= $form->field($model, 'health_care_utilization_q2b', Common::convertTemplate($template,"after","hours"))->textInput(['maxlength' => true])->hint("<strong>INTERVIEWER INSTRUCTION : </strong> Record time estimates in hours to the nearest quarter hour: 15 minutes = .25 hour; 30 minutes = .5 hour; 45 minutes = .75 hour; 2½ hours = 2.5 etc., If the participant says 1 day or 1/2 day, clarify this in hours (e.g., half day = 12 hours; full day = 24 hours)  <br /> ")  ?>		
                    <?= $form->field($model, 'health_care_utilization_q2c', Common::convertTemplate($template,"after","rupees"))->textInput(['maxlength' => true]) ?>	
                    <?= $form->field($model, 'health_care_utilization_q2d', Common::convertTemplate($template,"after","rupees"))->textInput(['maxlength' => true]) ?>	
<?= $form->field($model, 'health_care_utilization_q3a', Common::convertTemplate($template,"after","visits"))->textInput(['maxlength' => true])->hint("<strong>INTERVIEWER INSTRUCTION : </strong> Code 997 for Don’t Know; 998 for Refused <br />") ?>	
<?= $form->field($model, 'health_care_utilization_q3b', Common::convertTemplate($template,"after","hours"))->textInput(['maxlength' => true])->hint("<strong>INTERVIEWER INSTRUCTION : </strong> Record time estimates in hours to the nearest quarter hour: 15 minutes = .25 hour; 30 minutes = .5 hour; 45 minutes = .75 hour; 2½ hours = 2.5 etc., If the participant says 1 day or 1/2 day, clarify this in hours (e.g., half day = 12 hours; full day = 24 hours)  <br /> ")  ?>		
<?= $form->field($model, 'health_care_utilization_q3c', Common::convertTemplate($template,"after","rupees"))->textInput(['maxlength' => true]) ?>	
<?= $form->field($model, 'health_care_utilization_q3d', Common::convertTemplate($template,"after","rupees"))->textInput(['maxlength' => true]) ?>	
<?= $form->field($model, 'health_care_utilization_q4a', Common::convertTemplate($template,"after","visits"))->textInput(['maxlength' => true])->hint("<strong>INTERVIEWER INSTRUCTION : </strong> Code 997 for Don’t Know; 998 for Refused <br />") ?>	
<?= $form->field($model, 'health_care_utilization_q4b', Common::convertTemplate($template,"after","hours"))->textInput(['maxlength' => true])->hint("<strong>INTERVIEWER INSTRUCTION : </strong> Record time estimates in hours to the nearest quarter hour: 15 minutes = .25 hour; 30 minutes = .5 hour; 45 minutes = .75 hour; 2½ hours = 2.5 etc., If the participant says 1 day or 1/2 day, clarify this in hours (e.g., half day = 12 hours; full day = 24 hours)  <br /> ")  ?>	
<?= $form->field($model, 'health_care_utilization_q4c', Common::convertTemplate($template,"after","rupees"))->textInput(['maxlength' => true]) ?>	
<?= $form->field($model, 'health_care_utilization_q4d', Common::convertTemplate($template,"after","rupees"))->textInput(['maxlength' => true]) ?>	
<?= $form->field($model, 'health_care_utilization_q5a', Common::convertTemplate($template,"after","visits"))->textInput(['maxlength' => true])->hint("<strong>INTERVIEWER INSTRUCTION : </strong> Code 997 for Don’t Know; 998 for Refused <br />") ?>
<?= $form->field($model, 'health_care_utilization_q5b', Common::convertTemplate($template,"after","hours"))->textInput(['maxlength' => true])->hint("<strong>INTERVIEWER INSTRUCTION : </strong> Record time estimates in hours to the nearest quarter hour: 15 minutes = .25 hour; 30 minutes = .5 hour; 45 minutes = .75 hour; 2½ hours = 2.5 etc., If the participant says 1 day or 1/2 day, clarify this in hours (e.g., half day = 12 hours; full day = 24 hours)  <br /> ")  ?>	
<?= $form->field($model, 'health_care_utilization_q5c', Common::convertTemplate($template,"after","rupees"))->textInput(['maxlength' => true]) ?>	
<?= $form->field($model, 'health_care_utilization_q5d', Common::convertTemplate($template,"after","rupees"))->textInput(['maxlength' => true]) ?>	
<?= $form->field($model, 'health_care_utilization_q6a', Common::convertTemplate($template,"after","visits"))->textInput(['maxlength' => true])->hint("<strong>INTERVIEWER INSTRUCTION : </strong> Code 997 for Don’t Know; 998 for Refused <br />") ?>	
<?= $form->field($model, 'health_care_utilization_q6b', Common::convertTemplate($template,"after","hours"))->textInput(['maxlength' => true])->hint("<strong>INTERVIEWER INSTRUCTION : </strong> Record time estimates in hours to the nearest quarter hour: 15 minutes = .25 hour; 30 minutes = .5 hour; 45 minutes = .75 hour; 2½ hours = 2.5 etc., If the participant says 1 day or 1/2 day, clarify this in hours (e.g., half day = 12 hours; full day = 24 hours)  <br /> ")  ?>	
<?= $form->field($model, 'health_care_utilization_q6c', Common::convertTemplate($template,"after","rupees"))->textInput(['maxlength' => true]) ?>	
<?= $form->field($model, 'health_care_utilization_q6d', Common::convertTemplate($template,"after","rupees"))->textInput(['maxlength' => true]) ?>	
<?= $form->field($model, 'health_care_utilization_q7', $template)->textInput(['maxlength' => true])->hint("<strong>INTERVIEWER INSTRUCTION:</strong> Code 997 for Don’t Know; 998 for Refused <br />") ?>

<div class="form-group">
 <div class="col-sm-5">
  <?= Html::label('INTERVIEWER READ : I am going to list some different types of hospitals. Please tell me if you stayed for one or more nights in any of these types of hospitals in the past 6 months.') ?>
 </div>
</div>
	
<?= $form->field($model, 'health_care_utilization_q8a', $template)->radioList($model->yes_no_dk,['separator'=>'&nbsp&nbsp&nbsp&nbsp'])?>
<?= $form->field($model, 'health_care_utilization_q8b', Common::convertTemplate($template,"after","days"))->textInput(['maxlength' => true,'data-min'=>1,'data-max'=>180, 'data-msg' => 'Please double-check that this answer is correct'])->hint("Number of days [Range : 1-180] <br />") ?>	
<?= $form->field($model, 'health_care_utilization_q9a', $template)->radioList($model->yes_no_dk,['separator'=>'&nbsp&nbsp&nbsp&nbsp'])?>
<?= $form->field($model, 'health_care_utilization_q9b', Common::convertTemplate($template,"after","days"))->textInput(['maxlength' => true,'data-min'=>1,'data-max'=>180, 'data-msg' => 'Please double-check that this answer is correct'])->hint("Number of days [Range : 1-180] <br />") ?>	
<?= $form->field($model, 'health_care_utilization_q10a', $template)->radioList($model->yes_no_dk,['separator'=>'&nbsp&nbsp&nbsp&nbsp'])?>
<?= $form->field($model, 'health_care_utilization_q10b', Common::convertTemplate($template,"after","days"))->textInput(['maxlength' => true,'data-min'=>1,'data-max'=>180, 'data-msg' => 'Please double-check that this answer is correct'])->hint("Number of days [Range : 1-180] <br />") ?>	
<?= $form->field($model, 'health_care_utilization_q11a', $template)->radioList($model->yes_no_dk,['separator'=>'&nbsp&nbsp&nbsp&nbsp'])?>
<?= $form->field($model, 'health_care_utilization_q11b', Common::convertTemplate($template,"after","days"))->textInput(['maxlength' => true,'data-min'=>1,'data-max'=>180, 'data-msg' => 'Please double-check that this answer is correct'])->hint("Number of days [Range : 1-180] <br />") ?>	
<?= $form->field($model, 'health_care_utilization_q12a', $template)->radioList($model->yes_no_dk,['separator'=>'&nbsp&nbsp&nbsp&nbsp'])?>
<?= $form->field($model, 'health_care_utilization_q12b', Common::convertTemplate($template,"after","days"))->textInput(['maxlength' => true,'data-min'=>1,'data-max'=>180, 'data-msg' => 'Please double-check that this answer is correct'])->hint("Number of days [Range : 1-180] <br />") ?>
<?= $form->field($model, 'health_care_utilization_q13', $template)->textInput(['maxlength' => true])->hint("<strong>INTERVIEWER INSTRUCTION:</strong> Code 997 for Don’t Know; 998 for Refused <br />") ?>	
<?= $form->field($model, 'health_care_utilization_q14', $template)->dropDownList($model->no_yes_dk, ['prompt'=>'Select'])?>
<?= $form->field($model, 'health_care_utilization_q15', $template)->textInput(['maxlength' => true])->hint("<strong>INTERVIEWER INSTRUCTION:</strong> Code 997 for Don’t Know; 998 for Refused <br />") ?>
<?= $form->field($model, 'health_care_utilization_q16', $template)->textInput(['maxlength' => true])->hint("<strong>INTERVIEWER INSTRUCTION:</strong> Code 997 for Don’t Know; 998 for Refused <br />") ?>
<?= $form->field($model, 'health_care_utilization_q17', Common::convertTemplate($template,"after","rupees"))->textInput(['maxlength' => true])->hint("<strong>INTERVIEWER INSTRUCTION:</strong> Code 997 for Don’t Know; 998 for Refused <br />") ?>
<?= $form->field($model, 'health_care_utilization_q18', Common::convertTemplate($template,"after","hours"))->textInput(['maxlength' => true])->hint("<strong>INTERVIEWER INSTRUCTION:</strong> Record time estimates in hours to the nearest quarter hour: 45 minutes = 0.75, 2 ½ hours = 2.5, etc. If participant says 1 day or ½ day, clarify this in hours (e.g., 4 hours, 8 hours, 12 hours, 24 hours?). Code 997 for Don’t Know; 998 for Refused <br />") ?>
				
									
					<?= $form->field($model, 'status', $htemplate)->hiddenInput(['value' => 1])->label() ?>
					<?= $form->field($model, $model->isNewRecord ? 'create_user' : 'update_user', $htemplate)->hiddenInput(['value' => yii::$app->user->identity->id])->label("") ?>
					<div class="form-group">
						<div class="col-sm-offset-5 col-sm-7">
									
					<?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
					<?= Html::a('Cancel', ['/'.Yii::$app->controller->id], ['class' => 'btn btn-default']) ?>
						</div>
					</div>
					<?php ActiveForm::end(); ?>
				</div>
				<!-- /.col-lg-6 (nested) -->
			</div>
			<!-- /.row (nested) -->
		</div>
		<!-- /.panel-body -->
	</div>
	<!-- /.panel -->
</div>