{% extends 'dashboard_screen/base.html' %}

{% block content %}

            <!-- ============================================================== -->
            <!-- Start right Content here -->
            <!-- ============================================================== -->
            <div class="content-page">
                <!-- Start content -->
                <div class="content">
                    <div class="container">
                        <div class="row">

                            <div class="col-lg-12">
                                 <!-- Basic Form Wizard -->

                            	<div class="card-box">
                            		<h4 class="m-t-0 header-title"><b>Edit Patient</b></h4>

									<form id="id_ajax_form_edit_patient" action="/dashboard/edit_patient/{{ Patient.patient_id }}/" class="form-horizontal" method="post" enctype="multipart/form-data">
                                        {% csrf_token %}
                                        <input type="hidden"  name="patient_id" value="{{ Patient.patient_id }}"/>
                                        <div>
                                                   <div class="col-lg-3">
                                                        <div class="p-20">
                                                            <h5><b>Patient External ID:</b></h5>
                                                            <div class="input-group m-t-15">
                                                                <select name="patient_client" class="select2-limiting" multiple="multiple" data-placeholder="Choose a Result" data-style="btn-white">
                                                                    {% for Client in Clients %}
                                                                         <option value="{{ Client.client_id }}" {% if Client == Patient.patient_client %} selected{% endif %}>{{ Client.client_code }}</option>
                                                                    {% endfor %}
                                                                </select>
                                                                <span class="input-group-addon bg-custom b-0 text-white"><i class="fa fa-users"></i></span>
                                                            </div>
                                                        </div>
                                                   </div>

                                                    <div class="col-lg-3">
                                                        <div class="p-20">
                                                            <h5><b>Patient External ID:</b></h5>
                                                            <div class="input-group m-t-15">
                                                                <input type="text" class="form-control" id="state-warning" maxlength="25" name="patient_external_id" placeholder="External ID" onKeyUp="this.value=this.value.toUpperCase();" value="{{ Patient.ext_id }}"/>
                                                                <span class="input-group-addon bg-custom b-0 text-white"><i class="fa fa-users"></i></span>
                                                            </div>
                                                        </div>
                                                   </div>

                                                    <div class="col-lg-3">
                                                        <div class="p-20">
                                                            <h5><b>First Name: (*)</b></h5>
                                                            <div class="input-group m-t-15">
                                                                <input type="text" class="form-control" id="state-warning"  required name="patient_first_name" placeholder="Enter First Name" value="{{ Patient.first_name }}" />
                                                                <span class="input-group-addon bg-custom b-0 text-white"><i class="fa fa fa-user"></i></span>
                                                            </div>
                                                        </div>
                                                   </div>

                                                   <div class="col-lg-3">
                                                        <div class="p-20">
                                                            <h5><b> Last Name: (*)</b></h5>
                                                            <div class="input-group m-t-15">
                                                                <input type="text" name="patient_last_name" required class="form-control" id="state-warning" placeholder="Enter Last Name" value="{{ Patient.last_name }}">
                                                                <span class="input-group-addon bg-custom b-0 text-white"><i class="fa fa fa-user"></i></span>
                                                            </div>
                                                        </div>
                                                   </div>

                                                   <div class="col-lg-3">
                                                        <div class="p-20">
                                                            <h5><b>DOB: mm/dd/yy (*)</b></h5>
                                                            <div class="input-group m-t-15">
                                                                 <input type="text" class="form-control" name="patient_dob" data-date-format="mm/dd/yyyy" placeholder="Enter patient Date of Birth " id="datepicker-autoclose" value="{{ Patient.dob |date:"m/d/Y" }}">
                                                                 <span class="input-group-addon bg-custom b-0 text-white"><i class="icon-calender"></i></span>
                                                            </div>
                                                        </div>
                                                   </div>

                                                   <div class="col-lg-4">
                                                        <div class="p-20">
                                                            <h5><b>Address:</b></h5>
                                                            <div class="input-group m-t-15">
                                                                 <input type="text" name="patient_address" class="form-control" id="id_patient_address" placeholder="Enter Patient address" value="{{ Patient.address }}">
                                                            <span class="input-group-addon bg-custom b-0 text-white"><i class="fa ion-map "></i></span>
                                                            </div>
                                                        </div>
                                                   </div>

                                                    <div class="col-lg-5">
                                                        <div class="p-20">
                                                            <h5><b>Address 2:</b></h5>
                                                            <div class="input-group m-t-15">
                                                                 <input type="text" name="patient_address2" class="form-control" id="id_patient_address2" placeholder="Enter Patient address" value="{{ Patient.address2}}">
                                                                 <span class="input-group-addon bg-custom b-0 text-white"><i class="fa ion-map "></i></span>
                                                            </div>
                                                        </div>
                                                   </div>

                                                    <div class="col-lg-3">
                                                        <div class="p-20">
                                                            <h5><b>SSN:(*)</b></h5>
                                                            <div class="input-group m-t-15">
                                                                 <input type="text" class="form-control" maxlength="9" name="patient_ssn" id="exampleInputPassword1" placeholder="Enter patient SSN" value="{{ Patient.SSN_number }}">
                                                             <span class="input-group-addon bg-custom b-0 text-white"><i class="fa fa-legal"></i></span>
                                                            </div>
                                                        </div>
                                                   </div>

                                                    <div class="col-lg-3">
                                                        <div class="p-20">
                                                            <h5><b>Phone:</b></h5>
                                                            <div class="input-group m-t-15">
                                                                <input type="tel" step="1" name="patient_phone" class="form-control" id="id_patient_phone" placeholder="Enter Patient Phone" value="{{ Patient.phone }}">
                                                                <span class="input-group-addon bg-custom b-0 text-white"><i class="fa fa-phone"></i></span>
                                                            </div>
                                                        </div>
                                                   </div>

                                                   <div class="col-lg-3">
                                                        <div class="p-20">
                                                            <h5><b>City:</b></h5>
                                                            <div class="input-group m-t-15">
                                                               <input type="text" name="patient_city" class="form-control" id="id_patient_city" placeholder="Enter City" value="{{ Patient.city }}">
                                                               <span class="input-group-addon bg-custom b-0 text-white"><i class="fa ion-map"></i></span>
                                                            </div>
                                                        </div>
                                                   </div>



                                                   <div class="col-lg-3">
                                                        <div class="p-20">
                                                            <h5><b>Zip Code:</b></h5>
                                                            <div class="input-group m-t-15">
                                                                <input type="text" name="patient_zipcode" class="form-control" id="exampleInputEmail1" placeholder="Zip Code" value="{{ Patient.zipcode }}">
                                                                <span class="input-group-addon bg-custom b-0 text-white"><i class="fa fa-map-marker"></i></span>
                                                            </div>
                                                        </div>
                                                   </div>

                                                   <div class="col-lg-3">
                                                        <div class="p-20">
                                                            <h5><b>State:</b></h5>
                                                            <div class="input-group m-t-15">
                                                                <select id="id_patient_state" name="patient_state" class="selectpicker show-tick" data-style="btn-white">
                                                                        {% if states %}
                                                                           {% for item in states %}
                                                                             <option value="{{ item.code }}" {% if item.code == Patient.state %} selected{% endif %}>{{ item.name }}</option>
                                                                           {% endfor %}
                                                                        {% endif %}
                                                                   </select>
                                                            </div>
                                                        </div>
                                                   </div>


                                                    <div class="col-lg-3">
                                                        <div class="p-20">
                                                            <h5><b>Gender:(*)</b></h5>
                                                            <div class="input-group m-t-15">
                                                                  <select id="id_patient_gender" required name="patient_gender" class="selectpicker show-tick" data-style="btn-white">
                                                                      <option value=""> Select Patient Gender</option>
                                                                       <option value="M" {% if Patient.gender == 'M' %} selected{% endif %}> Male</option>
                                                                       <option value="F" {% if Patient.gender == 'F'%} selected{% endif %}> Female</option>
                                                                   </select>
                                                             </div>
                                                        </div>
                                                    </div>

                                                    <div class="col-lg-4">
                                                        <div class="p-20">
                                                            <h5><b>Ethnicity:</b></h5>
                                                            <div class="input-group m-t-15">
                                                                  <select id="id_patient_ethnicity" name="patient_ethnicity" class="selectpicker show-tick" data-style="btn-white">
                                                                      <option value="0"> Select Patient Ethnicty</option>
                                                                              <option value="1" {% if Patient.ethnicity == '1' %} selected{% endif %}> American Indian or Alaska Native</option>
                                                                              <option value="2" {% if Patient.ethnicity == '2' %} selected{% endif %}> Asian</option>
                                                                              <option value="3" {% if Patient.ethnicity == '3' %} selected{% endif %}> Black or African American</option>
                                                                              <option value="4" {% if Patient.ethnicity == '4' %} selected{% endif %}> Hispanic or Latino</option>
                                                                              <option value="5" {% if Patient.ethnicity == '5' %} selected{% endif %}> Native Hawaiian or Other Pacific Islander </option>
                                                                              <option value="6" {% if Patient.ethnicity == '6' %} selected{% endif %}> White</option>
                                                                              <option value="7" {% if Patient.ethnicity == '7' %} selected{% endif %}> Other</option>
                                                                   </select>
                                                            </div>
                                                        </div>
                                                    </div>

                                                    <div class="col-lg-12">
                                                        <div class="form-group ">
                                                            <p class="text-muted font-13 m-b-15 m-t-20">Please select how the Patient will get the Notification.</p>
                                                            <div class="col-sm-12">
                                                                <div class="radio radio-inline">
                                                                    <input type="radio" id="inlineRadio2" value="1" name="notification" {% if Patient.notification == 1 %} checked{% endif %}>
                                                                    <label for="inlineRadio2"> Web Site </label>
                                                                </div>

                                                                <div class="radio radio-inline">
                                                                    <input type="radio" id="inlineRadio3" value="0" name="notification" {% if Patient.notification == 0 %} checked{% endif %}>
                                                                    <label for="inlineRadio3"> Doctor Office </label>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>

                                                    <div class="form-group clearfix">
                                                       <label class="col-lg-6 control-label ">(*) Mandatory</label>
                                                    </div>

                                                     <div class="form-group m-b-0">
                                                        <div class="col-sm-offset-10 col-sm-10">
                                                          <button type="submit" name="edit_patient" class="btn btn-default waves-effect waves-light">Save</button>
                                                        </div>
                                                    </div>

                                                    <div class="form-group clearfix">
                                                        <label class="col-lg-6 control-label ">{{ message }}</label>
                                                    </div>



                                         </div>
                                    </form>


                            	</div>


                            <!-- End row -->

                            </div> <!-- end col -->
                        </div>

						<!-- end row -->



                    </div> <!-- container -->

                </div> <!-- content -->


{% endblock %}