Skip to content

Commit 7b7d9f1

Browse files
Show previous programme vaccinations in a table
1 parent 197aa02 commit 7b7d9f1

1 file changed

Lines changed: 56 additions & 57 deletions

File tree

app/views/patient/programme.njk

Lines changed: 56 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,62 @@
2626
patient: patient
2727
}) }}
2828

29+
{% call card({
30+
heading: __mf("patientProgramme.vaccinationsGiven.count", {
31+
count: patientProgramme.vaccinationsGiven.length
32+
}),
33+
headingLevel: 3
34+
}) %}
35+
{{ patientProgramme.formatted.statusWithNotes | nhsukMarkdown }}
36+
37+
{% if patientProgramme.vaccinationsGiven.length %}
38+
{% set vaccinationRows = [] %}
39+
{% for vaccination in patientProgramme.vaccinationsGiven %}
40+
{% set vaccinationRows = vaccinationRows | push([
41+
{
42+
header: __("vaccination.createdAt.label"),
43+
html: vaccination.link.createdAt
44+
},
45+
{
46+
header: __("vaccination.age.label"),
47+
text: patient.dob | age(at=vaccination.createdAt)
48+
},
49+
{
50+
header: __("vaccination.programme.label"),
51+
html: vaccination.formatted.programmeWithSequence
52+
}
53+
]) %}
54+
{% endfor %}
55+
56+
{{ table({
57+
id: "vaccinations",
58+
responsive: true,
59+
head: [
60+
{ text: __("vaccination.createdAt.label") },
61+
{ text: __("vaccination.age.label") },
62+
{ text: __("vaccination.programme.label") }
63+
],
64+
rows: vaccinationRows
65+
}) }}
66+
{% endif %}
67+
68+
{{ appButtonGroup({
69+
buttons: [{
70+
classes: "nhsuk-button--secondary",
71+
text: __("patientSession.record.title", {
72+
programme: patientProgramme.programme
73+
}) | safe,
74+
attributes: {
75+
formaction: patientProgramme.uri + "/record?referrer=" + referrer
76+
}
77+
}, {
78+
classes: "nhsuk-button--secondary",
79+
text: __("vaccination.new.alreadyVaccinated.title"),
80+
href: patientProgramme.uri + "/new/vaccination"
81+
}]
82+
}) if patientProgramme.status != PatientStatus.Vaccinated and patientProgramme.eligible }}
83+
{% endcall %}
84+
2985
{% if patientProgramme.ttcvVaccinations %}
3086
{% call card({
3187
heading: __("patientProgramme.ttcv.label"),
@@ -73,63 +129,6 @@
73129
{% endcall %}
74130
{% endif %}
75131

76-
{% call card({
77-
heading: __mf("patientProgramme.vaccinationsGiven.count", {
78-
count: patientProgramme.vaccinationsGiven.length
79-
}),
80-
headingLevel: 3
81-
}) %}
82-
{{ patientProgramme.formatted.statusWithNotes | nhsukMarkdown }}
83-
84-
{% if patientProgramme.vaccinationsGiven.length %}
85-
{% for vaccination in patientProgramme.vaccinationsGiven %}
86-
{{ summaryList({
87-
card: {
88-
classes: "app-card--compact app-card--offset",
89-
heading: vaccination.formatted.vaccine_snomed,
90-
headingLevel: 4,
91-
href: vaccination.uri,
92-
clickable: true
93-
},
94-
rows: summaryRows(vaccination, {
95-
outcome: {},
96-
vaccine_snomed: {},
97-
method: {},
98-
site: {},
99-
dose: {},
100-
sequence: {},
101-
batch: {},
102-
location: {},
103-
identifiedBy: {},
104-
suppliedBy: {},
105-
createdBy: {},
106-
createdAt: {},
107-
reportedAt: {},
108-
protocol: {},
109-
note: {},
110-
syncStatus: {}
111-
})
112-
}) }}
113-
{% endfor %}
114-
{% endif %}
115-
116-
{{ appButtonGroup({
117-
buttons: [{
118-
classes: "nhsuk-button--secondary",
119-
text: __("patientSession.record.title", {
120-
programme: patientProgramme.programme
121-
}) | safe,
122-
attributes: {
123-
formaction: patientProgramme.uri + "/record?referrer=" + referrer
124-
}
125-
}, {
126-
classes: "nhsuk-button--secondary",
127-
text: __("vaccination.new.alreadyVaccinated.title"),
128-
href: patientProgramme.uri + "/new/vaccination"
129-
}]
130-
}) if patientProgramme.status != PatientStatus.Vaccinated and patientProgramme.eligible }}
131-
{% endcall %}
132-
133132
{% if patientProgramme.patientSessions.length %}
134133
{% set patientSessionRows = [] %}
135134
{% for patientSession in patientProgramme.patientSessions %}

0 commit comments

Comments
 (0)