Skip to content

Commit

Permalink
Revert "need to update all active users next-outgoing extension (and …
Browse files Browse the repository at this point in the history
…not touch the followup values)"

This reverts commit 5a2de54.
  • Loading branch information
pbugni committed Jan 8, 2025
1 parent 4059664 commit bb72bbd
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions isacc_messaging/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,19 +275,18 @@ def send_system_emails(category, dry_run, include_test_patients):
@click.option("--dry-run", is_flag=True, default=False, help="Simulate execution; don't persist to FHIR store")
def update_patient_extensions(dry_run):
"""Iterate through active patients, update any stale/missing extensions"""
# not routinely used - typically following a bug fix WRT user extensions

# NB - no longer updating the followup-extension as it would displace
# any work done by users who "marked as read" the latest message for a patient
# see https://github.com/uwcirg/isacc-messaging-client-sof/pull/85

# this was a 1 and done migration method. disable for now
raise click.ClickException(
"DISABLED: unsafe to run as this will now undo any user marked "
"read messages via "
"https://github.com/uwcirg/isacc-messaging-client-sof/pull/85")
from isacc_messaging.models.fhir import next_in_bundle
from isacc_messaging.models.isacc_patient import IsaccPatient as Patient
active_patients = Patient.active_patients()
for json_patient in next_in_bundle(active_patients):
patient = Patient(json_patient)
patient.mark_next_outgoing(persist_on_change=not dry_run)
# (see note above) patient.mark_followup_extension(persist_on_change=not dry_run)
patient.mark_followup_extension(persist_on_change=not dry_run)


@base_blueprint.cli.command("maintenance-reinstate-all-patients")
Expand Down

0 comments on commit bb72bbd

Please sign in to comment.