templates/backOffice/assays/show.html.twig line 1

Open in your IDE?
  1. {% extends 'backOffice/baseAuthenticated.html.twig' %}
  2. {% import 'backOffice/assays/_helpers.html.twig' as assayHelpers %}
  3. {% import 'backOffice/assayReports/_helpers.html.twig' as assayReportHelpers %}
  4. {% set page_title = "Sample ##{ assay.sampleId }" %}
  5. {% set body_classes = "assays-show-page" %}
  6. {% block stylesheets %}
  7.     {{ parent() }}
  8.     {{ encore_entry_link_tags('assays') }}
  9. {% endblock %}
  10. {% block javascripts %}
  11.     {{ parent() }}
  12.     {{ encore_entry_script_tags('assays') }}
  13. {% endblock %}
  14. {% block actions %}
  15.     {% if assayData | length %}
  16.         <a class="btn btn-primary"
  17.            href="{{ path('app_backoffice_assaydata_index', {'_format': 'csv', 'assayId': assay.assayId}) }}">
  18.             Export Data
  19.         </a>
  20.     {% endif %}
  21.     {% if assay.status == constant('App\\Enum\\AssayStatus::COMPLETED')
  22.         and assay.result is not null
  23.         and assay.protocol.test.certificateTemplate is not null
  24.     %}
  25.         <a class="btn btn-primary"
  26.            href="{{ path('app_backoffice_assays_downloadreport', {'assayId': assay.assayId}) }}">
  27.             Download Report
  28.         </a>
  29.         {% if app.request.server.get('APP_ENV') == 'dev' and assay.protocol.notifySinave %}
  30.             {# This actually emmits a result communication so it's better to do it only in dev env #}
  31.             <a class="btn btn-primary"
  32.                href="{{ path('app_backoffice_assays_notifysinave', {'assayId': assay.assayId}) }}">
  33.                 Notify SINAVE
  34.             </a>
  35.         {% endif %}
  36.     {% endif %}
  37. {% endblock %}
  38. {% block body %}
  39.     {% for label, messages in app.flashes %}
  40.         {% for message in messages %}
  41.             <div class="alert alert-{{ label }} alert-dismissible fade show" role="alert">
  42.                 {{ message }}
  43.                 <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span>
  44.                 </button>
  45.             </div>
  46.         {% endfor %}
  47.     {% endfor %}
  48.     <div class="card">
  49.         <div class="card-body">
  50.             {% if assay.status == constant('App\\Enum\\AssayStatus::WAITING_CONFIRMATION') %}
  51.                 <div class="alert alert-warning">
  52.                     This assay is waiting lab confirmation
  53.                 </div>
  54.             {% elseif assay.status == constant('App\\Enum\\AssayStatus::WAITING_RESULT') %}
  55.                 <div class="alert alert-warning">
  56.                     This assay is waiting result
  57.                 </div>
  58.             {% endif %}
  59.             <div class="row">
  60.                 <div class="col-md-6">
  61.                     <strong>ID</strong> {{ assay.assayId }}
  62.                     <br>
  63.                     <strong>SKU</strong> {{ assay.protocol.sku }}
  64.                     <br>
  65.                     <strong>Batch</strong> {{ assay.batch }}
  66.                     <br>
  67.                     <strong>Status</strong> {{ assayHelpers.assay_status(assay) }}
  68.                     <br>
  69.                     <strong>Date</strong> {{ assay.createdAt | date }}
  70.                     <br>
  71.                     <strong>Sample ID</strong> {{ assay.sampleId }}
  72.                     <br>
  73.                     <strong>Device ID</strong> {{ assay.deviceId }}
  74.                     <br>
  75.                     <strong>Expected Entry Count</strong> {{ assay.expectedEntryCount }}
  76.                     <br>
  77.                     <strong>Received Entry Count</strong> {{ assay.receivedEntryCount }}
  78.                 </div>
  79.                 <div class="col-md-6">
  80.                     <strong>Device Model</strong> {{ assay.deviceModel }}
  81.                     <br>
  82.                     <strong>Device Version</strong> {{ assay.deviceVersion }}
  83.                     <br>
  84.                     <strong>App Version</strong> {{ appVersion }}
  85.                     <br>
  86.                     <strong>Firmware</strong> <small>{{ assay.firmwareVersion }}</small>
  87.                     <br>
  88.                     <strong>Hardware</strong> {{ assay.hardwareVersion }}
  89.                     <br>
  90.                     <strong>Report results to</strong> {{ assay_reporter(assay.reporter) }}
  91.                 </div>
  92.             </div>
  93.             <hr/>
  94.             <div class="row">
  95.                 <div class="col-md-6">
  96.                     {% if assay.result %}
  97.                         {% set result = assay.result %}
  98.                         <strong>CT Assay A</strong>
  99.                         {% if result.ctAssayA is not null %}
  100.                             {{ result.ctAssayA }}
  101.                         {% elseif result.details.ctDataTime is defined %}
  102.                             {{ result.details.ctDataTime }}
  103.                         {% endif %}
  104.                         {% if assay.protocol.requiresConfirmation %}
  105.                             <br>
  106.                             <strong>App CT Assay A</strong>
  107.                             {% if result.predictedDetails.ctDataTime is defined %}
  108.                                 {{ result.predictedDetails.ctDataTime }}
  109.                             {% endif %}
  110.                         {% endif %}
  111.                         <br>
  112.                         <strong>Biomarker A</strong>
  113.                         {{ result.biomarkerA }}
  114.                         <br>
  115.                         <strong>Result A</strong>
  116.                         {{ assayHelpers.assay_result(result.resultA, assay.protocol.test) }}
  117.                         {% if assay.protocol.requiresConfirmation %}
  118.                             <br>
  119.                             <strong>App Result A</strong>
  120.                             {{ assayHelpers.assay_result(result.predictedResultA, assay.protocol.test) }}
  121.                         {% endif %}
  122.                         <br/>
  123.                         <strong>Analysis Channel A</strong>
  124.                         {{ assayHelpers.analysis_channel(assay.protocol.analysisChannelA) }}
  125.                         <br/>
  126.                         {% if result.healthAuthorityRx is not null %}
  127.                             <a data-toggle="collapse" href="#healthAuthorityRx" role="button" aria-expanded="false"
  128.                                aria-controls="healthAuthorityRx">
  129.                                 <strong>Health Authority Response <span class="fa fa-caret-down"></span></strong>
  130.                             </a>
  131.                             <div class="collapse" id="healthAuthorityRx">
  132.                                 <div class="card card-body">
  133.                                     {{ result.healthAuthorityRx }}
  134.                                 </div>
  135.                             </div>
  136.                         {% endif %}
  137.                     {% endif %}
  138.                 </div>
  139.                 <div class="col-md-6">
  140.                     <strong>Manual Result</strong>
  141.                     {{ form_start(assayResultForm) }}
  142.                     {% set resultExtra = {} %}
  143.                     {% if assay.reporter is not null %}
  144.                         {% set resultExtra = resultExtra | merge({
  145.                             'help' : 'Assigning a manual result will report the result to '
  146.                             ~ assay_reporter(assay.reporter)
  147.                         }) %}
  148.                     {% endif %}
  149.                     {{ form_row(
  150.                         assayResultForm.resultA,
  151.                         {
  152.                             'label': false,
  153.                         } | merge(resultExtra)) }}
  154.                     {{ form_row(assayResultForm.submit, {'label': 'Submit Result'}) }}
  155.                     {{ form_end(assayResultForm) }}
  156.                     <hr>
  157.                     <strong>Simulate Result</strong>
  158.                     {{ form_start(analysisMethodSimulationForm) }}
  159.                     {{ form_row(analysisMethodSimulationForm.analysisMethod, {'label': false}) }}
  160.                     {{ form_row(analysisMethodSimulationForm.submit, {'label': 'Submit Result'}) }}
  161.                     {{ form_end(analysisMethodSimulationForm) }}
  162.                 </div>
  163.             </div>
  164.             <div class="row">
  165.                 <div class="col-md-12">
  166.                     {% if assayData | length %}
  167.                         <div class="charts-container"
  168.                             data-protocol="{{ assayHelpers.protocol_json(assay.protocol) }}"
  169.                             data-points="{{ assayDataPoints | json_encode | e('html_attr') }}">
  170.                         </div>
  171.                     {% endif %}
  172.                 </div>
  173.             </div>
  174.             {% if assay.reporter is not null %}
  175.                 <hr/>
  176.                 <div class="row">
  177.                     <div class="col-md-12 d-flex">
  178.                         <h3 class="flex-grow-1">Reported Results</h3>
  179.                         <div class="flex-shrink-0">
  180.                             <form
  181.                                     action="{{ path('app_backoffice_assays_notifyreporter', { 'assayId': assay.assayId }) }}"
  182.                                     method="post">
  183.                                 <button class="btn btn-primary" type="submit">
  184.                                     Notify {{ assay_reporter(assay.reporter) }}
  185.                                 </button>
  186.                             </form>
  187.                         </div>
  188.                     </div>
  189.                     <div class="col-md-12">
  190.                         <table class="table table-bordered">
  191.                             {% for assayReport in assayReports %}
  192.                                 <tr>
  193.                                     <td class="text-nowrap">{{ assayReport.createdAt | date }}</td>
  194.                                     <td class="text-nowrap">{{ assay_reporter( assayReport.reporter) }}</td>
  195.                                     <td class="text-nowrap">{{ assayReportHelpers.assay_report_status(assayReport) }}</td>
  196.                                     <td>
  197.                                         <div style="display: grid">
  198.                                             <pre>{{ assayReport.data }}</pre>
  199.                                         </div>
  200.                                     </td>
  201.                                 </tr>
  202.                             {% endfor %}
  203.                         </table>
  204.                     </div>
  205.                 </div>
  206.             {% endif %}
  207.         </div>
  208.     </div>
  209. {% endblock %}