Skip to content

Commit

Permalink
pivotal 188624366; look for Communication category `isacc-message-res…
Browse files Browse the repository at this point in the history
…olved-no-send` when looking up un-followed-up message times.
  • Loading branch information
pbugni committed Nov 27, 2024
1 parent ce46a9a commit 0ee9f38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion isacc_messaging/models/isacc_communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
})
Expand Down
2 changes: 1 addition & 1 deletion isacc_messaging/models/isacc_patient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0ee9f38

Please sign in to comment.