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

{% block content %}

            <!-- ============================================================== -->
            <!-- Start right Content here -->
            <!-- ============================================================== -->
    <div class="content-page" xmlns="http://www.w3.org/1999/html">
                <!-- 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>New Order Entry Form </b></h4>

                                     {% if Step == 0 %}
                                         <form id="" action="/dashboard/wizard/" class="group-border-dashed" method="post" enctype="multipart/form-data">
                                     {% else %}
                                         <form id="" action="/dashboard/wizard/{{ Step }}/" class="group-border-dashed" method="post" enctype="multipart/form-data">
									 {% endif %}
                                        {% csrf_token %}
                                        <input type="hidden"  name="Step" value="{{ Step }}"/>

                                        {% if Patient %}
                                            <input type="hidden"  name="patient_id" value="{{ Patient.patient_id }}"/>
                                        {% else %}
                                            <input type="hidden"  name="patient_id" value=""/>
                                        {% endif %}

                                        {% if Entry %}
                                            <input type="hidden"  name="entry_id" value="{{Entry.entry_id }}"/>
                                        {% endif %}


                                        <div id="wizard">
                                            <h3>Patient Information</h3>
                                            <section>
                                                {% if Step == 0 %}
                                                    {% if Patient %}
                                                        <h4 class="m-t-0 header-title"><b>Update Patient</b></h4>
                                                    {% else %}
                                                        <h4 class="m-t-0 header-title"><b>Adding New Patient</b></h4>
                                                    {% endif %}
                                                    <div>
                                                           <div class="col-lg-3">
                                                                   <div class="p-20">
                                                                       <h5><b>Client Name / Client Code(*)</b></h5>
                                                                       <div class="input-group m-t-15">
                                                                            <select  name="client_id" class="selectpicker" autofocus data-placeholder="Choose a Client" multiple data-max-options="1" data-style="btn-white">
                                                                                {% for Client in Clients %}
                                                                                     <option value="{{ Client.client_id }}" {% if Client == Patient.patient_client %} selected{% endif %}>({{ Client.client_code }}) {{ Client.get_full_name }}</option>
                                                                                {% endfor %}
                                                                            </select>
                                                                       </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" value="{% if Patient %}{{ Patient.ext_id }} {% endif %}" onKeyUp="this.value=this.value.toUpperCase();" />
                                                                        <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" value="{% if Patient %}{{ Patient.first_name }} {% else %}{% if patient_first_name %}{{ patient_first_name }}{% endif %}{% endif %}" />
                                                                        <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="{% if Patient %}{{ Patient.last_name }}{% else %}{% if patient_last_name %}{{ patient_last_name }}{% endif %}{% endif %}">
                                                                        <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="{% if Patient %}{{ Patient.dob |date:"m/d/Y" }}{% endif %}">
                                                                         <span class="input-group-addon bg-custom b-0 text-white"><i class="icon-calender"></i></span>
                                                                    </div>
                                                                </div>
                                                           </div>

                                                           <div class="col-lg-3">
                                                                <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="{% if Patient %}{{ Patient.address }}{% endif %}">
                                                                    <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>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="{% if Patient %}{{ Patient.address2 }}{% endif %}">
                                                                         <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="{% if Patient %}{{ Patient.SSN_number }}{% endif %}">
                                                                     <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="{% if Patient %}{{ Patient.phone }}{% endif %}">
                                                                        <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="{% if Patient %}{{ Patient.city }}{% endif %}">
                                                                       <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="{% if Patient %}{{ Patient.zipcode }}{% endif %}">
                                                                        <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-12">


                                                                <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 %} {% if Patient.gender == 'F'%} selected{% endif %}{% else %}selected{% endif %}> Female</option>
                                                                               </select>
                                                                         </div>
                                                                    </div>
                                                                </div>

                                                                <div class="col-lg-3">
                                                                    <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>


                                                           <div class="col-lg-12">

                                                                <div class="form-group">
                                                                    <p class="control-label"><strong>Enter payor information</strong></p>

                                                                        <div class="radio radio-custom radio-inline">
                                                                            <input type="radio" id="inlineRadio1" value="0" onclick="toggle(this)" name="billing_option" {% if not Patient.insurance_type  %} checked{% endif %}>
                                                                            <label for="inlineRadio1"> Client </label>
                                                                        </div>

                                                                        <div class="radio radio-custom radio-inline">
                                                                            <input type="radio" id="inlineRadio2" value="1" onclick="toggle(this)" name="billing_option" {% if Patient.insurance_type %} checked{% endif %}>
                                                                            <label for="inlineRadio2"> Insurance </label>
                                                                        </div>

                                                                    <div id="uno" style="display:none">
                                                                        <p class="text-muted font-13 m-b-15 m-t-20">Insurance Options:{{ Patient.insurance_name }}</p>
                                                                        <div class="col-sm-12">
                                                                            <div class="radio radio-custom radio-inline">
                                                                                <input type="radio" id="inlineRadio3" value="Medicare" name="insurance_name" {% if Patient.insurance_name == 'Medicare' %} checked{% endif %}>
                                                                                <label for="inlineRadio3"> Medicare </label>
                                                                            </div>

                                                                            <div class="radio radio-custom radio-inline">
                                                                                <input type="radio" id="inlineRadio4" value="Medicaid" name="insurance_name" {% if Patient.insurance_name == 'Medicaid' %} checked{% endif %}>
                                                                                <label for="inlineRadio4"> Medicaid </label>
                                                                            </div>

                                                                            <div class="radio radio-custom radio-inline">
                                                                                <input type="radio" id="inlineRadio6" value="Private"  name="insurance_name" {% if Patient.insurance_name == 'Private' %} checked{% endif %}>
                                                                                <label for="inlineRadio6"> Private </label>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-sm-12">

                                                                            <div class="col-lg-3">
                                                                                <div class="p-1">
                                                                                    <h5><b>Subscriber No.</b></h5>
                                                                                    <div class="input-group m-t-15">
                                                                                        <input type="text" name="insurance_suscriber_number" class="form-control" id="exampleInputEmail1" value="{% if Patient %}{{ Patient.insurance_suscriber_number }}{% endif %}">
                                                                                        <span class="input-group-addon bg-custom b-0 text-white"><i class="fa fa-sort-numeric-asc"></i></span>
                                                                                    </div>
                                                                                </div>
                                                                            </div>

                                                                            <div class="col-lg-3">
                                                                                <div class="p-1">
                                                                                    <h5><b>DOB: mm/dd/yy (*)</b></h5>
                                                                                    <div class="input-group m-t-15">
                                                                                         <input type="text" class="form-control" name="insurance_dob" data-date-format="mm/dd/yyyy" placeholder="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-6">
                                                                                <div class="p-1">
                                                                                    <h5><b>Insurance Group:</b></h5>
                                                                                    <div class="input-group m-t-15">
                                                                                        <input type="text" name="insurance_group" class="form-control" id="exampleInputEmail1" placeholder="Insurance Group" value="{% if Patient %}{{ Patient.insurance_group }}{% endif %}">
                                                                                        <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-1">
                                                                                    <h5><b>UPIN:</b></h5>
                                                                                    <div class="input-group m-t-15">
                                                                                        <input type="text" name="insurance_upin" class="form-control" id="exampleInputEmail1" placeholder="UPIN" value="{% if Patient %}{{ Patient.insurance_UPIN }}{% endif %}">
                                                                                        <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-9">
                                                                                <div class="p-1">
                                                                                    <h5><b>ICD9 Diagnosis Code:</b></h5>
                                                                                    <div class="input-group m-t-15">
                                                                                          <select id="id_medicare_icd9" name="insurance_icd10" class="selectpicker show-tick" data-style="btn-white">
                                                                                                <option value="0"> Select ICD9 Diagnosis Code</option>
                                                                                                <option value="795.00">Nonspecific abnormal Papanicolaou smear of cervix - unspecified 795.00</option>
                                                                                                <option value="795.01">ASCUS favor benign 795.01</option>
                                                                                                <option value="795.02">ASCUS favor dysplasia 795.02</option>
                                                                                                <option value="795.09">Other nonspecific abnormal Papanicolaou smear of cervix 795.09</option>
                                                                                                <option value="627.3">Atrophic Vaginitis 627.3</option>
                                                                                                <option value="622.1">Dysplasia 622.1</option>
                                                                                                <option value="626.6">Metrorrhagia 626.6</option>
                                                                                                <option value="V22.0/V22.2">Pregnancy State V22.0/V22.2</option>
                                                                                                <option value="V24.2">Routine  Postpartum Follow Up V24.2</option>
                                                                                                <option value="616.10">Vaginitis 616.10</option>
                                                                                                <option value="627.2">Menopause 627.2</option>
                                                                                                <option value="616.0">Cervicitis 616.0</option>
                                                                                                <option value="V76.2" selected="selected">Routine V76.2</option>
                                                                                                <option value="S10.1">Oral Contraceptives-Eval Prior to Method S10.1</option>
                                                                                                <option value="S10.2">Oral Contraceptives-Maintain Adherence S10.2</option>
                                                                                                <option value="S20.1">Depo-Provera Injection-Eval prior to method S20.1</option>
                                                                                                <option value="S50.1">Barriers and spermicide-Eval prior to method S50.1</option>
                                                                                                <option value="S50.2">Barriers and spermicide-Maintain adherence S50.2</option>
                                                                                                <option value="">Other </option>
                                                                                           </select>
                                                                                    </div>
                                                                                </div>
                                                                            </div>


                                                                        </div>



                                                                    </div>
                                                            </div>


                                                            <div class="col-lg-12">
                                                                    <div class="col-lg-6">
                                                                            <div class="p-1">
                                                                                <h5><b>Responsible Party (if different from patient)</b></h5>
                                                                                <div class="input-group m-t-15">
                                                                                     <input type="text" name="responsible_party" class="form-control" id="id_responsible_party"  value="{% if Patient %}{{ Patient.insurance_responsible_party }}{% endif %}">
                                                                                     <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-6">
                                                                        <p class="text-muted font-13 m-b-15 m-t-20">Relationship To Patient:</p>
                                                                            <div class="col-sm-12">
                                                                                <div class="radio radio-custom radio-inline">
                                                                                    <input type="radio" id="inlineRadio7" value="Self" name="insurance_relationship" {% if Patient.insurance_relationship == 'Self' %} checked{% endif %}>
                                                                                    <label for="inlineRadio7"> Self </label>
                                                                                </div>

                                                                                <div class="radio radio-custom radio-inline">
                                                                                    <input type="radio" id="inlineRadio8" value="Child" name="insurance_relationship" {% if Patient.insurance_relationship == 'Child' %} checked{% endif %}>
                                                                                    <label for="inlineRadio8"> Child </label>
                                                                                </div>

                                                                                <div class="radio radio-custom radio-inline">
                                                                                    <input type="radio" id="inlineRadio9" value="Spouse" name="insurance_relationship" {% if Patient.insurance_relationship == 'Spouse' %} checked{% endif %}>
                                                                                    <label for="inlineRadio9"> Spouse </label>
                                                                                </div>

                                                                                <div class="radio radio-custom radio-inline">
                                                                                    <input type="radio" id="inlineRadio10" value="Other"  name="insurance_relationship" {% if Patient.insurance_relationship == 'Other' %} checked{% endif %}>
                                                                                    <label for="inlineRadio10"> Other </label>
                                                                                </div>
                                                                            </div>
                                                                    </div>




                                                            </div>



                                                    </div>
                                                {% endif %}
                                            </section>



                                            <h3 class="title current">Select Exams</h3>
                                            <section >
                                                {% if Step == 1 %}
                                                <div>
                                                     <div class="col-lg-4">
                                                        <div class="p-20">
                                                            <h5><b>Collection Date:(*)</b></h5>
                                                            <div class="input-group m-t-15">
                                                               <input type="text" class="form-control" required name="collection_date" data-date-format="mm/dd/yyyy" placeholder="Collection Date" id="datepicker-autoclose" value="{% if Entry %}{{ Entry.collection_date |date:"m/d/Y"}}{% endif %}">
                                                               <span class="input-group-addon bg-custom b-0 text-white"><i class="icon-calender"></i></span>
                                                            </div>
                                                        </div>
                                                     </div>

                                                     <div class="col-lg-5">
                                                        <div class="p-20">
                                                            <h5><b>Attending Physician Name (*)</b></h5>
                                                            <div class="input-group m-t-15">
                                                                <input type="text" class="form-control" id="state-warning"  required placeholder="Attending Physician Name" name="physician_name" value="{% if Entry %}{{ Entry.physician_name }}{% endif %}" />
                                                                <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-10">
                                                           <div class="col-lg-12">
                                                               <div class="p-20">
                                                                    <p class="text-muted m-b-15 font-13">You can select <code>  Multiple</code> Exams.</p>
                                                                    <select  name="my_multi_select2[]" class="multi-select select2 select2-multiple"  multiple="multiple" multiple data-placeholder="Choose a Case Type" data-style="btn-white">
                                                                        {% for case in CaseTypes %}
                                                                               <optgroup label="{{ case.case_type_name }}">
                                                                                   {% for exam in Exams %}
                                                                                       {% if case.case_type_name  == exam.exam_casetype.case_type_name %}
                                                                                          <option value="{{ exam.exam_id }}" {% if Entry.test_in_entry.all %}{%  for case in Entry.test_in_entry.all %}{% if case.exam_id == exam.exam_id %}selected{% endif %}{% endfor %}{% endif %}>{{ exam.exam_name }}</option>
                                                                                       {% endif %}
                                                                                   {% endfor %}
                                                                                </optgroup>
                                                                        {% endfor %}

                                                                    </select>
                                                               </div>
                                                           </div>
                                                    </div>

                                                </div>
                                                {% endif %}
                                            </section>

                                            <h3>Test Information</h3>
                                            <section>
                                                 {% if Step == 2 %}
                                                    <div>
                                                         <!-- INBOX -->
                                                        <div class="col-lg-4">
                                                            <div class="card-box">
                                                                <h4 class="m-t-0 m-b-20 header-title"><b>Order Info</b></h4>

                                                                <div class="inbox-widget mx-box">
                                                                    {% if Entry.test_in_entry.all %}
                                                                        {%  for case in Entry.test_in_entry.all %}
                                                                            <div class="inbox-item">
                                                                                <div class="inbox-item-img">
                                                                                    <i class="ion-beaker text-custom"></i>
                                                                                </div>
                                                                                <p class="inbox-item-author">{{ case.exam_name }}</p>
                                                                                <p class="inbox-item-text">{{ case.exam_casetype.case_type_name }}</p>
                                                                                <p class="inbox-item-date">{{ case.cpt_name }}</p>
                                                                            </div>
                                                                        {% endfor %}
                                                                    {% endif %}
                                                                </div>
                                                            </div>

                                                        </div> <!-- end INBOX -->
                                                        <div class="col-lg-8">
                                                              <div class="card-view">
                                                                 {% if CaseTypes_in %}
                                                                    {% for case in CaseTypes_in %}
                                                                            {% if case.case_type_id == 1 %}
                                                                                <h4 class="m-t-0 m-b-20 header-title"><b>Enter clinical information for {{ case.case_type_name }}</b></h4>


                                                                                <div class="col-lg-12">
                                                                                    <div class="form-group ">
                                                                                         <p class="text-muted font-13 m-b-15 m-t-20"><strong>Specimen Type:</strong></p>
                                                                                        <div class="col-sm-12">
                                                                                            <div class="radio radio-custom radio-inline">
                                                                                                <input type="radio" id="inlineRadio1" value="Liquid Base PAP" name="GYN_speciment_type" {% if Entry.GYN_speciment_type != 'Conventional' %}checked{% endif %}>
                                                                                                <label for="inlineRadio1"> Liquid Base PAP </label>
                                                                                            </div>

                                                                                            <div class="radio radio-custom radio-inline">
                                                                                                <input type="radio" id="inlineRadio2" value="Conventional" name="GYN_speciment_type" {% if Entry.GYN_speciment_type == 'Conventional' %}checked{% endif %}>
                                                                                                <label for="inlineRadio2"> Conventional </label>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                                                                </div>

                                                                                <div class="col-lg-12">
                                                                                    <div class="form-group ">
                                                                                         <p class="text-muted font-13 m-b-15 m-t-20"><strong>Specimen Source:</strong></p>
                                                                                        <div class="col-sm-12">
                                                                                            <div class="col-lg-3">
                                                                                                <div class="col-sm-offset-0">
                                                                                                    <div class="checkbox checkbox-custom">
                                                                                                        <input id="checkbox1" type="checkbox" value="1" name="GYN_Cervix" {% if Entry.GYN_Cervix == 1 %}checked{% endif %}>
                                                                                                        <label for="checkbox1">
                                                                                                            Cervix
                                                                                                        </label>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>

                                                                                            <div class="col-lg-3">
                                                                                                <div class="col-sm-offset-1">
                                                                                                    <div class="checkbox checkbox-custom">
                                                                                                        <input id="checkbox2" type="checkbox" value="1" name="GYN_Vaginal" {% if Entry.GYN_Vaginal == 1 %}checked{% endif %}>
                                                                                                        <label for="checkbox2">
                                                                                                            Vaginal
                                                                                                        </label>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                            <div class="col-lg-3">
                                                                                                <div class="col-sm-offset-1">
                                                                                                    <div class="checkbox checkbox-custom">
                                                                                                        <input id="checkbox3" type="checkbox" value="1" name="GYN_Endocervix" {% if Entry.GYN_Endocervix == 1 %}checked{% endif %}>
                                                                                                        <label for="checkbox3">
                                                                                                            Endocervix
                                                                                                        </label>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                            <div class="col-lg-3">
                                                                                                <div class="col-sm-offset-1">
                                                                                                    <div class="checkbox checkbox-custom">
                                                                                                        <input id="checkbox4" type="checkbox" value="1" name="GYN_None" {% if Entry.GYN_None == 1 %}checked{% endif %}>
                                                                                                        <label for="checkbox4">
                                                                                                            None given
                                                                                                        </label>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                                                                </div>

                                                                                <div class="col-lg-12">
                                                                                    <div class="form-group ">
                                                                                        <p class="text-muted font-13 m-b-15 m-t-20"><strong>Please select menstrual status.</strong></p>
                                                                                        <div class="col-sm-12">
                                                                                            <div class="radio radio-custom radio-inline">
                                                                                                <input type="radio" id="inlineRadio21" value="Regular" name="GYN_mestrual" {% if Entry.GYN_mestrual == 'Regular' %}checked{% endif %}>
                                                                                                <label for="inlineRadio21"> Regular </label>
                                                                                            </div>

                                                                                            <div class="radio radio-custom radio-inline">
                                                                                                <input type="radio" id="inlineRadio32" value="Irregular" name="GYN_mestrual" {% if Entry.GYN_mestrual == 'Irregular' %}checked{% endif %}>
                                                                                                <label for="inlineRadio32"> Irregular </label>
                                                                                            </div>

                                                                                             <div class="radio radio-custom radio-inline">
                                                                                                <input type="radio" id="inlineRadio3" value="Post-menopausal" name="GYN_mestrual" {% if Entry.GYN_mestrual == 'Post-menopausal' %}checked{% endif %}>
                                                                                                <label for="inlineRadio3"> Post-menopausal </label>
                                                                                            </div>
                                                                                             <div class="radio radio-custom radio-inline">
                                                                                                <input type="radio" id="inlineRadio4" value="Pregnant" name="GYN_mestrual" {% if Entry.GYN_mestrual == 'Pregnant' %}checked{% endif %}>
                                                                                                <label for="inlineRadio4"> Pregnant </label>
                                                                                             </div>
                                                                                             <div class="radio radio-custom radio-inline">
                                                                                                <input type="radio" id="inlineRadio5" value="Post-partum" name="GYN_mestrual" {% if Entry.GYN_mestrual == 'Post-partum' %}checked{% endif %}>
                                                                                                <label for="inlineRadio5"> Post-partum </label>
                                                                                            </div>

                                                                                        </div>
                                                                                    </div>
                                                                                </div>
                                                                                <div class="col-lg-12">
                                                                                    <div class="col-lg-6">
                                                                                        <div class="p-20">
                                                                                            <h5><b>Date of last menstrual period:(*)</b></h5>
                                                                                            <div class="input-group m-t-15">
                                                                                                <input type="text" class="form-control" required name="GYN_last_menstrual_period" value="{{ Entry.GYN_last_menstrual_period }}"/>
                                                                                                <span class="input-group-addon bg-custom b-0 text-white"><i class="icon-calender"></i></span>
                                                                                            </div>
                                                                                        </div>
                                                                                   </div>

                                                                                   <div class="col-lg-6">
                                                                                        <div class="p-20">
                                                                                            <h5><b>Date of previous biopsy: </b></h5>
                                                                                            <div class="input-group m-t-15">
                                                                                                <input type="text" class="form-control" id="state-warning"  name="GYN_previous_biopsy" value="{{ Entry.GYN_previous_biopsy }}" />
                                                                                                <span class="input-group-addon bg-custom b-0 text-white"><i class="icon-calender"></i></span>
                                                                                            </div>
                                                                                        </div>
                                                                                   </div>
                                                                                </div>
                                                                                <div class="col-lg-12">

                                                                                   <div class="col-lg-6">
                                                                                        <div class="p-20">
                                                                                            <h5><b>Date of previous pap smear: (*)</b></h5>
                                                                                            <div class="input-group m-t-15">
                                                                                                <input type="text" class="form-control" id="state-warning"   name="GYN_pap_smear"  value="{{ Entry.GYN_pap_smear }}"/>
                                                                                                <span class="input-group-addon bg-custom b-0 text-white"><i class="icon-calender"></i></span>
                                                                                            </div>
                                                                                        </div>
                                                                                   </div>

                                                                                   <div class="col-lg-6">
                                                                                        <div class="p-20">
                                                                                            <h5><b>Prior abnormal report:</b></h5>
                                                                                            <div class="input-group m-t-15">
                                                                                                <select id="id_abnormal_report" name="GYN_abnormal_report" class="selectpicker show-tick" data-style="btn-white">
                                                                                                    <option value="">Select if Applicable</option>
                                                                                                    <option value="ASC-US" {% if Entry.GYN_abnormal_report == 'ASC-US' %}selected{% endif %}>ASC-US</option>
                                                                                                    <option value="ASC-H" {% if Entry.GYN_abnormal_report == 'ASC-H' %}selected{% endif %}>ASC-H</option>
                                                                                                    <option value="LSIL" {% if Entry.GYN_abnormal_report == 'LSIL' %}selected{% endif %}>LSIL</option>
                                                                                                    <option value="HSIL" {% if Entry.GYN_abnormal_report == 'HSIL' %}selected{% endif %}>HSIL</option>
                                                                                                    <option value="Malignant" {% if Entry.GYN_abnormal_report == 'Malignant' %}selected{% endif %}>Malignant</option>
                                                                                                </select>
                                                                                            </div>
                                                                                        </div>
                                                                                   </div>
                                                                                </div>

                                                                                <div class="col-lg-12">
                                                                                    <div class="form-group ">
                                                                                         <p class="text-muted font-13 m-b-15 m-t-20"><strong>Present complaint or physical findings(select all that apply):</strong></p>
                                                                                        <div class="col-sm-12">
                                                                                            <div class="col-lg-3">
                                                                                                <div class="col-sm-offset-0">
                                                                                                    <div class="checkbox checkbox-custom checkbox-inline">
                                                                                                        <input id="checkbox6" type="checkbox" value="1" name="GYN_routine" {% if Entry.GYN_routine == 1 %}checked{% endif %}>
                                                                                                        <label for="checkbox6">
                                                                                                            Routine
                                                                                                        </label>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>

                                                                                            <div class="col-lg-3">
                                                                                                <div class="col-sm-offset-1">
                                                                                                    <div class="checkbox checkbox-custom checkbox-inline">
                                                                                                        <input id="checkbox14" type="checkbox" value="1" name="GYN_vaginitis" {% if Entry.GYN_vaginitis == 1 %}checked{% endif %}>
                                                                                                        <label for="checkbox14">
                                                                                                            Vaginitis
                                                                                                        </label>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                            <div class="col-lg-3">
                                                                                                <div class="col-sm-offset-1">
                                                                                                    <div class="checkbox checkbox-custom checkbox-inline">
                                                                                                        <input id="checkbox8" type="checkbox" value="1" name="GYN_cervicitis" {% if Entry.GYN_cervicitis == 1 %}checked{% endif %}>
                                                                                                        <label for="checkbox8">
                                                                                                            Cervicitis
                                                                                                        </label>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                            <div class="col-lg-3">
                                                                                                <div class="col-sm-offset-1">
                                                                                                    <div class="checkbox checkbox-custom checkbox-inline">
                                                                                                        <input id="checkbox9" type="checkbox" value="1" name="GYN_condyloma" {% if Entry.GYN_condyloma == 1 %}checked{% endif %}>
                                                                                                        <label for="checkbox9">
                                                                                                            HPV
                                                                                                        </label>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>

                                                                                            <div class="col-lg-3">
                                                                                                <div class="col-sm-offset-1">
                                                                                                    <div class="checkbox checkbox-custom checkbox-inline">
                                                                                                        <input id="checkbox10" type="checkbox" value="1" name="GYN_herpes" {% if Entry.GYN_herpes == 1 %}checked{% endif %}>
                                                                                                        <label for="checkbox10">
                                                                                                            Possible Herpes
                                                                                                        </label>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                            <div class="col-lg-3">
                                                                                                <div class="col-sm-offset-1">
                                                                                                    <div class="checkbox checkbox-custom checkbox-inline">
                                                                                                        <input id="checkbox11" type="checkbox" value="1" name="GYN_clinically_suspicious" {% if Entry.GYN_clinically_suspicious == 1 %}checked{% endif %}>
                                                                                                        <label for="checkbox11">
                                                                                                            Clinically suspicious
                                                                                                        </label>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                            <div class="col-lg-3">
                                                                                                <div class="col-sm-offset-1">
                                                                                                    <div class="checkbox checkbox-custom checkbox-inline">
                                                                                                        <input id="checkbox12" type="checkbox" value="1" name="GYN_abnormal_bleeding" {% if Entry.GYN_abnormal_bleeding == 1 %}checked{% endif %}>
                                                                                                        <label for="checkbox12">
                                                                                                            Abnormal Bleeding
                                                                                                        </label>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                            <div class="col-lg-3">
                                                                                                <div class="col-sm-offset-1">
                                                                                                    <div class="checkbox checkbox-custom checkbox-inline">
                                                                                                        <input id="checkbox13" type="checkbox" value="1" name="GYN_cervical_lesion" {% if Entry.GYN_cervical_lesion == 1 %}checked{% endif %}>
                                                                                                        <label for="checkbox13">
                                                                                                            Cervical Lesion
                                                                                                        </label>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                            <div class="col-lg-3">
                                                                                                <div class="col-sm-offset-1">
                                                                                                    <div class="checkbox checkbox-custom checkbox-inline">
                                                                                                        <input id="checkbox7" type="checkbox" value="1" name="GYN_menopausal_syndrome" {% if Entry.GYN_menopausal_syndrome == 1 %}checked{% endif %}>
                                                                                                        <label for="checkbox7">
                                                                                                            Menopausal Syndrome
                                                                                                        </label>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                            <div class="col-lg-3">
                                                                                                <div class="col-sm-offset-1">
                                                                                                    <div class="checkbox checkbox-custom checkbox-inline">
                                                                                                        <input id="checkbox15" type="checkbox" value="1" name="GYN_bleeds_on_contact" {% if Entry.GYN_bleeds_on_contact == 1 %}checked{% endif %}>
                                                                                                        <label for="checkbox15">
                                                                                                            Bleeds on Contact
                                                                                                        </label>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                            <div class="col-lg-3">
                                                                                                <div class="col-sm-offset-1">
                                                                                                    <div class="checkbox checkbox-custom checkbox-inline">
                                                                                                        <input id="checkbox16" type="checkbox" value="1" name="GYN_infection" {% if Entry.GYN_infection == 1 %}checked{% endif %}>
                                                                                                        <label for="checkbox16">
                                                                                                            Infection
                                                                                                        </label>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                            <div class="col-lg-3">
                                                                                                <div class="col-sm-offset-1">
                                                                                                    <div class="checkbox checkbox-custom checkbox-inline">
                                                                                                        <input id="checkbox41" type="checkbox" value="1" name="GYN_iud" {% if Entry.GYN_iud == 1 %}checked{% endif %}>
                                                                                                        <label for="checkbox41">
                                                                                                            IUD
                                                                                                        </label>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>



                                                                                        </div>
                                                                                        <div class="col-sm-12">

                                                                                            <div class="col-lg-3">
                                                                                                <div class="col-sm-offset-1">
                                                                                                    <div class="checkbox checkbox-custom checkbox-inline">
                                                                                                        <input id="checkbox17" type="checkbox" value="1" name="GYN_discharge" {% if Entry.GYN_discharge == 1 %}checked{% endif %}>
                                                                                                        <label for="checkbox17">
                                                                                                            Discharge
                                                                                                        </label>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                            <div class="col-lg-4">
                                                                                                <div class="col-sm-offset-1">
                                                                                                    <div class="checkbox checkbox-custom checkbox-inline">
                                                                                                        <input id="checkbox18" type="checkbox" value="1" name="GYN_hysterectomy" {% if Entry.GYN_hysterectomy == 1 %}checked{% endif %}>
                                                                                                        <label for="checkbox18">
                                                                                                            Hysterectomy
                                                                                                        </label>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                            <div class="col-lg-4">
                                                                                                <div class="radio radio-custom radio-inline">
                                                                                                    <input type="radio" id="inlineRadio11" value="Partial" name="GYN_discharge_info" {% if Entry.GYN_discharge_info == 'Partial' %}checked{% endif %}>
                                                                                                    <label for="inlineRadio11"> Partial </label>
                                                                                                </div>
                                                                                                <div class="radio radio-custom radio-inline">
                                                                                                    <input type="radio" id="inlineRadio12" value="Total" name="GYN_discharge_info" {% if Entry.GYN_discharge_info == 'Total' %}checked{% endif %}>
                                                                                                    <label for="inlineRadio12"> Total </label>
                                                                                                </div>
                                                                                            </div>

                                                                                        </div>
                                                                                        <div class="col-sm-12">
                                                                                            <div class="col-lg-12">
                                                                                                <div class="p-20">
                                                                                                    <h5><b>Others</b></h5>
                                                                                                    <div class="input-group m-t-15">
                                                                                                        <input type="text" class="form-control" id="state-warning"  name="GYN_hysterectomy_description"  value="{{ Entry.GYN_hysterectomy_description }}"/>
                                                                                                        <span class="input-group-addon bg-custom b-0 text-white"><i class="ion-beaker"></i></span>
                                                                                                    </div>
                                                                                                </div>
                                                                                           </div>
                                                                                        </div>
                                                                                    </div>
                                                                                </div>
                                                                                <div class="col-lg-12">
                                                                                   <hr />
                                                                                </div>
                                                                            {% endif %}

                                                                            {% if case.case_type_id == 2 %}
                                                                                <h4 class="m-t-0 m-b-20 header-title"><b>Enter clinical information for {{ case.case_type_name }}</b></h4>

                                                                                <div class="col-lg-12">
                                                                                    <div class="form-group ">
                                                                                         <div class="col-sm-12">
                                                                                             <div class="col-lg-12">
                                                                                                <div class="p-20">
                                                                                                    <h5><b>Specimen Source (*):</b></h5>
                                                                                                    <div class="input-group m-t-15">
                                                                                                        <select id="id_Non_GYN_specimen_source" required name="Non_GYN_specimen_source" class="selectpicker show-tick" data-style="btn-white">
                                                                                                            <option value="" selected>Select if Applicable</option>
                                                                                                            {% for source in no_gyn_specimen_sources %}
                                                                                                                <option value="{{ source.id }}" {% if Entry.Non_GYN_specimen_source == source.id %}selected {% endif %}>{{ source.name }}</option>
                                                                                                            {% endfor %}
                                                                                                        </select>
                                                                                                    </div>
                                                                                                </div>
                                                                                             </div>
                                                                                             <div class="col-lg-12">
                                                                                                <div class="p-20">
                                                                                                    <h5><b>Clinical information:</b></h5>
                                                                                                    <div class="input-group m-t-15">
                                                                                                        <textarea id="textarea" name="Non_GYN_clinical_info" class="form-control" maxlength="200" rows="2" >{{ Entry.Non_GYN_clinical_info }}</textarea>
                                                                                                        <span class="input-group-addon bg-custom b-0 text-white"><i class="ion-beaker"></i></span>
                                                                                                    </div>
                                                                                                </div>
                                                                                             </div>
                                                                                         </div>
                                                                                         <div class="col-sm-12">
                                                                                             <div class="col-lg-12">
                                                                                                <div class="p-20">
                                                                                                    <h5><b>Gross description:</b></h5>
                                                                                                    <div class="input-group m-t-15">
                                                                                                        <textarea id="textarea" name="Non_GYN_gross_description" class="form-control" maxlength="200" rows="2" >{{ Entry.Non_GYN_gross_description }}</textarea>
                                                                                                        <span class="input-group-addon bg-custom b-0 text-white"><i class="ion-beaker"></i></span>
                                                                                                    </div>
                                                                                                </div>
                                                                                             </div>

                                                                                          </div>
                                                                                    </div>
                                                                                </div>
                                                                                <div class="col-lg-12">
                                                                                   <hr />
                                                                                </div>

                                                                            {% endif %}

                                                                            {% if case.case_type_id == 3 %}
                                                                                <h4 class="m-t-0 m-b-20 header-title"><b>Enter clinical information for {{ case.case_type_name }}</b></h4>

                                                                                <div class="col-lg-12">
                                                                                    <div class="form-group ">
                                                                                         <p class="text-muted font-13 m-b-15 m-t-20"><strong>Specimen Source:</strong></p>
                                                                                         <div class="col-sm-12">
                                                                                             <div class="col-lg-12">
                                                                                                    <div class="col-sm-12">
                                                                                                        <div class="radio radio-custom radio-inline">
                                                                                                            <input type="radio" id="inlineRadio13" value="Vaginal" name="MP_speciment_source" {% if Entry.MP_speciment_source == 'Vaginal' %} checked{% endif %}>
                                                                                                            <label for="inlineRadio13"> Vaginal swab </label>
                                                                                                        </div>

                                                                                                        <div class="radio radio-custom radio-inline">
                                                                                                            <input type="radio" id="inlineRadio14" value="Urethral" name="MP_speciment_source" {% if Entry.MP_speciment_source == 'Urethral' %} checked{% endif %}>
                                                                                                            <label for="inlineRadio14"> Urethral swab </label>
                                                                                                        </div>

                                                                                                        <div class="radio radio-custom radio-inline">
                                                                                                            <input type="radio" id="inlineRadio15" value="Urine" name="MP_speciment_source" {% if Entry.MP_speciment_source == 'Urine' %} checked{% endif %}>
                                                                                                            <label for="inlineRadio15"> Urine </label>
                                                                                                        </div>

                                                                                                        <div class="radio radio-custom radio-inline">
                                                                                                            <input type="radio" id="inlineRadio16" value="Liquid-based"  name="MP_speciment_source" {% if Entry.MP_speciment_source == 'Liquid-based' %} checked{% endif %}>
                                                                                                            <label for="inlineRadio16"> Liquid-based </label>
                                                                                                        </div>
                                                                                                        <div class="radio radio-custom radio-inline">
                                                                                                            <input type="radio" id="inlineRadio17" value="PAP"  name="MP_speciment_source" {% if Entry.MP_speciment_source == 'PAP' %} checked{% endif %}>
                                                                                                            <label for="inlineRadio17"> PAP </label>
                                                                                                        </div>
                                                                                                    </div>
                                                                                             </div>
                                                                                         </div>
                                                                                    </div>
                                                                                </div>
                                                                                <div class="col-lg-12">
                                                                                   <hr />
                                                                                </div>
                                                                            {% endif %}

                                                                            {% if case.case_type_id == 4 %}

                                                                                <h4 class="m-t-0 m-b-20 header-title"><b>Enter clinical information for {{ case.case_type_name }}</b></h4>

                                                                                <div class="col-lg-12">
                                                                                    <div class="form-group ">
                                                                                         <div class="col-sm-12">
                                                                                             <div class="col-lg-12">
                                                                                                <div class="p-20">
                                                                                                    <h5><b>Clinical information:</b></h5>
                                                                                                    <div class="input-group m-t-15">
                                                                                                        <textarea id="textarea" name="SP_clinical_info" required class="form-control" maxlength="200" rows="1" >{{ Entry.SP_clinical_info }}</textarea>
                                                                                                        <span class="input-group-addon bg-custom b-0 text-white"><i class="ion-beaker"></i></span>
                                                                                                    </div>
                                                                                                </div>
                                                                                             </div>
                                                                                         </div>

                                                                                        {% if Entry.test_in_entry.all %}
                                                                                            {%  for exam in Entry.test_in_entry.all %}
                                                                                                {% if case.case_type_name  == exam.exam_casetype.case_type_name %}
                                                                                                        {% for i in exam.get_cut_range %}
                                                                                                             <div class="col-sm-12">
                                                                                                                 <div class="col-lg-12">
                                                                                                                    <div class="p-20">
                                                                                                                        <h5><b>Part #: {{ forloop.counter }} - Specimen Source (*):</b></h5>
                                                                                                                        <div class="input-group m-t-15">
                                                                                                                            <input type="text" class="form-control" required id="state-warning" name="SP_specimen_source_{{ forloop.counter }}" value="{% if forloop.counter == 1 %}{{ Entry.SP_specimen_source_1 }}{% elif forloop.counter == 2 %}{{ Entry.SP_specimen_source_2 }}{% elif forloop.counter == 3 %}{{ Entry.SP_specimen_source_3 }}{% elif forloop.counter == 4 %}{{ Entry.SP_specimen_source_4 }}{% elif forloop.counter == 5 %}{{ Entry.SP_specimen_source_5 }}{% elif forloop.counter == 6 %}{{ Entry.SP_specimen_source_6 }}{% elif forloop.counter == 7 %}{{ Entry.SP_specimen_source_7 }}{% elif forloop.counter == 8 %}{{ Entry.SP_specimen_source_8 }}{% elif forloop.counter == 9 %}{{ Entry.SP_specimen_source_9 }}{% elif forloop.counter == 10 %}{{ Entry.SP_specimen_source_10 }}{% elif forloop.counter == 11 %}{{ Entry.SP_specimen_source_11 }}{% elif forloop.counter == 12 %}{{ Entry.SP_specimen_source_12 }}{% endif %}" />
                                                                                                                            <span class="input-group-addon bg-custom b-0 text-white"><i class="ion-beaker"></i></span>
                                                                                                                        </div>
                                                                                                                    </div>
                                                                                                                 </div>
                                                                                                             </div>

                                                                                                             <div class="col-sm-12">
                                                                                                                 <div class="col-lg-12">
                                                                                                                    <div class="p-20">
                                                                                                                        <h5><b>Part #: {{ forloop.counter }} - Gross description (*):</b></h5>
                                                                                                                        <div class="input-group m-t-15">
                                                                                                                            <textarea id="textarea" name="SP_gross_description_{{ forloop.counter }}" required class="form-control" maxlength="200" rows="2" >{% if forloop.counter == 1 %}{{ Entry.SP_gross_description_1 }}{% elif forloop.counter == 2 %}{{ Entry.SP_gross_description_2 }}{% elif forloop.counter == 3 %}{{ Entry.SP_gross_description_3 }}{% elif forloop.counter == 4 %}{{ Entry.SP_gross_description_4 }}{% elif forloop.counter == 5 %}{{ Entry.SP_gross_description_5 }}{% elif forloop.counter == 6 %}{{ Entry.SP_gross_description_6 }}{% elif forloop.counter == 7 %}{{ Entry.SP_gross_description_7 }}{% elif forloop.counter == 8 %}{{ Entry.SP_gross_description_8 }}{% elif forloop.counter == 9 %}{{ Entry.SP_gross_description_9 }}{% elif forloop.counter == 10 %}{{ Entry.SP_gross_description_10 }}{% elif forloop.counter == 11 %}{{ Entry.SP_gross_description_11 }}{% elif forloop.counter == 12 %}{{ Entry.SP_gross_description_12 }}{% endif %}</textarea>
                                                                                                                            <span class="input-group-addon bg-custom b-0 text-white"><i class="ion-beaker"></i></span>
                                                                                                                        </div>
                                                                                                                    </div>
                                                                                                                 </div>
                                                                                                             </div>
                                                                                                        {% endfor %}
                                                                                                {% endif %}
                                                                                            {% endfor %}
                                                                                        {% endif %}




                                                                                    </div>
                                                                                </div>
                                                                                <div class="col-lg-12">
                                                                                   <hr />
                                                                                </div>

                                                                            {% endif %}


                                                                    {% endfor %}
                                                                 {% endif %}

                                                             </div>

                                                        </div>
                                                    </div>
                                                {% endif %}
                                            </section>


                                            <h3>Confirmation</h3>
                                            <section>
                                                 {% if Step == 3 %}
                                                     <div>
                                                          <!-- INBOX -->
                                                            <div class="col-lg-4">
                                                                <div class="card-box">
                                                                    <h4 class="m-t-0 m-b-20 header-title"><b>LAB ID: {{ Entry.created_date |date:"Ymd" }}-{{ Entry.entry_id }}</b></h4>

                                                                    <div class="inbox-widget mx-box">
                                                                        {% if Entry.test_in_entry.all %}
                                                                                <div class="inbox-item">
                                                                                    <div class="inbox-item-img">
                                                                                        <i class="ion-beaker text-custom"></i>
                                                                                    </div>
                                                                                    <p class="inbox-item-author">Patient: {{ Entry.patient.full_name }}</p>
                                                                                    <p class="inbox-item-date">Patient ID: {{ Entry.patient.patient_id}}</p>
                                                                                    <p class="inbox-item-text">Create Date: {{ Entry.created_date |date:"m/d/Y" }}</p>
                                                                                    <p class="inbox-item-text">Client: {{ Entry.patient.patient_client.get_full_name }}</p>
                                                                                    <p class="inbox-item-text">Physicians Name: {{ Entry.physician_name }} </p>
                                                                                    <p class="inbox-item-text">Collection Date: {{ Entry.collection_date |date:"m/d/Y" }}</p>
                                                                                    <p class="inbox-item-text">Age: {% if Entry.patient.age %}{{ Entry.patient.age }}{% else %}{{ Entry.patient.how_old }}{% endif %}</p>
                                                                                    <p class="inbox-item-text">DOB:{{ Entry.patient.dob |date:"m/d/Y" }} </p>
                                                                                    <p class="inbox-item-text">Gender: {{ Entry.patient.show_gender_name }}</p>
                                                                                   {% if Entry.initial_info == 0 %}<span class="label label-warning">Waiting for Confirmation</span> {% else %} <span class="label label-success">Confirmed</span> {% endif %}
                                                                                </div>
                                                                        {% endif %}
                                                                    </div>
                                                                </div>

                                                            </div> <!-- end INBOX -->
                                                            <div class="col-lg-8">
                                                                  <div class="">
                                                                      {%  for case in Entry.test_in_entry.all %}
                                                                            <div class="inbox-item">
                                                                                    <div class="col-lg-12">
                                                                                        <div class="alert alert-success">
                                                                                             <div class="row">
                                                                                                <div class="col-lg-8">
                                                                                                    <strong>Exam Name:</strong> {{ case.exam_name }}
                                                                                                </div>
                                                                                                <div class="col-lg-4">
                                                                                                  <strong>{{ case.exam_casetype.case_type_name }}</strong>
                                                                                                </div>
                                                                                             </div>
                                                                                        </div>
                                                                                    </div>
                                                                                    <div class="col-lg-12">
                                                                                         <div class="col-lg-7">
                                                                                             <p class="inbox-item-text"><strong>Accession Number:</strong> {% for access in Entry.accession_number.all %} {% if case.exam_id == access.exam_in.exam_id %}{{ access.accession_number }} {% endif %}{% endfor %}</p>
                                                                                             <p class="inbox-item-text"><strong>BarCode Number</strong>: {% for access in Entry.accession_number.all %} {% if case.exam_id == access.exam_in.exam_id %}{{ access.barcode }} {% endif %}{% endfor %}</p>
                                                                                             <p class="inbox-item-date"><strong>CPT Code:</strong> {{ case.cpt_name }}</p>
                                                                                         </div>

                                                                                         <div class="col-lg-5">
                                                                                            {% for access in Entry.accession_number.all %}
                                                                                                 {% if case.exam_id == access.exam_in.exam_id %}
                                                                                                      <img class="img-responsive" src="/{{ access.barcode_img }}"  alt="{{ access.barcode }}" width="250px" height="70px" >
                                                                                                 {% endif %}
                                                                                             {% endfor %}
                                                                                         </div>
                                                                                    </div>

                                                                                    {% if case.exam_casetype.case_type_id == 1 %}
                                                                                        <div class="col-lg-12">
                                                                                            <p class="inbox-item-text"><strong>Specimen Source:</strong>
                                                                                                {% if Entry.GYN_Cervix == 1 %} <i class="glyphicon glyphicon-check"> Cervix </i> {% endif %}
                                                                                                {% if Entry.GYN_Vaginal == 1 %}<i class="glyphicon glyphicon-check"> Vaginal </i> {% endif %}
                                                                                                {% if Entry.GYN_Endocervix == 1 %}<i class="glyphicon glyphicon-check"> Endocervix </i> {% endif %}
                                                                                                {% if Entry.GYN_None == 1 %} <i class="glyphicon glyphicon-check"> None given </i> {% endif %}
                                                                                            </p>
                                                                                        </div>
                                                                                        <div class="col-lg-12">
                                                                                            <p class="inbox-item-text"><strong>Menstrual Status:</strong>
                                                                                                {% if Entry.GYN_mestrual == 'Regular' %}<i class="glyphicon glyphicon-check"> Regular</i>{% endif %}
                                                                                                {% if Entry.GYN_mestrual == 'Irregular' %}<i class="glyphicon glyphicon-check"> Irregular</i>{% endif %}
                                                                                                {% if Entry.GYN_mestrual == 'Post-menopausal' %}<i class="glyphicon glyphicon-check"> Post-menopausal</i>{% endif %}
                                                                                                {% if Entry.GYN_mestrual == 'Pregnant' %}<i class="glyphicon glyphicon-check"> Pregnant</i>{% endif %}
                                                                                                {% if Entry.GYN_mestrual == 'Post-partum' %}<i class="glyphicon glyphicon-check"> Post-partum</i>{% endif %}
                                                                                            </p>
                                                                                        </div>

                                                                                        <div class="col-lg-12">
                                                                                                 {% if Entry.GYN_last_menstrual_period %}<p class="inbox-item-text"><strong>Date of last menstrual period:</strong> {{ Entry.GYN_last_menstrual_period }} </p>  {% endif %}
                                                                                                 {% if Entry.GYN_previous_biopsy %}<p class="inbox-item-text"><strong>Date of previous biopsy:</strong> {{ Entry.GYN_previous_biopsy }} </p>  {% endif %}
                                                                                                 {% if Entry.GYN_pap_smear %}<p class="inbox-item-text"><strong>Date of previous pap smear:</strong> {{ Entry.GYN_pap_smear }}</p>  {% endif %}
                                                                                                 {% if Entry.GYN_abnormal_report %}<p class="inbox-item-text"><strong>Prior abnormal report:</strong> {{ Entry.GYN_abnormal_report }}</p>  {% endif %}
                                                                                        </div>

                                                                                        <div class="col-lg-12">
                                                                                             <p class="inbox-item-text"><strong>Present complaint or physical findings:</strong></p>
                                                                                             <p class="inbox-item-text">
                                                                                                {% if Entry.GYN_routine == 1 %}<i class="glyphicon glyphicon-check"> Routine </i>{% endif %}
                                                                                                {% if Entry.GYN_vaginitis == 1 %}<i class="glyphicon glyphicon-check"> Vaginitis </i>{% endif %}
                                                                                                {% if Entry.GYN_cervicitis == 1 %}<i class="glyphicon glyphicon-check"> Cervicitis </i>{% endif %}
                                                                                                {% if Entry.GYN_condyloma == 1 %}<i class="glyphicon glyphicon-check"> HPV </i>{% endif %}
                                                                                                {% if Entry.GYN_herpes == 1 %}<i class="glyphicon glyphicon-check"> Possible Herpes </i>{% endif %}
                                                                                                {% if Entry.GYN_clinically_suspicious == 1 %}<i class="glyphicon glyphicon-check"> Clinically suspicious </i>{% endif %}
                                                                                                {% if Entry.GYN_abnormal_bleeding == 1 %}<i class="glyphicon glyphicon-check"> Abnormal Bleeding </i>{% endif %}
                                                                                                {% if Entry.GYN_cervical_lesion == 1 %}<i class="glyphicon glyphicon-check"> Cervical Lesion </i>{% endif %}
                                                                                                {% if Entry.GYN_menopausal_syndrome == 1 %}<i class="glyphicon glyphicon-check"> Menopausal Syndrome </i>{% endif %}
                                                                                                {% if Entry.GYN_bleeds_on_contact == 1 %}<i class="glyphicon glyphicon-check"> Bleeds on Contact </i>{% endif %}
                                                                                                {% if Entry.GYN_infection == 1 %}<i class="glyphicon glyphicon-check"> Infection </i>{% endif %}
                                                                                                {% if Entry.GYN_iud == 1 %}<i class="glyphicon glyphicon-check"> IUD </i>{% endif %}
                                                                                                {% if Entry.GYN_discharge == 1 %}<i class="glyphicon glyphicon-check"> Discharge </i>{% endif %}
                                                                                                 {% if Entry.GYN_hysterectomy == 1 %}<i class="glyphicon glyphicon-check"> Hysterectomy </i>{% endif %}
                                                                                                 {% if Entry.GYN_hysterectomy == 1 %}
                                                                                                         {% if Entry.GYN_discharge_info == 'Partial' %}<i class="glyphicon glyphicon-hand-right"> Partial </i>{% endif %}
                                                                                                       {% if Entry.GYN_discharge_info == 'Total' %}<i class="glyphicon glyphicon-hand-right"> Total </i>{% endif %}
                                                                                                {% endif %}
                                                                                             </p>
                                                                                             <p class="inbox-item-text">
                                                                                                 {% if Entry.GYN_hysterectomy_description %}<strong>Others:</strong> {{ Entry.GYN_hysterectomy_description }}{% endif %}
                                                                                             </p>

                                                                                        </div>
                                                                                    {% endif %}

                                                                                    {% if case.exam_casetype.case_type_id == 2 %}
                                                                                        <div class="col-lg-12">
                                                                                            <p class="inbox-item-text"><strong>Specimen Source: </strong>
                                                                                               {% if Entry.Non_GYN_specimen_source %} {% for source in no_gyn_specimen_sources %} {% if source.id == Entry.Non_GYN_specimen_source %} {{ source.name }} {% endif %}{% endfor %}{% endif %}
                                                                                            </p>
                                                                                            {% if Entry.Non_GYN_clinical_info %}
                                                                                               <p class="inbox-item-text"><strong>Clinical information: </strong>
                                                                                                {{ Entry.Non_GYN_clinical_info }}
                                                                                               </p>
                                                                                            {% endif %}
                                                                                            {% if Entry.Non_GYN_gross_description %}
                                                                                               <p class="inbox-item-text"><strong>Gross description: </strong>
                                                                                                {{ Entry.Non_GYN_gross_description }}
                                                                                               </p>
                                                                                            {% endif %}
                                                                                        </div>

                                                                                    {% endif %}

                                                                                    {% if case.exam_casetype.case_type_id == 3 %}
                                                                                        <div class="col-lg-12">
                                                                                            <p class="inbox-item-text"><strong>Specimen Source: </strong>
                                                                                                {% if Entry.MP_speciment_source == 'Vaginal' %}<i class="glyphicon glyphicon-check"> Vaginal swab </i>{% endif %} 
                                                                                                {% if Entry.MP_speciment_source == 'Urethral' %}<i class="glyphicon glyphicon-check"> Urethral swab </i>{% endif %}
                                                                                                {% if Entry.MP_speciment_source == 'Urine' %}<i class="glyphicon glyphicon-check"> Urine </i>{% endif %} 
                                                                                                {% if Entry.MP_speciment_source == 'Liquid-based' %}<i class="glyphicon glyphicon-check"> Liquid-based </i>{% endif %}
                                                                                                {% if Entry.MP_speciment_source == 'PAP' %}<i class="glyphicon glyphicon-check"> PAP </i>{% endif %}
                                                                                            </p>
                                                                                        </div>

                                                                                    {% endif %}
                                                                                    {% if case.exam_casetype.case_type_id == 4 %}
                                                                                        <div class="col-lg-12">
                                                                                           {% if Entry.SP_clinical_info %}
                                                                                             <p class="inbox-item-text"><strong>Clinical information: </strong>
                                                                                                {{ Entry.SP_clinical_info }}
                                                                                             </p>
                                                                                           {% endif %}
                                                                                            {% if Entry.test_in_entry.all %} 
                                                                                                {%  for exam in Entry.test_in_entry.all %}
                                                                                                    {% if case.exam_casetype.case_type_name  == exam.exam_casetype.case_type_name %}
                                                                                                        {% for i in exam.get_cut_range %} 
                                                                                                            <p class="inbox-item-text"><strong> Specimen Source Part #: {{ forloop.counter }}:</strong>
                                                                                                              {% if forloop.counter == 1 %}{{ Entry.SP_specimen_source_1 }}{% elif forloop.counter == 2 %}{{ Entry.SP_specimen_source_2 }}{% elif forloop.counter == 3 %}{{ Entry.SP_specimen_source_3 }}{% elif forloop.counter == 4 %}{{ Entry.SP_specimen_source_4 }}{% elif forloop.counter == 5 %}{{ Entry.SP_specimen_source_5 }}{% elif forloop.counter == 6 %}{{ Entry.SP_specimen_source_6 }}{% elif forloop.counter == 7 %}{{ Entry.SP_specimen_source_7 }}{% elif forloop.counter == 8 %}{{ Entry.SP_specimen_source_8 }}{% elif forloop.counter == 9 %}{{ Entry.SP_specimen_source_9 }}{% elif forloop.counter == 10 %}{{ Entry.SP_specimen_source_10 }}{% elif forloop.counter == 11 %}{{ Entry.SP_specimen_source_11 }}{% elif forloop.counter == 12 %}{{ Entry.SP_specimen_source_12 }}{% endif %}
                                                                                                            </p>
                                                                                                            <p class="inbox-item-text"><strong> Gross description Part #: {{ forloop.counter }}:</strong>
                                                                                                             {% if forloop.counter == 1 %}{{ Entry.SP_gross_description_1 }}{% elif forloop.counter == 2 %}{{ Entry.SP_gross_description_2 }}{% elif forloop.counter == 3 %}{{ Entry.SP_gross_description_3 }}{% elif forloop.counter == 4 %}{{ Entry.SP_gross_description_4 }}{% elif forloop.counter == 5 %}{{ Entry.SP_gross_description_5 }}{% elif forloop.counter == 6 %}{{ Entry.SP_gross_description_6 }}{% elif forloop.counter == 7 %}{{ Entry.SP_gross_description_7 }}{% elif forloop.counter == 8 %}{{ Entry.SP_gross_description_8 }}{% elif forloop.counter == 9 %}{{ Entry.SP_gross_description_9 }}{% elif forloop.counter == 10 %}{{ Entry.SP_gross_description_10 }}{% elif forloop.counter == 11 %}{{ Entry.SP_gross_description_11 }}{% elif forloop.counter == 12 %}{{ Entry.SP_gross_description_12 }}{% endif %}
                                                                                                            </p>
                                                                                                        {% endfor %}
                                                                                                    {% endif %} 
                                                                                                {% endfor %}
                                                                                             {% endif %}
                                                                                        </div>

                                                                                    {% endif %}

                                                                            </div>
                                                                      {% endfor %}
                                                                  </div>
                                                            </div>
                                                     </div>
                                                 {% endif %}
                                            </section>


                                            <div class="form-group m-b-0">
                                               <div class="col-sm-offset-5 col-sm-5">
                                                 {{ message }}
                                               </div>
                                            </div>



                                                     {% if Step == 0 %}
                                                         <div class="form-group m-b-0">
                                                             <div class="col-sm-offset-9 col-sm-9">
                                                                 <a href="/dashboard/new_entry/">
                                                                     <button type="link" name="new_case" class="btn btn-default btn-custom waves-effect waves-light">Back to Search</button>
                                                                 </a>
                                                                     <button type="submit" name="save_step1" class="btn btn-default btn-custom waves-effect waves-light">Save & Continue</button>
                                                             </div>
                                                         </div>
                                                     {% endif %}
                                                     {% if Step == 1 %}
                                                         <div class="form-group m-b-0">
                                                             <div class="col-sm-offset-9 col-sm-9">
                                                                 <a href="/dashboard/wizard/">
                                                                     <button type="link" name="previus" class="btn btn-default btn-custom waves-effect waves-light">Previous</button>
                                                                 </a>
                                                                 <button type="submit" name="save_step2" class="btn btn-default btn-custom waves-effect waves-light">Save & Continue</button>
                                                             </div>
                                                         </div>

                                                     {% endif %}
                                                     {% if Step == 2 %}
                                                         <div class="form-group m-b-0">
                                                             <div class="col-sm-offset-9 col-sm-9">
                                                                 <a href="/dashboard/wizard/1/">
                                                                         <button type="link" name="previus" class="btn btn-default btn-custom waves-effect waves-light">Previous</button>
                                                                 </a>
                                                                 <button type="submit" name="save_step3" class="btn btn-default btn-custom waves-effect waves-light">Save & Continue</button>
                                                             </div>
                                                         </div>

                                                     {% endif %}

                                                     {% if Step == 3 %}
                                                         <div class="form-group m-b-0">
                                                             <div class="col-sm-offset-8 col-sm-12">
                                                                 <div class="col-sm-12">
                                                                        <div class="col-lg-3">
                                                                            <div class="col-sm-offset-0">
                                                                                <div class="checkbox checkbox-custom">
                                                                                    <input id="checkbox1" type="checkbox" value="1" checked name="print_labels">
                                                                                    <label for="checkbox1">
                                                                                        Do you want to print labels?
                                                                                    </label>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                 </div>

                                                             </div>
                                                         </div>
                                                         <div class="form-group m-b-0">
                                                             <div class="col-sm-offset-7 col-sm-7">

                                                                 {% if Entry.initial_info == 1 %}
                                                                     <a href="/dashboard/view_detail/{{ Entry.entry_id }}/" class="btn btn-default btn-custom waves-effect waves-light">
                                                                         View Entry
                                                                     </a>

                                                                     <a href="/dashboard/new_entry/" class="btn btn-default btn-custom waves-effect waves-light">
                                                                          New Entry
                                                                     </a>
                                                                     <a href="/dashboard/enter_result/{{ Entry.entry_id }}/" class="btn btn-default btn-custom waves-effect waves-light">
                                                                        Enter Result
                                                                     </a>
                                                                 {% else %}
                                                                      <button type="submit" name="save_step4" class="btn btn-default btn-custom waves-effect waves-light"> Confirm</button>
                                                                 {% endif %}


                                                             </div>
                                                         </div>

                                                     {% endif %}
                                        </div>
                                    </form>
                            	</div>


                            <!-- End row -->

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

						<!-- end row -->



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

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




{% endblock %}