Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Add custom fields on the specimen table

Note

The specimen custom field is only supported on specimen manifest. The order and request manifest doesn't support it

Expand
titleSteps to configure the manifest template
  1. Download the default manifest template file of your choice (for example visit.html) from the system setting as shown above.

  2. Open the template in the editor of choice.

  3. Go to the specimen table, add additional custom fields of your choice (for example “Use Specimen for Research”) as shown below in the script, and save it.

  4. Follow the above steps to import the manifest template either at the system or individual level and download the manifest PDF for the same.

Script to add custom field on the specimen table

Code Block
....
....
  <h3> Specimens </h3>

    <table class="specimens">
      <thead>
        <tr>
          <th>Label</th>
          <th>Parent</th>
          <th>Type</th>
          <th>Use Spcimen for Research</th>
          <th>Quantity</th>
          <th>Processing Date</th>
          <th>Location</th>
        </tr>
      </thead>

      <tbody>
        #foreach ($spmn in $allSpecimens)
          <tr>
            <td>
              #if ($spmn.label)
                <span>$spmn.label</span>
              #end
            </td>
            <td>
              #if ($spmn.parentLabel)
                <span>$spmn.parentLabel</span>
              #end
            </td>
            <td>$spmn.type</td>
            <td>
              #if ($spmn.extensionDetail.attrsMap.use_specimen_for_research)
                <span>$spmn.extensionDetail.attrsMap.use_specimen_for_research</span>
              #end
            </td>
            <td>
              #if ($spmn.status == 'Collected')
                #if ($spmn.availableQty)
                  <span>$spmn.availableQty</span>
                  <span>$spmn.getQuantityUnit()</span>
                #end
              #elseif ($spmn.status == 'Pending' || !$spmn.status)
                #if ($spmn.initialQty)
                  <span>$spmn.initialQty</span>
                  <span>$spmn.getQuantityUnit()</span>
                #end
              #end
            </td>
            <td>
              #if ($spmn.lineage == 'New' and $spmn.collectionEvent.time)
                <span>$dateFmt.format($spmn.collectionEvent.time)</span>
              #elseif ($spmn.createdOn)
                <span>$dateFmt.format($spmn.createdOn)</span>
              #end
            </td>
            <td>
              #if ($spmn.storageLocation.name)
                <span>$spmn.storageLocation.name</span>
                #if ($spmn.storageLocation.mode == 'TWO_D')
                  <span>($spmn.storageLocation.positionY, $spmn.storageLocation.positionX)</span>
                #elseif ($spmn.storageLocation.mode == 'LINEAR')
                  <span>($spmn.storageLocation.position)</span>
                #end
              #end
            </td>
          </tr>
        #end
      </tbody>
    </table>
....
....

Manifest PDF View

View file
namevisit_with_custom_field.html
View file
namespecimens-manifest_with_custom_field.pdf

...