{% load panels %}
<div class="col-md-12">
  <div class="panel panel-active">
    <div class="panel-heading text-center">
      <h3>
        Inpatient admission
        [[ episode.date_of_admission | shortDate]]<span ng-show="episode.discharge_date"> - [[ episode.discharge_date | shortDate ]]</span>
      </h3>
    </div>
    <div class="panel-body">
      <center>
        <button
           ng-hide="profile.readonly"
           ng-click="dischargeEpisode(episode)"
           class="btn btn-primary btn-lg">
          <i class="fa fa-home"></i>
          <span ng-show="episode.discharge_date">Confirm</span>
          Discharge
        </button>
      </center>
    </div>
  </div>
</div>
<div class="col-md-6"> <!-- Detail panels col 1 -->
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3>
        <i class="fa fa-map-marker"></i> Location
        <i class="fa fa-pencil edit pull-right"
           ng-click="editNamedItem('location', 0)"></i>
      </h3>
    </div>
    <div class="panel-body">
      <div class="row">
        <div class="col-md-4">
          <b>Category</b>
        </div>
        <div class="col-md-8">
          [[episode.category.charAt(0).toUpperCase() + episode.category.substring(1)]]
        </div>
      </div>
      <div class="row" ng-show="episode.date_of_admission">
        <div class="col-md-4">
          <b>Admitted</b>
        </div>
        <div class="col-md-8">
          [[ episode.date_of_admission | shortDate ]]
        </div>
      </div>
      <div class="row" ng-show="episode.discharge_date">
        <div class="col-md-4">
          <b>Discharged</b>
        </div>
        <div class="col-md-8">
          [[ episode.discharge_date | shortDate ]]
        </div>
      </div>
      <div class="row" ng-show="episode.date_of_episode">
        <div class="col-md-4">
          <b>Date</b>
        </div>
        <div class="col-md-8">
          [[ episode.date_of_episode | shortDate ]]
        </div>
      </div>
      <div class="row">
        <div class="col-md-4">
          <b>Hospital</b>
        </div>
        <div class="col-md-8">
          [[ episode.location[0].hospital ]]
        </div>
      </div>
      <div class="row">
        <div class="col-md-4">
          <b>Ward</b>
        </div>
        <div class="col-md-8">
          [[ episode.location[0].ward ]]
        </div>
      </div>
      <div class="row">
        <div class="col-md-4">
          <b>Bed</b>
        </div>
        <div class="col-md-8">
          [[ episode.location[0].bed ]]
        </div>
      </div>
    </div>
  </div>
  {% teams_panel %}
  {% record_panel models.Allergies noentries="No known allergies"%}
  {% record_panel models.PastMedicalHistory %}
  {% record_panel models.Travel %}
  {% record_timeline models.MicrobiologyInput "when" %}
</div>                 <!-- Ends Detail panels col 1 -->
<div class="col-md-6"> <!-- Detail panels col 2 -->
  {% record_panel models.PresentingComplaint %}
  {% record_panel models.Diagnosis %}
  {% record_panel models.Antimicrobial %}
  {% record_panel models.MicrobiologyTest %}
  {% record_panel models.Todo %}
  {% record_panel models.GeneralNote %}
</div>                 <!-- Ends Detail panels col 2 -->
