Skip to content

Commit

Permalink
Merge pull request #2 from tango-3/dev
Browse files Browse the repository at this point in the history
feat: Add Booster Vaccine Dose
  • Loading branch information
miketrebilcock authored Sep 29, 2021
2 parents 0d5839f + 084fc9a commit 3d5dac5
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
Binary file modified .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions default-dummy-patient-list.csv
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ NhsNumber,Name,DateOfBirth,SessionDate,StartTime,RegisteredPracticeName,Address,
349888464,Test Patient,29/08/1948,20/01/2021,11:40,Test General Medical Practice,"142 Test Street, Bedford, BD12 3AD",Second
835258980,Test Patient,30/01/1924,20/01/2021,11:50,Test General Medical Practice,"143 Test Street, Bedford, BD12 3AD",Second
451757567,Test Patient,31/10/1942,20/01/2021,12:00,Test General Medical Practice,"144 Test Street, Bedford, BD12 3AD",Second
2418409899,Test Patient Booster,15/06/1972,20/01/2021,09:00,Test General Medical Practice,"144 Test Street, Bedford, BD12 3AD",Booster
5001523761,Test Patient Booster,03/11/1962,20/01/2021,10:00,Test General Medical Practice,"144 Test Street, Bedford, BD12 3AD",Booster
9391287379,Test Patient Booster,23/02/1932,20/01/2021,10:30,Test General Medical Practice,"144 Test Street, Bedford, BD12 3AD",Booster
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h1>COVID Vaccine QR Generator 3.12</h1>
<h4>What's New</h4>
<p>This new release contains some changes you need to know about:</p>
<ul>
<li>Dependancy Updates</li>
<li>Booster added as a vaccine dose</li>
</ul>
</div>
<p><button type="button" class="btn btn-primary btn-block my-4" id="get-started">Get Started</button></p>
Expand Down
2 changes: 1 addition & 1 deletion scripts/template.form.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function genFullPageHTML(patient, index) {
ageHTML = ' (Under 18)'
}
firstdoseHTML = ``;
doseHTML = ` First | Second`;
doseHTML = ` First | Second | Booster`;



Expand Down
22 changes: 22 additions & 0 deletions scripts/template.stickers.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ function genPatientStickersHTML() {
} else if (csvVaccineDose == "Second") {
//Second dose only
doseHTML = generateSecondDoseHTML(sessiondate, sessiontime, batchNumber);
} else if (csvVaccineDose == "Booster") {
//Second dose only
doseHTML = generateBoosterDoseHTML(sessiondate, sessiontime, batchNumber);
} else {
//No vaccine dose in CSV file, revert to unspecified
doseHTML = generateUnspecifiedDoseHTML(sessiondate, sessiontime, batchNumber);
Expand Down Expand Up @@ -102,6 +105,25 @@ function generateSecondDoseHTML(sessiondate, sessiontime, batchNumber) {
return tableheadHTML + secondDoseHTML + tablefootHTML + batchOnRecordHTML;
}

function generateBoosterDoseHTML(sessiondate, sessiontime, batchNumber) {
tableheadHTML = `<table class="dose-details">
<tr><td colspan="2"><i>Dose Details</i></td></tr> `;
tablefootHTML = `</table>`;

if (batchNumber) {
batchHTML = `<td>Batch: ` + batchNumber + `</td>`;
batchOnRecordHTML = '';
} else {
batchOnRecordHTML = `<small class="batchOnRecord text-center">The batch details are stored in your medical record.</small>`;
batchHTML = '';
}

boosterDoseHTML = `<tr><td><strong>Booster</strong>:` + sessiondate + ` ` + sessiontime + `</td>` +
batchHTML + '</tr>';

return tableheadHTML + boosterDoseHTML + tablefootHTML + batchOnRecordHTML;
}

function generateUnspecifiedDoseHTML(sessiondate, sessiontime, batchNumber) {
return `
<tr>
Expand Down

0 comments on commit 3d5dac5

Please sign in to comment.