<commit_before>
<div class='row' style='padding: 5px 0 25px 0;'>
  <h2 class="section-title col-xs-12 col-sm-12 col-md-8" style="margin-bottom: 2px; margin-top:0; padding-bottom: 0;"><div style='font-family: sans-serif; color: darkgray; display: inline-block;'><?php
                       echo $patient['Patient']['patient_number'].' '; ?> </div>
                       <?php
                       echo $patient['Patient']['patient_lastname'].", ";
                       echo $patient['Patient']['patient_firstname']." ";
                       echo $patient['Patient']['patient_middlename'];
                      ?></h2>
         <h4 class="col-xs-12 col-sm-12 col-md-4" style="margin-bottom: 0; font-family: sans-serif; font-style: italic; text-align:right;"><?php
                       echo $patient['Patient']['gender'].',    Age ';
                       echo $age = calculateAge( date("F j, Y", strtotime($patient['Patient']['dob'])));;
                      ?></h4>
<!--                         
          <h4 class="col-xs-6 col-sm-6 col-md-4" style="padding: 2px 0 2px 0; margin-top: 0; margin-bottom: 0; text-align: right;"><small><em>dob </em></small><?php
                       echo $date = date("F j, Y", strtotime($patient['Patient']['dob']));;
                      // echo "<h4><NAME></h4>"
                      ?></h4>-->
</div>				  
<!--		     
            <h1 >Patient Information </h1>
			
			</br/>-->
			

            <!-----Add Three Buttons------------------------------------------>
<!--            <div style="padding-bottom:10px;">
           <a href="/visits/add" class="btn btn-primary" style="padding-left:5px;"><span class="glyphicon glyphicon-plus"></span> Add Visit</a>
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
           <a href="/patients/edit" class="btn btn-primary" style="padding-left:5px;"><span class="glyphicon glyphicon-edit"></span> Update Patient</a>
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
           <a href="/patients/delete" data-confirm="Do you want to delete this patient record?" data-method="delete" class="btn btn-primary" style="padding-left:5px;"><span class="glyphicon glyphicon-trash"></span> Delete Patient</a>
            </div>-->

<div class='patient-tabs'>
<ul class="nav nav-tabs">
 <li id="patient-tab-information" class="active nav-tab" data-tab-index="information">
   <a href="#information" data-toggle="tab">Patient Information</a>
 </li>
  <li id="patient-tab-visits" class="nav-tab" data-tab-index="visits">
   <a href="#visits" data-toggle="tab">Visits</a>
 </li>
 <li id="patient-tab-vitals" class="nav-tab" data-tab-index="vitals">
   <a href="#vitals" data-toggle="tab">Vitals & Labs</a>
 </li>
 <li id="patient-tab-allergies" class="nav-tab" data-tab-index="allergies">
   <a href="#allergies" data-toggle="tab">Drug Allergies</a>
 </li>
 <li id="patient-tab-history" class="nav-tab" data-tab-index="history">
   <a href="#history" data-toggle="tab">Medical History</a>
 </li>
 <li id="patient-tab-medications" class="nav-tab" data-tab-index="medications">
   <a href="#medications" data-toggle="tab">Medications</a>
 </li>
 <li id="patient-tab-charts" class="nav-tab" data-tab-index="charts">
   <a href="#charts" data-toggle="tab">Charts</a>
 </li>
</ul><!-- end pt tab list -->


<!-- start patient information tab -->
<div id="patient-tab-content" class="tab-content" style="height:auto;overflow:visible;">
    <div id="information" class="tab-pane active">
<!--      <button type="button" class="btn btn-primary btn-update-patient" 
              style="padding:5px; float: right;">
        <span class="glyphicon glyphicon-edit"></span>
        Update Patient</button>
      <button type="submit" class="btn btn-primary btn-delete-patient"
              style="padding:5px; float: right;" method="POST">
        <span class="glyphicon glyphicon-trash"></span> 
        Delete Patient</button>-->
      <div style="padding:5px; display: inline-block;">
            <a href="/patients/edit" class="btn btn-primary" style="padding:5px; float: right;"><span class="glyphicon glyphicon-edit"></span> Update Patient</a>
      </div>
      <div style="padding:5px; display: inline-block;">
            <a href="/patients/delete" data-confirm="Do you want to delete this patient record?" data-method="delete" class="btn btn-primary" style="padding:5px; float: right;"><span class="glyphicon glyphicon-trash"></span> Delete Patient</a>
      </div>
        <div class='col-md-8'>
        <div style="padding: 15px 15px 15px 0;"class="col-md-6">
          <div style="font-size: large; font-family: sans-serif; font-weight: bold;">DOB 
            <div style="display: inline-block; font-weight: normal; font-size: medium; font-family: sans-serif;"><?php echo $date = date("F j, Y", strtotime($patient['Patient']['dob']));; ?></div>
          </div>
          <div style="font-size: large; font-family: sans-serif; font-weight: bold;">Race 
            <div style="display: inline-block; font-weight: normal; font-size: medium; font-family: sans-serif;"><?php echo $patient['Patient']['race']?: 'N/A';?></div>
          </div>
           <?php if ($patient['Patient']['occupation']!=null) {?>
              <div style="font-size: large; font-family: sans-serif; font-weight: bold;">Occupation 
                <div style="display: inline-block; font-weight: normal; font-size: medium; font-family: sans-serif;"><?php echo $patient['Patient']['occupation']; ?></div>
              </div>
          <?php }?>
        </div>
         <?php if ($patient['Patient']['street']!=null && $patient['Patient']['city'] != null) {?>
            <div style="padding: 15px 15px 15px 0;"class="col-md-6">
              <div style="font-size: large; font-family: sans-serif; font-weight: bold;">Address</div>
              <div style="font-size: medium; font-family: sans-serif;">
                <?php echo $patient['Patient']['street'];?>
              </div>
              <div style="font-size: medium; font-family: sans-serif;">
                <?php echo $patient['Patient']['city'],", ";
                      echo $patient['Patient']['state']." ";
                      echo $patient['Patient']['postal_code'];?>
              </div>
           </div>
          <?php }?>
          

        </div>
                   
                    <!-- Patient Diagnoses -->
                                    
        <div class="col-md-8">
          <h3>Diagnosis </h3> 
		   <p style='font-family: sans-serif; color: dimgray;'>Type II Diabetes Mellitus</p>
		   
		  <!-- Commented code: can be used in case of multiple diagnoses
          <?php if ($patient[ 'Diagnosis' ] == null) {?>
          <div style='font-family: sans-serif; color: dimgray;'>Type II Diabetes Mellitus</div>
          <?php } ?>
          <?php if ($patient[ 'Diagnosis' ] != null) {?>
          <table class="table table-condensed">
            <thead>
                <tr>
                    <th>Diagnosis</th>
                    <th>ICD-9</th>
                    <th>ICD-10</th>
                    </tr>
            </thead>
            <?php foreach($patient[ 'Diagnosis' ] as $diagnosis ) :?>
            <tbody>
              <tr>
                <td><?php echo $diagnosis['dxname']?>
                <td><?php echo $diagnosis['icd9code']?>
                <td><?php echo $diagnosis['icd10code']?>
              </tr>
             </tbody>
              <?php endforeach; ?>
          </table>
          <?php } ?>
		  -->
		  
        </div>
        <br clear="all">               
  </div><!-- end patient diagnosis tab -->
  
  
  <!-- start visits tab -->       
  <div id="visits" class="tab-pane">
    <div style="padding:5px; display: inline-block;">
      <a href="/visits/add" class="btn btn-primary" style="padding-left:5px; float: right;"><span class="glyphicon glyphicon-plus"></span> Add Visit</a>
    </div>
    <div class="col-md-8">
      <h3>Visit history </h3> 
        <table class="table table-hover">
        <?php 
        if ($patient['Visit']==null)
            echo 'This patient does not have visit history';
        foreach($patient[ 'Visit' ] as $visit ):?>
        <tbody>
          <tr>
            <td>
              <?php echo $this->Html->link($date = date("F j, Y", strtotime($visit['created'])), array('controller' => 'visits', 'action' => 'show', $visit['id'])); ?>
            </td>
          </tr>
          </tbody>
        <?php endforeach;?> 
        </table>
      </div>         
    </div><!-- end visits tab -->
  
  
    <!-- start vitals tab -->
    <div id="vitals" class="tab-pane">
       <div class="col-md-8">


      <h3>Vitals and Lab Results <?php if ($lastVisit['Visit']!=null) { ?>as of last visit on <?php echo $lastVisitDate; }?></h3> 
           <table  class="table table-condensed">
                  <?php 
                  if ($lastVisit['Visit']==null){
                  echo 'This patient does not have any Vitals or Lab Results recorded.';} 
                  else{ ?>
	
	    <tr>
            <th class="dimgray-header">Weight: </th> 
            <td> <?php echo $lastVisit['VitalsLab']['weight']?: 'unknown'; ?> kg</td>
			<td>  </td>
        </tr>

        <tr> 
            <th class="dimgray-header">Height: </th>
            <td><?php echo $lastVisit['VitalsLab']['height']?: 'unknown'; ?> cm</td>
			<td>  </td>
        </tr>
        <tr>  
            <th class="dimgray-header">BMI: </th>
            <td><?php echo $lastVisit['VitalsLab']['bmi']?: 'unknown'; ?> kg/m<sup>2</sup> </td>
			<td> Normal: 18.5 - 25.0 kg/m<sup>2</sup> </td>
        </tr>
        <tr>  
            <th class="dimgray-header"><a href=" /pages/weightclassification" target="_blank"> Weight Classification:</a>  </th>
            <td><?php echo $lastVisit['VitalsLab']['bmi_status']?: 'unknown'; ?></td>
			<td>  </td>
        </tr>
        <tr> 
            <th class="dimgray-header">Glycated Hemoglobin (A1C): </th>
            <td><?php echo $lastVisit['VitalsLab']['A1c']?: 'unknown'; ?> %</td>
			<td> Normal: 4.5 - 5.7% </td>
        </tr><commit_msg>Fixed units for height & weight in Vitals & Labs<commit_after>
<div class='row' style='padding: 5px 0 25px 0;'>
  <h2 class="section-title col-xs-12 col-sm-12 col-md-8" style="margin-bottom: 2px; margin-top:0; padding-bottom: 0;"><div style='font-family: sans-serif; color: darkgray; display: inline-block;'><?php
                       echo $patient['Patient']['patient_number'].' '; ?> </div>
                       <?php
                       echo $patient['Patient']['patient_lastname'].", ";
                       echo $patient['Patient']['patient_firstname']." ";
                       echo $patient['Patient']['patient_middlename'];
                      ?></h2>
         <h4 class="col-xs-12 col-sm-12 col-md-4" style="margin-bottom: 0; font-family: sans-serif; font-style: italic; text-align:right;"><?php
                       echo $patient['Patient']['gender'].',    Age ';
                       echo $age = calculateAge( date("F j, Y", strtotime($patient['Patient']['dob'])));;
                      ?></h4>
<!--                         
          <h4 class="col-xs-6 col-sm-6 col-md-4" style="padding: 2px 0 2px 0; margin-top: 0; margin-bottom: 0; text-align: right;"><small><em>dob </em></small><?php
                       echo $date = date("F j, Y", strtotime($patient['Patient']['dob']));;
                      // echo "<h4><NAME></h4>"
                      ?></h4>-->
</div>				  
<!--		     
            <h1 >Patient Information </h1>
			
			</br/>-->
			

            <!-----Add Three Buttons------------------------------------------>
<!--            <div style="padding-bottom:10px;">
           <a href="/visits/add" class="btn btn-primary" style="padding-left:5px;"><span class="glyphicon glyphicon-plus"></span> Add Visit</a>
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
           <a href="/patients/edit" class="btn btn-primary" style="padding-left:5px;"><span class="glyphicon glyphicon-edit"></span> Update Patient</a>
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
           <a href="/patients/delete" data-confirm="Do you want to delete this patient record?" data-method="delete" class="btn btn-primary" style="padding-left:5px;"><span class="glyphicon glyphicon-trash"></span> Delete Patient</a>
            </div>-->

<div class='patient-tabs'>
<ul class="nav nav-tabs">
 <li id="patient-tab-information" class="active nav-tab" data-tab-index="information">
   <a href="#information" data-toggle="tab">Patient Information</a>
 </li>
  <li id="patient-tab-visits" class="nav-tab" data-tab-index="visits">
   <a href="#visits" data-toggle="tab">Visits</a>
 </li>
 <li id="patient-tab-vitals" class="nav-tab" data-tab-index="vitals">
   <a href="#vitals" data-toggle="tab">Vitals & Labs</a>
 </li>
 <li id="patient-tab-allergies" class="nav-tab" data-tab-index="allergies">
   <a href="#allergies" data-toggle="tab">Drug Allergies</a>
 </li>
 <li id="patient-tab-history" class="nav-tab" data-tab-index="history">
   <a href="#history" data-toggle="tab">Medical History</a>
 </li>
 <li id="patient-tab-medications" class="nav-tab" data-tab-index="medications">
   <a href="#medications" data-toggle="tab">Medications</a>
 </li>
 <li id="patient-tab-charts" class="nav-tab" data-tab-index="charts">
   <a href="#charts" data-toggle="tab">Charts</a>
 </li>
</ul><!-- end pt tab list -->


<!-- start patient information tab -->
<div id="patient-tab-content" class="tab-content" style="height:auto;overflow:visible;">
    <div id="information" class="tab-pane active">
<!--      <button type="button" class="btn btn-primary btn-update-patient" 
              style="padding:5px; float: right;">
        <span class="glyphicon glyphicon-edit"></span>
        Update Patient</button>
      <button type="submit" class="btn btn-primary btn-delete-patient"
              style="padding:5px; float: right;" method="POST">
        <span class="glyphicon glyphicon-trash"></span> 
        Delete Patient</button>-->
      <div style="padding:5px; display: inline-block;">
            <a href="/patients/edit" class="btn btn-primary" style="padding:5px; float: right;"><span class="glyphicon glyphicon-edit"></span> Update Patient</a>
      </div>
      <div style="padding:5px; display: inline-block;">
            <a href="/patients/delete" data-confirm="Do you want to delete this patient record?" data-method="delete" class="btn btn-primary" style="padding:5px; float: right;"><span class="glyphicon glyphicon-trash"></span> Delete Patient</a>
      </div>
        <div class='col-md-8'>
        <div style="padding: 15px 15px 15px 0;"class="col-md-6">
          <div style="font-size: large; font-family: sans-serif; font-weight: bold;">DOB 
            <div style="display: inline-block; font-weight: normal; font-size: medium; font-family: sans-serif;"><?php echo $date = date("F j, Y", strtotime($patient['Patient']['dob']));; ?></div>
          </div>
          <div style="font-size: large; font-family: sans-serif; font-weight: bold;">Race 
            <div style="display: inline-block; font-weight: normal; font-size: medium; font-family: sans-serif;"><?php echo $patient['Patient']['race']?: 'N/A';?></div>
          </div>
           <?php if ($patient['Patient']['occupation']!=null) {?>
              <div style="font-size: large; font-family: sans-serif; font-weight: bold;">Occupation 
                <div style="display: inline-block; font-weight: normal; font-size: medium; font-family: sans-serif;"><?php echo $patient['Patient']['occupation']; ?></div>
              </div>
          <?php }?>
        </div>
         <?php if ($patient['Patient']['street']!=null && $patient['Patient']['city'] != null) {?>
            <div style="padding: 15px 15px 15px 0;"class="col-md-6">
              <div style="font-size: large; font-family: sans-serif; font-weight: bold;">Address</div>
              <div style="font-size: medium; font-family: sans-serif;">
                <?php echo $patient['Patient']['street'];?>
              </div>
              <div style="font-size: medium; font-family: sans-serif;">
                <?php echo $patient['Patient']['city'],", ";
                      echo $patient['Patient']['state']." ";
                      echo $patient['Patient']['postal_code'];?>
              </div>
           </div>
          <?php }?>
          

        </div>
                   
                    <!-- Patient Diagnoses -->
                                    
        <div class="col-md-8">
          <h3>Diagnosis </h3> 
		   <p style='font-family: sans-serif; color: dimgray;'>Type II Diabetes Mellitus</p>
		   
		  <!-- Commented code: can be used in case of multiple diagnoses
          <?php if ($patient[ 'Diagnosis' ] == null) {?>
          <div style='font-family: sans-serif; color: dimgray;'>Type II Diabetes Mellitus</div>
          <?php } ?>
          <?php if ($patient[ 'Diagnosis' ] != null) {?>
          <table class="table table-condensed">
            <thead>
                <tr>
                    <th>Diagnosis</th>
                    <th>ICD-9</th>
                    <th>ICD-10</th>
                    </tr>
            </thead>
            <?php foreach($patient[ 'Diagnosis' ] as $diagnosis ) :?>
            <tbody>
              <tr>
                <td><?php echo $diagnosis['dxname']?>
                <td><?php echo $diagnosis['icd9code']?>
                <td><?php echo $diagnosis['icd10code']?>
              </tr>
             </tbody>
              <?php endforeach; ?>
          </table>
          <?php } ?>
		  -->
		  
        </div>
        <br clear="all">               
  </div><!-- end patient diagnosis tab -->
  
  
  <!-- start visits tab -->       
  <div id="visits" class="tab-pane">
    <div style="padding:5px; display: inline-block;">
      <a href="/visits/add" class="btn btn-primary" style="padding-left:5px; float: right;"><span class="glyphicon glyphicon-plus"></span> Add Visit</a>
    </div>
    <div class="col-md-8">
      <h3>Visit history </h3> 
        <table class="table table-hover">
        <?php 
        if ($patient['Visit']==null)
            echo 'This patient does not have visit history';
        foreach($patient[ 'Visit' ] as $visit ):?>
        <tbody>
          <tr>
            <td>
              <?php echo $this->Html->link($date = date("F j, Y", strtotime($visit['created'])), array('controller' => 'visits', 'action' => 'show', $visit['id'])); ?>
            </td>
          </tr>
          </tbody>
        <?php endforeach;?> 
        </table>
      </div>         
    </div><!-- end visits tab -->
  
  
    <!-- start vitals tab -->
    <div id="vitals" class="tab-pane">
       <div class="col-md-8">


      <h3>Vitals and Lab Results <?php if ($lastVisit['Visit']!=null) { ?>as of last visit on <?php echo $lastVisitDate; }?></h3> 
           <table  class="table table-condensed">
                  <?php 
                  if ($lastVisit['Visit']==null){
                  echo 'This patient does not have any Vitals or Lab Results recorded.';} 
                  else{ ?>
	
	    <tr>
            <th class="dimgray-header">Weight: </th> 
<!--            <td> <?php echo $lastVisit['VitalsLab']['weight']?: 'unknown'; ?> kg</td> -->
            <td>
              <?php if($unitType == 'metric'): ?>
                <?php echo $lastVisit['VitalsLab']['weight'] ?> kg
              <?php else: ?>
                <?php echo round($lastVisit['VitalsLab']['weight'] * 2.20462); ?> lb
              <?php endif; ?>
            </td>
            <td>  </td>
        </tr>

        <tr> 
            <th class="dimgray-header">Height: </th>
<!--            <td><?php echo $lastVisit['VitalsLab']['height']?: 'unknown'; ?> cm</td> -->
            <td>
              <?php if($unitType == 'metric'): ?>
                <?php echo $lastVisit['VitalsLab']['height'] ?> cm 
              <?php else: ?>
                <?php
                $inches = 0;
                $inches = $lastVisit['VitalsLab']['height'] * 0.3937008;
                $feets = floor($inches / 12);
                $inches = ($inches % 12);
                $value = $feets . ("'") . $inches . ('"');
                ?>
                <?php echo $value ?> inch 
              <?php endif; ?>
            </td>
                        <td>  </td>
        </tr>
        <tr>  
            <th class="dimgray-header">BMI: </th>
            <td><?php echo $lastVisit['VitalsLab']['bmi']?: 'unknown'; ?> kg/m<sup>2</sup> </td>
			<td> Normal: 18.5 - 25.0 kg/m<sup>2</sup> </td>
        </tr>
        <tr>  
            <th class="dimgray-header"><a href=" /pages/weightclassification" target="_blank"> Weight Classification:</a>  </th>
            <td><?php echo $lastVisit['VitalsLab']['bmi_status']?: 'unknown'; ?></td>
			<td>  </td>
        </tr>
        <tr> 
            <th class="dimgray-header">Glycated Hemoglobin (A1C): </th>
            <td><?php echo $lastVisit['VitalsLab']['A1c']?: 'unknown'; ?> %</td>
			<td> Normal: 4.5 - 5.7% </td>
        </tr>
{'fraction_non_alphanumeric': 0.19981024667931688, 'fraction_numerical': 0.010104364326375712, 'mean_word_length': 2.1412606168976307, 'pattern_counts': {'":': 0, '<': 534, '<?xml version=': 0, '>': 542, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4408878', 'n_tokens_mistral': 6839, 'n_tokens_neox': 6302, 'n_words': 1408}