All checks were successful
Build and Push Docker Image / build (push) Successful in 4m14s
Reference numbers (unified scheme PREFIX-YYYYMM-HOSP-NNNN, e.g. CMP-202606-HHN-0001): - new ReferenceSequence model + generate_reference() helper (apps/core) - Complaint/Inquiry/Observation/Appreciation/Suggestion emit unified refs via save() - prefix-based auto-routing in public track API (CMP/INQ/OBS trackable; APR/SGT internal-only) - removed legacy CMP-/INQ- generators in ui_views, integrations, px_sources - migrations: core.0003_referencesequence, appreciation.0006, feedback.0008, observations.0012 - unit tests (format, sanitization, monthly reset, 40-thread concurrency) QA audit: - isolated E2E hospital sandbox mirroring HH-N + 10 role users (create_e2e_isolated_env) - feedback-modules-audit.spec.ts + audit helper (headed, run-to-completion) - reports/feedback-modules-qa-report.md Also bundles accumulated in-progress work across complaints, observations, organizations, templates, and other modules.
65 lines
3.1 KiB
Python
65 lines
3.1 KiB
Python
from django.core.management.base import BaseCommand
|
|
from apps.organizations.models import Department
|
|
|
|
HR_NAME_MAP = {
|
|
"Anesthesia And Or": "Anesthesia Department",
|
|
"Critical Care": "Critical Care Department",
|
|
"Dermatology": "Dermatology Department",
|
|
"Facility Management & Maintenance": "Facility Management & Maintenance Department",
|
|
"Infection Control": "Infection Control Department",
|
|
"Information Technology": "Information Technology Department",
|
|
"Internal Medicine": "Internal Medicine Department",
|
|
"Laboratory And Blood Bank": "Laboratory Department",
|
|
"Medical Ancillary Services": "Medical Ancillary Services Department",
|
|
"Obstetrics And Gynecology": "Obstetrics & Gynecology Department",
|
|
"Oncology": "ONCOLOGY Department",
|
|
"Ophthalmology": "Ophthalmology Department",
|
|
"Radiology": "Radiology Department",
|
|
"Dentistry": "Dental Department",
|
|
"Surgeries": "Surgery Department",
|
|
"Pediatrics": "Pediatric Department",
|
|
"Emergency Department": "Emergency Medicine Department",
|
|
"Accident And Emergency": "Emergency Medicine Department",
|
|
"Human Resource": "HR Department",
|
|
"Support Services": "Support Services Department",
|
|
"Finance Department": "Financial Collection & Claims Department",
|
|
"Corporate Administration": "Executive Administration",
|
|
"Senior Management Offices": "Executive Administration",
|
|
"Patient Relations & Patient Experience Department": "Patient Experience Department",
|
|
"Porter Department": "Security Department",
|
|
"Transportation Department": "Security Department",
|
|
"Corporate Communication Department": "Patient Experience Department",
|
|
"Marketing Department": "Patient Experience Department",
|
|
"Supply Chain": "Facility Management & Maintenance Department",
|
|
"Pharmacy Warehouse Alaziziyah": "Pharmacy Department",
|
|
"Family Medicine": "Outpatient Department",
|
|
"Business Development": "Executive Administration",
|
|
"Continuous Medical Education Managment": "Medical Administration",
|
|
"Academic Education And Training Affairs": "Medical Administration",
|
|
"Innovation Communication Management": "Medical Administration",
|
|
"Transformation And Change Management": "Medical Administration",
|
|
"Talent Acquisition Department": "HR Department",
|
|
"Internal Audit": "Financial Collection & Claims Department",
|
|
"Legal Affairs Department": "Executive Administration",
|
|
"Cybersecurity Management": "Information Technology Department",
|
|
"Rehabilitation Center": "Outpatient Department",
|
|
}
|
|
|
|
|
|
class Command(BaseCommand):
|
|
help = "Set hr_name on Department records from HR system name mapping"
|
|
|
|
def handle(self, *args, **options):
|
|
updated = 0
|
|
for hr_name, name_en in HR_NAME_MAP.items():
|
|
depts = Department.objects.filter(
|
|
name_en__iexact=name_en, status="active", hr_name=""
|
|
)
|
|
for dept in depts:
|
|
dept.hr_name = hr_name
|
|
dept.save(update_fields=["hr_name"])
|
|
updated += 1
|
|
self.stdout.write(f" {dept.code}: hr_name={repr(hr_name)}")
|
|
|
|
self.stdout.write(self.style.SUCCESS(f"\nUpdated {updated} departments"))
|