Test Print
###
Auditing
###
3309/Any rev04
###
Tests for a selected shelter animal.
###
en
###
SELECT
a.ShelterCode, a.ID AS AID, a.AnimalName, t.AnimalType, il.LocationName,
tt.TestName, av.DateRequired,
av.DateOfTest, tr.ResultName, av.Comments
FROM animal a
INNER JOIN animaltype t ON t.ID = a.AnimalTypeID
INNER JOIN animaltest av ON a.ID = av.AnimalID
INNER JOIN testtype tt ON av.TestTypeID = tt.ID
INNER JOIN testresult tr ON av.TestResultID = tr.ID
INNER JOIN internallocation il ON il.ID = a.ShelterLocation
WHERE a.ID = $ASK ANIMAL$
ORDER BY av.DateOfTest
###
$$HEADER
<h2>Tests for $SHELTERCODE - <a target="_blank" href="animal?id=$AID">$ANIMALNAME</a></h2>
<table border=1>
<thead>
<tr>
<th><b>Test Type</b></th>
<th><b>Required</b></th>
<th><b>Given</b></th>
<th><b>Result</b></th>
<th><b>Comments</b></th>
</tr>
</thead>
<tbody>
HEADER$$

$$BODY<tr>
<td>$TESTNAME</td>
<td>$DATEREQUIRED</td>
<td>$DATEOFTEST</td>
<td>$RESULTNAME</td>
<td>$COMMENTS</td>
</tr>
BODY$$

$$FOOTER
</tbody>
</table>
FOOTER$$
