<commit_before><div page-wrapper>
  <h1 class="page-header">Patients <small>{{count}} patients</small></h1>

  <div class="row">
    <div class="col-lg-8">
      <p recruit-patient-permission>
        <a ui-sref="recruitPatient.search" class="btn btn-primary">Recruit Patient</a>
      </p>

      <div loading="loading" list-helper="proxy">
        <div ng-show="!items.length">
          <p>No patients found.</p>
        </div>

        <div ng-if="items.length">
          <p ng-if="viewDemographicsPermission"><span toggle-demographics></span></p>
          <p><a ng-href="{{downloadUrl}}" class="no-link"><i class="fa fa-download"></i> <span class="link">Download</span></a></p>
        </div>

        <table class="table table-condensed table-striped" ng-if="items.length">
          <thead>
            <tr>
              <th sort-helper="id">ID</th>
              <th sort-helper="firstName">First Name</th>
              <th sort-helper="lastName">Last Name</th>
              <th sort-helper="dateOfBirth">DOB</th>
              <th sort-helper="gender">Gender</th>
              <th sort-helper="primaryPatientNumber" ng-if="viewDemographicsPermission">Patient Number</th>
              <th sort-helper="recruitedDate">Recruited On</th>
              <th ng-repeat="group in groups" sort-helper="group_{{group.id}}">{{group.shortName}}</th>
              <th>Cohorts</th>
              <th>Hospitals</th>
            </tr>
          </thead>

          <tbody>
            <tr ng-repeat="patient in items" ng-class="{dead: patient.dateOfDeath || patient.yearOfDeath}">
              <td>
                <a ui-sref="patient.demographics({patientId: patient.id})">{{patient.id}}</a>
                <i class="fa fa-link" ng-if="patient.ukrdc" title="Receiving data from UKRDC"></i>
                <!-- <i class="fa fa-exclamation-triangle" ng-if="patient.consentStatus == 'SOON'"></i>
                <i class="fa fa-ban" ng-if="patient.consentStatus == 'EXPIRED' || patient.consentStatus == 'MISSING'"></i> -->
              </td>

              <td>
                <a ui-sref="patient.demographics({patientId: patient.id})">
                  <span ng-if="patient.firstName !== undefined">
                    <span if-demographics-visible>{{patient.firstName | missing}}</span>
                    <span if-demographics-visible>{{patient | json}}</span>
                    <span if-demographics-hidden class="hidden-demographics">Hidden</span>
                  </span>

                  <span ng-if="patient.firstName === undefined" class="hidden-demographics">Hidden</span>
                </a>
              </td>

              <td>
                <a ui-sref="patient.demographics({patientId: patient.id})">
                  <span ng-if="patient.lastName !== undefined">
                    <span if-demographics-visible>{{patient.lastName | missing}}</span>
                    <span if-demographics-hidden class="hidden-demographics">Hidden</span>
                  </span>

                  <span ng-if="patient.lastName === undefined" class="hidden-demographics">Hidden</span>
                </a>
              </td>

              <td>
                <span ng-if="patient.dateOfBirth !== undefined">
                  <span if-demographics-visible>{{patient.dateOfBirth | dateFormat}}</span>
                  <span if-demographics-hidden>{{patient.yearOfBirth | missing}}</span>
                </span>

                <span ng-if="patient.dateOfBirth === undefined">{{patient.yearOfBirth | missing}}</span>

                <span ng-if="patient.yearOfDeath || patient.dateOfDeath" title="Deceased"><i class="fa fa-exclamation-triangle"></i></span>
              </td>

              <td>{{patient.gender.label | missing}}</td>

              <td ng-if="viewDemographicsPermission">
                <span ng-if="patient.primaryPatientNumber !== undefined">
                  <span if-demographics-visible>
                    <span ng-if="patient.primaryPatientNumber === null">-</span>
                    <span ng-if="patient.primaryPatientNumber !== null"><commit_msg>RDR-666: Added radarDateOfDeath Added radarDateOfDeath as an OR condition in patient-list component.<commit_after><div page-wrapper>
  <h1 class="page-header">Patients <small>{{count}} patients</small></h1>

  <div class="row">
    <div class="col-lg-8">
      <p recruit-patient-permission>
        <a ui-sref="recruitPatient.search" class="btn btn-primary">Recruit Patient</a>
      </p>

      <div loading="loading" list-helper="proxy">
        <div ng-show="!items.length">
          <p>No patients found.</p>
        </div>

        <div ng-if="items.length">
          <p ng-if="viewDemographicsPermission"><span toggle-demographics></span></p>
          <p><a ng-href="{{downloadUrl}}" class="no-link"><i class="fa fa-download"></i> <span class="link">Download</span></a></p>
        </div>

        <table class="table table-condensed table-striped" ng-if="items.length">
          <thead>
            <tr>
              <th sort-helper="id">ID</th>
              <th sort-helper="firstName">First Name</th>
              <th sort-helper="lastName">Last Name</th>
              <th sort-helper="dateOfBirth">DOB</th>
              <th sort-helper="gender">Gender</th>
              <th sort-helper="primaryPatientNumber" ng-if="viewDemographicsPermission">Patient Number</th>
              <th sort-helper="recruitedDate">Recruited On</th>
              <th ng-repeat="group in groups" sort-helper="group_{{group.id}}">{{group.shortName}}</th>
              <th>Cohorts</th>
              <th>Hospitals</th>
            </tr>
          </thead>

          <tbody>
            <tr ng-repeat="patient in items" 
                ng-class="{dead: patient.dateOfDeath || patient.yearOfDeath || patient.radarDateOfDeath}">
              <td>
                <a ui-sref="patient.demographics({patientId: patient.id})">{{patient.id}}</a>
                <i class="fa fa-link" ng-if="patient.ukrdc" title="Receiving data from UKRDC"></i>
                <!-- <i class="fa fa-exclamation-triangle" ng-if="patient.consentStatus == 'SOON'"></i>
                <i class="fa fa-ban" ng-if="patient.consentStatus == 'EXPIRED' || patient.consentStatus == 'MISSING'"></i> -->
              </td>

              <td>
                <a ui-sref="patient.demographics({patientId: patient.id})">
                  <span ng-if="patient.firstName !== undefined">
                    <span if-demographics-visible>{{patient.firstName | missing}}</span>
                    <span if-demographics-hidden class="hidden-demographics">Hidden</span>
                  </span>

                  <span ng-if="patient.firstName === undefined" class="hidden-demographics">Hidden</span>
                </a>
              </td>

              <td>
                <a ui-sref="patient.demographics({patientId: patient.id})">
                  <span ng-if="patient.lastName !== undefined">
                    <span if-demographics-visible>{{patient.lastName | missing}}</span>
                    <span if-demographics-hidden class="hidden-demographics">Hidden</span>
                  </span>

                  <span ng-if="patient.lastName === undefined" class="hidden-demographics">Hidden</span>
                </a>
              </td>

              <td>
                <span ng-if="patient.dateOfBirth !== undefined">
                  <span if-demographics-visible>{{patient.dateOfBirth | dateFormat}}</span>
                  <span if-demographics-hidden>{{patient.yearOfBirth | missing}}</span>
                </span>

                <span ng-if="patient.dateOfBirth === undefined">{{patient.yearOfBirth | missing}}</span>

                <span ng-if="patient.yearOfDeath || patient.dateOfDeath || patient.radarDateOfDeath" 
                      title="Deceased"><i class="fa fa-exclamation-triangle"></i></span>
              </td>

              <td>{{patient.gender.label | missing}}</td>

              <td ng-if="viewDemographicsPermission">
                <span ng-if="patient.primaryPatientNumber !== undefined">
                  <span if-demographics-visible>
                    <span ng-if="patient.primaryPatientNumber === null">-</span>
                    <span ng-if="patient.primaryPatientNumber !== null">
{'fraction_non_alphanumeric': 0.16540449573266017, 'fraction_numerical': 0.0010818608005769925, 'mean_word_length': 2.0342815463165573, 'pattern_counts': {'":': 0, '<': 233, '<?xml version=': 0, '>': 233, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '346255', 'n_tokens_mistral': 2500, 'n_tokens_neox': 2287, 'n_words': 385}