diff --git a/care/facility/management/commands/load_dummy_data.py b/care/facility/management/commands/load_dummy_data.py index 819b54a764..6a3d64c463 100644 --- a/care/facility/management/commands/load_dummy_data.py +++ b/care/facility/management/commands/load_dummy_data.py @@ -22,13 +22,11 @@ def handle(self, *args, **options): ) try: - management.call_command("loaddata", self.BASE_URL + "users.json") - management.call_command("load_data", "kerala") + management.call_command("loaddata", self.BASE_URL + "states.json") + management.call_command("load_skill_data") management.call_command("load_medicines_data") management.call_command("seed_data") - management.call_command("load_skill_data") + management.call_command("loaddata", self.BASE_URL + "users.json") management.call_command("loaddata", self.BASE_URL + "facility.json") - management.call_command("loaddata", self.BASE_URL + "cypress_users.json") - management.call_command("loaddata", self.BASE_URL + "facility_users.json") except Exception as e: raise CommandError(e) diff --git a/data/dummy/cypress_users.json b/data/dummy/cypress_users.json deleted file mode 100644 index 6818e8a57f..0000000000 --- a/data/dummy/cypress_users.json +++ /dev/null @@ -1,78 +0,0 @@ -[ - { - "model": "users.user", - "pk": 21, - "fields": { - "password": "argon2$argon2i$v=19$m=512,t=2,p=2$Tjk2THBOVnZqbW9O$Q1PFLkEcY/3grHVSo7rWvw", - "last_login": null, - "is_superuser": false, - "first_name": "Dev", - "last_name": "Doctor", - "email": "", - "is_staff": false, - "is_active": true, - "date_joined": "2022-10-28T06:48:51.373Z", - "username": "devdoctor", - "user_type": 15, - "created_by": 1, - "ward": null, - "local_body": null, - "district": 7, - "state": 1, - "phone_number": "+919876543219", - "alt_phone_number": "+919876543219", - "gender": 1, - "age": 20, - "home_facility": 1, - "doctor_qualification": null, - "doctor_experience_commenced_on": null, - "doctor_medical_council_registration": null, - "verified": true, - "deleted": false, - "pf_endpoint": null, - "pf_p256dh": null, - "pf_auth": null, - "asset": null, - "groups": [], - "user_permissions": [] - } - }, - { - "model": "users.user", - "pk": 22, - "fields": { - "password": "argon2$argon2i$v=19$m=512,t=2,p=2$Tjk2THBOVnZqbW9O$Q1PFLkEcY/3grHVSo7rWvw", - "last_login": null, - "is_superuser": false, - "first_name": "Dev", - "last_name": "Staff", - "email": "", - "is_staff": false, - "is_active": true, - "date_joined": "2022-10-28T06:48:51.373Z", - "username": "devstaff2", - "user_type": 10, - "created_by": 1, - "ward": null, - "local_body": null, - "district": 7, - "state": 1, - "phone_number": "+919876543219", - "alt_phone_number": "+919876543219", - "gender": 1, - "age": 20, - "home_facility": 1, - "doctor_qualification": null, - "doctor_experience_commenced_on": null, - "doctor_medical_council_registration": null, - "verified": true, - "deleted": false, - "pf_endpoint": null, - "pf_p256dh": null, - "pf_auth": null, - "asset": null, - "groups": [], - "user_permissions": [] - } - } -] diff --git a/data/dummy/facility.json b/data/dummy/facility.json index 8af5d7adaa..e7b6e00366 100644 --- a/data/dummy/facility.json +++ b/data/dummy/facility.json @@ -54,8 +54,8 @@ "latitude": null, "pincode": 670112, "address": "89.66.33.55", - "ward": 218, - "local_body": 12, + "ward": 15162, + "local_body": 6, "district": 7, "state": 1, "oxygen_capacity": 0, @@ -6739,159 +6739,5 @@ "created_by": 2, "last_edited_by": 2 } - }, - { - "model": "facility.facilityrelatedsummary", - "pk": "99627ad6-53e7-4585-821a-21ac6e765f7b", - "fields": { - "created_date": "2022-09-27T07:00:00.163Z", - "modified_date": "2022-09-27T07:25:00.165Z", - "facility": 1, - "s_type": "FacilityCapacity", - "data": { - "id": "81092ced-8720-44cb-b4c5-3f0ad0540153", - "name": "Dummy Facility 1", - "ward": 1, - "state": 1, - "address": "127.0.0.1", - "pincode": 670000, - "district": 7, - "features": [ - 1, - 2, - 3, - 4, - 5, - 6 - ], - "latitude": null, - "inventory": {}, - "longitude": null, - "local_body": 920, - "ward_object": { - "id": 1, - "name": "NEERICODE WEST", - "number": 1, - "local_body": 920 - }, - "availability": [ - { - "id": "bfb7a4d8-6bf0-46d6-bf20-d5020850ea55", - "room_type": 150, - "modified_date": "2022-09-27T12:30:19.399000+05:30", - "room_type_text": "Oxygen beds", - "total_capacity": 1000, - "current_capacity": 20 - } - ], - "created_date": "2022-09-27T12:29:15.929000+05:30", - "phone_number": "+919999999888", - "state_object": { - "id": 1, - "name": "Kerala" - }, - "facility_type": "Private Hospital", - "modified_date": "2022-09-27T12:29:15.929000+05:30", - "district_object": { - "id": 7, - "name": "Ernakulam", - "state": 1 - }, - "kasp_empanelled": false, - "oxygen_capacity": 0, - "type_b_cylinders": 0, - "type_c_cylinders": 0, - "type_d_cylinders": 0, - "local_body_object": { - "id": 920, - "name": "Alangad  Grama Panchayat, Ernakulam District", - "district": 7, - "body_type": 1, - "localbody_code": "G070203" - }, - "actual_live_patients": 1, - "read_cover_image_url": null, - "expected_type_b_cylinders": 0, - "expected_type_c_cylinders": 0, - "expected_type_d_cylinders": 0, - "actual_discharged_patients": 0, - "expected_oxygen_requirement": 0 - } - } - }, - { - "model": "facility.facilityrelatedsummary", - "pk": "e294a2c2-3b05-469f-b975-e7766201df13", - "fields": { - "created_date": "2022-09-27T07:20:00.162Z", - "modified_date": "2022-09-27T07:25:00.171Z", - "facility": 2, - "s_type": "FacilityCapacity", - "data": { - "id": "fa33079d-727d-4295-b0fd-19153b36b2db", - "name": "Dummy Shifting Center", - "ward": 218, - "state": 1, - "address": "89.66.33.55", - "pincode": 670112, - "district": 7, - "features": [ - 1, - 6 - ], - "latitude": null, - "inventory": {}, - "longitude": null, - "local_body": 12, - "ward_object": { - "id": 218, - "name": "VALAMBOOR", - "number": 2, - "local_body": 12 - }, - "availability": [ - { - "id": "52bd4e97-9064-4697-8fea-37e0a2b8c87c", - "room_type": 150, - "modified_date": "2022-09-27T12:46:52.525280+05:30", - "room_type_text": "Oxygen beds", - "total_capacity": 20, - "current_capacity": 1 - } - ], - "created_date": "2022-09-27T12:45:51.075776+05:30", - "phone_number": "+919876665987", - "state_object": { - "id": 1, - "name": "Kerala" - }, - "facility_type": "Shifting Centre", - "modified_date": "2022-09-27T12:45:51.075811+05:30", - "district_object": { - "id": 7, - "name": "Ernakulam", - "state": 1 - }, - "kasp_empanelled": false, - "oxygen_capacity": 0, - "type_b_cylinders": 0, - "type_c_cylinders": 0, - "type_d_cylinders": 0, - "local_body_object": { - "id": 12, - "name": "Aikaranad  Grama Panchayat, Ernakulam District", - "district": 7, - "body_type": 1, - "localbody_code": "G071005" - }, - "actual_live_patients": 0, - "read_cover_image_url": null, - "expected_type_b_cylinders": 0, - "expected_type_c_cylinders": 0, - "expected_type_d_cylinders": 0, - "actual_discharged_patients": 0, - "expected_oxygen_requirement": 0 - } - } } ] diff --git a/data/dummy/facility_users.json b/data/dummy/facility_users.json deleted file mode 100644 index 63653d33df..0000000000 --- a/data/dummy/facility_users.json +++ /dev/null @@ -1,38 +0,0 @@ -[ -{ - "model": "facility.facilityuser", - "pk": 1, - "fields": { - "facility": 1, - "user": 2, - "created_by": 2 - } -}, -{ - "model": "facility.facilityuser", - "pk": 2, - "fields": { - "facility": 2, - "user": 2, - "created_by": 2 - } -}, -{ - "model": "facility.facilityuser", - "pk": 3, - "fields": { - "facility": 1, - "user": 21, - "created_by": 2 - } -}, -{ - "model": "facility.facilityuser", - "pk": 4, - "fields": { - "facility": 1, - "user": 22, - "created_by": 2 - } -} -] diff --git a/data/dummy/states.json b/data/dummy/states.json new file mode 100644 index 0000000000..c5d35562ce --- /dev/null +++ b/data/dummy/states.json @@ -0,0 +1,92 @@ +[ + { + "model": "users.state", + "pk": 1, + "fields": { + "name": "Kerala" + } + }, + { + "model": "users.district", + "pk": 5, + "fields": { + "state": 1, + "name": "Kottayam" + } + }, + { + "model": "users.district", + "pk": 7, + "fields": { + "state": 1, + "name": "Ernakulam" + } + }, + { + "model": "users.localbody", + "pk": 6, + "fields": { + "district": 7, + "name": "Aikaranad Grama Panchayat, Ernakulam District", + "body_type": 1, + "localbody_code": "G071005" + } + }, + { + "model": "users.localbody", + "pk": 12, + "fields": { + "district": 7, + "name": "Alangad Block Panchayat, Ernakulam District", + "body_type": 2, + "localbody_code": "B070200" + } + }, + { + "model": "users.localbody", + "pk": 20, + "fields": { + "district": 7, + "name": "Aluva Municipality, Ernakulam District", + "body_type": 10, + "localbody_code": "M070800" + } + }, + { + "model": "users.localbody", + "pk": 95, + "fields": { + "district": 5, + "name": "Changanassery Municipality, Kottayam District", + "body_type": 10, + "localbody_code": "M050300" + } + }, + { + "model": "users.ward", + "pk": 5896, + "fields": { + "local_body": 95, + "name": "ANNAPOORNESWARI TEMPLE", + "number": 2 + } + }, + { + "model": "users.ward", + "pk": 6276, + "fields": { + "local_body": 20, + "name": "MANA", + "number": 4 + } + }, + { + "model": "users.ward", + "pk": 15162, + "fields": { + "local_body": 6, + "name": "PAZHAMTHOTTAM", + "number": 1 + } + } +] diff --git a/data/dummy/users.json b/data/dummy/users.json index c18cd97b40..3b809cb414 100644 --- a/data/dummy/users.json +++ b/data/dummy/users.json @@ -1,123 +1,4 @@ [ - { - "model": "users.state", - "pk": 1, - "fields": { - "name": "Kerala" - } - }, - { - "model": "users.district", - "pk": 1, - "fields": { - "state": 1, - "name": "Thiruvananthapuram" - } - }, - { - "model": "users.district", - "pk": 2, - "fields": { - "state": 1, - "name": "Kollam" - } - }, - { - "model": "users.district", - "pk": 3, - "fields": { - "state": 1, - "name": "Pathanamthitta" - } - }, - { - "model": "users.district", - "pk": 4, - "fields": { - "state": 1, - "name": "Alappuzha" - } - }, - { - "model": "users.district", - "pk": 5, - "fields": { - "state": 1, - "name": "Kottayam" - } - }, - { - "model": "users.district", - "pk": 6, - "fields": { - "state": 1, - "name": "Idukki" - } - }, - { - "model": "users.district", - "pk": 7, - "fields": { - "state": 1, - "name": "Ernakulam" - } - }, - { - "model": "users.district", - "pk": 8, - "fields": { - "state": 1, - "name": "Thrissur" - } - }, - { - "model": "users.district", - "pk": 9, - "fields": { - "state": 1, - "name": "Palakkad" - } - }, - { - "model": "users.district", - "pk": 10, - "fields": { - "state": 1, - "name": "Malappuram" - } - }, - { - "model": "users.district", - "pk": 11, - "fields": { - "state": 1, - "name": "Kozhikode" - } - }, - { - "model": "users.district", - "pk": 12, - "fields": { - "state": 1, - "name": "Wayanad" - } - }, - { - "model": "users.district", - "pk": 13, - "fields": { - "state": 1, - "name": "Kannur" - } - }, - { - "model": "users.district", - "pk": 14, - "fields": { - "state": 1, - "name": "Kasargode" - } - }, { "model": "users.user", "pk": 1, @@ -136,7 +17,7 @@ "created_by": null, "ward": null, "local_body": null, - "district": 1, + "district": 5, "state": 1, "phone_number": "+919696969696", "alt_phone_number": null,