diff --git a/care/facility/management/commands/load_dummy_data.py b/care/facility/management/commands/load_dummy_data.py index 1ce9e1d0d6..819b54a764 100644 --- a/care/facility/management/commands/load_dummy_data.py +++ b/care/facility/management/commands/load_dummy_data.py @@ -26,6 +26,7 @@ def handle(self, *args, **options): management.call_command("load_data", "kerala") management.call_command("load_medicines_data") management.call_command("seed_data") + management.call_command("load_skill_data") 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") diff --git a/care/users/management/commands/load_skill_data.py b/care/users/management/commands/load_skill_data.py new file mode 100644 index 0000000000..4d476f793f --- /dev/null +++ b/care/users/management/commands/load_skill_data.py @@ -0,0 +1,59 @@ +from django.core.management import BaseCommand + +from care.users.models import Skill + + +class Command(BaseCommand): + """ + Command to load default skills + """ + + help = "Seed Data for Skills" + + def handle(self, *args, **options): + self.stdout.write("Seeding Skills Data... ", ending="") + + skills = [ + "Anesthesiologist", + "Cardiac Surgeon", + "Cardiologist", + "Dermatologist", + "Diabetologist", + "Emergency Medicine Physician", + "Endocrinologist", + "Family Physician", + "Gastroenterologist", + "General Medicine", + "General Surgeon", + "Hematologist", + "Intensivist", + "Medical Officer", + "Nephrologist", + "Neuro Surgeon", + "Neurologist", + "Obstetrician and Gynecologist", + "Oncologist", + "Oncology Surgeon", + "Ophthalmologist", + "Orthopedic", + "Orthopedic Surgeon", + "Otolaryngologist (ENT)", + "Pediatrician", + "Palliative care Physician", + "Pathologist", + "Physician", + "Plastic Surgeon", + "Psychiatrist", + "Pulmonologist", + "Radio technician", + "Radiologist", + "Rheumatologist", + "Thoraco-Vascular Surgeon", + "Urologist", + ] + + Skill.objects.bulk_create( + [Skill(name=skill) for skill in skills], ignore_conflicts=True + ) + + self.stdout.write(self.style.SUCCESS("OK")) diff --git a/docs/django-commands/configuration.rst b/docs/django-commands/configuration.rst index 03d53e2f8f..d873646fbf 100644 --- a/docs/django-commands/configuration.rst +++ b/docs/django-commands/configuration.rst @@ -26,6 +26,10 @@ All Django commands must be executed by invoking :code:`python manage.py`, so fo | | | | | | | Example Invocation: :code:`python manage.py seed_data` | +---------------------+---------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| load_skill_data | None | This command loads default skills | +| | | | +| | | Example Invocation: :code:`python manage.py load_skill_data` | ++---------------------+---------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | summarize | None | The summary jobs are run by Celery every 10 mins, but we can force Django to summarize the current data and update the summary table with this command | | | | | | | | Example Invocation: :code:`python manage.py summarize` |