From ecfd65fac25030183e138c671500bf7484953835 Mon Sep 17 00:00:00 2001
From: rivalee {{ clinic.sessionTimes | formatTimeRange }} - {{ clinic.date | formatDate }} Record an outcome for every participant to close this clinic. Complete or end this appointment to close the clinic. {{ participant | getFullName }} NHS: {{ participant.medicalInformation.nhsNumber | formatNhsNumber }} These participants attended but their appointment did not take place. {{ participant | getFullName }} NHS: {{ participant.medicalInformation.nhsNumber | formatNhsNumber }} These participants did not arrive for their appointment. {{ participant | getFullName }} NHS: {{ participant.medicalInformation.nhsNumber | formatNhsNumber }}
+ {{ unit.name }}
+ {{ pageHeading }}
+
+
+ In progress
+
+
+
+
+
+
+
+ {% for appointment in inProgressAppointments %}
+ {% set participant = data.participants | findById(appointment.participantId) %}
+ Time
+ Details
+ Actions
+
+
+ {% endfor %}
+
+ {{ appointment.statusHistory[0].timestamp | formatTimeString }}
+
+
+
+ Go to appointment
+
+ Checked in, not screened
+
+
+
+
+
+
+
+ {% for appointment in checkedInAppointments %}
+ {% set participant = data.participants | findById(appointment.participantId) %}
+ Time
+ Details
+ Actions
+
+
+ {% endfor %}
+
+ {{ appointment.statusHistory[0].timestamp | formatTimeString }}
+
+
+
+ Mark as attended not screened
+
+ Did not check in
+
+
+
+
+
+
+
+ {% for appointment in remainingAppointments %}
+ {% set participant = data.participants | findById(appointment.participantId) %}
+ Time
+ Details
+ Actions
+
+
+ {% endfor %}
+
+ {{ appointment.statusHistory[0].timestamp | formatTimeString }}
+
+
+
+ Mark as did not attend
+
+
{{ clinic.sessionTimes | formatTimeRange }} - {{ clinic.date | formatDate }}
These participants attended but their appointment did not take place.
+ {% if checkedInAppointments | length %} +Mark all as attended not screened
+ {% endif %} +| {{ appointment.statusHistory[0].timestamp | formatTimeString }} | @@ -88,9 +94,20 @@
- Mark as attended not screened
+ {% if appointment.status == "attended_not_screened" %}
+ {{ appointment.status | toTag({ vocabulary: "appointment" }) }}
+ + View appointment + ++ Undo + + {% else %} + Mark as attended not screened + {% endif %} |
These participants did not arrive for their appointment.
+ {% if remainingAppointments | length %} + + {% endif %} +| {{ appointment.statusHistory[0].timestamp | formatTimeString }} | @@ -125,9 +148,20 @@
- Mark as did not attend
+ {% if appointment.status == "did_not_attend" %}
+ {{ appointment.status | toTag({ vocabulary: "appointment" }) }}
+ + View appointment + ++ Undo + + {% else %} + Mark as did not attend + {% endif %} |
These participants attended but their appointment did not take place.
{% if checkedInAppointments | length %} @@ -122,7 +122,7 @@These participants did not arrive for their appointment.
{% if remainingAppointments | length %} From 18bc49d2fd7f2acb99aa3440c1d7116b088ad7cb Mon Sep 17 00:00:00 2001 From: rivalee{{ clinic.sessionTimes | formatTimeRange }} - {{ clinic.date | formatDate }}
- {{ insetText({ - html: "Record an outcome for every participant to close this clinic.
" - }) }} - - {# In progress appointments #} - {% set inProgressAppointments = allAppointments | filterAppointmentsByStatus("in-progress") %} - - {% if inProgressAppointments | length %} -Complete or end this appointment to close the clinic.
- -| Time | -Details | -Actions | -
|---|---|---|
| {{ appointment.statusHistory[0].timestamp | formatTimeString }} | -
- {{ participant | getFullName }} -NHS: {{ participant.medicalInformation.nhsNumber | formatNhsNumber }} - |
- - Go to appointment - | -
These participants attended but their appointment did not take place.
+ {{ insetText({ + html: "Record an appointment outcome for every participant to close this clinic.
There were " + allAppointments | length + " total participants in this clinic, and " + needsOutcomeAppointments | length + " still need a final outcome assigned.
" + }) }} - {% if checkedInAppointments | length %} -Mark all as attended not screened
+ {# Macro for appointment table rows #} + {% macro appointmentRow(appointment, clinicId, showActions) %} + {% set participant = data.participants | findById(appointment.participantId) %} ++ {{ participant | getFullName }} +
+NHS: {{ participant.medicalInformation.nhsNumber | formatNhsNumber }}
+| Time | -Details | -Actions | -
|---|---|---|
| {{ appointment.statusHistory[0].timestamp | formatTimeString }} | -
- {{ participant | getFullName }} -NHS: {{ participant.medicalInformation.nhsNumber | formatNhsNumber }} - |
-
- {% if appointment.status == "attended_not_screened" %}
- {{ appointment.status | toTag({ vocabulary: "appointment" }) }}
- - View appointment - -- Undo - - {% else %} - Mark as attended not screened - {% endif %} - |
-
| Time | +Details | +Status | +{{ "Actions" if showActions }} | +
|---|
Complete or end these appointments to close the clinic.
+ {{ statusGroupTable(inProgressAppointments, clinicId, true) }} + {% endif %} + + {# Checked in, not screened #} + {% set checkedInAppointments = allAppointments | where("status", "checked_in") %} + {% set newlyMarkedAns = allAppointments | where("status", "attended_not_screened") | where("id", newlyResolvedIds) %} + {% if checkedInAppointments | length or newlyMarkedAns | length %} +Mark all as attended not screened
+ {% set checkedInGroup = [] %} + {% for appointment in allAppointments %} + {% if appointment.status == "checked_in" or (appointment.status == "attended_not_screened" and appointment.id in newlyResolvedIds) %} + {% set checkedInGroup = checkedInGroup.concat(appointment) %} + {% endif %} + {% endfor %} + {{ statusGroupTable(checkedInGroup, clinicId, true) }} + {% endif %} + + {# Did not check in #} + {% set scheduledAppointments = allAppointments | where("status", "scheduled") %} + {% set newlyMarkedDna = allAppointments | where("status", "did_not_attend") | where("id", newlyResolvedIds) %} + {% if scheduledAppointments | length or newlyMarkedDna | length %} +These participants did not arrive for their appointment.
+ {# Outcome recorded: appointments that already had a final status before visiting this page #} + {% set outcomeRecordedAppointments = allAppointments | where("status", ["complete", "partially_screened", "did_not_attend", "attended_not_screened", "cancelled", "rescheduled"]) | removeWhere("id", newlyResolvedIds) %} - {% if remainingAppointments | length %} - - {% endif %} + {% if outcomeRecordedAppointments | length %} + {% set outcomeRecordedHtml %} + {{ statusGroupTable(outcomeRecordedAppointments, clinicId, false) }} + {% endset %} -| Time | -Details | -Actions | -
|---|---|---|
| {{ appointment.statusHistory[0].timestamp | formatTimeString }} | -
- {{ participant | getFullName }} -NHS: {{ participant.medicalInformation.nhsNumber | formatNhsNumber }} - |
-
- {% if appointment.status == "did_not_attend" %}
- {{ appointment.status | toTag({ vocabulary: "appointment" }) }}
- - View appointment - -- Undo - - {% else %} - Mark as did not attend - {% endif %} - |
-
| Location | +Clinic name and location | Date and time | Clinic type | Participants | @@ -62,7 +62,13 @@
|---|---|---|---|---|
|
- {% if location.type === 'mobile_unit' %}
- {{ location.name }} at {{ clinic.siteName }}
- {% else %}
- {{ location.name }}
- {% endif %}
- - ({{ clinic.sessionType | sentenceCase }}) + {{ clinic.clinicCode }} ({{ clinic.sessionType | lower }}) + + {% if location.type === 'mobile_unit' %} + {{ (location.name + " at " + clinic.siteName) | asHint }} + {% else %} + {{ location.name | asHint }} + {% endif %} |
{{ clinic.date | formatDate | noWrap }} {{clinic.sessionTimes | formatTimeRange | asHint }} diff --git a/app/views/clinics/show.html b/app/views/clinics/show.html index a66b081a..a4d2cb82 100644 --- a/app/views/clinics/show.html +++ b/app/views/clinics/show.html @@ -34,9 +34,14 @@
{{ clinic.status | toTag({ vocabulary: "clinic" }) }}
-
@@ -50,14 +55,6 @@ + + {% if clinic.status !== "closed" and clinic.status !== "scheduled" %} + + {% endif %}
{{ clinic.sessionTimes | formatTimeRange }} - {{ clinic.date | formatDate }}{{pageHeading}} | |||
| {{ appointment.statusHistory[0].timestamp | formatTimeString }} |
- - {{ participant | getFullName }} - -NHS: {{ participant.medicalInformation.nhsNumber | formatNhsNumber }} +{{ participant | getFullName }} +NHS: {{ participant.medicalInformation.nhsNumber | formatNhsNumber }} + |
{{ appointment.status | toTag({ vocabulary: "appointment" }) }} |
@@ -79,7 +76,7 @@ |
Mark all as attended not screened
- {% set checkedInGroup = [] %} - {% for appointment in allAppointments %} - {% if appointment.status == "checked_in" or (appointment.status == "attended_not_screened" and appointment.id in newlyResolvedIds) %} - {% set checkedInGroup = checkedInGroup.concat(appointment) %} - {% endif %} - {% endfor %} - {{ statusGroupTable(checkedInGroup, clinicId, true) }} ++ Mark all as attended not screened +
+ {{ statusGroupTable(checkedInAppointments, clinicId, true) }} {% endif %} {# Did not check in #} {% set scheduledAppointments = allAppointments | where("status", "scheduled") %} - {% set newlyMarkedDna = allAppointments | where("status", "did_not_attend") | where("id", newlyResolvedIds) %} - {% if scheduledAppointments | length or newlyMarkedDna | length %} + {% if scheduledAppointments | length %}+ Mark all as did not attend +
+ {{ statusGroupTable(scheduledAppointments, clinicId, true) }} {% endif %} {% endset %} @@ -129,7 +116,7 @@- Mark all as attended not screened +
+ Mark all as attended not screened
{{ statusGroupTable(checkedInAppointments, clinicId, true) }} {% endif %} @@ -100,37 +100,38 @@