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

...

Expand
titleExample Code
Code Block
    <div>
      <ol style="font-size: 13px; padding-left: 13px;">
        <caption style="text-align: left; font-size: 13px; margin-left: 0px;"><u><b>Processing Notes:</b></u></caption>
        <li><![CDATA[Inequality Synmbols: >,<,>=,<=]]></li>
      </ol>
    </div>

2.

...

Ans: Yes. Please add the following HTML wherever you want a page break or new page should be started.

Syntax

<div style="page-break-after:always"></div>

Example:

...

titleExample Code

...

Does the Order manifest support specimen custom or participant registration fields?

No. Order manifest doesn’t support specimen custom or participant registration fields such as (External Suj ID).

We suggest using the order report option where the user attaches a custom query with required fields to your Distribution protocol and generates a report for orders under it. https://openspecimen.atlassian.net/wiki/spaces/CAT/pages/1492680746/Additional+Distribution+Features#Report

3. Would it be possible to page break or start a new page? 

Ans: Yes. Please add the following HTML wherever you want a page break or a new page should be started.

Syntax

<div style="page-break-after:always"></div>

Example:

Expand
titleComplete Code
Code Block
#foreach ($spmn in $allSpecimens)
      <div style="page-break-after: always;"></div>
        #if ($visit.extensionDetail.attrsMap.service_request && $spmn.lineage == 'New' && $spmn.collectionEvent.time && ($spmn.label.startsWith("P1") || $spmn.label.startsWith("P6")))
          <tr>
            <td class="label">First Name</td>
            <td>: <![CDATA[$cpr.participant.firstName]]></td>
          </tr>
          <tr>
            <td class="label">Last Name</td>
            <td>: <![CDATA[$cpr.participant.lastName]]></td>
          </tr>
          <tr>
              <td class="label">MRN</td>
              <td>: <![CDATA[$cpr.participant.empi]]></td>
          </tr>
          <tr>
              <td class="label">Date of Birth</td>
               #if ($visit.extensionDetail.attrsMap.service_request && $spmn.lineage == 'New' && $spmn.collectionEvent.time && ($spmn.label.startsWith("P1") || $spmn.label.startsWith("P6")))<td>: $dateOnlyFmt.format($cpr.participant.birthDate)</td>
          </tr>
          <tr>
              <td class="label">First>Participant Name<ID</td>
              <td>: <![CDATA[$cpr.participant.firstNameppid]]></td>
          </tr>
          <tr>
            <td class="label">Last>PI Name</td>
            <td>: <![CDATA[$cpr.participant$cp.principalInvestigator.firstName $cp.principalInvestigator.lastName]]></td>
          </tr> 
          <tr>
 
            <td class="label">MRN<>PI Email</td>
 
            <td>: <![CDATA[$cpr$cp.participantprincipalInvestigator.empiemailAddress]]></td>
          </tr>
          <tr>#foreach ($request       in $visit.extensionDetail.attrsMap.service_request)
      <td class="label">Date of Birth</td>        #if (($spmn.label.startsWith("P1") && $request.service_requested == 'DNA  <td>: $dateOnlyFmt.format($cpr.participant.birthDate)</td>
    Extraction') || ($spmn.label.startsWith("P6") && $request.service_requested == 'PBMC Processing'))
     </tr>           <tr>
                  <td class="label">Participant>Service ID<Requested</td>
                  <td>: <![CDATA[$cpr$request.ppidservice_requested]]></td>
                </tr>
                <tr>
                  <td class="label">PI>Number of Name<tubes</td>
                  <td>: <![CDATA[$cp.principalInvestigator.firstName $cp.principalInvestigator.lastName$request.number_of_tubes]]></td>           </tr>      
     <tr>             <td class="label">PI Email</td>
 </tr>
          <td>: <![CDATA[$cp.principalInvestigator.emailAddress]]></td>        <tr>
       </tr>           #foreach ($request in $visit.extensionDetail.attrsMap.service_request)<td class="label">Volume in each tube</td>
                #if (($spmn.label.startsWith("P1") && $request.service_requested == 'DNA Extraction') || ($spmn.label.startsWith("P6") && $request.service_requested == 'PBMC Processing')) <td>: <![CDATA[$request.volume_in_each_tube2]]></td>
                </tr>
                <tr>
                  <td class="label">Service>Collection Requested<Date</td>
                  <td><tr>: <![CDATA[$request.service_requested$dateFmt.format($spmn.collectionEvent.time)]]></td>tr>
                </tr>
                #if ($request.comments)
 </tr>                 <tr>
                    <td class="label">Number>Comments</td>
of tubes</td>                   <td>: <![CDATA[$request.number_of_tubescomments]]></td>            
                     </tr>
                <tr>#end
              #end
   <td class="label">Volume in each tube</td>    #end	
              <td>: <![CDATA[$request.volume_in_each_tube2]]></td><tr>
                </tr><td>----------------------------------------------------------------------------------</td>
            <td>-----------------------------------------</td>  
 <tr>                   <td class="label">Collection Date</td>
 </tr>				
        #end
       <tr>: <![CDATA[$dateFmt.format($spmn.collectionEvent.time)]]></tr>
                </tr>
                #if ($request.comments)
                  <tr>
       #end

View file
namenew_page_example.pdf

4. Is it possible to sort the specimen table in order manifest based on the ascending order of PPID? 

Ans: Yes. You need to implement the sorting function directly within the HTML template as shown below (before the start of <html> tag).

Syntax

Code Block
#set($numItems = $items.size())
#set($range = $numItems - 1)
#foreach ($i in [0..$range])
  #set($subRange = $range - $i - 1)
  #if ($subRange >= 0)
    #foreach ($j in [0..$subRange])
      #if ($items.get($j).specimen.ppid.compareTo($items.get($j + 1).specimen.ppid) > 0)
<td
 
class="label">Comments</td>
       #set ($temp = $items[$j])
        #set 
<td>: <![CDATA[$request.comments]]></td>
($items[$j] = $items[$j + 1])
        #set ($items[$j + 1] = $temp)
     
</tr>
 #end
    #end
  #end
#end

Example:

5. Is it possible to sort the specimen table in order manifest based on the descending order of PPID? 

Ans: Yes. You need to implement the sorting function directly within the HTML template as shown below (before the start of <html> tag).

Syntax

...

Code Block
#set($numItems = $items.size())
#set($range = $numItems - 
#end
1)
#foreach ($i in [0..$range])
  #set($subRange = $range - $i - 1)
 
#end
 #if ($subRange >= 0)
    #foreach ($j 
#end <tr>
in [0..$subRange])
      
<td>----------------------------------------------------------------------------------</td> <td>-----------------------------------------</td> </tr>
#if ($items.get($j).specimen.ppid.compareTo($items.get($j + 1).specimen.ppid) < 0)
        #set ($temp = $items[$j])
        #set ($items[$j] = $items[$j + 1])
        #set ($items[$j + 1] = $temp)
      #end
    #end
  
#end
#end

...