...
<div style="page-break-after:always"></div>
Example:
Expand |
---|
title | Example Complete 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>
<td>: $dateOnlyFmt.format($cpr.participant.birthDate)</td>
</tr>
<tr>
<td class="label">Participant ID</td>
<td>: <![CDATA[$cpr.ppid]]></td>
</tr>
<tr>
<td class="label">PI Name</td>
<td>: <![CDATA[$cp.principalInvestigator.firstName $cp.principalInvestigator.lastName]]></td>
</tr>
<tr>
<td class="label">PI Email</td>
<td>: <![CDATA[$cp.principalInvestigator.emailAddress]]></td>
</tr>
#foreach ($request in $visit.extensionDetail.attrsMap.service_request)
#if (($spmn.label.startsWith("P1") && $request.service_requested == 'DNA Extraction') || ($spmn.label.startsWith("P6") && $request.service_requested == 'PBMC Processing'))
<tr>
<td class="label">Service Requested</td>
<td>: <![CDATA[$request.service_requested]]></td>
</tr>
<tr>
<td class="label">Number of tubes</td>
<td>: <![CDATA[$request.number_of_tubes]]></td>
</tr>
<tr>
<td class="label">Volume in each tube</td>
<td>: <![CDATA[$request.volume_in_each_tube2]]></td>
</tr>
<tr>
<td class="label">Collection Date</td>
<tr>: <![CDATA[$dateFmt.format($spmn.collectionEvent.time)]]></tr>
</tr>
#if ($request.comments)
<tr>
<td class="label">Comments</td>
<td>: <![CDATA[$request.comments]]></td>
</tr>
#end
#end
#end
<tr>
<td>----------------------------------------------------------------------------------</td>
<td>-----------------------------------------</td>
</tr>
#end
#end |
|
...
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)
#set ($temp = $items[$j])
#set ($items[$j] = $items[$j + 1])
#set ($items[$j + 1] = $temp)
#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 - 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)
#set ($temp = $items[$j])
#set ($items[$j] = $items[$j + 1])
#set ($items[$j + 1] = $temp)
#end
#end
#end
#end |