-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds migration to move
ip_no
to op_no
for non admission consultat…
…ions (#1428) * migration to move ip_no to op_no for non admission * merge migrations --------- Co-authored-by: Vignesh Hari <vichuhari100@gmail.com>
- Loading branch information
1 parent
4163d74
commit aaffcd1
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Generated by Django 4.2.2 on 2023-07-04 11:16 | ||
|
||
from django.db import migrations | ||
from django.db.models import F | ||
|
||
|
||
class Migration(migrations.Migration): | ||
def move_non_admission_ip_to_op(apps, schema_editor): | ||
PatientConsultation = apps.get_model("facility", "PatientConsultation") | ||
PatientConsultation.objects.exclude(suggestion="A").filter( | ||
ip_no__isnull=False, admission_date__isnull=True | ||
).update(op_no=F("ip_no"), ip_no=None) | ||
|
||
dependencies = [ | ||
("facility", "0366_auto_20230627_1806"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython( | ||
move_non_admission_ip_to_op, reverse_code=migrations.RunPython.noop | ||
) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Generated by Django 4.2.2 on 2023-07-05 09:30 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("facility", "0367_auto_20230704_1646"), | ||
("facility", "0369_merge_0366_auto_20230627_1806_0368_populate_medibase"), | ||
] | ||
|
||
operations = [] |