diff --git a/isacc_messaging/models/isacc_communication.py b/isacc_messaging/models/isacc_communication.py index 13a99c07..b08e27ab 100644 --- a/isacc_messaging/models/isacc_communication.py +++ b/isacc_messaging/models/isacc_communication.py @@ -39,12 +39,15 @@ def change_status(self, status): def about_patient(patient): """Query for "outside" Communications about the patient + This includes the dummy Communications added when staff resolve + a message without a response (category:isacc-message-resolved-no-send) + NB: only `sent` or `received` will have a valueDateTime depending on direction of outside communication. `sent` implies communication from practitioner, `received` implies communication from patient. """ return HAPI_request("GET", "Communication", params={ - "category": "isacc-non-sms-message", + "category": "isacc-non-sms-message,isacc-message-resolved-no-send", "subject": f"Patient/{patient.id}", "_sort": "-sent", }) diff --git a/isacc_messaging/models/isacc_patient.py b/isacc_messaging/models/isacc_patient.py index 88c3bc59..02f06795 100644 --- a/isacc_messaging/models/isacc_patient.py +++ b/isacc_messaging/models/isacc_patient.py @@ -235,7 +235,7 @@ def mark_followup_extension(self, persist_on_change=True): for c in next_in_bundle(Communication.for_patient(self, category="isacc-manually-sent-message")): most_recent_followup = FHIRDate(c["sent"]) break - # also possible a followup was recorded as `outside communication` + # also possible a followup was recorded as `outside communication` or resolved for c in next_in_bundle(Communication.about_patient(self)): # only consider outside communications reported to have been `sent` if "sent" in c: