Skip to content

Commit c919c27

Browse files
Remove files that don't appear to be needed, iterator rather than all for command
1 parent e814201 commit c919c27

File tree

4 files changed

+5
-61
lines changed

4 files changed

+5
-61
lines changed

apps/fhir/bluebutton/management/commands/migrate_fhir_id_to_v2.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ def migrate_fhir_id_to_v2(apps=None, schema_editor=None) -> None:
1818

1919
apps_mod = apps if apps is not None else global_apps
2020
Crosswalk = apps_mod.get_model('bluebutton', 'Crosswalk')
21-
for crosswalk in Crosswalk.objects.all():
21+
for crosswalk in Crosswalk.objects.iterator(chunk_size=1000):
2222
if getattr(crosswalk, '_fhir_id', None):
2323
crosswalk.fhir_id_v2 = getattr(crosswalk, '_fhir_id') # type: ignore[attr-defined]
2424
crosswalk.save()
2525

2626
ArchivedCrosswalk = apps_mod.get_model('bluebutton', 'ArchivedCrosswalk')
27-
for archived in ArchivedCrosswalk.objects.all():
27+
for archived in ArchivedCrosswalk.objects.iterator(chunk_size=1000):
2828
if getattr(archived, '_fhir_id', None):
2929
archived.fhir_id_v2 = getattr(archived, '_fhir_id') # type: ignore[attr-defined]
3030
archived.save()
@@ -35,13 +35,13 @@ def reverse_migrate_v2_to_fhir_id(apps=None, schema_editor=None) -> None:
3535

3636
apps_mod = apps if apps is not None else global_apps
3737
Crosswalk = apps_mod.get_model('bluebutton', 'Crosswalk')
38-
for crosswalk in Crosswalk.objects.all():
38+
for crosswalk in Crosswalk.objects.iterator(chunk_size=1000):
3939
if getattr(crosswalk, 'fhir_id_v2', None):
4040
crosswalk._fhir_id = getattr(crosswalk, 'fhir_id_v2') # type: ignore[attr-defined]
4141
crosswalk.save()
4242

4343
ArchivedCrosswalk = apps_mod.get_model('bluebutton', 'ArchivedCrosswalk')
44-
for archived in ArchivedCrosswalk.objects.all():
44+
for archived in ArchivedCrosswalk.objects.iterator(chunk_size=1000):
4545
if getattr(archived, 'fhir_id_v2', None):
4646
archived._fhir_id = getattr(archived, 'fhir_id_v2') # type: ignore[attr-defined]
4747
archived.save()

apps/fhir/bluebutton/migrations/0009_migrate_fhir_id_to_v2.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ class Migration(migrations.Migration):
1414
]
1515

1616
operations = [
17-
# migrations.RunPython(migrate_fhir_id_to_v2, reverse_migrate_v2_to_fhir_id),
18-
migrations.AddConstraint( # After migration happens, add constraint that a fhir_id must be present
17+
migrations.AddConstraint( # After migrate_fhir_id_to_v2 is run, add constraint that a fhir_id_v2 or v3 must be present
1918
model_name='crosswalk',
2019
constraint=models.CheckConstraint(
2120
check=models.Q(fhir_id_v2__isnull=False) | models.Q(fhir_id_v3__isnull=False),

apps/testclient/management/commands/generate_test_data.py

Lines changed: 0 additions & 54 deletions
This file was deleted.

synthetic-data/synthetic-beneficiary.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)