"""
Management command to initialize onboarding acknowledgement data
"""
from django.core.management.base import BaseCommand
from django.utils import timezone
from apps.accounts.models import (
AcknowledgementContent,
AcknowledgementChecklistItem,
Role
)
class Command(BaseCommand):
help = 'Initialize default acknowledgement content and checklist items'
def handle(self, *args, **options):
self.stdout.write('Initializing onboarding acknowledgement data...')
# Create generic content (applies to all users)
self._create_generic_content()
# Create department-specific content
self._create_departmental_content()
# Create role-specific content
self._create_px_admin_content()
self._create_hospital_admin_content()
self._create_department_manager_content()
self._create_physician_content()
self._create_staff_content()
self.stdout.write(self.style.SUCCESS('Onboarding data initialized successfully!'))
def _create_generic_content(self):
"""Create generic acknowledgement content for all users"""
self.stdout.write('Creating generic content...')
role = None # Generic content
# Create generic content items
contents = [
{
'code': 'INTRO_PX360',
'order': 1,
'title_en': 'Welcome to PX360',
'title_ar': 'مرحبًا بك في PX360',
'description_en': 'Overview of the PX360 Patient Experience Management System',
'description_ar': 'نظرة عامة على نظام إدارة تجربة المريض PX360',
'content_en': """
Welcome to PX360
PX360 is a comprehensive Patient Experience Management System designed to help healthcare organizations improve patient satisfaction and quality of care.
Key Features:
- Patient Feedback Collection: Gather and analyze patient feedback across multiple channels
- Analytics & Reporting: Real-time dashboards and detailed reports
- Complaint Management: Streamlined process for handling patient complaints
- Quality Observations: Track and improve service quality
- Physician Management: Manage physician profiles and credentials
- Call Center Integration: Integrated call center for patient communication
Getting Started:
This wizard will guide you through the essential features and policies of the system. Please review each section carefully and acknowledge the checklist items to complete your onboarding.
""",
'content_ar': """
مرحبًا بك في PX360
PX360 هو نظام شامل لإدارة تجربة المرضى مصمم لمساعدة المؤسسات الصحية على تحسين رضا المرضى وجودة الرعاية.
الميزات الرئيسية:
- جمع ملاحظات المرضى: جمع وتحليل ملاحظات المرضى عبر قنوات متعددة
- التحليلات والتقارير: لوحات تحكم في الوقت الفعلي وتقارير مفصلة
- إدارة الشكاوى: عملية مبسطة للتعامل مع شكاوى المرضى
- ملاحظات الجودة: تتبع وتحسين جودة الخدمة
- إدارة الأطباء: إدارة ملفات الأطباء واعتماداتهم
- تكامل مركز الاتصال: مركز اتصال متكامل للتواصل مع المرضى
البدء:
سيقوم هذا المعالج بإرشادك عبر الميزات والسياسات الأساسية للنظام. يرجى مراجعة كل قسم بعناية والاعتراف بالبنود المدرجة في القائمة لإكمال التسجيل.
"""
},
{
'code': 'DATA_PRIVACY',
'order': 2,
'title_en': 'Data Privacy & Security',
'title_ar': 'خصوصية البيانات والأمان',
'description_en': 'Understanding data protection and security policies',
'description_ar': 'فهم سياسات حماية البيانات والأمان',
'content_en': """
Data Privacy & Security
Data Protection Principles:
- All patient data is confidential and protected
- Access is granted based on role and need-to-know basis
- Data is encrypted in transit and at rest
- All access is logged and auditable
User Responsibilities:
- Keep your password secure and do not share it
- Log out when leaving your workstation
- Report any suspected security incidents immediately
- Access only the data you need for your role
""",
'content_ar': """
خصوصية البيانات والأمان
مبادئ حماية البيانات:
- جميع بيانات المرضى سرية ومحمية
- يتم منح الوصول بناءً على الدورة والحاجة للمعرفة
- يتم تشفير البيانات أثناء النقل والتخزين
- جميع عمليات الوصول مسجلة وقابلة للتدقيق
مسؤوليات المستخدم:
- احتفظ بكلمة المرور آمنة ولا تشاركها مع أحد
- قم بتسجيل الخروج عند مغادرة محطة العمل
- أبلغ عن أي حوادث أمنية مشتبه بها فورًا
- الوصول فقط إلى البيانات التي تحتاجها لدورك
"""
},
{
'code': 'SYSTEM_USAGE',
'order': 3,
'title_en': 'System Usage Guidelines',
'title_ar': 'إرشادات استخدام النظام',
'description_en': 'Best practices for using PX360 effectively',
'description_ar': 'أفضل الممارسات لاستخدام PX360 بشكل فعال',
'content_en': """
System Usage Guidelines
Best Practices:
- Regular Updates: Check dashboards daily for updates
- Timely Actions: Respond to patient feedback and complaints promptly
- Accurate Data: Ensure all entered data is accurate and complete
- Communication: Use the system for all official communications
Support:
If you need assistance:
- Contact your department manager
- Submit a support ticket through the help center
- Refer to the user documentation
""",
'content_ar': """
إرشادات استخدام النظام
أفضل الممارسات:
- التحديثات المنتظمة: تحقق من لوحات التحكم يوميًا للحصول على التحديثات
- الإجراءات في الوقت المناسب: استجب لملاحظات وشكاوى المرضى بسرعة
- البيانات الدقيقة: تأكد من أن جميع البيانات المدخلة دقيقة ومكتملة
- التواصل: استخدم النظام لجميع الاتصالات الرسمية
الدعم:
إذا كنت بحاجة إلى المساعدة:
- اتصل بمدير قسمك
- قدم تذكرة دعم من خلال مركز المساعدة
- راجع وثائق المستخدم
"""
}
]
for content_data in contents:
AcknowledgementContent.objects.update_or_create(
code=content_data['code'],
role=role,
defaults=content_data
)
# Create checklist items for generic content
intro_content = AcknowledgementContent.objects.get(code='INTRO_PX360')
privacy_content = AcknowledgementContent.objects.get(code='DATA_PRIVACY')
usage_content = AcknowledgementContent.objects.get(code='SYSTEM_USAGE')
checklist_items = [
{
'content': intro_content,
'code': 'INTRO_ACK',
'order': 1,
'text_en': 'I have reviewed the PX360 system overview',
'text_ar': 'لقد راجعت نظرة عامة على نظام PX360',
'description_en': 'Confirm that you understand the system purpose and key features',
'description_ar': 'أكد أنك تفهم الغرض من النظام والميزات الرئيسية',
'is_required': True
},
{
'content': privacy_content,
'code': 'PRIVACY_ACK',
'order': 1,
'text_en': 'I acknowledge and agree to the data privacy and security policies',
'text_ar': 'أعترف وأوافق على سياسات خصوصية البيانات والأمان',
'description_en': 'Confirm that you understand your responsibilities regarding data protection',
'description_ar': 'أكد أنك تفهم مسؤولياتك فيما يتعلق بحماية البيانات',
'is_required': True
},
{
'content': privacy_content,
'code': 'PRIVACY_PASSWORD',
'order': 2,
'text_en': 'I will keep my password secure and report any security incidents',
'text_ar': 'سأحتفظ بكلمة المرور آمنة وسأبلغ عن أي حوادث أمنية',
'description_en': 'Commit to password security and incident reporting',
'description_ar': 'الالتزام بأمان كلمة المرور والإبلاغ عن الحوادث',
'is_required': True
},
{
'content': usage_content,
'code': 'USAGE_ACK',
'order': 1,
'text_en': 'I will follow system usage guidelines and best practices',
'text_ar': 'سأتبع إرشادات استخدام النظام وأفضل الممارسات',
'description_en': 'Commit to using the system effectively and responsibly',
'description_ar': 'الالتزام باستخدام النظام بفعالية ومسؤولية',
'is_required': True
}
]
for item_data in checklist_items:
AcknowledgementChecklistItem.objects.update_or_create(
code=item_data['code'],
defaults=item_data
)
def _create_departmental_content(self):
"""Create department-specific acknowledgement content"""
self.stdout.write('Creating departmental acknowledgement content...')
role = None # Generic content - applies to all users based on department
# Departmental acknowledgement contents
departmental_contents = [
{
'code': 'DEPT_CLINICS',
'order': 5,
'title_en': 'Clinics Operations',
'title_ar': 'عمليات العيادات',
'description_en': 'Clinics policies and procedures',
'description_ar': 'سياسات وإجراءات العيادات',
'content_en': """
Clinics Operations
Review and acknowledge the following Clinics policies and procedures:
- Patient registration and intake procedures
- Appointment scheduling guidelines
- Clinic opening and closing protocols
- Patient flow management
- Documentation requirements
- Infection control protocols
- Patient privacy and confidentiality
""",
'content_ar': """
عمليات العيادات
راجع واعترف بالسياسات والإجراءات التالية للعيادات:
- إجراءات تسجيل واستقبال المرضى
- إرشادات جدولة المواعيد
- بروتوكولات فتح وإغلاق العيادات
- إدارة تدفق المرضى
- متطلبات التوثيق
- بروتوكولات مكافحة العدوى
- خصوصية وسرية المرضى
"""
},
{
'code': 'DEPT_ADMISSIONS',
'order': 6,
'title_en': 'Admissions & Social Services',
'title_ar': 'القبول والخدمات الاجتماعية',
'description_en': 'Admissions and social services procedures',
'description_ar': 'إجراءات القبول والخدمات الاجتماعية',
'content_en': """
Admissions & Social Services
Review and acknowledge the following Admissions & Social Services procedures:
- Patient admission criteria and process
- Social worker responsibilities
- Patient assessment protocols
- Discharge planning procedures
- Patient support services
- Family communication guidelines
- Cultural sensitivity requirements
""",
'content_ar': """
القبول والخدمات الاجتماعية
راجع واعترف بإجراءات القبول والخدمات الاجتماعية التالية:
- معايير وعملية قبول المرضى
- مسؤوليات الأخصائي الاجتماعي
- بروتوكولات تقييم المرضى
- إجراءات التخطيط للخروج
- خدمات دعم المرضى
- إرشادات التواصل مع العائلة
- متطلبات الحساسية الثقافية
"""
},
{
'code': 'DEPT_MEDICAL_APPROVALS',
'order': 7,
'title_en': 'Medical Approvals',
'title_ar': 'الموافقات الطبية',
'description_en': 'Medical approval procedures and protocols',
'description_ar': 'إجراءات وبروتوكولات الموافقة الطبية',
'content_en': """
Medical Approvals
Review and acknowledge the following Medical Approval procedures:
- Treatment authorization process
- Physician approval workflows
- Emergency approval protocols
- Documentation requirements
- Compliance with MOH regulations
- Audit trail maintenance
""",
'content_ar': """
الموافقات الطبية
راجع واعترف بإجراءات الموافقة الطبية التالية:
- عملية ترخيص العلاج
- سير عمل الموافقة الطبية
- بروتوكولات الموافقة في حالات الطوارئ
- متطلبات التوثيق
- الامتثال للوائح وزارة الصحة
- الحفاظ على سجل التدقيق
"""
},
{
'code': 'DEPT_CALL_CENTER',
'order': 8,
'title_en': 'Call Center Operations',
'title_ar': 'عمليات مركز الاتصال',
'description_en': 'Call center policies and procedures',
'description_ar': 'سياسات وإجراءات مركز الاتصال',
'content_en': """
Call Center Operations
Review and acknowledge the following Call Center policies:
- Call handling procedures
- Customer service standards
- Emergency call protocols
- Recording and documentation
- Privacy and confidentiality
- Escalation procedures
- Performance metrics
""",
'content_ar': """
عمليات مركز الاتصال
راجع واعترف بسياسات مركز الاتصال التالية:
- إجراءات التعامل مع المكالمات
- معايير خدمة العملاء
- بروتوكولات مكالمات الطوارئ
- التسجيل والتوثيق
- الخصوصية والسرية
- إجراءات التصعيد
- مقاييس الأداء
"""
},
{
'code': 'DEPT_PAYMENTS',
'order': 9,
'title_en': 'Payments & Billing',
'title_ar': 'الدفع والفواتير',
'description_en': 'Payment processing and billing procedures',
'description_ar': 'إجراءات معالجة الدفع والفوترة',
'content_en': """
Payments & Billing
Review and acknowledge the following Payment & Billing procedures:
- Payment processing protocols
- Insurance verification procedures
- Billing documentation requirements
- Refund policies
- Financial privacy and security
- Audit compliance
""",
'content_ar': """
الدفع والفواتير
راجع واعترف بإجراءات الدفع والفوترة التالية:
- بروتوكولات معالجة الدفع
- إجراءات التحقق من التأمين
- متطلبات توثيق الفواتير
- سياسات الاسترداد
- خصوصية وأمان البيانات المالية
- امتثال التدقيق
"""
},
{
'code': 'DEPT_EMERGENCY',
'order': 10,
'title_en': 'Emergency Services',
'title_ar': 'خدمات الطوارئ',
'description_en': 'Emergency services protocols and procedures',
'description_ar': 'بروتوكولات وإجراءات خدمات الطوارئ',
'content_en': """
Emergency Services
Review and acknowledge the following Emergency Services protocols:
- Triage procedures
- Emergency response protocols
- Documentation requirements
- Team coordination procedures
- Communication protocols
- Quality assurance in emergencies
""",
'content_ar': """
خدمات الطوارئ
راجع واعترف ببروتوكولات خدمات الطوارئ التالية:
- إجراءات التصنيف
- بروتوكولات الاستجابة للطوارئ
- متطلبات التوثيق
- إجراءات تنسيق الفريق
- بروتوكولات التواصل
- ضمان الجودة في حالات الطوارئ
"""
},
{
'code': 'DEPT_MEDICAL_REPORTS',
'order': 11,
'title_en': 'Medical Reports',
'title_ar': 'التقارير الطبية',
'description_en': 'Medical report generation and management',
'description_ar': 'إنشاء وإدارة التقارير الطبية',
'content_en': """
Medical Reports
Review and acknowledge the following Medical Report procedures:
- Report generation protocols
- Medical record documentation
- Privacy and confidentiality
- Report distribution procedures
- Quality control requirements
- Compliance with regulations
""",
'content_ar': """
التقارير الطبية
راجع واعترف بإجراءات التقارير الطبية التالية:
- بروتوكولات إنشاء التقارير
- توثيق السجلات الطبية
- الخصوصية والسرية
- إجراءات توزيع التقارير
- متطلبات مراقبة الجودة
- الامتثال للوائح
"""
},
{
'code': 'DEPT_ADMISSIONS_OFFICE',
'order': 12,
'title_en': 'Admissions Office',
'title_ar': 'مكتب القبول',
'description_en': 'Admissions office operations',
'description_ar': 'عمليات مكتب القبول',
'content_en': """
Admissions Office
Review and acknowledge the following Admissions Office procedures:
- Patient registration procedures
- Bed management protocols
- Transfer coordination
- Documentation standards
- Patient communication
- Inter-department coordination
""",
'content_ar': """
مكتب القبول
راجع واعترف بإجراءات مكتب القبول التالية:
- إجراءات تسجيل المرضى
- بروتوكولات إدارة الأسرة
- تنسيق النقل
- معايير التوثيق
- التواصل مع المرضى
- التنسيق بين الأقسام
"""
},
{
'code': 'DEPT_CBAHI',
'order': 13,
'title_en': 'CBAHI Standards',
'title_ar': 'معايير CBAHI',
'description_en': 'CBAHI accreditation standards',
'description_ar': 'معايير اعتماد CBAHI',
'content_en': """
CBAHI Standards
Review and acknowledge the following CBAHI requirements:
- CBAHI accreditation standards
- Quality management requirements
- Patient safety protocols
- Documentation compliance
- Continuous quality improvement
- Audit preparation
""",
'content_ar': """
معايير CBAHI
راجع واعترف بمتطلبات CBAHI التالية:
- معايير اعتماد CBAHI
- متطلبات إدارة الجودة
- بروتوكولات سلامة المرضى
- امتثال التوثيق
- التحسين المستمر للجودة
- الاستعداد للتدقيق
"""
},
{
'code': 'DEPT_HR_PORTAL',
'order': 14,
'title_en': 'HR Portal',
'title_ar': 'بوابة الموارد البشرية',
'description_en': 'HR portal usage and procedures',
'description_ar': 'استخدام وإجراءات بوابة الموارد البشرية',
'content_en': """
HR Portal
Review and acknowledge the following HR Portal procedures:
- HR portal access and login
- Personal information management
- Leave request procedures
- Training and development resources
- Performance management
- HR policies and procedures
""",
'content_ar': """
بوابة الموارد البشرية
راجع واعترف بإجراءات بوابة الموارد البشرية التالية:
- الوصول وتسجيل الدخول إلى بوابة الموارد البشرية
- إدارة المعلومات الشخصية
- إجراءات طلب الإجازة
- موارد التدريب والتطوير
- إدارة الأداء
- سياسات وإجراءات الموارد البشرية
"""
},
{
'code': 'DEPT_GENERAL_ORIENTATION',
'order': 15,
'title_en': 'General Orientation',
'title_ar': 'التوجيه العام',
'description_en': 'General orientation and onboarding',
'description_ar': 'التوجيه العام والتسجيل',
'content_en': """
General Orientation
Review and acknowledge the following General Orientation information:
- Hospital mission and values
- Organizational structure
- Code of conduct
- Safety protocols
- Patient rights and responsibilities
- Quality standards
""",
'content_ar': """
التوجيه العام
راجع واعترف بمعلومات التوجيه العام التالية:
- مهمة وقيم المستشفى
- الهيكل التنظيمي
- مدونة السلوك
- بروتوكولات السلامة
- حقوق ومسؤوليات المرضى
- معايير الجودة
"""
},
{
'code': 'DEPT_SEHATY',
'order': 16,
'title_en': 'Sehaty App',
'title_ar': 'تطبيق صحتي',
'description_en': 'Sehaty app usage for sick leaves',
'description_ar': 'استخدام تطبيق صحتي للإجازات المرضية',
'content_en': """
Sehaty App
Review and acknowledge the following Sehaty App procedures:
- App login and authentication
- Sick leave request process
- Medical certificate upload
- Leave tracking and management
- Integration with HR system
- Privacy and data security
""",
'content_ar': """
تطبيق صحتي
راجع واعترف بإجراءات تطبيق صحتي التالية:
- تسجيل الدخول والمصادقة في التطبيق
- عملية طلب الإجازة المرضية
- تحميل الشهادة الطبية
- تتبع وإدارة الإجازات
- التكامل مع نظام الموارد البشرية
- خصوصية وأمان البيانات
"""
},
{
'code': 'DEPT_MOH_CARE',
'order': 17,
'title_en': 'MOH Care Portal',
'title_ar': 'بوابة رعاية وزارة الصحة',
'description_en': 'MOH Care portal procedures',
'description_ar': 'إجراءات بوابة رعاية وزارة الصحة',
'content_en': """
MOH Care Portal
Review and acknowledge the following MOH Care Portal procedures:
- Portal access and authentication
- Patient record access
- MOH reporting requirements
- Data synchronization
- Compliance with MOH regulations
- Security protocols
""",
'content_ar': """
بوابة رعاية وزارة الصحة
راجع واعترف بإجراءات بوابة رعاية وزارة الصحة التالية:
- الوصول والمصادقة على البوابة
- الوصول إلى سجلات المرضى
- متطلبات الإبلاغ لوزارة الصحة
- مزامنة البيانات
- الامتثال للوائح وزارة الصحة
- بروتوكولات الأمان
"""
},
{
'code': 'DEPT_CHI_CARE',
'order': 18,
'title_en': 'CHI Care Portal',
'title_ar': 'بوابة رعاية CHI',
'description_en': 'CHI Care portal procedures',
'description_ar': 'إجراءات بوابة رعاية CHI',
'content_en': """
CHI Care Portal
Review and acknowledge the following CHI Care Portal procedures:
- Portal access and authentication
- Patient information management
- Insurance verification
- Claims processing
- Data security protocols
- System integration
""",
'content_ar': """
بوابة رعاية CHI
راجع واعترف بإجراءات بوابة رعاية CHI التالية:
- الوصول والمصادقة على البوابة
- إدارة معلومات المرضى
- التحقق من التأمين
- معالجة المطالبات
- بروتوكولات أمان البيانات
- تكامل النظام
"""
}
]
# Create content items
content_map = {}
for content_data in departmental_contents:
content, created = AcknowledgementContent.objects.update_or_create(
code=content_data['code'],
role=role,
defaults=content_data
)
content_map[content_data['code']] = content
# Create checklist items for each department
departmental_checklist_items = [
# Clinics
{'content_code': 'DEPT_CLINICS', 'code': 'CLINICS_ACK', 'order': 1,
'text_en': 'I have reviewed and acknowledge Clinics operations policies',
'text_ar': 'لقد راجعت وأعترف بسياسات عمليات العيادات',
'description_en': 'Acknowledgement of Clinics policies', 'description_ar': 'اعتراف بسياسات العيادات'},
# Admissions / Social Services
{'content_code': 'DEPT_ADMISSIONS', 'code': 'ADMISSIONS_ACK', 'order': 1,
'text_en': 'I have reviewed and acknowledge Admissions & Social Services procedures',
'text_ar': 'لقد راجعت وأعترف بإجراءات القبول والخدمات الاجتماعية',
'description_en': 'Acknowledgement of Admissions procedures', 'description_ar': 'اعتراف بإجراءات القبول'},
# Medical Approvals
{'content_code': 'DEPT_MEDICAL_APPROVALS', 'code': 'MED_APPROVALS_ACK', 'order': 1,
'text_en': 'I have reviewed and acknowledge Medical Approval protocols',
'text_ar': 'لقد راجعت وأعترف ببروتوكولات الموافقة الطبية',
'description_en': 'Acknowledgement of Medical Approvals', 'description_ar': 'اعتراف بالموافقات الطبية'},
# Call Center
{'content_code': 'DEPT_CALL_CENTER', 'code': 'CALL_CENTER_ACK', 'order': 1,
'text_en': 'I have reviewed and acknowledge Call Center policies',
'text_ar': 'لقد راجعت وأعترف بسياسات مركز الاتصال',
'description_en': 'Acknowledgement of Call Center policies', 'description_ar': 'اعتراف بسياسات مركز الاتصال'},
# Payments
{'content_code': 'DEPT_PAYMENTS', 'code': 'PAYMENTS_ACK', 'order': 1,
'text_en': 'I have reviewed and acknowledge Payments & Billing procedures',
'text_ar': 'لقد راجعت وأعترف بإجراءات الدفع والفوترة',
'description_en': 'Acknowledgement of Payment procedures', 'description_ar': 'اعتراف بإجراءات الدفع'},
# Emergency Services
{'content_code': 'DEPT_EMERGENCY', 'code': 'EMERGENCY_ACK', 'order': 1,
'text_en': 'I have reviewed and acknowledge Emergency Services protocols',
'text_ar': 'لقد راجعت وأعترف ببروتوكولات خدمات الطوارئ',
'description_en': 'Acknowledgement of Emergency Services', 'description_ar': 'اعتراف بخدمات الطوارئ'},
# Medical Reports
{'content_code': 'DEPT_MEDICAL_REPORTS', 'code': 'MED_REPORTS_ACK', 'order': 1,
'text_en': 'I have reviewed and acknowledge Medical Report procedures',
'text_ar': 'لقد راجعت وأعترف بإجراءات التقارير الطبية',
'description_en': 'Acknowledgement of Medical Reports', 'description_ar': 'اعتراف بالتقارير الطبية'},
# Admissions Office
{'content_code': 'DEPT_ADMISSIONS_OFFICE', 'code': 'ADMISSIONS_OFFICE_ACK', 'order': 1,
'text_en': 'I have reviewed and acknowledge Admissions Office procedures',
'text_ar': 'لقد راجعت وأعترف بإجراءات مكتب القبول',
'description_en': 'Acknowledgement of Admissions Office', 'description_ar': 'اعتراف بمكتب القبول'},
# CBAHI
{'content_code': 'DEPT_CBAHI', 'code': 'CBAHI_ACK', 'order': 1,
'text_en': 'I have reviewed and acknowledge CBAHI standards and requirements',
'text_ar': 'لقد راجعت وأعترف بمعايير ومتطلبات CBAHI',
'description_en': 'Acknowledgement of CBAHI standards', 'description_ar': 'اعتراف بمعايير CBAHI'},
# HR Portal
{'content_code': 'DEPT_HR_PORTAL', 'code': 'HR_PORTAL_ACK', 'order': 1,
'text_en': 'I have reviewed and acknowledge HR Portal usage procedures',
'text_ar': 'لقد راجعت وأعترف بإجراءات استخدام بوابة الموارد البشرية',
'description_en': 'Acknowledgement of HR Portal', 'description_ar': 'اعتراف ببوابة الموارد البشرية'},
# General Orientation
{'content_code': 'DEPT_GENERAL_ORIENTATION', 'code': 'ORIENTATION_ACK', 'order': 1,
'text_en': 'I have reviewed and acknowledge General Orientation information',
'text_ar': 'لقد راجعت وأعترف بمعلومات التوجيه العام',
'description_en': 'Acknowledgement of General Orientation', 'description_ar': 'اعتراف بالتوجيه العام'},
# Sehaty App
{'content_code': 'DEPT_SEHATY', 'code': 'SEHATY_ACK', 'order': 1,
'text_en': 'I have reviewed and acknowledge Sehaty App usage for sick leaves',
'text_ar': 'لقد راجعت وأعترف باستخدام تطبيق صحتي للإجازات المرضية',
'description_en': 'Acknowledgement of Sehaty App', 'description_ar': 'اعتراف بتطبيق صحتي'},
# MOH Care Portal
{'content_code': 'DEPT_MOH_CARE', 'code': 'MOH_CARE_ACK', 'order': 1,
'text_en': 'I have reviewed and acknowledge MOH Care Portal procedures',
'text_ar': 'لقد راجعت وأعترف بإجراءات بوابة رعاية وزارة الصحة',
'description_en': 'Acknowledgement of MOH Care Portal', 'description_ar': 'اعتراف ببوابة رعاية وزارة الصحة'},
# CHI Care Portal
{'content_code': 'DEPT_CHI_CARE', 'code': 'CHI_CARE_ACK', 'order': 1,
'text_en': 'I have reviewed and acknowledge CHI Care Portal procedures',
'text_ar': 'لقد راجعت وأعترف بإجراءات بوابة رعاية CHI',
'description_en': 'Acknowledgement of CHI Care Portal', 'description_ar': 'اعتراف ببوابة رعاية CHI'},
]
for item_data in departmental_checklist_items:
content = content_map.get(item_data.pop('content_code'))
if content:
item_data['content'] = content
item_data['is_required'] = True # All departmental acknowledgements are required
AcknowledgementChecklistItem.objects.update_or_create(
code=item_data['code'],
defaults=item_data
)
def _create_px_admin_content(self):
"""Create PX Admin specific content"""
try:
role = Role.objects.get(name='PX_ADMIN')
except Role.DoesNotExist:
self.stdout.write(self.style.WARNING('PX Admin role not found, skipping PX Admin content'))
return
self.stdout.write('Creating PX Admin content...')
content_data = {
'code': 'PX_ADMIN_RESP',
'role': role,
'order': 4,
'title_en': 'PX Admin Responsibilities',
'title_ar': 'مسؤوليات مسؤول PX',
'description_en': 'Understanding PX Admin role and permissions',
'description_ar': 'فهم دور وصلاحيات مسؤول PX',
'content_en': """
PX Admin Responsibilities
As a PX Admin, you have full access to all system features and are responsible for:
- User and role management
- System configuration
- Audit and compliance
- Content management for acknowledgements
- Organizational settings
Note: With great power comes great responsibility. All your actions are logged and audited.
""",
'content_ar': """
مسؤوليات مسؤول PX
بصفتك مسؤول PX، لديك حق الوصول الكامل إلى جميع ميزات النظام ومسؤول عن:
- إدارة المستخدمين والأدوار
- تكوين النظام
- التدقيق والامتثال
- إدارة المحتوى للاعترافات
- إعدادات المؤسسة
ملاحظة: مع السلطة العالية تأتي المسؤولية الكبيرة. جميع إجراءاتك مسجلة وقابلة للتدقيق.
"""
}
content, _ = AcknowledgementContent.objects.update_or_create(
code=content_data['code'],
role=role,
defaults=content_data
)
checklist_items = [
{
'content': content,
'code': 'PX_ADMIN_OVERSIGHT',
'order': 1,
'text_en': 'I understand my role as PX Admin and will use permissions responsibly',
'text_ar': 'أفهم دوري كمسؤول PX وسأستخدم الصلاحيات بمسؤولية',
'description_en': 'Accept responsibility for PX Admin role',
'description_ar': 'قبول المسؤولية لدور مسؤول PX',
'is_required': True
}
]
for item_data in checklist_items:
AcknowledgementChecklistItem.objects.update_or_create(
code=item_data['code'],
defaults=item_data
)
def _create_hospital_admin_content(self):
"""Create Hospital Admin specific content"""
try:
role = Role.objects.get(name='HOSPITAL_ADMIN')
except Role.DoesNotExist:
return
self.stdout.write('Creating Hospital Admin content...')
content_data = {
'code': 'HOSPITAL_ADMIN_RESP',
'role': role,
'order': 4,
'title_en': 'Hospital Admin Responsibilities',
'title_ar': 'مسؤوليات مدير المستشفى',
'description_en': 'Understanding Hospital Admin role and scope',
'description_ar': 'فهم دور ونطاق مدير المستشفى',
'content_en': """
Hospital Admin Responsibilities
As a Hospital Admin, you can manage users, view reports, and oversee operations within your hospital.
- Manage hospital-level settings
- Oversee department operations
- Access comprehensive analytics
- Manage hospital staff
""",
'content_ar': """
مسؤوليات مدير المستشفى
بصفتك مدير المستشفى، يمكنك إدارة المستخدمين وعرض التقارير والإشراف على العمليات داخل مستشفاك.
- إدارة إعدادات مستوى المستشفى
- الإشراف على عمليات الأقسام
- الوصول إلى تحليلات شاملة
- إدارة موظفي المستشفى
"""
}
content, _ = AcknowledgementContent.objects.update_or_create(
code=content_data['code'],
role=role,
defaults=content_data
)
checklist_items = [
{
'content': content,
'code': 'HOSPITAL_ADMIN_SCOPE',
'order': 1,
'text_en': 'I understand my Hospital Admin role and hospital-level responsibilities',
'text_ar': 'أفهم دوري كمدير مستشفى ومسؤولياتي على مستوى المستشفى',
'description_en': 'Accept responsibility for Hospital Admin role',
'description_ar': 'قبول المسؤولية لدور مدير المستشفى',
'is_required': True
}
]
for item_data in checklist_items:
AcknowledgementChecklistItem.objects.update_or_create(
code=item_data['code'],
defaults=item_data
)
def _create_department_manager_content(self):
"""Create Department Manager specific content"""
try:
role = Role.objects.get(name='DEPARTMENT_MANAGER')
except Role.DoesNotExist:
return
self.stdout.write('Creating Department Manager content...')
content_data = {
'code': 'DEPT_MGR_RESP',
'role': role,
'order': 4,
'title_en': 'Department Manager Responsibilities',
'title_ar': 'مسؤوليات مدير القسم',
'description_en': 'Understanding Department Manager role and operations',
'description_ar': 'فهم دور وعمليات مدير القسم',
'content_en': """
Department Manager Responsibilities
As a Department Manager, you oversee your department's operations and staff performance.
- Manage department staff
- Monitor department metrics
- Respond to department-specific feedback
- Improve patient experience in your area
""",
'content_ar': """
مسؤوليات مدير القسم
بصفتك مدير القسم، تشرف على عمليات قسمك وأداء الموظفين.
- إدارة موظفي القسم
- مراقبة مؤشرات القسم
- الرد على الملاحظات الخاصة بالقسم
- تحسين تجربة المريض في منطقتك
"""
}
content, _ = AcknowledgementContent.objects.update_or_create(
code=content_data['code'],
role=role,
defaults=content_data
)
checklist_items = [
{
'content': content,
'code': 'DEPT_MGR_SCOPE',
'order': 1,
'text_en': 'I understand my Department Manager role and responsibilities',
'text_ar': 'أفهم دوري ومسؤولياتي كمدير قسم',
'description_en': 'Accept responsibility for Department Manager role',
'description_ar': 'قبول المسؤولية لدور مدير القسم',
'is_required': True
}
]
for item_data in checklist_items:
AcknowledgementChecklistItem.objects.update_or_create(
code=item_data['code'],
defaults=item_data
)
def _create_physician_content(self):
"""Create Physician specific content"""
try:
role = Role.objects.get(name='PHYSICIAN')
except Role.DoesNotExist:
return
self.stdout.write('Creating Physician content...')
content_data = {
'code': 'PHYSICIAN_RESP',
'role': role,
'order': 4,
'title_en': 'Physician Responsibilities',
'title_ar': 'مسؤوليات الطبيب',
'description_en': 'Understanding Physician role in PX360',
'description_ar': 'فهم دور الطبيب في PX360',
'content_en': """
Physician Responsibilities
As a Physician, you play a key role in patient experience and quality of care.
- Review and respond to patient feedback
- Maintain accurate physician profile
- Participate in quality initiatives
- Improve patient care based on insights
""",
'content_ar': """
مسؤوليات الطبيب
بصفتك طبيبًا، تلعب دورًا رئيسيًا في تجربة المريض وجودة الرعاية.
- مراجعة والرد على ملاحظات المرضى
- الحفاظ على ملف الطبيب بدقة
- المشاركة في مبادرات الجودة
- تحسين رعاية المرضى بناءً على الرؤى
"""
}
content, _ = AcknowledgementContent.objects.update_or_create(
code=content_data['code'],
role=role,
defaults=content_data
)
checklist_items = [
{
'content': content,
'code': 'PHYSICIAN_SCOPE',
'order': 1,
'text_en': 'I understand my Physician role and commitment to patient care',
'text_ar': 'أفهم دوري كطبيب والالتزام برعاية المرضى',
'description_en': 'Accept responsibility for Physician role',
'description_ar': 'قبول المسؤولية لدور الطبيب',
'is_required': True
}
]
for item_data in checklist_items:
AcknowledgementChecklistItem.objects.update_or_create(
code=item_data['code'],
defaults=item_data
)
def _create_staff_content(self):
"""Create Staff specific content"""
try:
role = Role.objects.get(name='STAFF')
except Role.DoesNotExist:
return
self.stdout.write('Creating Staff content...')
content_data = {
'code': 'STAFF_RESP',
'role': role,
'order': 4,
'title_en': 'Staff Responsibilities',
'title_ar': 'مسؤوليات الموظف',
'description_en': 'Understanding Staff role and daily operations',
'description_ar': 'فهم دور الموظف والعمليات اليومية',
'content_en': """
Staff Responsibilities
As a Staff member, you contribute to daily operations and patient experience.
- Complete assigned tasks efficiently
- Report patient feedback and concerns
- Follow established procedures
- Maintain high service standards
""",
'content_ar': """
مسؤوليات الموظف
بصفتك موظفًا، تساهم في العمليات اليومية وتجربة المريض.
- إكمال المهام المخصصة بكفاءة
- الإبلاغ عن ملاحظات ومخاوف المرضى
- اتباع الإجراءات المعمول بها
- الحفاظ على معايير خدمة عالية
"""
}
content, _ = AcknowledgementContent.objects.update_or_create(
code=content_data['code'],
role=role,
defaults=content_data
)
checklist_items = [
{
'content': content,
'code': 'STAFF_SCOPE',
'order': 1,
'text_en': 'I understand my Staff role and commitment to quality service',
'text_ar': 'أفهم دوري كموظف والالتزام بخدمة عالية الجودة',
'description_en': 'Accept responsibility for Staff role',
'description_ar': 'قبول المسؤولية لدور الموظف',
'is_required': True
}
]
for item_data in checklist_items:
AcknowledgementChecklistItem.objects.update_or_create(
code=item_data['code'],
defaults=item_data
)