{% load panels %}
<div class="col-md-12">
  <div class="panel panel-active">
    <div class="panel-heading text-center">
      <h3>
        Inpatient admission
        [[ episode.start | displayDate ]]<span ng-show="episode.end"> - [[ episode.end | displayDate ]]</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.end">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="episode.recordEditor.editItem('location', episode.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_name ]]
        </div>
      </div>
      <div class="row" ng-show="episode.start">
        <div class="col-md-4">
          <b>Admitted</b>
        </div>
        <div class="col-md-8">
          [[ episode.start | displayDate ]]
        </div>
      </div>
      <div class="row" ng-show="episode.end">
        <div class="col-md-4">
          <b>Discharged</b>
        </div>
        <div class="col-md-8">
          [[ episode.end | displayDate ]]
        </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 %}
</div>                 <!-- Ends Detail panels col 1 -->
<div class="col-md-6"> <!-- Detail panels col 2 -->
  {% record_panel models.Diagnosis %}
  {% record_panel models.Treatment %}
  {% record_panel models.Investigation %}
</div>                 <!-- Ends Detail panels col 2 -->
