<commit_before>/**
 * Created by <NAME> @ Infermedica on 08/02/2017.
 */

import html from '../../templates/helpers';

const template = (context) => {
  return new Promise((resolve) => {
    context.api.diagnosis(context.patient.toDiagnosis()).then((data) => {
      resolve(html`
        <h5 class="card-title">Summary</h5>
        <div class="card-text">
          <p>Basing on the interview, you could suffer from:</p>
          ${data.conditions.map(condition => `
            <div class="summary-item row">
              <div class="col-8">
                ${condition.name}
                ${condition.probability >= 0.2
                  ? `<i class="fa fa-fw fa-eye"></i><a href data-id="${condition.id}" class="explain">explain</a>` : ``}
              </div>
              <div class="col-4">
                <div class="progress">
                  <div class="progress-bar bg-info" role="progressbar" style="width: ${Math.round(condition.probability * 100 * 100) / 100}%">${Math.round(condition.probability * 100 * 100) / 100}%</div>
                </div>
              </div>
              <div class="explanation col-12"></div>
            </div>          
          `)}
          <div class="alert alert-warning" role="alert">
            <i class="fa fa-info-circle"></i> This list may not be complete. Only a licensed medical provider can diagnose and treat illnesses.
          </div><commit_msg>Use Math.floor to round probability on summary<commit_after>/**
 * Created by <NAME> @ Infermedica on 08/02/2017.
 */

import html from '../../templates/helpers';

const template = (context) => {
  return new Promise((resolve) => {
    context.api.diagnosis(context.patient.toDiagnosis()).then((data) => {
      resolve(html`
        <h5 class="card-title">Summary</h5>
        <div class="card-text">
          <p>Basing on the interview, you could suffer from:</p>
          ${data.conditions.map(condition => `
            <div class="summary-item row">
              <div class="col-8">
                ${condition.name}
                ${condition.probability >= 0.2
                  ? `<i class="fa fa-fw fa-eye"></i><a href data-id="${condition.id}" class="explain">explain</a>` : ``}
              </div>
              <div class="col-4">
                <div class="progress">
                  <div class="progress-bar bg-info" role="progressbar" style="width: ${Math.floor(condition.probability * 100)}%">${Math.floor(condition.probability * 100)}%</div>
                </div>
              </div>
              <div class="explanation col-12"></div>
            </div>          
          `)}
          <div class="alert alert-warning" role="alert">
            <i class="fa fa-info-circle"></i> This list may not be complete. Only a licensed medical provider can diagnose and treat illnesses.
          </div>
{'fraction_non_alphanumeric': 0.16590348714336034, 'fraction_numerical': 0.019725255371609723, 'mean_word_length': 2.021276595744681, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 65, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6700279', 'n_tokens_mistral': 858, 'n_tokens_neox': 793, 'n_words': 189}